Spaces:
Running
Running
Jishu Developer
commited on
Create user_id.py
Browse files- plugins/user_id.py +16 -0
plugins/user_id.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pyrogram import filters, enums
|
| 2 |
+
from pyrogram.types import Message
|
| 3 |
+
|
| 4 |
+
from bot import Bot
|
| 5 |
+
|
| 6 |
+
@Bot.on_message(filters.command("id") & filters.private)
|
| 7 |
+
async def showid(client, message):
|
| 8 |
+
chat_type = message.chat.type
|
| 9 |
+
|
| 10 |
+
if chat_type == enums.ChatType.PRIVATE:
|
| 11 |
+
user_id = message.chat.id
|
| 12 |
+
await message.reply_text(
|
| 13 |
+
f"<b>Your User ID Is :</b> <code>{user_id}</code>",
|
| 14 |
+
quote=True
|
| 15 |
+
)
|
| 16 |
+
|