fix(twitch): Correct payload attr names for event

This commit is contained in:
2026-07-31 13:51:15 +03:00
parent 97bdf8e8e3
commit 1c5eb6ceeb
+6 -6
View File
@@ -58,9 +58,7 @@ class CampaignComponent(cmds.Component):
# Check the tier and duration of the subscription.
# Continue if tier = 3000 and duration is at least 3 months
if (tier := detail_row["tier"]) == 3000 and (
duration := detail_row["duration_months"]
) >= 3:
if detail_row["tier"] == 3000 and detail_row["duration_months"] >= 3:
# Check if there is an ongoing campaign
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.
await campaign.add_reward(
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"],
twitch_user_id=data["chatter_user_id"],
twitch_user_name=data["chatter_user_name"],
twitch_user_id=data.chatter.id,
twitch_user_name=data.chatter.name,
)
await self.dispatch_update(campaign)
else:
logger.info(f"Campaigns ignoring sub notice event: {event_row}")
# @cmds.Component.listener()
async def event_custom_redemption_add(self, payload):