コード例 #1
0
async def inline_handler(event):
        builder = event.builder
        query = event.text
        replied_user = await torrentbot.get_me()
        firstname = replied_user.username
        if query == None or " ": 
            resulte = builder.article(
                title="Usage Guide.",
                description="(C) @StarkGanG",
                text=f"**How To Use Me?** \n**Youtube :** `@{firstname} yt <query>` \n**Example :** `@{firstname} yt why we lose song` \n\n**Torrent :** `@{firstname} torrent <query>` \n**Example :** `@{firstname} torrent avengers endgame ` \n\n**JioSaavan :** `@{firstname} jm <query>` \n**Example :** `@{firstname} jm dilbaar`",
                buttons=[
                      [Button.url("Contact Me", f"t.me/{firstname}")],
                      [Button.switch_inline("Search Youtube", query="yt ", same_peer=True)],
                      [Button.switch_inline("Search Torrent", query="torrent ", same_peer=True)],
                      [Button.switch_inline("Search JioSaavn", query="jm ", same_peer=True)],
                              ]
            )
            await event.answer([resulte])
コード例 #2
0
async def reopen_again(event):
    if not event.is_group:
        await event.edit(
            pm_caption,
            buttons=[
                [
                    Button.inline("Advanced", data="soon"),
                    Button.inline("Commands", data="help_menu"),
                ],
                  [
                    Button.url(
                        "Add Me To Your Group!", "t.me/aniegrpbot?startgroup=true"
                    ),
                ],
            ],
        )
    else:
        await event.reply("I'm Awake☺️")
コード例 #3
0
ファイル: anime.py プロジェクト: Vethya/HelperBot
async def mal_character(e):
    aw = await e.reply('Searching...')
    c = await get_character(e.pattern_match.group(1), e.client.loop)
    if not c:
        await aw.edit('No results found!')
        return
    text = f'<b>{c["name"]} ({c["name_kanji"]})</b>\n'
    about = html.escape(c['about'].replace('\\n', ''))
    text += f'<i>{about}</i>\n'
    text = shorten(text)
    await aw.delete()
    await e.client.send_message(e.chat_id,
                                text.strip(),
                                reply_to=e.id,
                                buttons=Button.url('More Information',
                                                   url=c['url']),
                                link_preview=True,
                                file=c['image_url'])
コード例 #4
0
ファイル: start.py プロジェクト: suprith-7023/TeleBot
async def settings(event):
    if event.sender_id == OWNER_ID:
        await event.delete()
        await tgbot.send_message(
            event.chat_id,
            "Here are the available options.",
            buttons=[
                [Button.inline("PM Bot", data="pmbot")],
                [
                    Button.url(
                        "Logs",
                        url=
                        f"https://t.me/{Var.TG_BOT_USER_NAME_BF_HER}?start=logs"
                    )
                ]
            ])
    else:
        await event.answer("You can't use this bot.", alert=True)
コード例 #5
0
async def testing_him(lightning):
    if lightning.query.user_id == bot.uid:
        fck_bit = f"Wait Lemme Test Him"
        await lightning.answer(fck_bit, _lightning_power=0, alert=True)
        return
    await lightning.get_chat()
    lightning_id = lightning.query.user_id
    text3 = f"Ok, Wait. You can Ask After {LIGHTNINGUSER} Approves You. Kindly, Wait."
    await bot.send_message(lightning.query.user_id, text3)
    await bot.send_message(
        LIGHT_LOGS,
        message=
        f"Hello, A [New User](tg://user?id={lightning_id}). Wants To Ask You Something.",
        lightning_buttons=[
            Button.url("Contact Him By",
                       f"tg://user?id={lightning_bot} If Urgent")
        ],
    )
コード例 #6
0
async def _(event):

    who = await aboutbot(GetFullUserRequest(event.sender_id))
    name = who.user.first_name
    uname = Config.OWNER_UN
    botname = Config.BOT_NAME
    await aboutbot.send_message(
        event.chat_id,
        f"**Hey {name}, I am {botname}.\n\nI am assistant of {uname}\n\nYou can check his info through me.😊**",
        buttons=
        [[Button.inline("Help:💬", data="help")],
         [
             Button.url(
                 "Deploy Your Own Bot🤩",
                 url=
                 "https://heroku.com/deploy?template=https://github.com/anonyindian/aboutbot"
             )
         ]])
