By using this code, you are automating your Discord Account. This is against Discord's Terms of Service and Community Guidelines. If not used properly, your account(s) might get suspended or terminated by Discord. I, the developer, is not responsible for any consequences that may arise from the use of this code. Use this software at your own risk and responsibility. Learn more about Discord's Terms of Service and Community Guidelines here.
DO NOT GIVE YOUR DISCORD TOKENS TO ANYONE.
TOKEN
as the key and your token as the value (Video)True
or False
), if you want to make any adjustmentsimport sys
import json
import time
import requests
import websocket
status = "online"
GUILD_ID = ADD_YOUR_SERVER_ID_HERE
CHANNEL_ID = ADD_YOUR_CHANNEL_ID_HERE
SELF_MUTE = True
SELF_DEAF = False
usertoken = "Add your token here"
headers = {"Authorization": usertoken, "Content-Type": "application/json"}
validate = requests.get('https://discordapp.com/api/v9/users/@me', headers=headers)
if validate.status_code != 200:
print("[ERROR] Your token might be invalid. Please check it again.")
sys.exit()
userinfo = requests.get('https://discordapp.com/api/v9/users/@me', headers=headers).json()
username = userinfo["username"]
discriminator = userinfo["discriminator"]
userid = userinfo["id"]
def joiner(token, status):
ws = websocket.WebSocket()
ws.connect('wss://gateway.discord.gg/?v=9&encoding=json')
start = json.loads(ws.recv())
heartbeat = start['d']['heartbeat_interval']
auth = {"op": 2,"d": {"token": token,"properties": {"$os": "Windows 10","$browser": "Google Chrome","$device": "Windows"},"presence": {"status": status,"afk": False}},"s": None,"t": None}
vc = {"op": 4,"d": {"guild_id": GUILD_ID,"channel_id": CHANNEL_ID,"self_mute": SELF_MUTE,"self_deaf": SELF_DEAF}}
ws.send(json.dumps(auth))
ws.send(json.dumps(vc))
time.sleep(heartbeat / 1000)
ws.send(json.dumps({"op": 1,"d": None}))
def run_joiner():
print(f"Logged in as {username}#{discriminator} ({userid}).")
while True:
joiner(usertoken, status)
time.sleep(30)
run_joiner()
True
or False
), if you want to make any adjustmentsrequirements.txt
file and copy paste the file contents inside requirements.txt without the Flask
modulepip install -r requirements.txt
python filename.py
If you have any issues or doubts regarding this, feel free to contact me.