diff --git a/src/modules/stream_notifications/messages_proc.py b/src/modules/stream_notifications/messages_proc.py index 05a6cbe..427885f 100644 --- a/src/modules/stream_notifications/messages_proc.py +++ b/src/modules/stream_notifications/messages_proc.py @@ -131,9 +131,9 @@ class MessagesProc: async def on_message(cls, event: MessageEvent): logging.info(f"Received message: {event}") - if "гойда" in event.message.text.lower(): - twitch = await authorize() + twitch = await authorize() + if "гойда" in event.message.text.lower(): await twitch.send_chat_message( event.broadcaster_user_id, config.TWITCH_ADMIN_USER_ID, @@ -142,8 +142,6 @@ class MessagesProc: ) if event.message.text.lower().startswith("!ai"): - twitch = await authorize() - try: completion = await get_completion(event.message.text) @@ -174,8 +172,6 @@ class MessagesProc: "курбез" in event.message.text.lower() or \ "булат" in event.message.text.lower()): - twitch = await authorize() - try: completion = await get_completion(event.message.text)