Skip to content

Commit

Permalink
fix(events): add missing variables to filter eval
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Oct 25, 2021
1 parent 58f1d45 commit 5ef86e0
Showing 1 changed file with 41 additions and 18 deletions.
59 changes: 41 additions & 18 deletions src/events.ts
Expand Up @@ -696,25 +696,48 @@ class Events extends Core {
bot: get(attributes, 'is.bot', false),
owner: get(attributes, 'is.owner', false),
},
$method: get(attributes, 'method', null),
$months: get(attributes, 'months', null),
$monthsName: get(attributes, 'monthsName', null),
$message: get(attributes, 'message', null),
$command: get(attributes, 'command', null),
$count: get(attributes, 'count', null),
$bits: get(attributes, 'bits', null),
$reason: get(attributes, 'reason', null),
$target: get(attributes, 'target', null),
$viewers: get(attributes, 'viewers', null),
$duration: get(attributes, 'duration', null),
$months: get(attributes, 'months', null),
$monthsName: get(attributes, 'monthsName', null),
$message: get(attributes, 'message', null),
$command: get(attributes, 'command', null),
$count: get(attributes, 'count', null),
$bits: get(attributes, 'bits', null),
$reason: get(attributes, 'reason', null),
$target: get(attributes, 'target', null),
$viewers: get(attributes, 'viewers', null),
$duration: get(attributes, 'duration', null),
// add global variables
$game: stats.value.currentGame,
$title: stats.value.currentTitle,
$views: stats.value.currentViews,
$followers: stats.value.currentFollowers,
$subscribers: stats.value.currentSubscribers,
$isBotSubscriber: isBotSubscriber(),
$isStreamOnline: isStreamOnline.value,
$game: stats.value.currentGame,
$title: stats.value.currentTitle,
$views: stats.value.currentViews,
$followers: stats.value.currentFollowers,
$subscribers: stats.value.currentSubscribers,
$isBotSubscriber: isBotSubscriber(),
$isStreamOnline: isStreamOnline.value,
// sub/resub
$method: get(attributes, 'method', null),
$tier: get(attributes, 'tier', null),
$subStreakShareEnabled: get(attributes, 'subStreakShareEnabled', null),
$subStreak: get(attributes, 'subStreak', false),
$subCumulativeMonths: get(attributes, 'subCumulativeMonths', false),
// hypetrain
$level: get(attributes, 'level', null),
$total: get(attributes, 'total', null),
$goal: get(attributes, 'goal', null),
$topContributionsBitsUserId: get(attributes, 'topContributionsBitsUserId', null),
$topContributionsBitsUsername: get(attributes, 'topContributionsBitsUsername', null),
$topContributionsBitsTotal: get(attributes, 'topContributionsBitsTotal', null),
$topContributionsSubsUserId: get(attributes, 'topContributionsSubsUserId', null),
$topContributionsSubsUsername: get(attributes, 'topContributionsSubsUsername', null),
$topContributionsSubsTotal: get(attributes, 'topContributionsSubsTotal', null),
$lastContributionType: get(attributes, 'lastContributionType', null),
$lastContributionUserId: get(attributes, 'lastContributionUserId', null),
$lastContributionUsername: get(attributes, 'lastContributionUsername', null),
$lastContributionTotal: get(attributes, 'lastContributionTotal', null),
// game-changed
$oldGame: get(attributes, 'oldGame', null),
// reward
$userInput: get(attributes, 'userInput', null),
...customVariables,
};
let result = false;
Expand Down

0 comments on commit 5ef86e0

Please sign in to comment.