-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
349b36a
commit 85a6467
Showing
1 changed file
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,57 @@ | ||
from pyrogram import Client, filters | ||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message | ||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message, WebAppInfo | ||
|
||
from config import OWNER_ID | ||
from config import SUPPORT_CHAT | ||
from config import OWNER_ID, SUPPORT_CHAT | ||
|
||
@Client.on_message(filters.command("start") & filters.private & filters.incoming) | ||
async def start(client, message: Message): | ||
me2 = (await client.get_me()).mention | ||
buttons = [ | ||
[ | ||
InlineKeyboardButton("Pyrogram", callback_data="pyrogram"), | ||
InlineKeyboardButton("Telethon", callback_data="telethon") | ||
], | ||
[ | ||
InlineKeyboardButton("📂 Support Chat 📂", url=SUPPORT_CHAT), | ||
InlineKeyboardButton("💫 Updates 💫", url="https://t.me/HEROKUBIN_01") | ||
], | ||
[ | ||
InlineKeyboardButton("📌 Source 📌", url="https://github.com/Badhacker98/StringBot/fork"), | ||
InlineKeyboardButton("🎵 Music Bot 🎶", url="https://t.me/Gaana_MusicBot") | ||
] | ||
] | ||
|
||
def filter(cmd: str): | ||
return filters.private & filters.incoming & filters.command(cmd) | ||
|
||
@Client.on_message(filter("start")) | ||
async def start(bot: Client, msg: Message): | ||
me2 = (await bot.get_me()).mention | ||
await bot.send_photo( | ||
chat_id=msg.chat.id, | ||
await client.send_photo( | ||
chat_id=message.chat.id, | ||
photo="https://files.catbox.moe/td0sdf.jpg", | ||
caption=f"""❍ ʜᴇʏ {msg.from_user.mention} ✤, | ||
❍ ɪ ᴀᴍ{me2}, | ||
caption=f"""❍ ʜᴇʏ {message.from_user.mention} ✤, | ||
❍ ɪ ᴀᴍ {me2}, | ||
❍ Aɴ ᴏᴘᴇɴ sᴏᴜʀᴄᴇ sᴛʀɪɴɢ sᴇssɪᴏɴ ɢᴇɴᴇʀᴀᴛᴏʀ ʙᴏᴛ, ᴡʀɪᴛᴛᴇɴ ɪɴ ᴩʏᴛʜᴏɴ ᴡɪᴛʜ ᴛʜᴇ ʜᴇʟᴩ ᴏғ ᴩʏʀᴏɢʀᴀᴍ. | ||
❍ ᴘʟᴇᴀꜱᴇ ᴄʜᴏᴏꜱᴇ ᴛʜᴇ ᴘʏᴛʜᴏɴ ʟɪʙʀᴀʀʏ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ɢᴇɴᴇʀᴀᴛᴇ ꜱᴛʀɪɴɢ ꜱᴇꜱꜱɪᴏɴ ꜰᴏʀ. | ||
❍ ɪғ ʏᴏᴜ ɴᴇᴇᴅ ᴀɴʏ ʜᴇʟᴘ, ᴛʜᴇɴ ᴅᴍ ᴛᴏ ᴍʏ ᴏᴡɴᴇʀ: [ʙᴀᴅ ᴹᵁᴺᴰᴬ](tg://user?id={OWNER_ID}) !""", | ||
reply_markup=InlineKeyboardMarkup( | ||
[ | ||
[ | ||
InlineKeyboardButton(text="💢 ɢᴇɴᴇʀᴀᴛᴇ sᴇssɪᴏɴ 💢", callback_data="generate") | ||
], | ||
[ | ||
InlineKeyboardButton("📂 sᴜᴘᴘᴏʀᴛ ᴄʜᴀᴛ 📂", url=SUPPORT_CHAT), | ||
InlineKeyboardButton("💫 ᴜᴘᴅᴀᴛᴇs 💫", url="https://t.me/HEROKUBIN_01") | ||
], | ||
[ | ||
InlineKeyboardButton("📌sᴏᴜʀᴄᴇ 📌", url="https://github.com/Badhacker98/StringBot/fork"), | ||
InlineKeyboardButton("🎵 ᴍᴜsɪᴄ ʙᴏᴛ 🎶", url="https://t.me/ShizuuMusicBot") | ||
] | ||
] | ||
) | ||
❍ ᴘʟᴇᴀꜱᴇ ᴄʜᴏᴏꜱᴇ ᴛʜᴇ ᴘʏᴛʜᴏɴ ʟɪʙʀᴀʀʏ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ɢᴇɴᴇʀᴀᴛᴇ ꜱᴛʀɪɴɢ ꜱᴇssɪᴏɴ ꜰᴏʀ. | ||
❍ ɪғ ʏᴏᴜ ɴᴇᴇᴅ ᴀɴʏ ʜᴇʟᴘ, ᴛʜᴇɴ ᴅᴍ ᴛᴏ ᴍʏ ᴏᴡɴᴇʀ: [ʙᴀᴅ ᴹᵁᴺᴰᴬ](tg://user?id={OWNER_ID})!""", | ||
reply_markup=InlineKeyboardMarkup(buttons) | ||
) | ||
|
||
@Client.on_callback_query(filters.regex("pyrogram|telethon")) | ||
async def handle_callback_query(client, callback_query): | ||
if callback_query.data == "pyrogram": | ||
text = "You selected Pyrogram. Click below to generate your string session." | ||
elif callback_query.data == "telethon": | ||
text = "You selected Telethon. Click below to generate your string session." | ||
|
||
buttons = [ | ||
[ | ||
InlineKeyboardButton( | ||
"String Session Generate", | ||
web_app=WebAppInfo(url="https://telegram.tools/session-string-generator#pyrogram,user") | ||
) | ||
] | ||
] | ||
|
||
await callback_query.message.edit_text( | ||
text=text, | ||
reply_markup=InlineKeyboardMarkup(buttons) | ||
) |