dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
648 stars 153 forks source link

Discord status is reset #651

Closed TheRealRedSlime closed 5 months ago

TheRealRedSlime commented 5 months ago

Summary

Discord status is reset when the session is resumed by the gateway

Reproduction Steps

I put a status to my discord selfbot with this :

headers = {
    "Authorization": token,
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36",
    "Content-Type": "application/json",
    "Accept": "*/*"
}
jsonData = {
    "status": random.choice(["dnd", "idle", "online"]),
    "custom_status": {
        "text": "please join this server → .gg/-------"
    }
}
r = requests.patch("https://discord.com/api/v9/users/@me/settings", headers=headers, json=jsonData)

When the session is resumed by the gateway, the custom status disappears.

System Information

I am in python 3.11 discord.py-self is in 2.0.0 version

Checklist

dolfies commented 5 months ago

Don't send requests to the API manually and expect the library to know what you did...

dolfies commented 4 months ago

Either way this should be fixed now in most cases. To reiterate though, don't send manual requests :)