Telegram: init

This commit is contained in:
2022-11-17 21:41:15 +03:00
parent 8442294982
commit ef63d7c23c
3 changed files with 39 additions and 0 deletions

20
telegram/main.py Executable file
View File

@@ -0,0 +1,20 @@
import json
from aiogram import Bot, Dispatcher, executor
with open("telegram/config.json") as config_file:
config_data = json.load(config_file)
API_TOKEN = config_data["main_settings"]["BOT_TOKEN"]
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=["start", "help"])
async def send_welcome(message):
await message.reply("Nice!")
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=True)