Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit eaad1b5

Browse files
committed
fix bug preventing live messages from being updated
1 parent 571501d commit eaad1b5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,14 +1054,14 @@ function updateTwitchChannel(channel){
10541054

10551055
}
10561056

1057-
function postLiveMessage(channel, discord_channel, message, embed, cb){
1057+
function postLiveMessage(channel, discord_channel, channel_id, message, embed, cb){
10581058
discord_channel
10591059
.send(message, {embed: helper.formatTwitchEmbed(channel)})
10601060
.then(_msg => {
10611061
if(DEBUG)
1062-
helper.log(`live message posted in ${_channel_id}, has msg_id ${_msg.id}`);
1062+
helper.log(`live message posted in ${channel_id}, has msg_id ${_msg.id}`);
10631063

1064-
channel.channels[_channel_id].msg_id = _msg.id;
1064+
channel.channels[channel_id].msg_id = _msg.id;
10651065
helper.saveJSON('trackedChannels', trackedChannels);
10661066

10671067
if(typeof cb === 'function') cb();
@@ -1102,7 +1102,7 @@ function postTwitchChannel(channel){
11021102
});
11031103

11041104
Promise.all(promises).then(() => {
1105-
postLiveMessage(channel, discord_channel, highlights, helper.formatTwitchEmbed, () => {
1105+
postLiveMessage(channel, discord_channel, _channel_id, highlights, helper.formatTwitchEmbed, () => {
11061106
unmention_roles.forEach(role => {
11071107
role.setMentionable(false);
11081108

@@ -1112,7 +1112,7 @@ function postTwitchChannel(channel){
11121112
});
11131113

11141114
}else{
1115-
postLiveMessage(channel, discord_channel, highlights, helper.formatTwitchEmbed);
1115+
postLiveMessage(channel, discord_channel, _channel_id, highlights, helper.formatTwitchEmbed);
11161116
}
11171117
}
11181118
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pagkibot",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Discord bot for instant twitch live notifications",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)