@@ -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 }
0 commit comments