def cleanup(bot, update, session, chat, user): """Triggering a one time conversion from text changes to tags.""" threshold = datetime.strptime('Jan 1 2000', '%b %d %Y') full_cleanup(session, threshold, update=update) call_tg_func(update.message.chat, 'send_message', ['Cleanup finished.'], {'reply_markup': get_main_keyboard(admin=True)})
def cleanup(session, context): """Triggering a one time conversion from text changes to tags.""" threshold = datetime.strptime('Jan 1 2000', '%b %d %Y') full_cleanup(session, threshold, chat=context.tg_chat) context.tg_chat.send_message('Cleanup finished.', reply_markup=get_main_keyboard(context.user)) context.message.delete()
def cleanup_job(context, session): """Send all new sticker to the newsfeed chats.""" threshold = datetime.now() - timedelta(hours=3) full_cleanup(session, threshold) return