mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-11-21 14:34:36 +00:00
Update Discord Bots API endpoint
This commit is contained in:
parent
d658672006
commit
32ace2f19e
1 changed files with 3 additions and 3 deletions
|
@ -57,8 +57,8 @@ class WorldTime(discord.Client):
|
||||||
logPrint("Report", "Currently in {0} guild(s).".format(guildcount))
|
logPrint("Report", "Currently in {0} guild(s).".format(guildcount))
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
if authtoken != '':
|
if authtoken != '':
|
||||||
rurl = "https://bots.discord.pw/api/bots/{}/stats".format(self.user.id)
|
rurl = "https://discord.bots.gg/api/v1/bots/{}/stats".format(self.user.id)
|
||||||
rdata = { "server_count": guildcount }
|
rdata = { "guildCount": guildcount }
|
||||||
rhead = { "Content-Type": "application/json", "Authorization": authtoken }
|
rhead = { "Content-Type": "application/json", "Authorization": authtoken }
|
||||||
try:
|
try:
|
||||||
await session.post(rurl, json=rdata, headers=rhead)
|
await session.post(rurl, json=rdata, headers=rhead)
|
||||||
|
@ -67,4 +67,4 @@ class WorldTime(discord.Client):
|
||||||
logPrint("Report", "Discord Bots API report failed: {}".format(e))
|
logPrint("Report", "Discord Bots API report failed: {}".format(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logPrint("Report", "Unknown error on Discord Bots API report.")
|
logPrint("Report", "Unknown error on Discord Bots API report.")
|
||||||
await asyncio.sleep(21600) # Repeat once every six hours
|
await asyncio.sleep(21600) # Repeat once every six hours
|
||||||
|
|
Loading…
Reference in a new issue