-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot_telegram.py
More file actions
31 lines (18 loc) · 755 Bytes
/
bot_telegram.py
File metadata and controls
31 lines (18 loc) · 755 Bytes
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
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import ContentType
API_TOKEN = '5388992561:AAFrfq9A5WK5aOEeyqRbEZWJXRaIpafnQbs'
logging.basicConfig(level=logging.INFO)
bot = Bot(token = API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start', 'help'])
async def send_welcome(message: types.Message):
await message.reply("Hi!\nI'm EchoBot!\nPowered by Aiogram.")
@dp.message_handler(content_types=ContentType.PHOTO)
async def picture_reaction(message: types.Message):
await message.reply("It's picture!")
@dp.message_handler()
async def echo(message: types.Message):
await message.answer(message.text)
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)