From 9bb89eb85bd9bec634cc576315df3f436e5243b7 Mon Sep 17 00:00:00 2001 From: Taken Date: Tue, 4 Apr 2023 00:14:12 +0200 Subject: [PATCH] Removing mineflayer --- index.js | 41 +++------------------------------ utils/mineflayer/logmessages.js | 8 +++++++ 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/index.js b/index.js index 0f34a2f..342457f 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,8 @@ const client = new Client({ ] }); +module.exports = client; + client.commands = new Collection(); client.events = new Collection(); client.modals = new Collection(); @@ -123,41 +125,4 @@ client.login(token); connect(mongoURI, {}).then(() => { console.log('Connected to MongoDB'); -}) - -// const bot = mineflayer.createBot({ -// host: 'mc.hypixel.net', -// port: 25565, -// username: 'privateinstagramante@gmail.com', -// -// version: '1.8.9', -// auth: 'microsoft' -// }); -// -// module.exports = bot; -// -// const { mineflayer: mineflayerViewer } = require('prismarine-viewer') -// bot.once('spawn', () => { -// mineflayerViewer(bot, { port: 10000, firstPerson: true }) -// }) -// -// const mfPath = path.join(__dirname, 'utils', 'mineflayer'); -// const mfFiles = fs.readdirSync(mfPath).filter(file => file.endsWith('.js')); -// -// for (const file of mfFiles) { -// -// const filePath = path.join(mfPath, file); -// const mf = require (filePath); -// -// if ('name' in mf && 'execute' in mf && 'type' in mf) { -// -// if (mf.once) { -// bot.once(mf.type, mf.execute); -// } else { -// bot.on(mf.type, mf.execute); -// } -// } else { -// console.log(`[WARNING] The mineflayer event at ${filePath} is missing a required "name", "execute" or "type" property.`); -// } -// -// } \ No newline at end of file +}) \ No newline at end of file diff --git a/utils/mineflayer/logmessages.js b/utils/mineflayer/logmessages.js index 1405ad5..d67b307 100644 --- a/utils/mineflayer/logmessages.js +++ b/utils/mineflayer/logmessages.js @@ -1,3 +1,5 @@ +const client = require('../../index.js'); + module.exports = { name: 'Guild chat relay', description: 'Sends a message to the chat.', @@ -5,6 +7,8 @@ module.exports = { async execute(jsonMsg) { + const gcchannel = "1092569207918575687" + const msg = jsonMsg.getText(); const annoyingMessages = [ "You are currently APPEARING OFFLINE", @@ -17,5 +21,9 @@ module.exports = { console.log("[Chat message] " + msg); + const channel = client.guild.channels.cache.get(gcchannel); + + channel.send(msg); + } }; \ No newline at end of file