вывод времени
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pavel_Duron 2022-11-03 00:39:03 +10:00
parent e1c6bc7cf7
commit 9ab8401ddc

12
bot.py
View File

@ -1,5 +1,7 @@
from cgitb import text from cgitb import text
import time import time
from datetime import datetime
date = datetime
import logging import logging
from aiogram import Bot, Dispatcher, executor, types from aiogram import Bot, Dispatcher, executor, types
@ -12,11 +14,17 @@ logging.basicConfig(level=logging.DEBUG)
bot = Bot(token=API_TOKEN) bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot) dp = Dispatcher(bot)
async def set_default_commands(dp): current_time = datetime.now()
@dp.message_handler(commands=time)
async def send_time(message: types.Message):
await message.reply(print(current_time)) #отображение времени, пока не рабоатет
""""async def set_default_commands(dp):
await dp.bot.set_my_commands([ await dp.bot.set_my_commands([
types.BotCommand("start", "Запустить бота"), types.BotCommand("start", "Запустить бота"),
types.BotCommand("photo", "рандомная пикча"), types.BotCommand("photo", "рандомная пикча"),
]) # отображает cписок команд ]) # отображает cписок команд но через бот фазер это проще"""
@dp.message_handler(commands=['start']) @dp.message_handler(commands=['start'])
async def start_func(message: types.Message): async def start_func(message: types.Message):