diff --git a/index.js b/index.js index dc4560a..52c6cdb 100644 --- a/index.js +++ b/index.js @@ -156,12 +156,12 @@ connect(mongoURI, {}).then(() => { // const filePath = path.join(mfPath, file); // const mf = require (filePath); // -// if ('name' in mf && 'execute' in mf && mf.type === 'mineflayer') { +// if ('name' in mf && 'execute' in mf && 'type' in mf) { // // if (mf.once) { -// bot.once(mf.name, mf.execute); +// bot.once(mf.type, mf.execute); // } else { -// bot.on(mf.name, mf.execute); +// bot.on(mf.type, mf.execute); // } // } else { // console.log(`[WARNING] The mineflayer event at ${filePath} is missing a required "name", "execute" or "type" property.`); diff --git a/utils/mineflayer/limbo.js b/utils/mineflayer/limbo.js new file mode 100644 index 0000000..6da21e9 --- /dev/null +++ b/utils/mineflayer/limbo.js @@ -0,0 +1,12 @@ +module.exports = { + name: 'limbo', + description: 'Sends bot to limbo.', + type: 'spawn', + + async execute() { + const bot = require ('../../index.js'); + + bot.chat('/locraw'); + + } +}; \ No newline at end of file diff --git a/utils/mineflayer/chatmessage.js b/utils/mineflayer/logmessages.js similarity index 82% rename from utils/mineflayer/chatmessage.js rename to utils/mineflayer/logmessages.js index 93be64c..1405ad5 100644 --- a/utils/mineflayer/chatmessage.js +++ b/utils/mineflayer/logmessages.js @@ -1,7 +1,7 @@ module.exports = { - name: 'message', + name: 'Guild chat relay', description: 'Sends a message to the chat.', - type: 'mineflayer', + type: 'message', async execute(jsonMsg) { @@ -15,7 +15,7 @@ module.exports = { if (annoyingMessages.includes(msg)) return; - // console.log(msg); + console.log("[Chat message] " + msg); } }; \ No newline at end of file diff --git a/utils/mineflayer/online.js b/utils/mineflayer/online.js index 738e0e6..a7b5c0d 100644 --- a/utils/mineflayer/online.js +++ b/utils/mineflayer/online.js @@ -1,14 +1,10 @@ module.exports = { name: 'login', description: 'Logs the bot in.', - type: 'mineflayer', + type: 'login', async execute() { - const bot = require ('../../index.js'); - - console.log('Logging in...'); - bot.chat("/lobby bedwars") - + console.log('Logged in as ' + bot.username + '!') } } \ No newline at end of file