Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
v2.1.1fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Arubinu committed Oct 12, 2023
1 parent b9df119 commit aa3e050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions addons/twitch/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"moderator:manage:chat_messages",
"moderator:manage:chat_settings",
"moderator:manage:shoutouts",
"moderator:read:followers",
"moderator:read:chat_settings",
"user:read:follows",
"whispers:edit",
Expand Down
11 changes: 6 additions & 5 deletions addons/twitch/twurple.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const methods = {
return false;
}

return await api_client.users.getFollowFromUserToBroadcaster(userIdCheck, user.id);
const { data: [follow] } = await api_client.channels.getChannelFollowers(user.id, userIdCheck);
return follow;
},
getAccounts: async () => {
return { broadcaster: channel, bot: bot_channel };
Expand Down Expand Up @@ -467,7 +468,7 @@ async function connect(clientId, accessToken, botAccessToken, callback) {
});

// Subscribes to events that represent a user following a channel.
ws_listeners.ChannelFollow = await ws_listener.onChannelFollow(channel.id, async e => {
ws_listeners.ChannelFollow = await ws_listener.onChannelFollow(channel.id, channel.id, async e => {
callback(await get('Follow', null, null, null, {
user: {
id: e.userId,
Expand Down Expand Up @@ -1227,7 +1228,7 @@ async function get(type, msg, message, user, merge) {
moderator: msg.userInfo.isMod,
subscriber: msg.userInfo.isSubscriber,
vip: msg.userInfo.isVip,
follower: ((msg.userInfo && msg.userInfo.userId) ? !!(await methods.checkFollow(false, msg.userId)) : false)
follower: (msg.userInfo && msg.userInfo.userId) ? !!(await methods.checkFollow(false, msg.userInfo.userId)) : false
}
: null,
user: { // type: mod, global_mod, admin, staff
Expand All @@ -1237,7 +1238,7 @@ async function get(type, msg, message, user, merge) {
display: msg.userInfo ? msg.userInfo.displayName : (msg.userDisplayName ? msg.userDisplayName : null)
},
color: msg.userInfo ? msg.userInfo.color : null,
message: is_command ? message.substr(1) : message,
message: is_command ? message.substring(1) : message,
isCheer: msg.isCheer,
isHighlight: msg.isHighlight,
isRedemption: msg.isRedemption,
Expand All @@ -1251,7 +1252,7 @@ async function get(type, msg, message, user, merge) {
prompt: msg.rewardPrompt,
cost: msg.rewardCost,
queued: msg.rewardIsQueued,
images: (msg.rewardImage || msg.defaultImage),
images: msg.rewardImage || msg.defaultImage,
}
}, (merge || {}));
}
Expand Down

0 comments on commit aa3e050

Please sign in to comment.