From 464180e148a5770c07642ed26f2b07cc8a036f27 Mon Sep 17 00:00:00 2001 From: Kepka Ludovic Date: Fri, 22 Aug 2025 07:13:08 +0200 Subject: [PATCH] Erreur d'authentification twitch --- twitchbot/__init__.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/twitchbot/__init__.py b/twitchbot/__init__.py index 963c1d7..cecdedd 100644 --- a/twitchbot/__init__.py +++ b/twitchbot/__init__.py @@ -33,15 +33,18 @@ class TwitchBot() : async def _connect(self): with webapp.app_context(): if _isConfigured() : - helper = ConfigurationHelper() - self.twitch = await Twitch(helper.getValue('twitch_client_id'), helper.getValue('twitch_client_secret')) - await self.twitch.set_user_authentication(helper.getValue('twitch_access_token'), USER_SCOPE, helper.getValue('twitch_refresh_token')) - self.chat = await Chat(self.twitch) - self.chat.register_event(ChatEvent.READY, _onReady) - self.chat.register_event(ChatEvent.MESSAGE, _onMessage) - # chat.register_event(ChatEvent.SUB, on_sub) - self.chat.register_command('hello', _helloCommand) - self.chat.start() + try : + helper = ConfigurationHelper() + self.twitch = await Twitch(helper.getValue('twitch_client_id'), helper.getValue('twitch_client_secret')) + await self.twitch.set_user_authentication(helper.getValue('twitch_access_token'), USER_SCOPE, helper.getValue('twitch_refresh_token')) + self.chat = await Chat(self.twitch) + self.chat.register_event(ChatEvent.READY, _onReady) + self.chat.register_event(ChatEvent.MESSAGE, _onMessage) + # chat.register_event(ChatEvent.SUB, on_sub) + self.chat.register_command('hello', _helloCommand) + self.chat.start() + except Exception as e: + logging.error(f'twitch auth error {e}') else: logging.info("Twitch is not configured")