fix: Channel sample payload format

This commit is contained in:
2026-07-28 09:14:27 +03:00
parent 84de4a7764
commit de64f9166b
+7 -3
View File
@@ -107,14 +107,16 @@ class CampaignChannel(Channel):
reward_progress=random.randint(0, 105), reward_progress=random.randint(0, 105),
reward_cap=150, reward_cap=150,
) )
await self.send_event(payload, websocket=websocket) await self.send_campaign_update(1, payload, websocket=websocket)
async def del_connection(self, websocket): async def del_connection(self, websocket):
for wss in self.communities.values(): for wss in self.communities.values():
wss.discard(websocket) wss.discard(websocket)
await super().del_connection(websocket) await super().del_connection(websocket)
async def send_campaign_update(self, communityid: int, payload, websocket=None): async def send_campaign_update(
self, communityid: int, payload: CampaignPayload, websocket=None
):
for ws in (websocket,) if websocket else self.communities[communityid]: for ws in (websocket,) if websocket else self.communities[communityid]:
await self.send_event( await self.send_event(
{ {
@@ -125,7 +127,9 @@ class CampaignChannel(Channel):
websocket=ws, websocket=ws,
) )
async def send_campaign_ended(self, communityid: int, payload, websocket=None): async def send_campaign_ended(
self, communityid: int, payload: CampaignPayload, websocket=None
):
for ws in (websocket,) if websocket else self.communities[communityid]: for ws in (websocket,) if websocket else self.communities[communityid]:
await self.send_event( await self.send_event(
{ {