コード例 #7
0
 async def handler(event):
     if event.message.from_id != uid:
         reply = "**STRING SESSION**"
         await event.reply(
             f"**Hai Kamu!**\n\n"
             f"Ingin Mengambil String Session Ini Di Bot?\n\n"
             f"Cukup Ambil Dibawah Button URL Ini\n\n"
             f"⚠️ **Gunakan String Session Dengan Bijak**\n\n"
             f"{reply}\n",
             buttons=[
                 [
                     Button.url(
                         "String Session",
                         "https://replit.com/@apisuserbot/String-Session?v=1",
                     )
                 ],
             ],
         )
コード例 #8
0
async def testing_him(lightning):
    if lightning.query.user_id == bot.uid:
        fck_bit = f"Wait Lemme Test Him"
        await lightning.answer(fck_bit, _lightning_power=0, alert=True)
        return
    await lightning.get_chat()
    lightning_id = lightning.query.user_id
    text6 = f"[Go To Hell](https://telegra.ph/file/c0b399f9e21a9da1b71ef.png)."
    await bot.send_message(lightning.query.user_id, text6)
    await bot.send_message(
        LIGHT_LOGS,
        message=
        f"Hello, A [New User](tg://user?id={lightning_id}). Wants To Ask You Something But He Pressed No So therefore Waiting.",
        lightning_buttons=[
            Button.url("Contact Him By",
                       f"tg://user?id={lightning_bot} If Urgent")
        ],
    )
コード例 #9
0
 async def inline_handler(event):
     builder = event.builder
     result = None
     query = event.text
     me = await bot.get_me()
     x = await xbot.get_me()
     if query.startswith("alive") and event.query.user_id == me.id:
         buttons = [[
             Button.url("Rᴇᴘᴏ", "https://github.com/ULTRA-OP/ULTRA-X"),
             Button.url(
                 "Dᴇᴘʟᴏʏ",
                 "https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fgithub.com%2FULTRA-OP%2FHEROKU&template=https%3A%2F%2Fgithub.com%2FULTRA-OP%2FHEROKU"
             )
         ],
                    [
                        Button.url(
                            "Sᴛʀɪɴɢ",
                            "https://replit.com/@legendx22/ULTRA-X#main.py"
                        ),
                        Button.url("Cʜᴀɴɴᴇʟ", "https://t.me/ULTRAXOT")
                    ],
                    [
                        Button.url("Mᴀsᴛᴇʀ", f"https://t.me/{me.username}"),
                        Button.url("Assɪsᴛᴀɴᴛ",
                                   f"https://t.me/{x.username}")
                    ]]
         buttons += [[
             custom.Button.inline("Hᴇʟᴘ", data="open"),
             custom.Button.inline("Rᴇsᴛᴀʀᴛ", data='restart')
         ]]
         if ALIVE_PHOTTO and ALIVE_PHOTTO.endswith(
             (".jpg", ".png", "gif", "mp4")):
             result = builder.photo(ALIVE_PHOTTO,
                                    text=pro_text,
                                    buttons=buttons,
                                    link_preview=False)
         elif ALIVE_PHOTTO:
             result = builder.document(
                 ALIVE_PHOTTO,
                 title="υℓтяα χ",
                 text=pro_text,
                 buttons=buttons,
                 link_preview=False,
             )
         else:
             result = builder.article(
                 title="υℓтяα χ",
                 text=pro_text,
                 buttons=buttons,
                 link_preview=False,
             )
         await event.answer([result] if result else None)
