def workday_end_time(bot, update):
bot.sendChatAction(
chat_id=update.message.chat_id, action=ChatAction.TYPING
)
text_templates = (
'{}?????????????',
'?????{}',
'??{}????',
'??????{}',
'???{}????',
'????{}',
'??????: {}',
)
now = TZ.normalize(update.message.date.replace(tzinfo=pytz.utc))
end_time = TZ.localize(datetime(now.year, now.month, now.day, hour=18))
duration = end_time - now
hour = duration.seconds // 3600
minute = (duration.seconds % 3600) // 60
time_remaining = ' {} ??'.format(hour) if hour else ''
time_remaining += ' {} ??'.format(minute)
text = random.choice(text_templates).format(time_remaining)
update.message.reply_text(text, quote=True)
评论列表
文章目录