AutoShard Titan bot with dpy rewrite, Closes #71

This commit is contained in:
Jeremy Zhang
2018-03-22 22:55:09 +00:00
parent 9c2b0990a7
commit f7b3e4e65e
7 changed files with 178 additions and 150 deletions

View File

@ -5,9 +5,9 @@ class DiscordBotsOrg(): # https://discordbots.org
self.url = "https://discordbots.org/api/bots/{}/stats".format(client_id)
self.token = token
async def post(self, count):
async def post(self, count, shard_count, shard_id):
headers = {"Authorization": self.token}
payload = {"server_count": count}
payload = {"server_count": count, "shard_count": shard_count, "shard_no": shard_id}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(self.url, data=payload, headers=headers)
@ -16,8 +16,8 @@ class BotsDiscordPw(): # https://bots.discord.pw/
self.url = "https://bots.discord.pw/api/bots/{}/stats".format(client_id)
self.token = token
async def post(self, count):
async def post(self, count, shard_count, shard_id):
headers = {"Authorization": self.token}
payload = {"server_count": count}
payload = {"server_count": count, "shard_count": shard_count, "shard_id": shard_id}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(self.url, json=payload, headers=headers)