コード例 #10
0
async def _(event):
    uid = int(event.data_match.group(1).decode("UTF-8"))
    if uid == event.sender_id:
        x = await get_user_join(uid)
        nm = (await BotzHub(GetFullUserRequest(uid))).user.first_name
        if x is False:
            await event.answer(f"You haven't joined @{channel} yet!", cache_time=0, alert=True)
        elif x is True:
            try:
                await BotzHub.edit_permissions(event.chat.id, uid, until_date=None, send_messages=True)
            except Exception as e:
                print(str(e))
                return
            msg = f"Welcome to {(await event.get_chat()).title}, {nm}!\nGood to see you here!"
            butt = [Button.url("Channel", url=f"https://t.me/{channel}")]
            await event.edit(msg, buttons=butt)
    else:
        await event.answer("You are an old member and can speak freely! This isn't for you!", cache_time=0, alert=True)
コード例 #11
0
ファイル: sched_send_delete.py プロジェクト: SGKbot/AltBot
async def snd_schl(
        pr, recipient):  # отправка отложенного, recipient 1 в канал, 2 в бот

    if recipient == 1:
        rcp = pr[1] * (-1)
    elif recipient == 2:
        rcp = pr[0]

    if len(pr[14]) > 0:
        x2, x3, x4, x5, x6, x7 = await user_info.processing_button_data(pr[14])

    # 0 id бота          используется в имени мм файла
    full_mm_path = await file_path_sch(pr)
    # 2 id  сообщения    используется в имени мм файла

    if not os.path.exists(full_mm_path):  # нет мм файла
        if not pr[14]:
            msg = await bot.send_message(rcp,
                                         pr[13],
                                         parse_mode='html',
                                         link_preview=False)
        else:
            msg = await bot.send_message(rcp,
                                         pr[13],
                                         parse_mode='html',
                                         link_preview=False,
                                         buttons=[[
                                             Button.url(x5, x4.strip()),
                                             Button.url(x7, x6.strip())
                                         ], [Button.url(x3, x2.strip())]])
    else:  # Картинка или видео с каментом
        if not pr[14]:
            msg = await bot.send_file(rcp,
                                      full_mm_path,
                                      caption=pr[13],
                                      parse_mode='html')
        else:
            msg = await bot.send_file(rcp,
                                      full_mm_path,
                                      caption=pr[13],
                                      parse_mode='html',
                                      buttons=[[
                                          Button.url(x5, x4.strip()),
                                          Button.url(x7, x6.strip())
                                      ], [Button.url(x3, x2.strip())]])

    if recipient == 2:
        await bot.send_message(rcp,
                               'Ваши действия',
                               buttons=bl_as_modul.schinf_but)

    return msg
コード例 #12
0
ファイル: bot.py プロジェクト: levina-x/ForceSub
async def _(event):
    uid = int(event.data_match.group(1).decode("UTF-8"))
    if uid == event.sender_id:
        x = await get_user_join(uid)
        nm = (await BotzHub(GetFullUserRequest(uid))).user.first_name
        if x is False:
            await event.answer(f"kamu masih belum join ke👉 @{channel}, join dulu yuk!", cache_time=0, alert=True)
        elif x is True:
            try:
                await BotzHub.edit_permissions(event.chat.id, uid, until_date=None, send_messages=True)
            except Exception as e:
                print(str(e))
                return
            msg = f"selamat datang di {(await event.get_chat()).title}, {nm}!\nsenang bisa melihat mu!"
            butt = [Button.url("CHANNEL", url=f"https://t.me/{channel}")]
            await event.edit(msg, buttons=butt)
    else:
        await event.answer("kamu adalah member lama, kamu bisa mengobrol dengan bebas, ini bukan untukmu!", cache_time=0, alert=True)
コード例 #13
0
ファイル: _menu.py プロジェクト: fvckcat/Toni
async def reopen_again(event):
    if not event.is_group:
        await event.edit(
            pm_caption,
            buttons=[
                [
                    Button.inline("🧰 Tutorial", data="soon"),
                    Button.inline("📚 Perintah", data="help_menu"),
                ],
                  [
                    Button.url(
                        "📌 Tambahkan Saya Ke Grup Kamu!", "t.me/TheToniBot$?startgroup=true"
                    ),
                ],
            ],
        )
    else:
        pass
