From f8edff24e81989f1a74434a646249c39f5ed3ea5 Mon Sep 17 00:00:00 2001 From: Pavel_Duron Date: Thu, 3 Nov 2022 16:28:19 +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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 325e110..e82110b 100644 --- a/bot.py +++ b/bot.py @@ -1,7 +1,5 @@ from cgitb import text -import time import datetime -date = datetime import logging from aiogram import Bot, Dispatcher, executor, types @@ -14,11 +12,16 @@ logging.basicConfig(level=logging.DEBUG) bot = Bot(token=API_TOKEN) dp = Dispatcher(bot) -current_time = datetime.datetime.now() + @dp.message_handler(commands=["time"]) async def send_time(message: types.Message): - await message.reply(current_time) #отображение времени, пока не рабоатет + current_datatime = datetime.datetime.now() + current_data = current_datatime.date() + current_time = current_datatime.time() + new_year = datetime.date(2022, 12, 31) + await message.reply('Сегодня' + current_data + '\nВремя' + current_time + '\nДо нового года осталось') #отображение времени, пока не рабоатет + """"async def set_default_commands(dp):