Make default bot prefix configurable

This commit is contained in:
Ethan Lane 2022-09-06 18:51:15 +01:00
parent 6ad9fcc098
commit aa86b3d1fe
Signed by: Vylpes
GPG key ID: EED233CC06D12504
6 changed files with 6 additions and 11 deletions

View file

@ -11,6 +11,7 @@ BOT_VER=DEV
BOT_AUTHOR=Vylpes BOT_AUTHOR=Vylpes
BOT_DATE=DEV BOT_DATE=DEV
BOT_OWNERID=147392775707426816 BOT_OWNERID=147392775707426816
BOT_PREFIX=d!
ABOUT_FUNDING=https://ko-fi.com/vylpes ABOUT_FUNDING=https://ko-fi.com/vylpes
ABOUT_REPO=https://github.com/vylpes/vylbot-app ABOUT_REPO=https://github.com/vylpes/vylbot-app

View file

@ -11,6 +11,7 @@ BOT_VER=3.1
BOT_AUTHOR=Vylpes BOT_AUTHOR=Vylpes
BOT_DATE=05 Sep 2022 BOT_DATE=05 Sep 2022
BOT_OWNERID=147392775707426816 BOT_OWNERID=147392775707426816
BOT_PREFIX=v!
ABOUT_FUNDING=https://ko-fi.com/vylpes ABOUT_FUNDING=https://ko-fi.com/vylpes
ABOUT_REPO=https://github.com/vylpes/vylbot-app ABOUT_REPO=https://github.com/vylpes/vylbot-app

View file

@ -11,6 +11,7 @@ BOT_VER=3.1
BOT_AUTHOR=Vylpes BOT_AUTHOR=Vylpes
BOT_DATE=05 Sep 2022 BOT_DATE=05 Sep 2022
BOT_OWNERID=147392775707426816 BOT_OWNERID=147392775707426816
BOT_PREFIX=s!
ABOUT_FUNDING=https://ko-fi.com/vylpes ABOUT_FUNDING=https://ko-fi.com/vylpes
ABOUT_REPO=https://github.com/vylpes/vylbot-app ABOUT_REPO=https://github.com/vylpes/vylbot-app

View file

@ -25,12 +25,10 @@ export class CoreClient extends Client {
return this._eventItems; return this._eventItems;
} }
constructor(intents: number[], devmode: boolean = false) { constructor(intents: number[]) {
super({ intents: intents }); super({ intents: intents });
dotenv.config(); dotenv.config();
DefaultValues.useDevPrefix = devmode;
CoreClient._commandItems = []; CoreClient._commandItems = [];
CoreClient._eventItems = []; CoreClient._eventItems = [];

View file

@ -17,11 +17,7 @@ export default class DefaultValues {
private static SetValues() { private static SetValues() {
if (this.values.length == 0) { if (this.values.length == 0) {
// Bot // Bot
if (this.useDevPrefix) { this.values.push({ Key: "bot.prefix", Value: process.env.BOT_PREFIX || "v!" })
this.values.push({ Key: "bot.prefix", Value: "d!" });
} else {
this.values.push({ Key: "bot.prefix", Value: "v!" });
}
// Commands // Commands
this.values.push({ Key: "commands.disabled", Value: "" }); this.values.push({ Key: "commands.disabled", Value: "" });

View file

@ -19,13 +19,11 @@ requiredConfigs.forEach(config => {
} }
}); });
const devmode = process.argv.find(x => x.toLowerCase() == "--dev") != null;
const client = new CoreClient([ const client = new CoreClient([
Intents.FLAGS.GUILDS, Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MEMBERS,
], devmode); ]);
registry.RegisterCommands(); registry.RegisterCommands();
registry.RegisterEvents(); registry.RegisterEvents();