warmifans commited on
Commit
d7390da
Β·
verified Β·
1 Parent(s): eeb1ce6

Delete demoo.py

Browse files
Files changed (1) hide show
  1. demoo.py +0 -133
demoo.py DELETED
@@ -1,133 +0,0 @@
1
- from pyrogram import Client, filters
2
- from pyrogram.types import (
3
- InlineKeyboardMarkup,
4
- InlineKeyboardButton,
5
- ReplyKeyboardMarkup,
6
- KeyboardButton
7
- )
8
-
9
- API_ID = 32346503
10
- API_HASH = "391c63b5936e4e717fc7fa19221651de"
11
- BOT_TOKEN = "8966602774:AAFDK_woLHYGpSPxKimun5WUlCwGwpTFFZM"
12
-
13
- app = Client("shakti_bot", api_id=API_ID, api_hash=API_HASH, bot_token=BOT_TOKEN)
14
-
15
- forward_button = ReplyKeyboardMarkup(
16
- [[KeyboardButton("πŸ“¨ Forward Message")]], resize_keyboard=True
17
- )
18
-
19
- @app.on_message(filters.command("start"))
20
- async def start(client, message):
21
- user_id = message.from_user.id
22
- text = f"""Hi Welcome To @User1nfo_bot πŸ‘‹
23
-
24
- πŸ“š Help : /help
25
- πŸ”” Channel : @iesrl
26
- Your ID : {user_id}"""
27
- buttons = InlineKeyboardMarkup([
28
- [InlineKeyboardButton(f"πŸ“‹ Copy {user_id}", callback_data=f"copy_{user_id}")],
29
- [InlineKeyboardButton("πŸš€ Share ID", switch_inline_query=str(user_id))]
30
- ])
31
- await message.reply_text(text, reply_markup=buttons)
32
- await message.reply_text("Tap below button to forward any message:", reply_markup=forward_button)
33
-
34
- @app.on_message(filters.command("help"))
35
- async def help_cmd(client, message):
36
- await message.reply_text(
37
- """πŸ“š HOW TO USE
38
-
39
- 1️⃣ Tap "Forward Message" button
40
- 2️⃣ Forward any message from any user/chat
41
- 3️⃣ Bot will show original sender's ID
42
-
43
- πŸ”Έ Channel : @iesrl
44
- πŸ”Έ Developer : @dmForbans"""
45
- )
46
-
47
- @app.on_message(filters.command("info") & filters.group)
48
- async def info_cmd(client, message):
49
- # Case 1: with username
50
- if len(message.text.split()) > 1:
51
- username = message.text.split(" ", 1)[1]
52
- if username.startswith("@"):
53
- username = username[1:]
54
- try:
55
- user = await client.get_users(username)
56
- user_link = f"https://t.me/{user.username}" if user.username else f"tg://user?id={user.id}"
57
- text = f"""πŸ‘€ User Info
58
-
59
- ID: {user.id}
60
- First Name: {user.first_name or '.'}
61
- Last Name: {user.last_name or ''}
62
- Username: @{user.username or 'None'}
63
- πŸ”— User Link: [link]({user_link})"""
64
- await message.reply_text(text, disable_web_page_preview=False) # No parse_mode
65
- return
66
- except Exception as e:
67
- await message.reply_text(f"❌ User not found. Error: {str(e)}")
68
- return
69
-
70
- # Case 2: own info
71
- user = message.from_user
72
- user_link = f"https://t.me/{user.username}" if user.username else f"tg://user?id={user.id}"
73
- text = f"""πŸ‘€ π™π™¨π™šπ™§ 𝙄𝙣𝙛𝙀
74
-
75
- π™„π˜Ώ: {user.id}
76
- π™π™žπ™§π™¨π™© π™‰π™–π™’π™š: {user.first_name or '.'}
77
- 𝙇𝙖𝙨𝙩 π™‰π™–π™’π™š: {user.last_name or ''}
78
- π™π™¨π™šπ™§π™£π™–π™’π™š: @{user.username or 'None'}
79
- πŸ”— User Link: [link]({user_link})"""
80
- await message.reply_text(text, disable_web_page_preview=False)
81
-
82
- # Forward handling (same as before)
83
- @app.on_message(filters.text & filters.regex("πŸ“¨ Forward Message"))
84
- async def forward_instruction(client, message):
85
- await message.reply_text(
86
- "πŸ”„ Now forward any message to me\n\n"
87
- "Go to any chat β†’ Press & hold a message β†’ Forward β†’ Select me"
88
- )
89
-
90
- @app.on_message(filters.forwarded)
91
- async def get_user_id(client, message):
92
- try:
93
- if message.forward_from:
94
- user = message.forward_from
95
- text = f"""πŸ”Έ Forward detected!
96
-
97
- User
98
- π™„π˜Ώ: {user.id}
99
- π™‰π™–π™’π™š: {user.first_name or '.'} {user.last_name or ''}
100
- π™π™¨π™šπ™§π™£π™–π™’π™š: @{user.username if user.username else 'None'}"""
101
- buttons = InlineKeyboardMarkup([
102
- [InlineKeyboardButton(f"πŸ“‹ Copy {user.id}", callback_data=f"copy_{user.id}")],
103
- [InlineKeyboardButton("πŸš€ Share ID", switch_inline_query=str(user.id))]
104
- ])
105
- await message.reply_text(text, reply_markup=buttons)
106
- elif message.forward_from_chat:
107
- chat = message.forward_from_chat
108
- text = f"""πŸ”Έ Forward detected!
109
-
110
- πŸ“’ Chat/Channel
111
- πŸ†” ID: {chat.id}
112
- πŸ“ Title: {chat.title}
113
- πŸ”— Username: @{chat.username if chat.username else 'None'}"""
114
- buttons = InlineKeyboardMarkup([
115
- [InlineKeyboardButton(f"πŸ“‹ Copy {chat.id}", callback_data=f"copy_{chat.id}")],
116
- [InlineKeyboardButton("πŸš€ Share ID", switch_inline_query=str(chat.id))]
117
- ])
118
- await message.reply_text(text, reply_markup=buttons)
119
- except Exception as e:
120
- await message.reply_text(f"❌ Error: {str(e)}")
121
-
122
- @app.on_callback_query()
123
- async def handle_callback(client, callback_query):
124
- if callback_query.data.startswith("copy_"):
125
- user_id = callback_query.data.replace("copy_", "")
126
- await callback_query.answer(f"Copied: {user_id}", show_alert=True)
127
- await callback_query.message.edit_text(
128
- callback_query.message.text + f"\n\nβœ… Copied: {user_id}"
129
- )
130
-
131
- if __name__ == "__main__":
132
- print("βœ… Bot Started Successfully!")
133
- app.run()