Update bot.py

This commit is contained in:
Jeremy "EndenDragon" Zhang 2021-03-12 15:21:03 -08:00 committed by GitHub
parent 2f8b5fd820
commit 3e251a2bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ import json
# raven_client = RavenClient(config["sentry-dsn"])
# except raven.exceptions.InvalidDsn:
# pass
import traceback
intents = discord.Intents.default()
intents.members = True
@ -84,6 +85,15 @@ class Titan(discord.AutoShardedClient):
self.botsDiscordPw = BotsDiscordPw(self.user.id, config.get("bots-discord-pw-token", None))
self.loop.create_task(self.auto_post_stats())
async def on_socket_raw_send(self, data):
data = str(data)
try:
data = json.loads(data)
except:
return
logging.info('DEBUG LOG {}'.format(data.get("op", -1)))
logging.info('{}'.format(str(list(traceback.format_stack()))))
async def on_message(self, message):
await self.socketio.on_message(message)
await self.redisqueue.push_message(message)