forked from cadence/out-of-your-element
Add "addbot" feature
This commit is contained in:
parent
6d83df2e95
commit
708955c062
6 changed files with 40 additions and 1 deletions
4
stdin.js
4
stdin.js
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue