2018-01-05 10:21:25 +01:00
|
|
|
import aiohttp
|
|
|
|
|
|
|
|
class DiscordBotsOrg(): # https://discordbots.org
|
|
|
|
def __init__(self, client_id, token):
|
|
|
|
self.url = "https://discordbots.org/api/bots/{}/stats".format(client_id)
|
|
|
|
self.token = token
|
|
|
|
|
2018-03-22 23:55:09 +01:00
|
|
|
async def post(self, count, shard_count, shard_id):
|
2018-01-05 10:21:25 +01:00
|
|
|
headers = {"Authorization": self.token}
|
2020-03-23 03:20:45 +01:00
|
|
|
payload = {"server_count": count, "shard_count": shard_count, "shard_id": shard_id}
|
2018-01-05 10:21:25 +01:00
|
|
|
async with aiohttp.ClientSession() as aioclient:
|
2018-08-12 01:25:06 +02:00
|
|
|
await aioclient.post(self.url, json=payload, headers=headers)
|
2018-01-06 10:59:04 +01:00
|
|
|
|
|
|
|
class BotsDiscordPw(): # https://bots.discord.pw/
|
|
|
|
def __init__(self, client_id, token):
|
|
|
|
self.url = "https://bots.discord.pw/api/bots/{}/stats".format(client_id)
|
|
|
|
self.token = token
|
|
|
|
|
2018-03-22 23:55:09 +01:00
|
|
|
async def post(self, count, shard_count, shard_id):
|
2018-01-06 10:59:04 +01:00
|
|
|
headers = {"Authorization": self.token}
|
2018-03-22 23:55:09 +01:00
|
|
|
payload = {"server_count": count, "shard_count": shard_count, "shard_id": shard_id}
|
2018-01-06 10:59:04 +01:00
|
|
|
async with aiohttp.ClientSession() as aioclient:
|
2020-03-23 03:20:45 +01:00
|
|
|
await aioclient.post(self.url, json=payload, headers=headers)
|