diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-20 01:47:19 -0400 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-20 01:47:19 -0400 |
| commit | c06c0be2e7520ceaf5284472d0d99c7417aceb7a (patch) | |
| tree | 22cd41cc51c0cdd345bf2133c6ed85772b6d306f /bot/src/plugins | |
| parent | bdeef58376711e9a49c3b6f26aaf3fc65fa6200b (diff) | |
| download | AleeBot-c06c0be2e7520ceaf5284472d0d99c7417aceb7a.tar.gz AleeBot-c06c0be2e7520ceaf5284472d0d99c7417aceb7a.tar.bz2 AleeBot-c06c0be2e7520ceaf5284472d0d99c7417aceb7a.zip | |
New command; New logging feature; QOTD (WIP)
Diffstat (limited to 'bot/src/plugins')
| -rw-r--r-- | bot/src/plugins/chatbot.js | 1 | ||||
| -rw-r--r-- | bot/src/plugins/eval.js | 3 | ||||
| -rw-r--r-- | bot/src/plugins/qotd.js | 28 |
3 files changed, 32 insertions, 0 deletions
diff --git a/bot/src/plugins/chatbot.js b/bot/src/plugins/chatbot.js new file mode 100644 index 0000000..f4095a2 --- /dev/null +++ b/bot/src/plugins/chatbot.js @@ -0,0 +1 @@ +// add llm feature here diff --git a/bot/src/plugins/eval.js b/bot/src/plugins/eval.js new file mode 100644 index 0000000..47b3988 --- /dev/null +++ b/bot/src/plugins/eval.js @@ -0,0 +1,3 @@ +export async function evaluation() { + +} diff --git a/bot/src/plugins/qotd.js b/bot/src/plugins/qotd.js new file mode 100644 index 0000000..a6ea73e --- /dev/null +++ b/bot/src/plugins/qotd.js @@ -0,0 +1,28 @@ +import { EmbedBuilder } from 'discord.js'; +import { abEmbedColour } from '../storage/consts.js'; +import { quote as quoteDB } from '../models/quote.js'; + +export async function QuoteOfTheDay(client) { + const channels = ['606602551634296968', '341669022179262464']; + const quoteList = await quoteDB.findAll({ attributes: ['id'] }); + const random = crypto.getRandomValues(new Uint32Array(1)); + + if (quoteList.length === 0) return console.log('[i] No quotes are currently in the database.'); + + let quoteID = quoteList[random[0] % quoteList.length].id; + + const quote = await quoteDB.findOne({ where: { id: quoteID } }); + + let userSubmitter = await client.users.fetch(quote.submitter); + + const quoteEmbed = new EmbedBuilder() + .setAuthor({ name: quote.author, iconURL: quote.authorImage }) + .setDescription(quote.quote) + .setColor(abEmbedColour) + .setFooter({ text: `- ${quote.year}\nSubmitted by ${userSubmitter.username}` }); + + for (const channel of channels) { + let qotdChannel = client.channels.cache.get(channel); + await qotdChannel.send({ embeds: [quoteEmbed] }); + } +} |
