Skip to content

Commit

Permalink
The message is actually already just json
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Feb 28, 2024
1 parent 3ffaf92 commit 2487280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tbot/twitch_bot/modlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ async def parse_message(self, message):
elif message['type'] == 'RECONNECT':
await self.ws.close()
elif message['type'] == 'MESSAGE':
m = json.loads(message['data']['message'])
if message['data']['topic'].startswith('chat_moderator_actions'):
m = json.loads(message['data']['message'])
await self.log_mod_action(message['data']['topic'], m['data'])
elif message['data']['topic'].startswith('channel-subscribe-events-v1'):
await self.log_sub(m['message'])
await self.log_sub(message['data']['message'])

async def log_mod_action(self, topic, data):
if 'moderation_action' not in data:
Expand Down

0 comments on commit 2487280

Please sign in to comment.