コード例 #14
0
async def Devsexpo(event):
    if event.sender_id != Config.OWNER_ID:
        rip = await check_him(Config.JTU_ID, Config.JTU_LINK, event.sender_id)
        if rip is False:
            await event.reply(
                "**To Use This Bot, Please Join My Channel. :)**",
                buttons=[Button.url("Join Channel", Config.JTU_LINK)],
            )
            return
    ok = await event.reply(
        "CHECKING PROXIES... PLEASE WAIT. MAY TAKE TIME DEPENDING ON NUMBER OF PROXIES."
    )
    pablo = await event.get_reply_message()
    if pablo == None:
        await event.reply('Reply To File')
        return
    escobar = await UltraBot.download_media(pablo.media, Config.DL_LOCATION)
    cmd = f"python3 -m PyProxyToolkit.Console -i {escobar} -o goood.txt -t 80 -x 20 -s httpbinStrategy"
    os.system(cmd)
    file = open("goood.txt", "r")
    Counter = 0
    Content = file.read()
    CoList = Content.split("\n")
    for i in CoList:
        if i:
            Counter += 1
    file.close()
    if Counter <= 0:
        await ok.edit(
            "Check Failed. Either Your File Has All Bad Proxies Or Your Proxy File Is Invalid."
        )
    elif Counter >= 1:
        file1 = open("goood.txt", "a")
        file1.write("\nCHECKED BY UltraBot \n")
        file1.close()
        ok.delete()
        await UltraBot.send_file(
            event.chat_id,
            "goood.txt",
            caption=
            f"**PROXIES CHECKED**\n**GOOD PROXIES: ** {Counter}\n\n**CHECKED BY UltraBot.**",
        )
        os.remove(escobar)
        os.remove("goood.txt")
コード例 #15
0
async def sedlyfsir(event):
    starkbot = await chatbot.get_me()
    bot_id = starkbot.first_name
    bot_username = starkbot.username
    replied_user = await event.client(GetFullUserRequest(event.sender_id))
    firstname = replied_user.user.first_name
    vent = event.chat_id
    oknoob = Config.OWNER_ID
    oksir = Config.CUSTOM_START
    if Config.CUSTOM_START is None:
        text_me = (
            f"**Hai. {firstname} , I am {bot_username}.** \n"
            f"`I am A ChatBot To Talk With My` [Master](tg://user?id={oknoob}) \n"
            f"**Send Me And I Will Send To Moi Master.** \n"
            f"**Thank You**")
    else:
        text_me = f"{oksir}"
    formaster = "Sir. How Can I Help You?"
    if event.sender_id in Config.OWNER_ID:
        ok = await chatbot.send_message(
            event.chat_id,
            message=formaster,
            buttons=[
                [custom.Button.inline("Commands For Owner.", data="cmds")],
                [custom.Button.inline("Close 🔐", data="close ")],
            ])
    else:
        if already_added(event.sender_id):
            pass
        elif not already_added(event.sender_id):
            add_usersid_in_db(event.sender_id)
            await chatbot.send_message(
                Config.DUMB_CHAT, f"NEW USER ! \nUser ID : `{event.chat_id}`")
        await chatbot.send_file(
            event.chat_id,
            file=Config.CUSTOM_IMG,
            caption=text_me,
            buttons=[
                [
                    Button.url("🔥 Join Our Channel 🔥",
                               "https://t.me/FutureTechnologyOfficial")
                ],
                [custom.Button.inline("Close 🔐", data="close ")],
            ])
コード例 #16
0
async def inline_id_handler(event: events.InlineQuery.Event):
    builder = event.builder
    if event.query.user_id == bot.uid:
        ok = builder.article(
            title="Inline Help",
            description="Nothing Much",
            text="Nothing Just Help",
            buttons=[
                [
                    Button.switch_inline("Image Searcher", query="img", same_peer=True),
                    Button.switch_inline("Modded Alive", query="dcmod", same_peer=True),
                    Button.switch_inline(
                        "Whisper Message", query="secret", same_peer=True
                    ),
                    Button.switch_inline(
                        "YT Video Searcher", query="yts", same_peer=True
                    ),
                ],
                [
                    Button.switch_inline(
                        "Google Searcher", query="google", same_peer=True
                    )
                ],
                [Button.inline("❌Close❌", b"iclose")],
            ],
        )
        await event.answer([ok])
        return
    else:
        s = builder.article(
            title="I am Not your Servant",
            description="Do your Own work sir don't interfere in Others Work",
            text="Hey You Must Use DARK COBRA USERBOT",
            buttons=[
                [
                    Button.url(
                        "Dark Cobra Modified",
                        "https://github.com/The-Terminal/DARKCOBRA",
                    )
                ],
            ],
        )
        await event.answer([s])
        return
