Change MPP bot config file location, fix channels in said config, and add a check to make sure we only chat in the desired channel

This commit is contained in:
Hri7566 2024-06-13 21:44:40 -04:00
parent c835b0b979
commit a92873a613
4 changed files with 17 additions and 14 deletions

View File

@ -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

8
config/mpp_bots.yml Normal file
View File

@ -0,0 +1,8 @@
- uri: wss://mppclone.com:8443
channel:
id: "✧𝓓𝓔𝓥 𝓡𝓸𝓸𝓶✧"
allowColorChanging: true
- uri: wss://mppclone.com:8443
channel:
id: "test/fishing"
allowColorChanging: true

View File

@ -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) {

View File

@ -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: {