Add "addbot" feature

This commit is contained in:
Cadence Ember
2023-10-02 21:48:06 +13:00
parent 6d83df2e95
commit 708955c062
6 changed files with 40 additions and 1 deletions

View File

@@ -2,9 +2,10 @@
const repl = require("repl")
const util = require("util")
const {addbot} = require("./addbot")
const passthrough = require("./passthrough")
const { discord, config, sync, db } = passthrough
const {discord, config, sync, db} = passthrough
const data = sync.require("./test/data")
const createSpace = sync.require("./d2m/actions/create-space")
@@ -39,6 +40,7 @@ setImmediate(() => { // assign after since old extraContext data will get remove
async function customEval(input, _context, _filename, callback) {
let depth = 0
if (input === "exit\n") return process.exit()
if (input === "addbot\n") return callback(null, addbot())
if (input.startsWith(":")) {
const depthOverwrite = input.split(" ")[0]
depth = +depthOverwrite.slice(1)