-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot.py
26 lines (20 loc) · 875 Bytes
/
bot.py
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
from pyrogram import Client
from pyrogram import filters
from pyrogram.types import Message
invite_logger =
esanaChat =
esanaChannel =
session=
api_id =
api_hash =
app = Client(session,api_id,api_hash)
@app.on_message(filters.command('invite') & filters.chat(esanaChat))
def my_handler(client, message):
r=app.search_messages(invite_logger, query='('+str(message.from_user.id), limit=5)
if len(r)==0:
link = app.create_chat_invite_link(esanaChannel)
m=message.reply("User: {0} ( {2} )\nYour invite link : {1}\n\nShare as you can to get free netflix.".format(message.from_user.mention(message.from_user.first_name) ,link.invite_link ,message.from_user.id) , disable_web_page_preview = True)
m.forward(invite_logger)
else:
message.reply(r[-1]['text'], disable_web_page_preview = True)
app.run()