forked from VJBots/VJ-Token-Verification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.py
49 lines (43 loc) · 1.89 KB
/
commands.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from utils import verify_user, check_token
#@Client.on_message..........
#async def start(...........
data = message.command[1]
if data.split("-", 1)[0] == "verify": # set if or elif it depend on your code
userid = data.split("-", 2)[1]
token = data.split("-", 3)[2]
if str(message.from_user.id) != str(userid):
return await message.reply_text(
text="<b>Invalid link or Expired link !</b>",
protect_content=True
)
is_valid = await check_token(client, userid, token)
if is_valid == True:
await message.reply_text(
text=f"<b>Hey {message.from_user.mention}, You are successfully verified !\nNow you have unlimited access for all files till today midnight.</b>",
protect_content=True
)
await verify_user(client, userid, token)
else:
return await message.reply_text(
text="<b>Invalid link or Expired link !</b>",
protect_content=True
)
# new code from here :-
# where you want to add your verification
# this is the code where user get shortlink and verification message
from utils import check_verification, get_token
from info import VERIFY, VERIFY_TUTORIAL, BOT_USERNAME
#@Client.on_message..........
#async def...........
if not await check_verification(client, message.from_user.id) and VERIFY == True:
btn = [[
InlineKeyboardButton("Verify", url=await get_token(client, message.from_user.id, f"https://telegram.me/{BOT_USERNAME}?start="))
],[
InlineKeyboardButton("How To Open Link & Verify", url=VERIFY_TUTORIAL)
]]
await message.reply_text(
text="<b>You are not verified !\nKindly verify to continue !</b>",
protect_content=True,
reply_markup=InlineKeyboardMarkup(btn)
)
return