diff options
| author | Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net> | 2026-04-22 22:49:01 +0200 |
|---|---|---|
| committer | Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net> | 2026-04-22 22:49:01 +0200 |
| commit | 3572b97661a3f7c6c29e958b63c20d9f2ef936ac (patch) | |
| tree | b3ee056039cf792edd467e5172feee25a07dd56c /commands | |
initialise repository
Signed-off-by: Amygdala Peanut-Almond <amygdala@almond.desloratadyna.net>
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/eval.js | 42 | ||||
| -rw-r--r-- | commands/exec.js | 43 | ||||
| -rw-r--r-- | commands/haze.js | 28 | ||||
| -rw-r--r-- | commands/help.js | 18 | ||||
| -rw-r--r-- | commands/ping.js | 12 | ||||
| -rw-r--r-- | commands/reload.js | 35 | ||||
| -rw-r--r-- | commands/sql.js | 65 |
7 files changed, 243 insertions, 0 deletions
diff --git a/commands/eval.js b/commands/eval.js new file mode 100644 index 0000000..e73c9bc --- /dev/null +++ b/commands/eval.js @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Emilia Luminé <eqilia@national.shitposting.agency> + * This file is a part of the Shamestech bot. + * + * The Shamestech bot is free software: you can redistribute it and/or modify it + * under the terms of the European Union Public License as published by + * by the European Union, only the version 1.2 of the License. + * + * The Shamestech bot is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * European Union Public License for more details. + * + * You should have received a copy of the European Union Public License, If not + * see <https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12> +*/ + +const util = require('node:util'); + +module.exports = { + name: 'eval', + hidden: true, + async execute(message, args) { + const prompt = args.join(' '); + let out = ''; + + if (message.author.id !== "1425229394703683614") { + return; + } + + try { + out = util.inspect(await eval(prompt)); + } catch (e) { + out = `${e}`; + } + + return await message.reply({ + content: `${out.length === 0 ? 'empty' : out}` + }); + } +} + diff --git a/commands/exec.js b/commands/exec.js new file mode 100644 index 0000000..c92b32a --- /dev/null +++ b/commands/exec.js @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Emilia Luminé <eqilia@national.shitposting.agency> + * This file is a part of the Shamestech bot. + * + * The Shamestech bot is free software: you can redistribute it and/or modify it + * under the terms of the European Union Public License as published by + * by the European Union, only the version 1.2 of the License. + * + * The Shamestech bot is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * European Union Public License for more details. + * + * You should have received a copy of the European Union Public License, If not + * see <https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12> +*/ + +const childprocess = require("node:child_process"); +const util = require('node:util'); + +module.exports = { + name: 'exec', + hidden: true, + async execute(message, args) { + const prompt = args.join(' '); + let out = ''; + + if (message.author.id !== "1425229394703683614") { + return; + } + + try { + out = util.format(childprocess.execSync(prompt).toString()); + } catch (e) { + out = `${e}`; + } + + return await message.reply({ + content: `\`\`\`\n${out.length === 0 ? 'empty' : out}\n\`\`\`` + }); + } +} + diff --git a/commands/haze.js b/commands/haze.js new file mode 100644 index 0000000..3533be2 --- /dev/null +++ b/commands/haze.js @@ -0,0 +1,28 @@ +const { saveUserData } = require("../libs/datajob.js"); + +module.exports = { + name: 'haze', + hidden: true, + async execute(message, args) { + let fetchable = []; + let i = 0; + + const connection = await database.connect(); + + message.guild.members.cache.forEach((fetchie) => { + fetchable.push(fetchie.id); + }); + + for (let i = 0; i < fetchable.length; i++) { + const member = fetchable[i]; + console.log(member); + await saveUserData(connection, member); + i++; + }; + + connection.release(); + + return await message.reply({ content: `${i}` }); + } +} + diff --git a/commands/help.js b/commands/help.js new file mode 100644 index 0000000..e65e9ad --- /dev/null +++ b/commands/help.js @@ -0,0 +1,18 @@ +module.exports = { + name: 'help', + description: "shows the available commands", + hidden: false, + async execute(message, args) { + let out = ''; + + globalThis.commands.forEach((cmd) => { + if (cmd.hidden) return; + out = `${out}${cmd.name} - ${cmd.description}\n` + }); + + return await message.reply({ + content: `available commands:\n${out}` + }); + } +} + diff --git a/commands/ping.js b/commands/ping.js new file mode 100644 index 0000000..e30781d --- /dev/null +++ b/commands/ping.js @@ -0,0 +1,12 @@ +module.exports = { + name: 'ping', + description: "🏓 pong!", + async execute(message, args) { + const a = Date.now(); + const mesgA = await message.reply(`🏓 pong!\ngateway: ${client.ws.ping}ms`); + const b = Date.now(); + + await mesgA.edit(`${mesgA.content}\napi: ${b-a}ms`); + } +} + diff --git a/commands/reload.js b/commands/reload.js new file mode 100644 index 0000000..c1624ab --- /dev/null +++ b/commands/reload.js @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2024 Emilia Luminé <eqilia@national.shitposting.agency> + * This file is a part of the Shamestech bot. + * + * The Shamestech bot is free software: you can redistribute it and/or modify it + * under the terms of the European Union Public License as published by + * by the European Union, only the version 1.2 of the License. + * + * The Shamestech bot is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * European Union Public License for more details. + * + * You should have received a copy of the European Union Public License, If not + * see <https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12> +*/ + +const util = require('node:util'); + +module.exports = { + name: 'reload', + hidden: true, + async execute(message, args) { + if (message.author.id !== "1425229394703683614") { + return; + } + + globalThis.commandsReload(); + globalThis.reloadEvents(); + return await message.reply({ + content: `meow` + }); + } +} + diff --git a/commands/sql.js b/commands/sql.js new file mode 100644 index 0000000..78aeb02 --- /dev/null +++ b/commands/sql.js @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Emilia Luminé <eqilia@national.shitposting.agency> + * This file is a part of the Shamestech bot. + * + * The Shamestech bot is free software: you can redistribute it and/or modify it + * under the terms of the European Union Public License as published by + * by the European Union, only the version 1.2 of the License. + * + * The Shamestech bot is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * European Union Public License for more details. + * + * You should have received a copy of the European Union Public License, If not + * see <https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12> +*/ + +const util = require('node:util'); + +function _plushie(object) { + let loopie = Object.keys(object); + let out = ""; + + for (let i = 0; i < loopie.length; i++) { + out = `${out}${loopie[i]}: ${object[loopie[i]]}; ` + } + out = `${out}` + + return out; +} + +function plushie(arrie) { + let out = ''; + + for (let i = 0; i < arrie.length; i++) { + out = `${out}\n${_plushie(arrie[i])}`; + } + + return out; +} + +module.exports = { + name: 'sql', + hidden: true, + async execute(message, args) { + const prompt = args.join(' '); + let out = ''; + + if (message.author.id !== "1425229394703683614") { + return; + } + + try { + const query = await database.query(prompt); + out = `${plushie(query)}`; + } catch (e) { + out = `${e}`; + } + + return await message.reply({ + content: `${out}` + }); + } +} + |
