startup flags

v2
Kit Kasune 2 years ago
parent f2d3f1eeb7
commit 3bdfb83d62
  1. 2
      bot.js
  2. 4
      src/handle/runtime/events/ready.js
  3. 20
      src/handle/startup/run/getflags.js
  4. 2
      src/handle/startup/run/setstatus.js

@ -25,6 +25,8 @@ const startBot = async () => {
client.log(client.utils.gr(client.config.randResp.clistart), {color: "#78d9f8", source: "NATS"}, true, true); //natsuki's wakeup log
require('./src/handle/startup/run/getflags')(client);
await require('./src/db/connect')(client); //connect to database
await require('./src/handle/startup/run/collect')(client); //load in commands and events
await require('./src/handle/startup/run/login')(client); //log in to discord

@ -1,7 +1,5 @@
const Discord = require('discord.js');
module.exports = async client => {
client.prefix = "n?";
client.basePrefix = client.config.options.dev ? client.config.options.prefix || "n!" : "n?";
require('../../startup/run/hello')(client); // startup info
require('../../startup/run/setstatus')(client);

@ -0,0 +1,20 @@
const chalk = require('chalk');
const {Tag, TagFilter} = require('../../../util/ts/tagfilter');
module.exports = client => {
const options = new TagFilter([
new Tag(['dev', 'd', 'developer', 'test'], 'dev', 'toggle'),
new Tag(['prefix', 'devprefix'], 'prefix', 'append')
]).test(process.argv.slice(2).join(" "));
client.config.options = {};
if (Object.keys(options).length) { //log and set options
client.log(`${chalk.gray.bold("Arguments detected.")}`, {source: 'args'}, 0, 1);
Object.keys(options).forEach(arg => {
client.config.options[arg] = options[arg];
client.log(`${chalk.gray.bold(arg)}${chalk.gray(':')} ${chalk.blue(options[arg])}`, {source: 'args'});
});
console.log('');
}
};

@ -1,5 +1,5 @@
module.exports = client => {
const prefix = client.prefix;
const prefix = client.basePrefix;
const statuses = {
"PLAYING": [
`with my darling`, 'RAIN: Shadow Lords', "with my waifu", "with the neko formula",

Loading…
Cancel
Save