generated from HoloTech/holotech-plugin-template
fix: Channel sample payload format
This commit is contained in:
+7
-3
@@ -107,14 +107,16 @@ class CampaignChannel(Channel):
|
||||
reward_progress=random.randint(0, 105),
|
||||
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):
|
||||
for wss in self.communities.values():
|
||||
wss.discard(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]:
|
||||
await self.send_event(
|
||||
{
|
||||
@@ -125,7 +127,9 @@ class CampaignChannel(Channel):
|
||||
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]:
|
||||
await self.send_event(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user