diff --git a/twitch.py b/twitch.py index c8cdc7e..07f908b 100644 --- a/twitch.py +++ b/twitch.py @@ -1502,11 +1502,17 @@ class Twitch: if watching_channel is None: # if we aren't watching anything, we can't earn any drops return None + watching_game: Game | None = watching_channel.game + if watching_game is None: + # if the channel isn't playing anything in particular, we can't determine the drop + return None drops: list[TimedDrop] = [] for campaign in self.inventory: - # can be earned on this channel - if (campaign.can_earn(watching_channel)): - # add only the drops we can actually earn + if ( + campaign.game == watching_game + or campaign.has_badge_or_emote + and campaign.can_earn(watching_channel) + ): drops.extend(drop for drop in campaign.drops if drop.can_earn(watching_channel)) if drops: drops.sort(key=lambda d: d.remaining_minutes)