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") ] ]
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)
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)")
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")))
def get_help(chat): return gs(chat, "approve_help")
def get_help(chat): return gs(chat, "userinfo_help")
def get_help(chat): return gs(chat, "muting_help")
def get_help(chat): return gs(chat, "nation_help")
def get_help(chat): return gs(chat, "blacklist_help")
def get_help(chat): return gs(chat, "log_help")
def get_help(chat): return gs(chat, "antispam_help")
def get_help(chat): return gs(chat, "warns_help")
def fmt_filling_help(update: Update, context: CallbackContext): update.effective_message.reply_text( gs(update.effective_chat.id, "filling_help"), parse_mode=ParseMode.HTML, )
def get_help(chat): return gs(chat, "misc_help")
def get_help(chat): return gs(chat, "gtranslate_help")
def get_help(chat): return gs(chat, "anilist_help")
def get_help(chat): return gs(chat, "reports_help")
def get_help(chat): return gs(chat, "admin_help")
def get_help(chat): return gs(chat, "notes_help")
def get_help(chat): return gs(chat, "antiflood_help")
def get_help(chat): return gs(chat, "cleaner_help")
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
def get_help(chat): return gs(chat, "backup_help")
def get_help(chat): return gs(chat, "connections_help")
def get_help(chat): return gs(chat, "fun_help")
def get_help(chat): return gs(chat, "weather_help")
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"))
def get_help(chat): return gs(chat, "bans_help")
def get_help(chat): return gs(chat, "afk_help")
def get_help(chat): return gs(chat, "greetings_help")