def check_update(self, update): chat = update.effective_chat if super().check_update(update): if sql.is_command_disabled(chat.id, self.friendly): return False else: return True
def check_update(self, update): chat = update.effective_chat user = update.effective_user if super().check_update(update): # Should be safe since check_update passed. command = update.effective_message.text_html.split( None, 1)[0][1:].split('@')[0] # disabled, admincmd, user admin if sql.is_command_disabled(chat.id, command): if command in ADMIN_CMDS and is_user_admin(chat, user.id): return True # not disabled else: return True