@@ -27,6 +27,7 @@ import {
2727 isStreamOnline , stats , streamStatusChangeSince ,
2828} from '~/helpers/api' ;
2929import { prepare } from '~/helpers/commons/prepare' ;
30+ import { start } from '~/helpers/core/stream' ;
3031import defaultPermissions from '~/helpers/permissions/defaultPermissions' ;
3132import { adminEndpoint } from '~/helpers/socket' ;
3233import {
@@ -38,6 +39,7 @@ import { isIgnored } from '~/helpers/user/isIgnored';
3839import { sendGameFromTwitch } from '~/services/twitch/calls/sendGameFromTwitch' ;
3940import { updateChannelInfo } from '~/services/twitch/calls/updateChannelInfo' ;
4041import { translate } from '~/translate' ;
42+ import { variables } from '~/watchers' ;
4143
4244const urls = {
4345 'SogeBot Token Generator' : 'https://twitch-token-generator.soge.workers.dev/refresh/' ,
@@ -260,8 +262,14 @@ class Twitch extends Service {
260262 }
261263
262264 @onStreamStart ( )
263- reconnectOnStreamStart ( ) {
265+ async reconnectOnStreamStart ( ) {
266+ const broadcasterUsername = variables . get ( 'services.twitch.broadcasterUsername' ) as string ;
267+
264268 this . uptime = 0 ;
269+ await this . tmi ?. part ( 'bot' ) ;
270+ await this . tmi ?. join ( 'bot' , broadcasterUsername ) ;
271+ await this . tmi ?. part ( 'broadcaster' ) ;
272+ await this . tmi ?. join ( 'broadcaster' , broadcasterUsername ) ;
265273 }
266274
267275 @onChange ( 'showWithAt' )
0 commit comments