|
from pyrogram import Client, filters |
|
from pyrogram.types import * |
|
|
|
@Client.on_callback_query(filters.regex(r"^track_(\d+)$")) |
|
async def track_request(client, callback_query): |
|
user_id = int(callback_query.matches[0].group(1)) |
|
|
|
if callback_query.from_user.id != user_id: |
|
await callback_query.answer("β This request isn't yours!", show_alert=True) |
|
return |
|
|
|
await callback_query.answer( |
|
"π Your request is in our development queue\n" |
|
"We'll notify you when it's implemented!", |
|
show_alert=True |
|
) |
|
|
|
@Client.on_message(filters.command("request") & filters.private) |
|
async def handle_request(client: Client, message: Message): |
|
request_text = " ".join(message.command[1:]) if len(message.command) > 1 else None |
|
|
|
if not request_text: |
|
await message.reply("Please specify your feature request after /request") |
|
return |
|
|
|
buttons = InlineKeyboardMarkup([ |
|
[InlineKeyboardButton("π’ View Channel", url="https://t.me/CodersUpdates")], |
|
[InlineKeyboardButton("β
Track Request", callback_data=f"track_{message.from_user.id}")] |
|
]) |
|
|
|
send = await client.send_message( |
|
chat_id="CodersUpdates", |
|
text=f"π **New Feature Request**\n\n" |
|
f"From: {message.from_user.mention}\n\n" |
|
f"**Request**:\n`{request_text}`", |
|
reply_markup=buttons |
|
) |
|
|
|
await message.reply( |
|
"β
Your feature request has been submitted!\n" |
|
"Check our channel for updates:", |
|
reply_markup=InlineKeyboardMarkup([ |
|
[InlineKeyboardButton("π View Message", url=f"https://t.me/c/1530454227/{send.id}")] |
|
]) |
|
) |