コード例 #17
0
async def _(e):
    try:
        quer = e.text.split(" ", maxsplit=1)[1]
    except IndexError:
        return await e.answer(
            [], switch_pm="Mod Apps Search. Enter app name!", switch_pm_param="start"
        )
    page = 1
    start = (page - 1) * 3 + 1
    da = base64.b64decode(choice(apis)).decode("ascii")
    url = f"https://www.googleapis.com/customsearch/v1?key={da}&cx=25b3b50edb928435b&q={quer}&start={start}"
    data = await async_searcher(url, re_json=True)
    search_items = data.get("items")
    modss = []
    for a in search_items:
        title = a.get("title")
        desc = a.get("snippet")
        link = a.get("link")
        text = f"**••Tɪᴛʟᴇ••** `{title}`\n\n"
        text += f"**Dᴇsᴄʀɪᴘᴛɪᴏɴ** `{desc}`"
        modss.append(
            await e.builder.article(
                title=title,
                description=desc,
                text=text,
                link_preview=True,
                buttons=[
                    [Button.url("Dᴏᴡɴʟᴏᴀᴅ", url=f"{link}")],
                    [
                        Button.switch_inline(
                            "Mᴏʀᴇ Mᴏᴅs",
                            query="mods ",
                            same_peer=True,
                        ),
                        Button.switch_inline(
                            "Sʜᴀʀᴇ",
                            query=f"mods {quer}",
                            same_peer=False,
                        ),
                    ],
                ],
            ),
        )
    await e.answer(modss, switch_pm="Search Mod Applications.", switch_pm_param="start")
コード例 #18
0
ファイル: main.py プロジェクト: Mukxtarov/test-bot
async def start(event):
    route['status'] = "start"

    db.InsertUser(
        event.sender.id, {
            'user_id': event.sender.id,
            'first_name': str(event.sender.first_name),
            'last_name': str(event.sender.last_name),
            'username': str(event.sender.username),
            'updated_at': datetime.datetime.today()
        })

    try:
        buttons_check = [[
            Button.url(message['azo_boling'], url=config['channel_url'])
        ], [Button.inline(message['check_azo'], data="check_channel")]]

        check = await bot(
            functions.channels.GetParticipantRequest(
                channel=config['channel_id'], user_id=event.sender.id))

        if check.users[0].id != event.sender.id:
            await event.reply(message['subs_channel'],
                              buttons=buttons_check,
                              parse_mode="HTML")
            return
            raise events.StopPropagation
    except Exception as e:
        if e:
            await event.reply(message['subs_channel'],
                              buttons=buttons_check,
                              parse_mode="HTML")
            return
            raise events.StopPropagation

    buttons = [[Button.inline(message['create_test'], data="create_test")],
               [
                   Button.inline(message['answer_the_test'],
                                 data="answer_the_test")
               ]]

    await event.reply(message['welcome'], buttons=buttons, parse_mode="HTML")

    raise events.StopPropagation
