Skip to content

Instantly share code, notes, and snippets.

@EricPanDev
Last active January 16, 2026 20:22
Show Gist options
  • Select an option

  • Save EricPanDev/25d26c13f09a96cb0ec47d4d716eb5b0 to your computer and use it in GitHub Desktop.

Select an option

Save EricPanDev/25d26c13f09a96cb0ec47d4d716eb5b0 to your computer and use it in GitHub Desktop.
Set a discord bot's token via discord's api - guild only.
bot_token = ""
guildid = ""
data = {"pronouns": "pronoun goes here"}
import requests
headers = {"authorization": "Bot " + bot_token, "content-type": "application/json",}
if requests.patch("https://canary.discord.com/api/v9/guilds/" + str(guildid) + "/members/@me", headers=headers, json=data).status_code == 200: print("Bot's Guild Pronouns Changed!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment