diff --git a/config/bots.yml b/config/bots.yml deleted file mode 100644 index 36be29f..0000000 --- a/config/bots.yml +++ /dev/null @@ -1,13 +0,0 @@ -# - uri: wss://mppclone.com:8443 -# channel: -# id: "βœ§π““π“”π“₯ π“‘π“Έπ“Έπ“Άβœ§" -# allowColorChanging: true -# - uri: wss://mppclone.com:8443 -# channel: -# id: "test/fishing" -# allowColorChanging: true - -- uri: wss://mppclone.com:8443 - channel: - id: "keller room" - allowColorChanging: true diff --git a/config/mpp_bots.yml b/config/mpp_bots.yml new file mode 100644 index 0000000..44583fc --- /dev/null +++ b/config/mpp_bots.yml @@ -0,0 +1,8 @@ +- uri: wss://mppclone.com:8443 + channel: + id: "βœ§π““π“”π“₯ π“‘π“Έπ“Έπ“Άβœ§" + allowColorChanging: true +- uri: wss://mppclone.com:8443 + channel: + id: "test/fishing" + allowColorChanging: true diff --git a/src/mpp/bot/Bot.ts b/src/mpp/bot/Bot.ts index 60844df..1bfd771 100644 --- a/src/mpp/bot/Bot.ts +++ b/src/mpp/bot/Bot.ts @@ -51,11 +51,19 @@ export class MPPNetBot { this.logger.info( `Received channel update for channel ID "${msg.ch._id}"` ); + + if (msg._id !== this.config.channel.id) { + this.client.setChannel(this.config.channel.id); + } }); this.client.on("a", async msg => { let prefixes: string[]; + if (this.client.channel._id !== this.config.channel.id) { + return; + } + try { prefixes = await this.trpc.prefixes.query(); } catch (err) { diff --git a/src/mpp/bot/index.ts b/src/mpp/bot/index.ts index df1f592..249f346 100644 --- a/src/mpp/bot/index.ts +++ b/src/mpp/bot/index.ts @@ -6,7 +6,7 @@ const logger = new Logger("big brain"); const bots: MPPNetBot[] = []; -const defaults = loadConfig("config/bots.yml", [ +const defaults = loadConfig("config/mpp_bots.yml", [ { uri: "wss://mppclone.com:8443", channel: {