Skip to content

Commit

Permalink
Display twitch request errors in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Oct 4, 2023
1 parent cc38861 commit 7de8ac6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tbot/twitch_bot/tasks/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from tbot import logger
from tbot.twitch_bot.bot_base import bot
from tbot.twitch_bot import var_filler
from tbot.utils.twitch import Twitch_request_error

cmds = []
_cmd_lookup = {}
Expand Down Expand Up @@ -94,8 +95,10 @@ async def db_command(cmd, target, data):
bot.send("PRIVMSG", target=target, message='@{}, {}'.format(data['display_name'], e))
except var_filler.Send_break:
pass
except:
logger.exception('db_command')
except Twitch_request_error as e:
bot.send("PRIVMSG", target=target, message=str(e))
except Exception as e:
logger.exception(str(e))

async def get_user_level(badges, user_id, channel_id, required_level):
if 'broadcaster' in badges:
Expand Down

0 comments on commit 7de8ac6

Please sign in to comment.