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( "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 is_admin(bot: Bot, update: Update, *args, **kwargs): user = update.effective_user # type: Optional[User] chat = update.effective_chat # type: Optional[Chat] if user and is_user_admin(update.effective_chat, user.id): return func(bot, update, *args, **kwargs) elif not user: pass elif DEL_CMDS and " " not in update.effective_message.text: update.effective_message.delete() elif (admin_sql.command_reaction(chat.id) == True): update.effective_message.reply_text("Who dis non-admin telling me what to do?")
def is_admin(bot: Bot, update: Update, *args, **kwargs): user = update.effective_user # type: Optional[User] chat = update.effective_chat # type: Optional[Chat] if user and is_user_admin(update.effective_chat, user.id): return func(bot, update, *args, **kwargs) elif not user: pass elif DEL_CMDS and " " not in update.effective_message.text: update.effective_message.delete() elif (admin_sql.command_reaction(chat.id) == True): update.effective_message.reply_text( "من غير المشرف يخبرني ماذا أفعل؟ ")
def is_admin(bot: Bot, update: Update, *args, **kwargs): user = update.effective_user # type: Optional[User] chat = update.effective_chat # type: Optional[Chat] if user and is_user_admin(update.effective_chat, user.id): return func(bot, update, *args, **kwargs) elif not user: pass elif DEL_CMDS and " " not in update.effective_message.text: update.effective_message.delete() elif (admin_sql.command_reaction(chat.id) == True): update.effective_message.reply_text( "First Become Admin And Then Give Me Instruction - What To Do?" )
def is_admin(bot: Bot, update: Update, *args, **kwargs): user = update.effective_user chat = update.effective_chat if user and is_user_admin(update.effective_chat, user.id): try: return func(bot, update, *args, **kwargs) except Exception: return elif not user: pass elif DEL_CMDS and " " not in update.effective_message.text: update.effective_message.delete() elif (admin_sql.command_reaction(chat.id) == True): update.effective_message.reply_text( tld(chat.id, 'helpers_user_not_admin'))
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)