Skip to content

Commit 103ca8b

Browse files
authored
Merge pull request #1 from gnatykdm/Bot-Skeleton
Bot-Skeleton C:1
2 parents e3da1ad + 90c8650 commit 103ca8b

File tree

9 files changed

+46
-0
lines changed

9 files changed

+46
-0
lines changed

telegram_bot_project/.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

telegram_bot_project/bot/__init__.py

Whitespace-only changes.

telegram_bot_project/bot/callbacks.py

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from typing import Any
2+
from aiogram.types import Message
3+
4+
async def start_command(message: Message, **kwargs: Any) -> None:
5+
await message.answer("Hello!")
6+
7+

telegram_bot_project/bot/handlers.py

Whitespace-only changes.

telegram_bot_project/bot/utills.py

Whitespace-only changes.

telegram_bot_project/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import os
2+
from dotenv import load_dotenv
3+
4+
load_dotenv()
5+
6+
TOKEN: str = os.getenv("BOT_TOKEN")
7+
8+
def get_token() -> str:
9+
return TOKEN

telegram_bot_project/main.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import asyncio
2+
3+
from aiogram import Dispatcher, Bot
4+
from aiogram.filters import Command
5+
from aiogram.types import Message
6+
7+
from config import TOKEN
8+
from bot.commands import start_command
9+
10+
dp: Dispatcher = Dispatcher()
11+
12+
@dp.message(Command("start"))
13+
async def start(message: Message):
14+
await start_command(message)
15+
16+
17+
async def main():
18+
bot: Bot = Bot(token=TOKEN)
19+
await dp.start_polling(bot)
20+
21+
if __name__ == "__main__":
22+
asyncio.run(main())

telegram_bot_project/messages.py

Whitespace-only changes.

0 commit comments

Comments
 (0)