Skip to content

Instantly share code, notes, and snippets.

Last active June 27, 2020 13:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import discord, aiohttp, json
from discord.ext import tasks, commands
class DEL(commands.Cog):
def __init__(self, bot): = bot
def cog_unload(self):
async def del_update_stats(self):
""" This automatically updates your server count to Discord Extreme List every 30 minutes. """
async with aiohttp.ClientSession() as session:
async with'{}/stats',
headers={'Authorization': 'TOKEN', # Make sure you put your API Token Here
"Content-Type": 'application/json'},
data=json.dumps({'guildCount': len(
,'shardCount': len( # Remove this line if you don't have shards on your bot
})) as r:
js = await r.json()
if js['error'] == True:
print(f'Failed to post to\n{js}')
def setup(bot):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment