mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-07-03 03:35:24 +02:00
Add posting status for discordbots.org
This commit is contained in:
12
discordbot/titanembeds/poststats.py
Normal file
12
discordbot/titanembeds/poststats.py
Normal file
@ -0,0 +1,12 @@
|
||||
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
|
||||
|
||||
async def post(self, count):
|
||||
headers = {"Authorization": self.token}
|
||||
payload = {"server_count": count}
|
||||
async with aiohttp.ClientSession() as aioclient:
|
||||
await aioclient.post(self.url, data=payload, headers=headers)
|
Reference in New Issue
Block a user