From 9ab8401ddcbc7f06f85415b74a0b43ff50b4f1cc Mon Sep 17 00:00:00 2001 From: Pavel_Duron Date: Thu, 3 Nov 2022 00:39:03 +1000 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=B2=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 94b714f..b48a287 100644 --- a/bot.py +++ b/bot.py @@ -1,5 +1,7 @@ from cgitb import text import time +from datetime import datetime +date = datetime import logging from aiogram import Bot, Dispatcher, executor, types @@ -12,11 +14,17 @@ logging.basicConfig(level=logging.DEBUG) bot = Bot(token=API_TOKEN) 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([ types.BotCommand("start", "Запустить бота"), types.BotCommand("photo", "рандомная пикча"), - ]) # отображает cписок команд + ]) # отображает cписок команд но через бот фазер это проще""" @dp.message_handler(commands=['start']) async def start_func(message: types.Message):