Example #1
0
def rem_cmds(bot: Bot, update: Update, args: List[str]) -> str:
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]

    if not args:
        del_pref = sql.get_cmd_pref(chat.id)
        if del_pref:
            update.effective_message.reply_text("നിലവിൽ @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യുന്നുണ്ട്.")
        else:
            update.effective_message.reply_text("നിലവിൽ @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യുന്നില്ല.")
        return ""

    if args[0].lower() in ("on", "yes"):
        sql.set_cmd_joined(str(chat.id), True)
        update.effective_message.reply_text("ശരി, @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യാൻ ശ്രമിക്കാം!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>ON</code>.".format(html.escape(chat.title),
                                                                         mention_html(user.id, user.first_name))
    elif args[0].lower() in ("off", "no"):
        sql.set_cmd_joined(str(chat.id), False)
        update.effective_message.reply_text("ശരി, @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യില്ല!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>OFF</code>.".format(html.escape(chat.title),
                                                                          mention_html(user.id, user.first_name))
    else:
        # idek what you're writing, say yes or no
        update.effective_message.reply_text("എന്താണ് ചെയ്യേണ്ടത് എന്നു മനസ്സിലായില്ല... 'on/yes' അല്ലെങ്കിൽ 'off/no' എന്ന് ചേർത്ത് അയക്കൂ!")
        return ""
Example #2
0
def rem_cmds(bot: Bot, update: Update, args: List[str]) -> str:

    chat = update.effective_chat  # type: Optional[Chat]

    user = update.effective_user  # type: Optional[User]

    if not args:

        del_pref = sql.get_cmd_pref(chat.id)

        if del_pref:

            update.effective_message.reply_text("നിലവിൽ @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യുന്നുണ്ട്.")

        else:

            update.effective_message.reply_text("നിലവിൽ @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യുന്നില്ല.")

        return ""

    if args[0].lower() in ("on", "yes"):

        sql.set_cmd_joined(str(chat.id), True)

        update.effective_message.reply_text("ശരി, @bluetextbot കമാന്റുകൾ ഡിലീറ്റ് ചെയ്യാൻ ശ്രമിക്കാം!")

        return "<b>{}:</b>" \

               "\n#ANTI_COMMAND" \

               "\n<b>Admin:</b> {}" \

               "\nHas toggled @AntiCommandBot to <code>ON</code>.".format(html.escape(chat.title),

                                                                         mention_html(user.id, user.first_name))
Example #3
0
def rem_cmds(bot: Bot, update: Update, args: List[str]) -> str:
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]

    if not args:
        del_pref = sql.get_cmd_pref(chat.id)
        if del_pref:
            update.effective_message.reply_text("I should be deleting `@bluetextbot` messages now.")
        else:
            update.effective_message.reply_text("I'm currently not deleting `@bluetextbot` messages!")
        return ""

    if args[0].lower() in ("on", "yes"):
        sql.set_cmd_joined(str(chat.id), True)
        update.effective_message.reply_text("I'll try to delete `@bluetextbot` messages!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>ON</code>.".format(html.escape(chat.title),
                                                                         mention_html(user.id, user.first_name))
    elif args[0].lower() in ("off", "no"):
        sql.set_cmd_joined(str(chat.id), False)
        update.effective_message.reply_text("I won't delete `@bluetextbot`  messages.")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>OFF</code>.".format(html.escape(chat.title),
                                                                          mention_html(user.id, user.first_name))
    else:
        # idek what you're writing, say yes or no
        update.effective_message.reply_text("I understand 'on/yes' or 'off/no' only!")
        return ""
Example #4
0
def rem_cmds(bot: Bot, update: Update, args: List[str]) -> str:
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]

    if not args:
        del_pref = sql.get_cmd_pref(chat.id)
        if del_pref:
            update.effective_message.reply_text("no commads yet.")
        else:
            update.effective_message.reply_text("not deleting the commads.")
        return ""

    if args[0].lower() in ("on", "yes"):
        sql.set_cmd_joined(str(chat.id), True)
        update.effective_message.reply_text(
            "yes,I am trying to delete the commands!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>ON</code>.".format(html.escape(chat.title),
                                                                         mention_html(user.id, user.first_name))
    elif args[0].lower() in ("off", "no"):
        sql.set_cmd_joined(str(chat.id), False)
        update.effective_message.reply_text(
            "no, i am not delete the commands!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>OFF</code>.".format(html.escape(chat.title),
                                                                          mention_html(user.id, user.first_name))
    else:
        # idek what you're writing, say yes or no
        update.effective_message.reply_text(
            "I dont understsand... Type 'on/yes' or 'off/no' !")
        return ""
Example #5
0
def rem_slash_commands(bot: Bot, update: Update) -> str:
    chat = update.effective_chat  # type: Optional[Chat]
    msg = update.effective_message  # type: Optional[Message]
    del_pref = sql.get_cmd_pref(chat.id)

    if del_pref:
        try:
            msg.delete()
        except BadRequest as excp:
            LOGGER.info(excp)
Example #6
0
def rem_cmds(bot: Bot, update: Update, args: List[str]) -> str:
    chat = update.effective_chat  # type: Optional[Chat]
    user = update.effective_user  # type: Optional[User]

    if not args:
        del_pref = sql.get_cmd_pref(chat.id)
        if del_pref:
            update.effective_message.reply_text(
                "Currently, The Commandzzz are being deleted.")
        else:
            update.effective_message.reply_text(
                "Currently, The Commandzzzz Aren't being deleted.")
        return ""

    if args[0].lower() in ("on", "yes"):
        sql.set_cmd_joined(str(chat.id), True)
        update.effective_message.reply_text(
            "OK, I will try to delete commandzzz!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>ON</code>.".format(html.escape(chat.title),
                                                                         mention_html(user.id, user.first_name))
    elif args[0].lower() in ("off", "no"):
        sql.set_cmd_joined(str(chat.id), False)
        update.effective_message.reply_text(
            "Ok, I will not delete commandzzz from now on!")
        return "<b>{}:</b>" \
               "\n#ANTI_COMMAND" \
               "\n<b>Admin:</b> {}" \
               "\nHas toggled @AntiCommandBot to <code>OFF</code>.".format(html.escape(chat.title),
                                                                          mention_html(user.id, user.first_name))
    else:
        # idek what you're writing, say yes or no
        update.effective_message.reply_text(
            "I didn't Understand what are you trying to say... 'on/yes' Or 'off/no' Include it and try again!"
        )
        return ""