-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
86 lines (70 loc) · 2.6 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import random
import string
import asyncio
from pyrogram import Client, compose, filters
from pyrogram import raw
from pyrogram.errors import FloodWait
import datetime
# pip install git+https://github.com/AFN4NX/pyrogram.git@dev --force-reinstall
# Original Pyrogram Repo Will Not Work.
# Make Sure You Install Pyrogram from Upper Repo and Ohter Packages if Not Installed
def timechk():
current_time = datetime.datetime.now()
time_str = current_time.strftime("%I:%M:%S %p")
date_str = current_time.strftime("%d %B")
timee = f"{time_str} - {date_str}"
return timee
def generate_random_string(length):
characters = string.ascii_letters + string.digits
random_string = "".join(random.choice(characters) for _ in range(length))
return random_string
async def main():
# Get Your API ID and HASH from > https://my.telegram.org
# Your Account Might Ban. So Use Temp Account. I am Not Responsible for Anything.
user = Client(
"OnlineBackSoon", api_id="11111111", api_hash="aaaaaaaaaaaaaaaaaaaa"
)
bot = Client(
"SCUXU",
api_id="111111",
api_hash="aaaaaaaaaaaa",
bot_token="0000000000:xxxxxxxxxxxxxx",
)
# Replace WIth Your Own API ID , Hash and Bot TOken
clients = [user, bot]
# ================================================================================
@bot.on_message(
filters.command("xstart", [".", "/"]) & filters.user(1739206386)
) # Change With Your Own UserID
async def xstart(client, message):
k = await message.reply("`Please wait!`")
count = 0
while True:
try:
giftcode = generate_random_string(27)
count += 1
link = f"https://t.me/giftcode/{giftcode}"
result = await user.invoke(
raw.functions.payments.CheckGiftCode(slug=giftcode)
)
text = f"{link} {result}"
await message.reply(text)
except FloodWait as e:
print(f"FloodWait Encountered, Sleeping for {e.value} Seconds")
await asyncio.sleep(e.value)
except Exception as e:
print(e)
text = f"""Checking Telegram GiftCard
Number : {count}
Code : `{giftcode}`
Error : `{e}`
Last Checked : {timechk()}
"""
await k.edit(text)
await asyncio.sleep(59)
print("Ready to Check Telegram GiftCards ✅")
await compose(clients)
asyncio.run(main())
# This Bot Code Developed by https://t.me/SCUXU
# Use it or Modify it doesnt Matter.
# Dont Sell it and Dont Remove this Footer