コード例 #19
0
async def gsearch(q_event):
    try:
        match = q_event.text.split(" ", maxsplit=1)[1]
    except IndexError:
        return await q_event.answer([],
                                    switch_pm="Google Search. Enter a query!",
                                    switch_pm_param="start")
    searcher = []
    gresults = await google_search(match)
    for i in gresults:
        try:
            title = i["title"]
            link = i["link"]
            desc = i["description"]
            searcher.append(
                await q_event.builder.article(
                    title=title,
                    description=desc,
                    thumb=wb(gugirl, 0, "image/jpeg", []),
                    text=
                    f"**Gᴏᴏɢʟᴇ Sᴇᴀʀᴄʜ**\n\n**••Tɪᴛʟᴇ••**\n`{title}`\n\n**••Dᴇsᴄʀɪᴘᴛɪᴏɴ••**\n`{desc}`",
                    link_preview=False,
                    buttons=[
                        [Button.url("Lɪɴᴋ", url=f"{link}")],
                        [
                            Button.switch_inline(
                                "Sᴇᴀʀᴄʜ Aɢᴀɪɴ",
                                query="go ",
                                same_peer=True,
                            ),
                            Button.switch_inline(
                                "Sʜᴀʀᴇ",
                                query=f"go {match}",
                                same_peer=False,
                            ),
                        ],
                    ],
                ), )
        except IndexError:
            break
    await q_event.answer(searcher,
                         switch_pm="Google Search.",
                         switch_pm_param="start")
コード例 #20
0
async def Buttons(event):
  await event.edit("`Mᴀᴋɪɴɢ Yᴏᴜʀ Bᴜᴛᴛᴏɴ ᴡᴇɪᴛ ᴍᴀsᴛᴇʀ !!!`")
  ULTRAX = Var.TG_BOT_USER_NAME_BF_HER
  pro = event.text[7:]
  pro, boy = pro.split("|")
  if "LEGENDX" == "PROBOYX":
    await xbot.send_message(event.chat_id, "buttons")
  else:
    try:
      async with bot.conversation(ULTRAX) as proboyx:
        await proboyx.send_message("/start")
        await proboyx.get_response()
        await proboyx.send_message("my button 🥺")
        await xbot.send_message(bot.me.id, f"{pro}", buttons=[[Button.url(f"{pro}", f"{boy}")]])
        pro = await proboyx.get_response()
        await pro.forward_to(event.chat_id)
        await event.delete()
    except:
        await event.edit("example:\n.button <button name>|<link>\n`.button ULTRAX|https://t.me/ULTRAXOT`\nmake sure your name and link no have Useless spece ",link_preview=False)
コード例 #21
0
ファイル: start.py プロジェクト: aayushrisked/Ultroid
async def assistant(event):
    if event.is_group and event.sender_id in sed:
        return await eor(event, "`I dont work in groups`")
    else:
        if not is_added(event.sender_id) and event.sender_id not in sed:
            add_user(event.sender_id)
            await asst.send_message(
                OWNER_ID,
                f"Bot started by [{event.sender_id}](tg://user?id={event.sender_id})",
            )
        ok = ""
        if Var.MSG_FRWD is True:
            ok = "You can contact me using this bot!!"
        if event.is_private and event.sender_id in sed:
            return
        await event.reply(
            f"Hey there, this is Ultroid Assistant of {OWNER_NAME}!\n\n{ok}",
            buttons=[Button.url("Know More", url="https://t.me/TeamUltroid")],
        )
コード例 #22
0
async def inline_handler(event):
        builder = event.builder
        query = event.text
        replied_user = await torrentbot.get_me()
        firstname = replied_user.username
        if query == None or " ": 
            resulte = builder.article(
                title="Turoial cara menggunakan BOT",
                description="2021 © MVPL",
                text=f"**Bagaimana cara menggunakannya?** \n**👉 Youtube:**\n `@{firstname} yt <kata kunci>` \n**Contoh :** `@{firstname} yt lagu indonesia raya` \n\n👉 **MP3 Youtube:**\n `@{firstname} ytmp3 <kata kunci>` \n**Contoh :**\n `@{firstname} ytmp3 lagu indonesia raya` \n\n👉 **Torrent: **\n `@{firstname} torrent <kata kunci>` \n**Contoh :** `@{firstname} torrent the raid`",
                buttons=[
                      [Button.url("Grup MVPL", f"t.me/idmvpl")],
                      [Button.switch_inline("Cari Video Youtube", query="yt ", same_peer=True)],
                      [Button.switch_inline("Cari MP3 Youtube", query="ytmp3 ", same_peer=True)],
                      [Button.switch_inline("Cari Magnet Torrent", query="torrent ", same_peer=True)]
                ]
                             
            )
            await event.answer([resulte])
