Skip to content

Commit

Permalink
redemption reward event sub
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Oct 16, 2024
1 parent 7d3122d commit 0906591
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/eventSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class EventSub {
console.log(`${event.userDisplayName} just followed ${event.broadcasterDisplayName}!`);
this.bot.say(`#${config.twitch.channels}`, `Gracias por seguirnos ${event.userDisplayName}!`)
});

this.middleware.onChannelRedemptionAddForReward(channelId, "427b3e63-e6cd-4d36-8954-9c7198af0a1d", event => {
console.log(`${event.userDisplayName} ha canjeado ${event.rewardTitle}!`);
this.bot.say(`#${config.twitch.channels}`, `${event.userDisplayName} ha canjeado ${event.rewardTitle}!`)
});
}
}

Expand Down
5 changes: 1 addition & 4 deletions lib/messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Messenger {

async init() {
await this.tokenAutoRefresh()
await this.channelTokenAutoRefresh()

const opts = {
options: { debug: true },
Expand Down Expand Up @@ -69,10 +70,6 @@ class Messenger {
authProvider.addUser(parseInt(config.twitch.roomId), tokenData, ['chat'])
}

getBot () {
return this.bot
}

listen () {
const apiClient = new ApiClient({ authProvider: this.authProvider })

Expand Down

0 comments on commit 0906591

Please sign in to comment.