Ejemplo n.º 1
0
def start(update, context):
    if update.effective_chat.type == "private":
        args = context.args
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id, tl(update.effective_message, HELP_STRINGS))

            elif args[0].lower() == "get_notes":
                update.effective_message.reply_text(tl(update.effective_message, "Now you can get notes in group."))

            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)

            elif args[0][:4] == "wiki":
                wiki = args[0].split("-")[1].replace('_', ' ')
                message = update.effective_message
                getlang = langsql.get_lang(message)
                if getlang == "id":
                    wikipedia.set_lang("id")
                pagewiki = wikipedia.page(wiki)
                judul = pagewiki.title
                summary = pagewiki.summary
                if len(summary) >= 4096:
                    summary = summary[:4000]+"..."
                message.reply_text("<b>{}</b>\n{}".format(judul, summary), parse_mode=ParseMode.HTML,
                    reply_markup=InlineKeyboardMarkup(
                            [[InlineKeyboardButton(text=tl(update.effective_message, "Read on Wikipedia"), url=pagewiki.url)]]))

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

        else:
            first_name = update.effective_user.first_name
            buttons = InlineKeyboardMarkup(
                [[InlineKeyboardButton(text="👤Add me to your group", url="https://t.me/ManagerGithubRobot?startgroup=new")],
                [InlineKeyboardButton(text="⚙️ Connections", callback_data="main_connect")],
                [InlineKeyboardButton(text="🐳 Language", callback_data="main_setlang"), InlineKeyboardButton(text="❓ Help", url="https://t.me/ManagerGithubRobot?start=help")]])
            update.effective_message.reply_text(
                tl(update.effective_message, PM_START_TEXT).format(escape_markdown(first_name), escape_markdown(context.bot.first_name), OWNER_ID),
                disable_web_page_preview=True,
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=buttons)
    else:
        update.effective_message.reply_text(tl(update.effective_message, "Ada yang bisa saya bantu? 😊"))
Ejemplo n.º 2
0
def start(update, context):
    if update.effective_chat.type == "private":
        args = context.args
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id, tl(update.effective_message, HELP_STRINGS))

            elif args[0].lower() == "get_notes":
                update.effective_message.reply_text(tl(update.effective_message, "Anda sekarang dapat mengambil catatan di grup."))

            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)

            elif args[0][:4] == "wiki":
                wiki = args[0].split("-")[1].replace('_', ' ')
                message = update.effective_message
                getlang = langsql.get_lang(message)
                if getlang == "id":
                    wikipedia.set_lang("id")
                pagewiki = wikipedia.page(wiki)
                judul = pagewiki.title
                summary = pagewiki.summary
                if len(summary) >= 4096:
                    summary = summary[:4000]+"..."
                message.reply_text("<b>{}</b>\n{}".format(judul, summary), parse_mode=ParseMode.HTML,
                    reply_markup=InlineKeyboardMarkup(
                            [[InlineKeyboardButton(text=tl(update.effective_message, "Baca di Wikipedia"), url=pagewiki.url)]]))

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

        else:
            first_name = update.effective_user.first_name
            buttons = InlineKeyboardMarkup(
                [
                [InlineKeyboardButton(text="💭Language💭 ", callback_data="main_setlang"), InlineKeyboardButton(text="⚙️Connect Group⚙️", callback_data="main_connect")],
                [InlineKeyboardButton(text="🚂join Hogwarts🏰", url="https://t.me/TheRex2k20"), InlineKeyboardButton(text="🏰🚂Hogwarts Channel🚂🏰", url="https://t.me/HogwartsPlus")],
                [InlineKeyboardButton(text="🌐Help🌐", url="https://t.me/{}?start=help".format(context.bot.username)), InlineKeyboardButton(text="💖About Developer💝", url="https://t.me/percy_jackson_4")],
                [InlineKeyboardButton(text="❤💚Sorting Hat💙💛", url="https://www.wizardingworld.com")]])
            update.effective_message.reply_photo(DAISY_IMG,
                tl(update.effective_message, PM_START_TEXT).format(escape_markdown(first_name), escape_markdown(context.bot.first_name), OWNER_ID),
                disable_web_page_preview=True,
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=buttons)
    else:
        update.effective_message.reply_text(tl(update.effective_message, "Ada yang bisa saya bantu? 😊"))
