-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
48 lines (36 loc) · 1.17 KB
/
bot.py
File metadata and controls
48 lines (36 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import logging
from aiogram import Bot
from aiogram import Dispatcher
from aiogram import executor
from aiogram import types
from data.config import CONFIG_DATA
from scripts.main import General
from data.models import SNILS
API_TOKEN = CONFIG_DATA['API_TOKEN']
# Configure logging
logging.basicConfig(level=logging.INFO)
# Initialize bot and dispatcher
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start', 'help'])
async def welcome(message: types.Message):
"""
This handler will be called when user sends `/start` or `/help` command
"""
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
@dp.message_handler(commands=['balls'])
async def welcome(message: types.Message):
"""
This handler will be called when user sends `/start` or `/help` command
"""
for i in General(266).main():
await message.reply(i)
@dp.message_handler(commands=['snils'])
async def welcome(message: types.Message):
"""
This handler will be called when user sends `/start` or `/help` command
"""
for i in General('160-461-141 26').main():
await message.reply(i)
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)