generated from HoloTech/holotech-plugin-template
fix(twitch): Correct payload attr names for event
This commit is contained in:
@@ -58,9 +58,7 @@ class CampaignComponent(cmds.Component):
|
|||||||
|
|
||||||
# Check the tier and duration of the subscription.
|
# Check the tier and duration of the subscription.
|
||||||
# Continue if tier = 3000 and duration is at least 3 months
|
# Continue if tier = 3000 and duration is at least 3 months
|
||||||
if (tier := detail_row["tier"]) == 3000 and (
|
if detail_row["tier"] == 3000 and detail_row["duration_months"] >= 3:
|
||||||
duration := detail_row["duration_months"]
|
|
||||||
) >= 3:
|
|
||||||
# Check if there is an ongoing campaign
|
# Check if there is an ongoing campaign
|
||||||
campaigns = await self.campaigns.fetch_campaigns(event_row["communityid"])
|
campaigns = await self.campaigns.fetch_campaigns(event_row["communityid"])
|
||||||
|
|
||||||
@@ -74,12 +72,14 @@ class CampaignComponent(cmds.Component):
|
|||||||
# Add a reward to the database with the correct info.
|
# Add a reward to the database with the correct info.
|
||||||
await campaign.add_reward(
|
await campaign.add_reward(
|
||||||
profileid=event_row["profileid"],
|
profileid=event_row["profileid"],
|
||||||
earned_from=f"(SUB) User subscribed for {duration} months at tier {tier}",
|
earned_from=f"(SUB NOTICE) {data.system_message}",
|
||||||
event_id=event_row["event_id"],
|
event_id=event_row["event_id"],
|
||||||
twitch_user_id=data["chatter_user_id"],
|
twitch_user_id=data.chatter.id,
|
||||||
twitch_user_name=data["chatter_user_name"],
|
twitch_user_name=data.chatter.name,
|
||||||
)
|
)
|
||||||
await self.dispatch_update(campaign)
|
await self.dispatch_update(campaign)
|
||||||
|
else:
|
||||||
|
logger.info(f"Campaigns ignoring sub notice event: {event_row}")
|
||||||
|
|
||||||
# @cmds.Component.listener()
|
# @cmds.Component.listener()
|
||||||
async def event_custom_redemption_add(self, payload):
|
async def event_custom_redemption_add(self, payload):
|
||||||
|
|||||||
Reference in New Issue
Block a user