From 4b98bed5424db2784978b5fb4317871b83b79d99 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Mon, 19 Aug 2024 14:24:55 -0400 Subject: [PATCH] Port the chat queue --- index.js | 6 ++++-- plugins/{cq.js => cq.mjs} | 3 ++- plugins/testing.mjs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) rename plugins/{cq.js => cq.mjs} (92%) diff --git a/index.js b/index.js index 8f96a92..9b6c45c 100755 --- a/index.js +++ b/index.js @@ -8,9 +8,11 @@ let botArray = [] const botplug = []; -import { default as botplug_testPlugin } from "./plugins/testing.mjs" // We have to load plugins manually, because auto-detection does not work in this format +import { default as botplug_test } from "./plugins/testing.mjs" // We have to load plugins manually, because auto-detection does not work in this format +import { default as botplug_chat } from "./plugins/cq.mjs" -botplug.push(botplug_testPlugin) +botplug.push(botplug_test) +botplug.push(botplug_chat) const bpl = fs.readdirSync('plugins') diff --git a/plugins/cq.js b/plugins/cq.mjs similarity index 92% rename from plugins/cq.js rename to plugins/cq.mjs index a5ba6f1..ded247e 100755 --- a/plugins/cq.js +++ b/plugins/cq.mjs @@ -1,4 +1,4 @@ -module.exports = { +export default { load: (b) => { b._client.on('login', () => { b.interval.chatQueue = setInterval(() => { @@ -15,5 +15,6 @@ module.exports = { b.chatqueue.push(element) }) } + b.chat(":3") } } diff --git a/plugins/testing.mjs b/plugins/testing.mjs index 6b41a73..e1e775a 100755 --- a/plugins/testing.mjs +++ b/plugins/testing.mjs @@ -1,5 +1,5 @@ export default { load: (b) => { - console.log(3) + } }