use webhook secret
@@ -37,6 +37,7 @@ class Events(commands.Cog):
async def vote_handler(r):
print(r.headers.get("X-DBL-Signature"))
+ if self.webhook_secret == r.headers.get("X-DBL-Signature")
user_id = (await r.json())["id"]
self.logger.info(f"\u001b[32;1m {user_id} VOTED ON DBL2 \u001b[0m")
user = self.bot.get_user(user_id)
@@ -54,6 +55,8 @@ class Events(commands.Cog):
await user.send(choice(messages).format(8))
return web.Response() # retursn 200 ok
+ else:
+ return web.Response(status=401) # if auth is invalid
web_app = web.Application(loop=self.bot.loop)