コード例 #23
0
async def start(event):

    if not event.is_group:
        await tbot.send_message(
            event.chat_id,
            pm_caption,
            buttons=[
                [
                    Button.inline("Tutorial", data="soon"),
                    Button.inline("Commands", data="help_menu"),
                ],
                [
                    Button.url("Add Me To Your Group!",
                               "t.me/Yunogasaichatbot?startgroup=true"),
                ],
            ],
        )
    else:
        await event.reply("Heya Yuno Gasai is here!,\nHow Can I Help Ya.")
コード例 #24
0
ファイル: start.py プロジェクト: mr-s9/Userbot
async def assistant(event):
    if event.is_group and event.sender_id in sed:
        bnn = (await asst.get_me()).username
        return await event.reply(
            "`I dont work in groups`",
            buttons=[Button.url("⚙️Sᴛᴀʀᴛ⚙️", url=f"https://t.me/{bnn}?start=set")],
        )
    else:
        if not is_added(event.sender_id) and event.sender_id not in sed:
            add_user(event.sender_id)
        ok = ""
        if udB.get("PMBOT") == "True":
            ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
        if event.is_private and event.sender_id in sed:
            return
        await event.reply(
            f"Hey there, this is Assistant of {OWNER_NAME}!\n\n{ok} \n you can contect me this bot i will reply your message ASAP"
            f"\nmaster >>> ",url="https://t.me/",.username
        )
コード例 #25
0
async def episode(event):
 tata = event.pattern_match.group(1)
 data = tata.decode()
 input = data.split("_", 1)[1]
 imd, episode = input.split("?", 1)
 animeid = episode.strip()
 epsd = imd.strip()
 result = anime.get_episodes_link(animeid, epsd)
 text = "You are watching Episode {} of {}:\n\nNote: Select HDP link for faster streaming.".format(epsd, animeid)
 butons = []
 cbutton = []
 for i in result:
  if not i == "title":
   k = Button.url(f"{i}", f"{result[i]}")
   butons.append(k)
   if len(butons) == 1:
    cbutton.append(butons)
    butons = []
 await event.edit(text, buttons=cbutton)
コード例 #26
0
async def callback_query_handler(event):
    # inline by LEGENDX and PROBOY22 🔥
    PROBOYX = [[
        Button.url("REPO-LEGENDX", "https://github.com/LEGENDX/LEGENDXX")
    ]]
    PROBOYX += [[Button.url("DEPLOY-LEGENDX", )]]
    PROBOYX += [[
        Button.url("TUTORIAL", ""),
        Button.url("STRING-SESSION",
                   "https://repl.it/@LEGENDX22/LEGEND-Bot#main.py")
    ]]
    PROBOYX += [[
        Button.url("API_ID & HASH", "https://t.me/usetgxbot"),
        Button.url("REDIS", "https://redislabs.com")
    ]]
    PROBOYX += [[
        Button.url("SUPPORT CHANNEL", "https://t.me/LEGENDXCHAT"),
        Button.url("SUPPORT GROUP", "https://t.me/LEGENDXCHAT")
    ]]
    PROBOYX += [[custom.Button.inline("ALIVE", data="PROBOY")]]
    await event.edit(text=f"𝙰𝙻𝙻 𝙳𝙴𝚃𝙰𝙸𝙻𝚂 𝙾𝙵 𝚁𝙴𝙿𝙾𝚂", buttons=PROBOYX)
コード例 #27
0
async def start(event):

    if not event.is_group:
        await tbot.send_message(
            event.chat_id,
            pm_caption,
            buttons=[
                [
                    Button.inline("Advanced", data="soon"),
                    Button.inline("Commands", data="help_menu"),
                ],
                [
                    Button.url("Add Me To Your Group!",
                               "t.me/missevie_robot?startgroup=true"),
                ],
            ],
        )
    else:
        await event.reply("Heya Luna Here!,\nHow Can I Help Ya.")