Ejemplo n.º 3
0
def start(update, context):
    if update.effective_chat.type == "private":
        args = context.args
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id, tl(update.effective_message, HELP_STRINGS))

            elif args[0].lower() == "get_notes":
                update.effective_message.reply_text(tl(update.effective_message, "Anda sekarang dapat mengambil catatan di grup."))

            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)

            elif args[0][:4] == "wiki":
                wiki = args[0].split("-")[1].replace('_', ' ')
                message = update.effective_message
                getlang = langsql.get_lang(message)
                if getlang == "id":
                    wikipedia.set_lang("id")
                pagewiki = wikipedia.page(wiki)
                judul = pagewiki.title
                summary = pagewiki.summary
                if len(summary) >= 4096:
                    summary = summary[:4000]+"..."
                message.reply_text("<b>{}</b>\n{}".format(judul, summary), parse_mode=ParseMode.HTML,
                    reply_markup=InlineKeyboardMarkup(
                            [[InlineKeyboardButton(text=tl(update.effective_message, "Baca di Wikipedia"), url=pagewiki.url)]]))

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

        else:
            first_name = update.effective_user.first_name
            buttons = InlineKeyboardMarkup(
                [
                [InlineKeyboardButton(text="🤿 Language", callback_data="main_setlang"), InlineKeyboardButton(text="📡  Connect Group", callback_data="main_connect")],
                [InlineKeyboardButton(text="🦾 Support Group", url="https://t.me/gangofmafiateam"), InlineKeyboardButton(text="📞  Contact Devoloper", url="https://t.me/prabhasha999")],
                [InlineKeyboardButton(text="⛑ Help", url="https://t.me/{}?start=help".format(context.bot.username)), InlineKeyboardButton(text="🤖 About Developer", url="https://sltechcom.webnode.com/about-us/")],
                [InlineKeyboardButton(text="👒 Add me to your group", url="https://t.me/{}?startgroup=new".format(context.bot.username))]])
            update.effective_message.reply_photo(DAISY_IMG,
                tl(update.effective_message, PM_START_TEXT).format(escape_markdown(first_name), escape_markdown(context.bot.first_name), OWNER_ID),
                disable_web_page_preview=True,
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=buttons)
    else:
        update.effective_message.reply_text(tl(update.effective_message, "Ada yang bisa saya bantu? 😊"))
Ejemplo n.º 4
0
def start(update, context):
    if update.effective_chat.type == "private":
        args = context.args
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id,
                          tl(update.effective_message, HELP_STRINGS))

            elif args[0].lower() == "get_notes":
                update.effective_message.reply_text(
                    tl(update.effective_message,
                       "Anda sekarang dapat mengambil catatan di grup."))

            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)

            elif args[0][:4] == "wiki":
                wiki = args[0].split("-")[1].replace('_', ' ')
                message = update.effective_message
                getlang = langsql.get_lang(message)
                if getlang == "id":
                    wikipedia.set_lang("id")
                pagewiki = wikipedia.page(wiki)
                judul = pagewiki.title
                summary = pagewiki.summary
                if len(summary) >= 4096:
                    summary = summary[:4000] + "..."
                message.reply_text("<b>{}</b>\n{}".format(judul, summary),
                                   parse_mode=ParseMode.HTML,
                                   reply_markup=InlineKeyboardMarkup([[
                                       InlineKeyboardButton(text=tl(
                                           update.effective_message,
                                           "Baca di Wikipedia"),
                                                            url=pagewiki.url)
                                   ]]))

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

        else:
            first_name = update.effective_user.first_name
            buttons = InlineKeyboardMarkup(
                [[
                    InlineKeyboardButton(
                        text="👑 Add me to your group",
                        url="https://t.me/{}?startgroup=new".format(
                            context.bot.username))
                ],
                 [
                     InlineKeyboardButton(text="💭 Language",
                                          callback_data="main_setlang"),
                     InlineKeyboardButton(text="⚙️ Connect Group",
                                          callback_data="main_connect")
                 ],
                 [
                     InlineKeyboardButton(text="👥 Support Group",
                                          url="http://t.me/notimetosleep1"),
                     InlineKeyboardButton(text="🌐 Support Channel",
                                          url="https://t.me/nttschennel")
                 ],
                 [
                     InlineKeyboardButton(
                         text="❓ Help",
                         url="https://t.me/{}?start=help".format(
                             context.bot.username)),
                     InlineKeyboardButton(
                         text="👻 Profil CESPER",
                         url="https://id.m.wikipedia.org/wiki/Casper_(film)")
                 ]])
            update.effective_message.reply_photo(
                "https://i.ibb.co/F3MnkFd/IMG-20210123-174846-513.jpg",
                tl(update.effective_message, PM_START_TEXT).format(
                    escape_markdown(first_name),
                    escape_markdown(context.bot.first_name), OWNER_ID),
                disable_web_page_preview=True,
                parse_mode=ParseMode.MARKDOWN,
                reply_markup=buttons)
    else:
        update.effective_message.reply_text(
            tl(update.effective_message, "ADA YANG BISA SAYA KENTOD? 💦"))
