Skip to content

Commit

Permalink
Update to Discord API v10
Browse files Browse the repository at this point in the history
There should be no change for us in the rest of the code.  Note that a
`sleep(1)` was added to avoid hitting the rate limiter when rerunning
`register_application_commands.py`.
  • Loading branch information
elliotgoodrich committed Feb 21, 2024
1 parent 6cfa327 commit d765687
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@

import requests
import json
import time

f = open("../config.json")

config = json.load(f)
url = f'https://discord.com/api/v8/applications/{config["application_id"]["value"]}/commands'
url = f'https://discord.com/api/v10/applications/{config["application_id"]["value"]}/commands'

commands = [
{
Expand Down Expand Up @@ -95,3 +96,4 @@
for command in commands:
r = requests.post(url, headers=headers, json=command)
print(r.json())
time.sleep(1)

0 comments on commit d765687

Please sign in to comment.