def msg_delete(bot, update, chat_id, origin_message_id, args): row_id = int(args[1]) channel_id = int(args[2]) msg_id = int(args[3]) msg_args = ["msg"] + args[2:] helper_database.delete_record_by_rowid(row_id) bot.answer_callback_query(callback_query_id=update.callback_query.id, text=helper_global.value("delete_success", "")) private_msg.update_dirty_msg(channel_id, msg_id) show_msg(bot, update, origin_message_id, chat_id, msg_args)
def reaction(bot, update, chat_id, origin_message_id, user_id, args): channel_id = int(args[1]) msg_id = int(args[2]) like_id = int(args[3]) config = helper_database.get_channel_config(channel_id) if config is None: return channel_lang = config[1] buttons = helper_database.get_button_options(channel_id, msg_id) helper_database.add_reaction(channel_id, msg_id, user_id, like_id) private_msg.update_dirty_msg(channel_id, msg_id, update_mode=0) bot.answer_callback_query( callback_query_id=update.callback_query.id, text=helper_global.value("like_recorded", "", lang=channel_lang) % buttons[like_id] )