This commit is contained in:
2025-04-21 18:03:24 +02:00
parent cafa0e3afd
commit 288e4769bc
19 changed files with 27 additions and 28 deletions

View File

@@ -49,14 +49,14 @@ jobs:
with: with:
url: ${{ secrets.WEBHOOK_URL }} url: ${{ secrets.WEBHOOK_URL }}
# - -
# name: Invoke deployment hook (worker) name: Invoke deployment hook (twitch_webhook)
# uses: joelwmale/webhook-action@master uses: joelwmale/webhook-action@master
# with: with:
# url: ${{ secrets.WEBHOOK_URL_2 }} url: ${{ secrets.WEBHOOK_URL_2 }}
# - # -
# name: Invoke deployment hook (scheduler) # name: Invoke deployment hook (worker)
# uses: joelwmale/webhook-action@master # uses: joelwmale/webhook-action@master
# with: # with:
# url: ${{ secrets.WEBHOOK_URL_3 }} # url: ${{ secrets.WEBHOOK_URL_3 }}

View File

@@ -1,7 +1,7 @@
import logging import logging
from datetime import datetime from datetime import datetime
from domain.streamers import TwitchConfig from applications.common.domain.streamers import TwitchConfig
from .twitch_events import get_twitch_events, TwitchEvent from .twitch_events import get_twitch_events, TwitchEvent
from .discord_events import ( from .discord_events import (

View File

@@ -1,5 +1,5 @@
from core.broker import broker from core.broker import broker
from repositories.streamers import StreamerConfigRepository from applications.common.repositories.streamers import StreamerConfigRepository
from .synchronizer import syncronize from .synchronizer import syncronize

View File

@@ -1,7 +0,0 @@
from .twitch.webhook import start_twitch_service
start = start_twitch_service
__all__ = ["start"]

View File

@@ -0,0 +1,10 @@
from asyncio import run
from .twitch.webhook import TwitchService
async def start_twitch_service() -> None:
await TwitchService.start()
run(start_twitch_service())

View File

@@ -3,7 +3,7 @@ import logging
from httpx import AsyncClient from httpx import AsyncClient
from core.config import config from core.config import config
from domain.streamers import StreamerConfig from applications.common.domain.streamers import StreamerConfig
from .state import State from .state import State
from .sent_notifications import SentNotification, SentNotificationType, SentResult from .sent_notifications import SentNotification, SentNotificationType, SentResult

View File

@@ -4,7 +4,7 @@ from pydantic import BaseModel
from twitchAPI.object.eventsub import ChannelPointsCustomRewardRedemptionAddEvent from twitchAPI.object.eventsub import ChannelPointsCustomRewardRedemptionAddEvent
from repositories.streamers import StreamerConfigRepository from applications.common.repositories.streamers import StreamerConfigRepository
from .twitch.authorize import authorize from .twitch.authorize import authorize

View File

@@ -3,7 +3,7 @@ from datetime import datetime, timezone
from twitchAPI.helper import first from twitchAPI.helper import first
from core.broker import broker from core.broker import broker
from repositories.streamers import StreamerConfigRepository from applications.common.repositories.streamers import StreamerConfigRepository
from .state import State, UpdateEvent, EventType from .state import State, UpdateEvent, EventType
from .watcher import StateWatcher from .watcher import StateWatcher

View File

@@ -7,11 +7,11 @@ from twitchAPI.twitch import Twitch
from twitchAPI.object.eventsub import StreamOnlineEvent, ChannelUpdateEvent, ChannelChatMessageEvent, ChannelPointsCustomRewardRedemptionAddEvent from twitchAPI.object.eventsub import StreamOnlineEvent, ChannelUpdateEvent, ChannelChatMessageEvent, ChannelPointsCustomRewardRedemptionAddEvent
from twitchAPI.oauth import validate_token from twitchAPI.oauth import validate_token
from repositories.streamers import StreamerConfigRepository, StreamerConfig from applications.common.repositories.streamers import StreamerConfigRepository, StreamerConfig
from modules.stream_notifications.tasks import on_stream_state_change, on_stream_state_change_with_check, on_message, on_redemption_reward_add_task from applications.twitch_webhook.tasks import on_stream_state_change, on_stream_state_change_with_check, on_message, on_redemption_reward_add_task
from modules.stream_notifications.state import UpdateEvent, EventType from applications.twitch_webhook.state import UpdateEvent, EventType
from modules.stream_notifications.messages_proc import MessageEvent from applications.twitch_webhook.messages_proc import MessageEvent
from modules.stream_notifications.reward_redemption import RewardRedemption from applications.twitch_webhook.reward_redemption import RewardRedemption
from .authorize import authorize from .authorize import authorize
@@ -196,7 +196,3 @@ class TwitchService:
) )
logger.info("Twitch service stopped") logger.info("Twitch service stopped")
async def start_twitch_service() -> NoReturn:
await TwitchService.start()

View File

@@ -3,7 +3,7 @@ from datetime import datetime, timezone, timedelta
from twitchAPI.helper import first from twitchAPI.helper import first
from core.redis import redis_manager from core.redis import redis_manager
from repositories.streamers import StreamerConfigRepository from applications.common.repositories.streamers import StreamerConfigRepository
from .state import State, StateManager, EventType from .state import State, StateManager, EventType
from .sent_notifications import SentNotificationRepository, SentNotificationType from .sent_notifications import SentNotificationRepository, SentNotificationType