-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecker.py
54 lines (41 loc) · 2.94 KB
/
checker.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
import discord
import asyncio
import aiohttp
import pystyle
from pystyle import Colors, Colorate
intents = discord.Intents.all()
print(Colorate.Horizontal(Colors.purple_to_blue, """
██████╗ ██████╗ ████████╗ ██████╗██╗ ██╗███████╗ ██████╗██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗╚══██╔══╝ ██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██████╔╝██║ ██║ ██║ ██║ ███████║█████╗ ██║ █████╔╝ █████╗ ██████╔╝
██╔══██╗██║ ██║ ██║ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ██╔══╝ ██╔══██╗
██████╔╝╚██████╔╝ ██║ ╚██████╗██║ ██║███████╗╚██████╗██║ ██╗███████╗██║ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
"""))
async def check_tokens(tokens):
valid_tokens = []
invalid_tokens = []
async with aiohttp.ClientSession() as session:
for token in tokens:
client = discord.Client(intents=intents)
try:
await asyncio.shield(client.login(token))
print(Colorate.Horizontal(Colors.purple_to_blue, f"Valid Token: {token}"))
valid_tokens.append(token)
except discord.errors.LoginFailure:
print(Colorate.Horizontal(Colors.purple_to_blue, f"Invalid Token : {token}"))
invalid_tokens.append(token)
await asyncio.sleep(0)
return valid_tokens, invalid_tokens
tokens_file = "tokens.txt" # Your tokens file
with open(tokens_file, "r") as file:
tokens = [line.strip() for line in file.readlines()]
valid_tokens, invalid_tokens = asyncio.run(check_tokens(tokens))
delete_invalid_tokens = input(Colorate.Horizontal(Colors.purple_to_blue,
"Wanna delete invalids tokens ? (yes/no): ").lower())
if delete_invalid_tokens == "yes":
with open(tokens_file, "w") as file:
file.write("\n".join(valid_tokens))
print(Colorate.Horizontal(Colors.purple_to_blue, "Invalids tokens deleted."))
else:
print(Colorate.Horizontal(Colors.purple_to_blue, "No changes."))