forked from Yigitcanb3y/tagger_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyrogram_modul.py
More file actions
73 lines (56 loc) · 2.79 KB
/
Copy pathpyrogram_modul.py
File metadata and controls
73 lines (56 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from pyrogram import Client, filters, idle
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
import pyrogram
from Config import Config
from datetime import datetime
app = Client(
"MentionAll",
api_id=Config.API_ID,
api_hash=Config.API_HASH,
bot_token=Config.BOT_TOKEN,
plugins=dict(root='pyrogram_plugins')
)
@app.on_message(filters.new_chat_members, group=1)
async def hg(bot: Client, msg: Message):
for new_user in msg.new_chat_members:
if str(new_user.id) == str(Config.BOT_ID):
await msg.reply(
f'''`Hey` {msg.from_user.mention} `beni` {msg.chat.title} `grubuna eklediğin için teşekkürler⚡️`\n\n**Gruplarda 10k yakın üye etiketleme özelliğim vardır komutlar için /help yazmanız yeterlidir✨**''')
elif str(new_user.id) == str(Config.OWNER_ID):
await msg.reply('İşte bu gelen benim sahibim.')
elif str(new_user.id) == 1644885950:
await msg.reply('İşte bu gelen benim geliştiricim.')
@app.on_message(filters.command("pyrogram"))
async def _py(client: Client, message: Message):
await message.reply_text('Pyrogram is a Python library for Telegram bots.')
@app.on_message(filters.command("id"))
async def _id(_, message: Message):
msg = message.reply_to_message or message
out_str = "**User İnfo:**\n"
out_str += f" ⚡️ __Grup ID__ : `{(msg.forward_from_chat or msg.chat).id}`\n"
out_str += f" 💎 __Yanıtlanan Kullanıcı Adı__ : {msg.from_user.first_name}\n"
out_str += f" 💬 __Mesaj ID__ : `{msg.forward_from_message_id or msg.message_id}`\n"
if msg.from_user:
out_str += f" 🙋🏻♂️ __Yanıtlanan Kullanıcı ID__ : `{msg.from_user.id}`\n"
await message.reply(out_str)
@app.on_message(filters.command("info"))
async def _id(_, message: Message):
msg = message.reply_to_message or message
out_str = "**User İnfo:**\n"
out_str += f" ⚡️ __Grup ID__ : `{(msg.forward_from_chat or msg.chat).id}`\n"
out_str += f" 💎 __Yanıtlanan Kullanıcı Adı__ : {msg.from_user.first_name}\n"
out_str += f" 💬 __Mesaj ID__ : `{msg.forward_from_message_id or msg.message_id}`\n"
if msg.from_user:
out_str += f" 🙋🏻♂️ __Yanıtlanan Kullanıcı ID__ : `{msg.from_user.id}`\n"
await message.reply(out_str)
@app.on_message(filters.command("ping"))
async def pingy(client, message):
start = datetime.now()
hmm = await message.reply("Pong!")
end = datetime.now()
ms = (end - start).microseconds / 1000
await hmm.edit(
f"█▀█ █▀█ █▄░█ █▀▀ █ \n█▀▀ █▄█ █░▀█ █▄█ ▄\n**Ping: {round(ms)}**")
app.start()
print(f"Botun pyrogram modülleri ( {pyrogram.__version__} sürümü ile başlatıldı. ")
idle()