Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions telegram_bot_project/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
7 changes: 7 additions & 0 deletions telegram_bot_project/bot/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from typing import Any
from aiogram.types import Message

async def start_command(message: Message, **kwargs: Any) -> None:
await message.answer("Hello!")


Empty file.
Empty file.
9 changes: 9 additions & 0 deletions telegram_bot_project/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
from dotenv import load_dotenv

load_dotenv()

TOKEN: str = os.getenv("BOT_TOKEN")

def get_token() -> str:
return TOKEN
22 changes: 22 additions & 0 deletions telegram_bot_project/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from aiogram import Dispatcher, Bot
from aiogram.filters import Command
from aiogram.types import Message

from config import TOKEN
from bot.commands import start_command

dp: Dispatcher = Dispatcher()

@dp.message(Command("start"))
async def start(message: Message):
await start_command(message)


async def main():
bot: Bot = Bot(token=TOKEN)
await dp.start_polling(bot)

if __name__ == "__main__":
asyncio.run(main())
Empty file.