Files
Tg-bot/bot.0.1/other_packages/intermediate_bots/telegram_bot(типа красивый).py
2024-10-29 16:09:13 +03:00

37 lines
937 B
Python
Executable File

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)