コード例 #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
ファイル: misc.py プロジェクト: gagaoqphs/EnterpriseALRobot
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
ファイル: welcome.py プロジェクト: hyper-ub/EnterpriseALRobot
def get_help(chat):
    return gs(chat, "greetings_help")