mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Fix
This commit is contained in:
@@ -47,7 +47,7 @@ async def main():
|
|||||||
twitch_activities.check_streams_states,
|
twitch_activities.check_streams_states,
|
||||||
twitch_activities.on_redemption_reward_add_activity,
|
twitch_activities.on_redemption_reward_add_activity,
|
||||||
],
|
],
|
||||||
workflow_runner=UnsandboxedWorkflowRunner(),
|
workflow_runner=UnsandboxedWorkflowRunner()
|
||||||
)
|
)
|
||||||
|
|
||||||
await worker.run()
|
await worker.run()
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
from temporalio import activity
|
from temporalio import activity
|
||||||
from dataclasses import dataclass
|
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from applications.twitch_webhook.state import State, EventType
|
from applications.twitch_webhook.state import State, EventType
|
||||||
from applications.twitch_webhook.watcher import StateWatcher
|
from applications.twitch_webhook.watcher import StateWatcher
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
class OnStreamStateChangeActivity(BaseModel):
|
||||||
class OnStreamStateChangeActivity:
|
|
||||||
streamer_id: int
|
streamer_id: int
|
||||||
event_type: EventType
|
event_type: EventType
|
||||||
new_state: State | None = None
|
new_state: State | None = None
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
from temporalio.client import Client
|
from temporalio.client import Client
|
||||||
|
from temporalio.contrib.pydantic import pydantic_data_converter
|
||||||
|
|
||||||
|
|
||||||
async def get_client() -> Client:
|
async def get_client() -> Client:
|
||||||
return await Client.connect("temporal:7233", namespace="default")
|
return await Client.connect(
|
||||||
|
"temporal:7233",
|
||||||
|
namespace="default",
|
||||||
|
data_converter=pydantic_data_converter
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user