update webhooks.py for new keys.json structure
@@ -10,7 +10,9 @@ import arrow
class Webhooks(commands.Cog):
def __init__(self, bot):
self.bot = bot
+
self.d = self.bot.d
+ self.k = self.bot.k
self.db = self.bot.get_cog('Database')
@@ -31,7 +33,7 @@ class Webhooks(commands.Cog):
try:
await self.ses.post(
f'https://top.gg/api/bots/{self.bot.user.id}/stats',
- headers={'Authorization': self.d.topgg_post_auth},
+ headers={'Authorization': self.k.topgg_api},
json={'server_count': str(len(self.bot.guilds))}
)
except Exception as e:
@@ -41,7 +43,7 @@ class Webhooks(commands.Cog):
async def webhooks_setup(self): # holy fucking shit that's hot
async def handler(req):
- if req.headers.get('Authorization') == self.d.topgg_hooks_auth:
+ if req.headers.get('Authorization') == self.k.topgg_webhook:
self.bot.dispatch('topgg_event', cj.classify(await req.json()))
else:
return web.Response(status=401)
