예제 #1
0
def get_help(chat):
    return [gs(chat, "formt_help_bse"),
            [
                InlineKeyboardButton(text="Markdown", callback_data="fmt_help_md"),
                InlineKeyboardButton(text="Filling", callback_data="fmt_help_filling")
            ]
            ]
예제 #2
0
def fmt_help(update: Update, context: CallbackContext):
    query = update.callback_query
    bot = context.bot
    help_info = query.data.split("fmt_help_")[1]
    if help_info == "md":
        help_text = gs(update.effective_chat.id, "md_help")
    elif help_info == "filling":
        help_text = gs(update.effective_chat.id, "filling_help")
    query.message.edit_text(
        text=help_text,
        parse_mode=ParseMode.HTML,
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton(text="Back", callback_data=f"help_module({__mod_name__.lower()})"),
              InlineKeyboardButton(text='Report Error', url='https://t.me/zerounions')]]
        ),
    )
    bot.answer_callback_query(query.id)
예제 #3
0
def markdown_help(update: Update, _):
    chat = update.effective_chat
    update.effective_message.reply_text((gs(chat.id, "markdown_help_text")),
                                        parse_mode=ParseMode.HTML)
    update.effective_message.reply_text(
        "Try forwarding the following message to me, and you'll see!")
    update.effective_message.reply_text(
        "/save test This is a markdown test. _italics_, *bold*, `code`, "
        "[URL](example.com) [button](buttonurl:github.com) "
        "[button2](buttonurl://google.com:same)")
예제 #4
0
파일: __main__.py 프로젝트: kari-36/Licht
def get_help(update, context):
    """#TODO

    Params:
        update  -
        context -
    """

    chat = update.effective_chat  # type: Optional[Chat]
    args = update.effective_message.text.split(None, 1)

    # ONLY send help in PM
    if chat.type != chat.PRIVATE:

        update.effective_message.reply_text(
            "Contact me in PM to get the list of possible commands.",
            reply_markup=InlineKeyboardMarkup(
                [
                    [
                        InlineKeyboardButton(
                            text="Help",
                            url="t.me/{}?start=help".format(context.bot.username),
                        )
                    ]
                ]
            ),
        )
        return

    elif len(args) >= 2 and any(args[1].lower() == x for x in HELPABLE):
        module = args[1].lower()
        text = (
            "Here is the available help for the *{}* module:\n".format(
                HELPABLE[module].__mod_name__
            )
            + HELPABLE[module].get_help
        )
        send_help(
            chat.id,
            text,
            InlineKeyboardMarkup(
                [[InlineKeyboardButton(text="Back", callback_data="help_back")]]
            ),
        )

    else:
        send_help(chat.id, (gs(chat.id, "pm_help_text")))
예제 #5
0
파일: approve.py 프로젝트: kari-36/Licht
def get_help(chat):
    return gs(chat, "approve_help")
예제 #6
0
def get_help(chat):
    return gs(chat, "userinfo_help")
예제 #7
0
def get_help(chat):
    return gs(chat, "muting_help")
예제 #8
0
def get_help(chat):
    return gs(chat, "nation_help")
예제 #9
0
def get_help(chat):
    return gs(chat, "blacklist_help")
예제 #10
0
def get_help(chat):
    return gs(chat, "log_help")
예제 #11
0
def get_help(chat):
    return gs(chat, "antispam_help")
예제 #12
0
def get_help(chat):
    return gs(chat, "warns_help")
예제 #13
0
def fmt_filling_help(update: Update, context: CallbackContext):
    update.effective_message.reply_text(
        gs(update.effective_chat.id, "filling_help"),
        parse_mode=ParseMode.HTML,
    )
예제 #14
0
def get_help(chat):
    return gs(chat, "misc_help")
예제 #15
0
def get_help(chat):
    return gs(chat, "gtranslate_help")
예제 #16
0
def get_help(chat):
    return gs(chat, "anilist_help")
예제 #17
0
def get_help(chat):
    return gs(chat, "reports_help")
예제 #18
0
파일: admin.py 프로젝트: kari-36/Licht
def get_help(chat):
    return gs(chat, "admin_help")
예제 #19
0
def get_help(chat):
    return gs(chat, "notes_help")
예제 #20
0
def get_help(chat):
    return gs(chat, "antiflood_help")
예제 #21
0
def get_help(chat):
    return gs(chat, "cleaner_help")
예제 #22
0
def help_button(update, context):
    '''#TODO

    Params:
        update  -
        context -
    '''

    query = update.callback_query
    mod_match = re.match(r"help_module\((.+?)\)", query.data)
    prev_match = re.match(r"help_prev\((.+?)\)", query.data)
    next_match = re.match(r"help_next\((.+?)\)", query.data)
    back_match = re.match(r"help_back", query.data)
    chat = update.effective_chat
    print(query.message.chat.id)

    try:
        if mod_match:
            module = mod_match.group(1)
            text = ("Here is the help for the *{}* module:\n".format(
                HELPABLE[module].__mod_name__) +
                    HELPABLE[module].get_help(update.effective_chat.id))
            query.message.edit_text(
                text=text,
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=InlineKeyboardMarkup([[
                    InlineKeyboardButton(text="Back",
                                         callback_data="help_back")
                ]]),
            )

        elif prev_match:
            curr_page = int(prev_match.group(1))
            query.message.edit_text(
                text=gs(chat.id, "pm_help_text"),
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=InlineKeyboardMarkup(
                    paginate_modules(curr_page - 1, HELPABLE, "help")),
            )

        elif next_match:
            next_page = int(next_match.group(1))
            query.message.edit_text(
                text=gs(chat.id, "pm_help_text"),
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=InlineKeyboardMarkup(
                    paginate_modules(next_page + 1, HELPABLE, "help")),
            )

        elif back_match:
            query.message.edit_text(
                text=gs(chat.id, "pm_help_text"),
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=InlineKeyboardMarkup(
                    paginate_modules(0, HELPABLE, "help")),
            )

        # ensure no spinny white circle
        context.bot.answer_callback_query(query.id)
        # query.message.delete()

    except BadRequest:
        pass
예제 #23
0
def get_help(chat):
    return gs(chat, "backup_help")
예제 #24
0
def get_help(chat):
    return gs(chat, "connections_help")
예제 #25
0
def get_help(chat):
    return gs(chat, "fun_help")
예제 #26
0
def get_help(chat):
    return gs(chat, "weather_help")
예제 #27
0
def start(update: Update, context: CallbackContext):
    '''#TODO

    Params:
        update: Update           -
        context: CallbackContext -
    '''
    chat = update.effective_chat
    args = context.args
    if update.effective_chat.type == "private":
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id,
                          (gs(chat.id, "pm_help_text")))
            elif args[0].lower() == "markdownhelp":
                IMPORTED["extras"].markdown_help_sender(update)
            elif args[0].lower() == "nations":
                IMPORTED["nations"].send_nations(update)
            elif args[0].lower().startswith("stngs_"):
                match = re.match("stngs_(.*)", args[0].lower())
                chat = dispatcher.bot.getChat(match.group(1))

                if is_user_admin(chat, update.effective_user.id):
                    send_settings(match.group(1), update.effective_user.id,
                                  False)
                else:
                    send_settings(match.group(1), update.effective_user.id,
                                  True)

            elif args[0][1:].isdigit() and "rules" in IMPORTED:
                IMPORTED["rules"].send_rules(update, args[0], from_pm=True)

        else:
            first_name = update.effective_user.first_name
            update.effective_message.reply_photo(
                photo=KIGYO_IMG,
                caption=gs(chat.id, "pm_start_text").format(
                    escape_markdown(first_name),
                    escape_markdown(context.bot.first_name),
                    OWNER_ID,
                ),
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=InlineKeyboardMarkup([
                    [
                        InlineKeyboardButton(
                            text=gs(chat.id, "add_bot_to_group_btn"),
                            url="t.me/{}?startgroup=true".format(
                                context.bot.username),
                        ),
                        InlineKeyboardButton(
                            text="Help",
                            url="t.me/{}?start=help".format(
                                context.bot.username),
                        ),
                    ],
                    [
                        InlineKeyboardButton(
                            text=gs(chat.id, "MY HERO_link_btn"),
                            url=f"https://t.me/@ABHI_VILAN",
                        ),
                        InlineKeyboardButton(
                            text=gs(chat.id, "My Creatir_link_btn"),
                            url="https://t.me/@ABHI_VILAN",
                        ),
                    ],
                    [
                        InlineKeyboardButton(
                            text=gs(chat.id, "src_btn"),
                            url="https://github.com/Dank-del/EnterpriseALRobot",
                        ),
                        InlineKeyboardButton(
                            text="Try inline mode",
                            switch_inline_query_current_chat="",
                        )
                    ],
                ]),
            )
    else:
        update.effective_message.reply_text(gs(chat.id, "grp_start_text"))
예제 #28
0
파일: bans.py 프로젝트: RyomenSukuna/Sukuna
def get_help(chat):
    return gs(chat, "bans_help")
예제 #29
0
def get_help(chat):
    return gs(chat, "afk_help")
예제 #30
0
def get_help(chat):
    return gs(chat, "greetings_help")