コード例 #28
0
ファイル: dictionary.py プロジェクト: Vethya/HelperBot
async def urbandictionary(e):
    defamount = int(e.pattern_match.group(1) or 1) - 1
    query = e.pattern_match.group(2)
    aw = await e.reply('Searching...')

    url = f'https://api.urbandictionary.com/v0/define?term={urlencode(query)}'
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as raw_resp:
            resp = await raw_resp.text()
            rcode = raw_resp.status
    if rcode != 200:
        await aw.edit('Word not found!')
        return
    definitions = json.loads(resp)['list']
    try:
        definition = definitions[defamount]
    except IndexError:
        await aw.edit('Not enough definitions')
        return

    author = definition["author"]
    text = f"<b>{html.escape(definition['word'])}</b> by <a href='http://www.urbandictionary.com/author.php?author={urlencode(author)}'>{author}</a>\n\n"
    meaning = definition['definition']
    text += f'<b>Definition:</b>\n{meaning}\n'
    text += f'<b>Examples:</b>\n{html.escape(definition["example"])}\n\n'
    text += f'👍 {definition["thumbs_up"]} 👎 {definition["thumbs_down"]}'
    await aw.delete()
    r = await e.client.send_message(
        e.chat_id,
        text,
        reply_to=e.id,
        buttons=[[
            Button.inline('Back', data='ud_back'),
            Button.inline(f'{defamount+1}/{len(definitions)}', data='ud_page'),
            Button.inline('Next', data='ud_next')
        ],
                 [
                     Button.url('Link to defintion',
                                url=html.escape(definition['permalink']))
                 ]],
        link_preview=False)
    data[(r.chat_id, r.id)] = definitions, defamount, e.sender_id
コード例 #29
0
async def start(event):
    starkbot = await tgbot.get_me()
    bot_id = starkbot.first_name
    bot_username = starkbot.username
    replied_user = await event.client(GetFullUserRequest(event.sender_id))
    firstname = replied_user.user.first_name
    devlop = await bot.get_me()
    hmmwow = devlop.first_name
    vent = event.chat_id
    mypic = Config.ASSISTANT_START_PIC
    starttext = f"Hello, {firstname} ! Nice To Meet You, Well I Am {bot_id}, An Powerfull Assistant Bot. \n\nMy Master [{hmmwow}](tg://user?id={bot.uid}) \nYou Can Talk/Contact My Master Using This Bot. \n\nIf You Want Your Own Assistant You Can Deploy From Button Below. \n\nPowered By [Friday Userbot](t.me/FridayOT)"
    if event.sender_id == bot.uid:
        await tgbot.send_message(
            vent,
            message=f"Hi Master, It's Me {bot_id}, Your Assistant ! \nWhat You Wanna Do today ?",
            buttons=[
                [custom.Button.inline("Show Users 🔥", data="users")],
                [custom.Button.inline("Commands For Assistant", data="gibcmd")],
                [
                    Button.url(
                        "Add Me to Group 👥", f"t.me/{bot_username}?startgroup=true"
                    )
                ],
            ],
        )
    else:
        if already_added(event.sender_id):
            pass
        elif not already_added(event.sender_id):
            add_usersid_in_db(event.sender_id)
        await tgbot.send_file(
            event.chat_id,
            file=mypic,
            caption=starttext,
            link_preview=False,
           # buttons=[
            #    [custom.Button.inline("Deploy your Friday 🇮🇳", data="deploy")],
             #   [Button.url("Help Me ❓", "t.me/Fridayot")],
            #],
        )
        if os.path.exists(mypic):
            os.remove(mypic)
コード例 #30
0
async def help(event):
    approved_userss = approved_users.find({})
    for ch in approved_userss:
        iid = ch["id"]
        userss = ch["user"]
    if event.is_group:
        if await is_register_admin(event.input_chat, event.message.sender_id):
            pass
        elif event.chat_id == iid and event.sender_id == userss:
            pass
        else:
            return
    if not event.is_group:
        buttons = paginate_help(event, 0, CMD_LIST, "helpme")
        await event.reply(PM_START_TEXT, buttons=buttons)
    else:
        await event.reply(
            "Contact me in PM to get the help menu",
            buttons=[[Button.url("Help ❓", "t.me/MissJuliaRobot?start=help")]],
        )