-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
45 lines (32 loc) · 1.26 KB
/
bot.py
File metadata and controls
45 lines (32 loc) · 1.26 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
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
import os
TOKEN = os.getenv('TOKEN')
bot = Bot(token=TOKEN)
dp = Dispatcher(bot, storage=MemoryStorage())
@dp.message_handler(commands=['start'])
async def process_start_command(message: types.Message):
await message.reply("Hi!!")
@dp.message_handler(commands=['help'])
async def process_help_command(message: types.Message):
await message.reply("Help!!")
@dp.message_handler(commands=['voice'])
async def process_help_command(message: types.Message):
await message.reply("Voice!!")
@dp.message_handler(commands=['group'])
async def process_help_command(message: types.Message):
await message.reply("Group!!")
@dp.message_handler(commands=['note'])
async def process_help_command(message: types.Message):
await message.reply("Note!!")
@dp.message_handler(commands=['file'])
async def process_help_command(message: types.Message):
await message.reply("File!!")
@dp.message_handler()
async def echo_message(msg: types.Message):
await bot.send_message(msg.from_user.id, msg.text)
if __name__ == '__main__':
executor.start_polling(dp)