Ejemplo n.º 5
0
def start(update, context):
    if update.effective_chat.type == "private":
        args = context.args
        if len(args) >= 1:
            if args[0].lower() == "help":
                send_help(update.effective_chat.id,
                          tl(update.effective_message, HELP_STRINGS))

            elif args[0].lower() == "get_notes":
                update.effective_message.reply_text(
                    tl(update.effective_message,
                       "Anda sekarang dapat mengambil catatan di grup."))

            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)

            elif args[0][:4] == "wiki":
                wiki = args[0].split("-")[1].replace('_', ' ')
                message = update.effective_message
                getlang = langsql.get_lang(message)
                if getlang == "id":
                    wikipedia.set_lang("id")
                pagewiki = wikipedia.page(wiki)
                judul = pagewiki.title
                summary = pagewiki.summary
                if len(summary) >= 4096:
                    summary = summary[:4000] + "..."
                message.reply_text("<b>{}</b>\n{}".format(judul, summary),
                                   parse_mode=ParseMode.HTML,
                                   reply_markup=InlineKeyboardMarkup([[
                                       InlineKeyboardButton(text=tl(
                                           update.effective_message,
                                           "Baca di Wikipedia"),
                                                            url=pagewiki.url)
                                   ]]))

            elif args[0][:6].lower() == "verify":
                chat_id = args[0].split("_")[1]
                verify_welcome(update, context, chat_id)

        else:
            first_name = update.effective_user.first_name
            buttons = InlineKeyboardMarkup(
                [[
                    InlineKeyboardButton(
                        text="🎉 Me adicione em outro grupo!",
                        url="https://t.me/{}?startgroup=new".format(
                            context.bot.username))
                ],
                 [
                     InlineKeyboardButton(text="💭 Linguagem",
                                          callback_data="main_setlang"),
                     InlineKeyboardButton(text="⚙️ Connect Group",
                                          callback_data="main_connect")
                 ],
                 [
                     InlineKeyboardButton(text="👥 Grupo de Suporte",
                                          url="https://t.me/EmiliaOfficial"),
                     InlineKeyboardButton(text="🔔 Update Channel",
                                          url="https://t.me/AyraBotNews")
                 ],
                 [
                     InlineKeyboardButton(
                         text="❓ Ajuda",
                         url="https://t.me/{}?start=help".format(
                             context.bot.username)),
                     InlineKeyboardButton(
                         text="💖 Donate",
                         url="http://ayrahikari.github.io/donations.html")
                 ]])
            update.effective_message.reply_text(tl(
                update.effective_message,
                PM_START_TEXT).format(escape_markdown(first_name),
                                      escape_markdown(context.bot.first_name),
                                      OWNER_ID),
                                                disable_web_page_preview=True,
                                                parse_mode=ParseMode.MARKDOWN,
                                                reply_markup=buttons)
    else:
        update.effective_message.reply_text(
            tl(update.effective_message, "Ada yang bisa saya bantu? 😊"))