first commit
This commit is contained in:
36
bot.0.1/other_packages/intermediate_bots/telegram_bot(типа красивый).py
Executable file
36
bot.0.1/other_packages/intermediate_bots/telegram_bot(типа красивый).py
Executable file
@@ -0,0 +1,36 @@
|
||||
from aiogram import Bot, Dispatcher, executor, types
|
||||
from open_weather_API import
|
||||
from BITCOIN_RUB import print_bitcoin
|
||||
from config import BOT_TOKEN
|
||||
import asyncio
|
||||
import requests
|
||||
|
||||
|
||||
bot = Bot(token=BOT_TOKEN)
|
||||
dp = Dispatcher(bot)
|
||||
|
||||
|
||||
@dp.message_handler(commands=['start'])
|
||||
async def cmd_test(message: types.Message):
|
||||
await message.reply("Hi!\nI'm Bot!\nPowered by aiogram.")
|
||||
|
||||
|
||||
@dp.message_handler(commands="bitcoin")
|
||||
async def get_coin(message: types.Message):
|
||||
await message.reply(f"{print_bitcoin()}")
|
||||
|
||||
|
||||
@dp.message_handler(content_types=['text'])
|
||||
async def reaction(message: types.Message):
|
||||
if message.text.lower() == "привет":
|
||||
await message.answer("Здорово!!!")
|
||||
|
||||
elif message.text.lower() == "погода":
|
||||
|
||||
|
||||
else:
|
||||
await message.reply("Моя тебя совсем не понимать")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp)
|
||||
Reference in New Issue
Block a user