def reaction(bot: Bot, update: Update, args: List[str]) -> str: chat = update.effective_chat # type: Optional[Chat] if len(args) >= 1: var = args[0] print(var) if var == "False": sql.set_command_reaction(chat.id, False) update.effective_message.reply_text( "Reaksi dinonaktifkan pada perintah admin untuk pengguna") elif var == "True": sql.set_command_reaction(chat.id, True) update.effective_message.reply_text( "Reaksi diaktifkan pada perintah admin untuk pengguna") else: update.effective_message.reply_text("Please enter True or False!", parse_mode=ParseMode.MARKDOWN) else: status = sql.command_reaction(chat.id) if status == False: update.effective_message.reply_text( "Reaksi atas perintah admin untuk pengguna sekarang `dinonaktifkan`!", parse_mode=ParseMode.MARKDOWN) else: update.effective_message.reply_text( "Reaksi atas perintah admin untuk pengguna sekarang `diaktifkan`!", parse_mode=ParseMode.MARKDOWN)
def reaction(bot: Bot, update: Update, args: List[str]) -> str: chat = update.effective_chat # type: Optional[Chat] if len(args) >= 1: var = args[0] print(var) if var == "False": sql.set_command_reaction(chat.id, False) update.effective_message.reply_text( "Disabled reaction on admin commands for users") elif var == "True": sql.set_command_reaction(chat.id, True) update.effective_message.reply_text( "Enabled reaction on admin commands for users") else: update.effective_message.reply_text("Please enter True or False!", parse_mode=ParseMode.MARKDOWN) else: status = sql.command_reaction(chat.id) if status == False: update.effective_message.reply_text( "Reaction on admin commands for users now `disabled`!", parse_mode=ParseMode.MARKDOWN) else: update.effective_message.reply_text( "Reaction on admin commands for users now `enabled`!", parse_mode=ParseMode.MARKDOWN)
def reaction(bot: Bot, update: Update, args: List[str]) -> str: chat = update.effective_chat # type: Optional[Chat] if len(args) >= 1: var = args[0] print(var) if var == "False": sql.set_command_reaction(chat.id, False) update.effective_message.reply_text("Disabled response to user-triggered admin commands.") elif var == "True": sql.set_command_reaction(chat.id, True) update.effective_message.reply_text("Enabled response to user-triggered admin commands.") else: update.effective_message.reply_text("Please enter True or False!", parse_mode=ParseMode.MARKDOWN) else: status = sql.command_reaction(chat.id) update.effective_message.reply_text( "Response for user-triggered admin commands is currently " f"`{'enabled' if status == True else 'disabled'}`!", parse_mode=ParseMode.MARKDOWN )
def reaction(bot: Bot, update: Update, args: List[str]) -> str: chat = update.effective_chat if len(args) >= 1: var = args[0] print(var) if var == "False": sql.set_command_reaction(chat.id, False) update.effective_message.reply_text( tld(chat.id, "admin_disable_reaction")) elif var == "True": sql.set_command_reaction(chat.id, True) update.effective_message.reply_text( tld(chat.id, "admin_enable_reaction")) else: update.effective_message.reply_text(tld(chat.id, "admin_err_wrong_arg"), parse_mode=ParseMode.MARKDOWN) else: status = sql.command_reaction(chat.id) update.effective_message.reply_text(tld( chat.id, "admin_reaction_status").format('enabled' if status == True else 'disabled'), parse_mode=ParseMode.MARKDOWN)