diff --git a/plugin/twitch/component.py b/plugin/twitch/component.py index 45a053e..90dbbff 100644 --- a/plugin/twitch/component.py +++ b/plugin/twitch/component.py @@ -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):