aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md45
-rw-r--r--bot/.dockerignore4
-rw-r--r--bot/Dockerfile16
-rw-r--r--bot/bun.lockbbin117052 -> 124855 bytes
-rw-r--r--bot/package.json4
-rw-r--r--bot/src/commands/avatar.js8
-rw-r--r--bot/src/commands/rm.js5
-rw-r--r--bot/src/commands/settings.js61
-rw-r--r--bot/src/commands/suggest.js66
-rw-r--r--bot/src/commands/userinfo.js18
-rw-r--r--bot/src/events/ClientReady.js4
-rw-r--r--bot/src/events/GuildBanAdd.js25
-rw-r--r--bot/src/events/GuildBanRemove.js25
-rw-r--r--bot/src/events/GuildCreate.js3
-rw-r--r--bot/src/events/GuildDelete.js14
-rw-r--r--bot/src/events/GuildMemberAdd.js26
-rw-r--r--bot/src/events/GuildMemberRemove.js25
-rw-r--r--bot/src/events/MessageCreate.js48
-rw-r--r--bot/src/events/MessageDelete.js25
-rw-r--r--bot/src/events/MessageUpdate.js27
-rw-r--r--bot/src/storage/activities.js6
-rw-r--r--bot/src/storage/consts.js3
-rw-r--r--bot/src/utils/sync.js7
23 files changed, 379 insertions, 86 deletions
diff --git a/README.md b/README.md
index 6665b03..aafe754 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,22 @@
-<div align="center">
- <h1>AleeBot</h1>
- <p>An all-in-one bot that's made from the Discord.JS api! This bot is made for discord servers.</p>
- <p>Project by Alee Productions</p>
+# AleeBot
+An all-in-one bot that's made from the Discord.JS API!
+
+Created by Andrew Lee
+
<a href="https://discordbots.org/bot/282547024547545109"><img src="https://discordbots.org/api/widget/status/282547024547545109.svg" alt="AleeBot Status Widget" />
</a><a href="https://discord.gg/EFhRDqG"><img src="https://img.shields.io/discord/243022206437687296.svg?colorB=7289DA&label=discord" alt="Discord Badge"> </a>
- </div>
-<br>
-<h1>What features does AleeBot have?</h1>
-<ul>
- <li>Customizable Prefix</li>
- <li>Moderation</li>
- <li>Fun features</li>
- <li>Quotes</li>
- <li>Economy</li>
-</ul>
-<h1>Reporting issues/pull request/request a feature</h1>
-<p>If you want to help. Do a pull request and also submit a problem/suggestion to the issues tab.</p>
-<h1>Contributors</h1>
-<p>Here's the list of people who helped me with AleeBot for discord servers</p>
-<ul>
- <li>Alee14</li>
- <li>OfficialRain (Raina)</li>
- <li>jtsshieh</li>
-</ul>
-<br>
-<b>Please note if you contribute to this please put your name here.</b>
+
+# What features does AleeBot have?
+- Quotes
+- LLM Chatbot
+- other stuff soon:tm:
+
+# Reporting issues/pull request/request a feature
+If you want to help, feel free to add a feature then submit a pull request.
+
+# Contributors
+The people who contributed to AleeBot:
+
+- Rain (Uptime command from 2.x)
+
+**If you are contributing to this project, please put your name here.**
diff --git a/bot/.dockerignore b/bot/.dockerignore
new file mode 100644
index 0000000..cde09bd
--- /dev/null
+++ b/bot/.dockerignore
@@ -0,0 +1,4 @@
+node_modules
+npm-debug.log
+.env
+database.db
diff --git a/bot/Dockerfile b/bot/Dockerfile
new file mode 100644
index 0000000..b5f30cd
--- /dev/null
+++ b/bot/Dockerfile
@@ -0,0 +1,16 @@
+FROM oven/bun:latest
+
+WORKDIR /bot
+
+#RUN apt-get update && apt-get install -y build-essential libtool autoconf automake python3
+
+COPY package.json ./
+
+COPY bun.lockb ./
+
+RUN bun run build
+
+COPY . .
+
+ENTRYPOINT ["node", "bot_discord.js"]
+
diff --git a/bot/bun.lockb b/bot/bun.lockb
index 6893805..13af9e0 100644
--- a/bot/bun.lockb
+++ b/bot/bun.lockb
Binary files differ
diff --git a/bot/package.json b/bot/package.json
index a403eb9..75534b4 100644
--- a/bot/package.json
+++ b/bot/package.json
@@ -7,6 +7,7 @@
"license": "GPL-3.0",
"scripts": {
"start": "node src/bot.js",
+ "dev": "nodemon src/bot.js",
"lint": "eslint ."
},
"dependencies": {
@@ -22,6 +23,7 @@
"@stylistic/eslint-plugin-js": "^4.1.0",
"dotenv": "^16.4.7",
"eslint": "^9.21.0",
- "globals": "^16.0.0"
+ "globals": "^16.0.0",
+ "nodemon": "^3.1.9"
}
}
diff --git a/bot/src/commands/avatar.js b/bot/src/commands/avatar.js
index 3d98608..a1db300 100644
--- a/bot/src/commands/avatar.js
+++ b/bot/src/commands/avatar.js
@@ -14,7 +14,7 @@ export default {
.setDescription('Gets the member\'s server profile picture.')),
async execute(interaction) {
- const username = interaction.options.getUser('username');
+ const username = interaction.options.getUser('username') || interaction.user;
const server = interaction.options.getBoolean('server');
if (username && server) {
@@ -24,10 +24,6 @@ export default {
return await interaction.reply(interaction.member.avatarURL({ dynamic: true, format: 'png', size: 1024 }));
}
- if (!username) {
- return await interaction.reply(interaction.user.avatarURL({ dynamic: true, format: 'png', size: 1024 }));
- } else {
- return await interaction.reply(username.avatarURL({ dynamic: true, format: 'png', size: 1024 }));
- }
+ return await interaction.reply(username.avatarURL({ dynamic: true, format: 'png', size: 1024 }));
}
};
diff --git a/bot/src/commands/rm.js b/bot/src/commands/rm.js
index ec6f647..7a1351c 100644
--- a/bot/src/commands/rm.js
+++ b/bot/src/commands/rm.js
@@ -1,4 +1,4 @@
-import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js';
+import { SlashCommandBuilder, PermissionFlagsBits, MessageFlags } from 'discord.js';
export default {
data: new SlashCommandBuilder()
@@ -12,8 +12,7 @@ export default {
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
async execute(interaction) {
const amount = interaction.options.getNumber('amount');
-
- if (amount > 100) return interaction.reply('Put a number less than 100.');
+ if (amount > 100) return interaction.reply({ content: 'Put a number less than 100.', flags: MessageFlags.Ephemeral });
return await interaction.channel.bulkDelete(amount)
.then( (messages) => interaction.reply(`Deleted ${messages.size} messages.`));
diff --git a/bot/src/commands/settings.js b/bot/src/commands/settings.js
index 5d32a67..00f7caf 100644
--- a/bot/src/commands/settings.js
+++ b/bot/src/commands/settings.js
@@ -1,4 +1,5 @@
-import { MessageFlags, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js';
+import { EmbedBuilder, MessageFlags, PermissionFlagsBits, SlashCommandBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, ComponentType } from 'discord.js';
+import { abEmbedColour } from '../storage/consts.js';
export default {
data: new SlashCommandBuilder()
@@ -14,13 +15,65 @@ export default {
.setDescription('Change settings for the user.')),
async execute(interaction) {
if (interaction.options.getSubcommand() === 'guild') {
- if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) return await interaction.reply({ content: 'You do not have the permission to manage this guild.', flags: MessageFlags.Ephemeral });
+ //if (!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) return await interaction.reply({ content: 'You do not have the permission to manage this guild.', flags: MessageFlags.Ephemeral });
- return await interaction.reply('recieved');
+ const logging = new ButtonBuilder()
+ .setCustomId('logging')
+ .setLabel('Logging')
+ .setStyle(ButtonStyle.Primary);
+
+ const suggestions = new ButtonBuilder()
+ .setCustomId('suggestions')
+ .setLabel('Suggestions')
+ .setStyle(ButtonStyle.Primary);
+
+ const row = new ActionRowBuilder()
+ .addComponents(logging, suggestions);
+
+ const guildEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Guild Settings', iconURL: interaction.client.user.avatarURL() })
+ .setDescription('Select the options')
+ .addFields(
+ { name: 'Logging', value: 'logchannel', inline: true },
+ { name: 'Suggestions', value: 'channel', inline: true },
+ { name: 'LLM Chatbot', value: 'Enabled', inline: true },
+ { name: 'Quote of the Day', value: 'logchannel', inline: true },
+ { name: 'QOTD Channel', value: 'logchannel', inline: true }
+ )
+ .setColor(abEmbedColour);
+
+ const guildSetup = await interaction.reply({ embeds: [guildEmbed], components: [row] });
+
+ const filter = (i) => i.user.id === interaction.user.id;
+
+ const guildCollector = guildSetup.createMessageComponentCollector({
+ componentType: ComponentType.Button,
+ filter,
+ time: 1000 * 120
+ });
+
+ guildCollector.on('collect', async (interaction) => {
+ if (interaction.customId === 'logging') {
+ await interaction.reply({ content: 'Clicked on logging' });
+ }
+
+ if (interaction.customId === 'suggestions') {
+ await interaction.reply({ content: 'Clicked on suggestions' });
+ }
+ });
}
if (interaction.options.getSubcommand() === 'user') {
- return;
+ const userEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot User Settings', iconURL: interaction.client.user.avatarURL() })
+ .setDescription('Select the options')
+ .addFields(
+ { name: 'Language', value: 'logchannel', inline: true },
+ { name: 'Location', value: 'channel', inline: true }
+ )
+ .setColor(abEmbedColour);
+
+ return await interaction.reply({ embeds: [userEmbed] });
}
}
};
diff --git a/bot/src/commands/suggest.js b/bot/src/commands/suggest.js
new file mode 100644
index 0000000..8f75915
--- /dev/null
+++ b/bot/src/commands/suggest.js
@@ -0,0 +1,66 @@
+import {
+ ActionRowBuilder,
+ MessageFlags,
+ ModalBuilder,
+ SlashCommandBuilder,
+ TextInputBuilder,
+ TextInputStyle,
+ EmbedBuilder
+} from 'discord.js';
+import { abEmbedColour, featureSuggestChannel } from '../storage/consts.js';
+
+export default {
+ data: new SlashCommandBuilder()
+ .setName('suggest')
+ .setDescription('Suggest something either for AleeBot or this server.')
+ .addSubcommand(subcommand =>
+ subcommand
+ .setName('feature')
+ .setDescription('Suggest a feature in AleeBot.'))
+ .addSubcommand(subcommand =>
+ subcommand
+ .setName('guild')
+ .setDescription('Suggest something for this server.')),
+ async execute(interaction) {
+ if (interaction.options.getSubcommand() === 'feature') {
+ const modal = new ModalBuilder()
+ .setCustomId(`suggest-${interaction.user.id}`)
+ .setTitle('Suggest a feature for AleeBot');
+
+ const featureText = new TextInputBuilder()
+ .setCustomId('feature')
+ .setLabel('Suggest the feature you want')
+ .setMaxLength(200)
+ .setPlaceholder('Feature')
+ .setStyle(TextInputStyle.Paragraph);
+
+ const firstActionRow = new ActionRowBuilder().addComponents(featureText);
+
+ modal.addComponents(firstActionRow);
+
+ await interaction.showModal(modal);
+
+ const filter = (interaction) => interaction.customId === `suggest-${interaction.user.id}`;
+
+ interaction.awaitModalSubmit({ filter, time: 1000 * 1200 })
+ .then(async (modalInteraction) => {
+ const feature = modalInteraction.fields.getTextInputValue('feature');
+
+ modalInteraction.client.channels.cache.get(featureSuggestChannel).send({ embeds: [
+ new EmbedBuilder()
+ .setTitle('AleeBot Feature Suggestion')
+ .setDescription(`This is an AleeBot feature suggested from ${modalInteraction.user.username}.`)
+ .addFields({ name: 'Suggestion Contents', value: feature })
+ .setColor(abEmbedColour)
+ .setFooter({ text: `Sending from ${modalInteraction.guild.name}`, iconURL: modalInteraction.guild.iconURL() })
+ ]});
+
+ return modalInteraction.reply({content: 'Your suggestion has been sent.', flags: MessageFlags.Ephemeral});
+ })
+ .catch((err) => {
+ console.error(err);
+ });
+
+ }
+ }
+};
diff --git a/bot/src/commands/userinfo.js b/bot/src/commands/userinfo.js
index b51ef0a..c079661 100644
--- a/bot/src/commands/userinfo.js
+++ b/bot/src/commands/userinfo.js
@@ -4,16 +4,22 @@ import { abEmbedColour } from '../storage/consts.js';
export default {
data: new SlashCommandBuilder()
.setName('userinfo')
- .setDescription('Information about a user.'),
+ .setDescription('Information about a user.')
+ .addUserOption(option =>
+ option
+ .setName('username')
+ .setDescription('The user to get the information of')),
async execute(interaction) {
+ const username = interaction.options.getUser('username') || interaction.user;
+ const member = interaction.guild.members.cache.get(username.id);
const userEmbed = new EmbedBuilder()
- .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() })
+ .setAuthor({ name: username.tag, iconURL: username.avatarURL() })
.setDescription('User Information')
- .setThumbnail(interaction.user.avatarURL())
+ .setThumbnail(username.avatarURL())
.addFields(
- { name: 'Names', value: `**Display Name:** ${interaction.member.displayName}\n**Username:** ${interaction.user.username}`},
- { name: 'Identity', value: `**User ID:** ${interaction.user.id}` },
- { name: 'Create and Join Times', value: `**Created At:** ${interaction.member.user.createdAt.toUTCString()}\n**Joined Guild At:** ${interaction.member.joinedAt.toUTCString()}`}
+ { name: 'Names', value: `**Display Name:** ${member.displayName}\n**Username:** ${username.username}`},
+ { name: 'Identity', value: `**User ID:** ${username.id}` },
+ { name: 'Create and Join Times', value: `**Created At:** ${username.createdAt.toUTCString()}\n**Joined Guild At:** ${member.joinedAt.toUTCString()}`}
)
.setColor(abEmbedColour);
return await interaction.reply({ embeds: [userEmbed] });
diff --git a/bot/src/events/ClientReady.js b/bot/src/events/ClientReady.js
index def2c88..af03e25 100644
--- a/bot/src/events/ClientReady.js
+++ b/bot/src/events/ClientReady.js
@@ -22,7 +22,7 @@ function botActivity(client) {
export default {
name: Events.ClientReady,
once: true,
- execute(client) {
+ async execute(client) {
console.log('[>] AleeBot is now ready!');
console.log(`[i] Logged in as ${client.user.tag}`);
console.log(`[i] Bot ID: ${client.user.id}`);
@@ -44,7 +44,7 @@ export default {
let statusChannel = client.channels.cache.get(process.env.statusChannelID);
if (!statusChannel) return console.error('The status channel does not exist! Skipping.');
- statusChannel.send({ embeds: [readyEmbed]});
+ await statusChannel.send({ embeds: [readyEmbed]});
}
setInterval(function() {
diff --git a/bot/src/events/GuildBanAdd.js b/bot/src/events/GuildBanAdd.js
new file mode 100644
index 0000000..1e52040
--- /dev/null
+++ b/bot/src/events/GuildBanAdd.js
@@ -0,0 +1,25 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.GuildBanAdd,
+ async execute(guild, user) {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: guild.id } });
+ if (!guildSetting || !guildSetting.logChannelID) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Logging', iconURL: guild.client.user.avatarURL() })
+ .setDescription(`This user got banned from ${guild.name}`)
+ .addFields(
+ { name: 'User:', value: `${user.tag}` },
+ { name: 'User ID:', value: `${user.id}`}
+ )
+ .setColor('#ff021b')
+ .setTimestamp();
+
+ let banMessage = guild.client.channels.cache.get(guildSetting.logChannelID);
+ if (!banMessage) return;
+
+ await banMessage.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/events/GuildBanRemove.js b/bot/src/events/GuildBanRemove.js
new file mode 100644
index 0000000..5b2e22c
--- /dev/null
+++ b/bot/src/events/GuildBanRemove.js
@@ -0,0 +1,25 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.GuildBanRemove,
+ async execute(guild, user) {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: guild.id } });
+ if (!guildSetting || !guildSetting.logChannelID) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Logging', iconURL: guild.client.user.avatarURL() })
+ .setDescription(`This user got unbanned from ${guild.name}`)
+ .addFields(
+ { name: 'User:', value: `${user.tag}` },
+ { name: 'User ID:', value: `${user.id}`}
+ )
+ .setColor('#ff021b')
+ .setTimestamp();
+
+ let banMessage = guild.client.channels.cache.get(guildSetting.logChannelID);
+ if (!banMessage) return;
+
+ await banMessage.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/events/GuildCreate.js b/bot/src/events/GuildCreate.js
index 565d8f2..7bcd0d1 100644
--- a/bot/src/events/GuildCreate.js
+++ b/bot/src/events/GuildCreate.js
@@ -13,12 +13,11 @@ export default {
{ name: 'Server ID:', value: `${guild.id}`, inline: true },
{ name: 'Members', value: `${guild.memberCount}`, inline: true }
)
-
.setColor(abEmbedColour)
.setFooter({ text: `We now run on ${guild.client.guilds.cache.size} guilds.` });
let statusChannel = guild.client.channels.cache.get(process.env.statusChannelID);
if (!statusChannel) return;
- statusChannel.send({ embeds: [logEmbed]});
+ await statusChannel.send({ embeds: [logEmbed]});
}
};
diff --git a/bot/src/events/GuildDelete.js b/bot/src/events/GuildDelete.js
index 50c4412..2dcba22 100644
--- a/bot/src/events/GuildDelete.js
+++ b/bot/src/events/GuildDelete.js
@@ -1,10 +1,21 @@
import { EmbedBuilder, Events } from 'discord.js';
import { abEmbedColour } from '../storage/consts.js';
+import { guildSettings } from '../models/guild-settings.js';
export default {
name: Events.GuildDelete,
async execute(guild) {
console.log(`[i] I have been removed from: ${guild.name} (${guild.id})`);
+
+ try {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: guild.id } });
+ if (guildSetting) {
+ await guildSettings.destroy({ where: { guildID: guild.id } });
+ }
+ } catch (error) {
+ console.error(`Failed to remove guild settings for ${guild.id}:`, error);
+ }
+
const logEmbed = new EmbedBuilder()
.setAuthor({ name: 'AleeBot', iconURL: guild.client.user.avatarURL() })
.setDescription('I got removed from a server...')
@@ -12,12 +23,11 @@ export default {
{ name: 'Server Name:', value: `${guild.name}`, inline: true },
{ name: 'Server ID:', value: `${guild.id}`, inline: true },
)
-
.setColor(abEmbedColour)
.setFooter({ text: `We now run on ${guild.client.guilds.cache.size} guilds.` });
let statusChannel = guild.client.channels.cache.get(process.env.statusChannelID);
if (!statusChannel) return;
- statusChannel.send({ embeds: [logEmbed]});
+ await statusChannel.send({ embeds: [logEmbed]});
}
};
diff --git a/bot/src/events/GuildMemberAdd.js b/bot/src/events/GuildMemberAdd.js
new file mode 100644
index 0000000..4b39d6d
--- /dev/null
+++ b/bot/src/events/GuildMemberAdd.js
@@ -0,0 +1,26 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.GuildMemberAdd,
+ async execute(member) {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: member.guild.id } });
+ if (!guildSetting || !guildSetting.logChannelID) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Logging', iconURL: member.client.user.avatarURL() })
+ .setDescription('A user has joined this server!')
+ .addFields(
+ { name: 'Username: ', value: `${member.user.tag}`, inline: true },
+ { name: 'User ID: ', value: `${member.id}`, inline: true },
+ { name: 'Created At: ', value: `${member.user.createdAt.toUTCString()}`}
+ )
+ .setColor('#4bff31')
+ .setTimestamp();
+
+ let guildMember = member.client.channels.cache.get(guildSetting.logChannelID);
+ if (!guildMember) return;
+
+ await guildMember.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/events/GuildMemberRemove.js b/bot/src/events/GuildMemberRemove.js
new file mode 100644
index 0000000..9bf5e9d
--- /dev/null
+++ b/bot/src/events/GuildMemberRemove.js
@@ -0,0 +1,25 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.GuildMemberRemove,
+ async execute(member) {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: member.guild.id } });
+ if (!guildSetting || !guildSetting.logChannelID) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Logging', iconURL: member.client.user.avatarURL() })
+ .setDescription('A user has joined this server!')
+ .addFields(
+ { name: 'Username: ', value: `${member.user.tag}`, inline: true },
+ { name: 'User ID: ', value: `${member.id}`, inline: true },
+ )
+ .setColor('#ec2727')
+ .setTimestamp();
+
+ let guildMember = member.client.channels.cache.get(guildSetting.logChannelID);
+ if (!guildMember) return;
+
+ await guildMember.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/events/MessageCreate.js b/bot/src/events/MessageCreate.js
index 9394a20..90b517d 100644
--- a/bot/src/events/MessageCreate.js
+++ b/bot/src/events/MessageCreate.js
@@ -12,35 +12,31 @@ export default {
const args = msg.content.slice(`<@${msg.client.user.id}>`.length).trim();
if (msg.mentions.has(msg.client.user)) {
- if (ollamaEnabled) {
- if (!args) return msg.reply('Sorry? What was that?');
-
- try {
- const response = await ollama.chat({
- model: ollamaModel,
- messages: [{ role: 'user', content: args }],
- });
-
- let content = response.message.content;
- content = content.replace(/<think>.*?<\/think>/g, '');
-
- if (content.length > 2000) {
- const chunks = content.match(/[\s\S]{1,2000}/g) || [];
- for (const chunk of chunks) {
- await msg.reply({ content: chunk });
- }
- } else {
- msg.reply({ content });
+ if (!ollamaEnabled) return msg.reply('Sorry, this feature has been turned off.');
+ if (!args) return msg.reply('Sorry? What was that?');
+
+ try {
+ const response = await ollama.chat({
+ model: ollamaModel,
+ messages: [{ role: 'user', content: args }],
+ });
+
+ let content = response.message.content;
+ content = content.replace(/<think>.*?<\/think>/g, '');
+
+ if (content.length > 2000) {
+ const chunks = content.match(/[\s\S]{1,2000}/g) || [];
+ for (const chunk of chunks) {
+ await msg.reply({ content: chunk });
}
-
- } catch (err) {
- console.error(err);
- msg.reply('Something went wrong.');
+ } else {
+ await msg.reply({ content });
}
- } else {
- return msg.reply('Sorry, this feature has been turned off.');
- }
+ } catch (err) {
+ console.error(err);
+ await msg.reply('Something went wrong.');
+ }
}
}
};
diff --git a/bot/src/events/MessageDelete.js b/bot/src/events/MessageDelete.js
new file mode 100644
index 0000000..2259d2f
--- /dev/null
+++ b/bot/src/events/MessageDelete.js
@@ -0,0 +1,25 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.MessageDelete,
+ async execute(msg) {
+ if (!msg.content) return;
+
+ const guildSetting = await guildSettings.findOne({ where: { guildID: msg.guild.id } });
+ if (!guildSetting || !guildSetting.logChannelID) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor('AleeBot Logging', msg.client.user.avatarURL())
+ .setDescription(`A message from ${msg.author.username} was deleted in <#${msg.channel.id}>`)
+ .addFields({ name: 'Deleted Message: ', value: `\`\`\`${msg.content}\`\`\`` })
+ .setColor('#ff021b')
+ .setTimestamp()
+ .setFooter(`Author ID: ${msg.author.id}`);
+
+ let deleteMessage = msg.client.channels.cache.get(guildSetting.logChannelID);
+ if (!deleteMessage) return;
+
+ await deleteMessage.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/events/MessageUpdate.js b/bot/src/events/MessageUpdate.js
new file mode 100644
index 0000000..26f6ab3
--- /dev/null
+++ b/bot/src/events/MessageUpdate.js
@@ -0,0 +1,27 @@
+import { EmbedBuilder, Events } from 'discord.js';
+import { guildSettings } from '../models/guild-settings.js';
+
+export default {
+ name: Events.MessageUpdate,
+ async execute(oldmsg, newmsg) {
+ const guildSetting = await guildSettings.findOne({ where: { guildID: oldmsg.guild.id } });
+ if (!oldmsg.guild || !guildSetting || !guildSetting.logChannelID) return;
+ if (oldmsg.content === newmsg.content) return;
+
+ const logEmbed = new EmbedBuilder()
+ .setAuthor({ name: 'AleeBot Logging', iconURL: oldmsg.client.user.avatarURL() })
+ .setDescription(`A message from ${oldmsg.author.username} was edited in <#${oldmsg.channel.id}>`)
+ .addFields(
+ { name: 'Before: ', value: `\`\`\`${oldmsg.content}\`\`\`` },
+ { name: 'After: ', value: `\`\`\`${newmsg.content}\`\`\`` }
+ )
+ .setColor('#ffff1a')
+ .setTimestamp()
+ .setFooter(`Author ID: ${oldmsg.author.id}`);
+
+ let editMessage = oldmsg.client.channels.cache.get(guildSetting.logChannelID);
+ if (!editMessage) return;
+
+ await editMessage.send({ embeds: [logEmbed]});
+ }
+};
diff --git a/bot/src/storage/activities.js b/bot/src/storage/activities.js
index ffdb468..df3bab5 100644
--- a/bot/src/storage/activities.js
+++ b/bot/src/storage/activities.js
@@ -2,8 +2,7 @@ import { version as discordVersion } from 'discord.js';
import { readFileSync } from 'node:fs';
const { version: abVersion } = JSON.parse(readFileSync('./package.json', 'utf-8'));
-
-const activities = [
+export const activities = [
{ name: `AleeBot ${abVersion}`, type: 4 },
{ name: 'Coding bytes', type: 4 },
{ name: 'Drawing shapes', type: 4 },
@@ -96,7 +95,6 @@ const activities = [
{ name: 'Debloating my ThinkPad', type: 4 },
{ name: 'Turbotastic!', type: 4 },
{ name: 'Artemis', type: 0 },
+ { name: 'The Beat 92.5 - Montreal\'s Perfect Mix', type: 2 },
{ name: `Now running on Discord.JS ${discordVersion}!`, type: 4 }
];
-
-export { activities };
diff --git a/bot/src/storage/consts.js b/bot/src/storage/consts.js
index 9172e92..905ef79 100644
--- a/bot/src/storage/consts.js
+++ b/bot/src/storage/consts.js
@@ -1,4 +1,5 @@
export const abEmbedColour = '#0066a6';
-export const readyMsg = true;
+export const readyMsg = false;
export const ollamaEnabled = false;
export const ollamaModel = 'deepseek-r1:14b';
+export const featureSuggestChannel = '427495678390960148';
diff --git a/bot/src/utils/sync.js b/bot/src/utils/sync.js
index d51a081..fbf6c2e 100644
--- a/bot/src/utils/sync.js
+++ b/bot/src/utils/sync.js
@@ -1,17 +1,16 @@
import { quote, pendingQuote } from '../models/quote.js';
import { guildSettings } from '../models/guild-settings.js';
-
export function syncDB() {
- quote.sync({alter: true}).then(() => {
+ quote.sync().then(() => {
console.log('[>] Quote database synced!');
});
- pendingQuote.sync({alter: true}).then(() => {
+ pendingQuote.sync().then(() => {
console.log('[>] Pending Quote database synced!');
});
- guildSettings.sync({alter: true}).then(() => {
+ guildSettings.sync().then(() => {
console.log('[>] Guild database synced!');
});
}