aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-03-30 17:39:45 -0400
committerAndrew Lee <andrew@alee14.me>2025-03-30 17:39:45 -0400
commit48d906bfd8fade21c13e73ea703ecb699a19c533 (patch)
tree8551fd01f1cc146d1f2d5d3afaa75b257e833060
parentd37cc8c56cbf8c9ffe7023c671abe0d579ea875d (diff)
downloadAleeBot-48d906bfd8fade21c13e73ea703ecb699a19c533.tar.gz
AleeBot-48d906bfd8fade21c13e73ea703ecb699a19c533.tar.bz2
AleeBot-48d906bfd8fade21c13e73ea703ecb699a19c533.zip
More eslint styling
-rw-r--r--bot/eslint.config.js1
-rw-r--r--bot/src/api/routes/quotes.js6
-rw-r--r--bot/src/commands/quote.js2
-rw-r--r--bot/src/commands/serverinfo.js4
-rw-r--r--bot/src/commands/suggest.js6
-rw-r--r--bot/src/commands/userinfo.js4
-rw-r--r--bot/src/events/ClientReady.js10
-rw-r--r--bot/src/events/GuildBanAdd.js2
-rw-r--r--bot/src/events/GuildBanRemove.js2
-rw-r--r--bot/src/events/GuildMemberAdd.js2
-rw-r--r--bot/src/events/MessageDelete.js2
-rw-r--r--bot/src/plugins/qotd.js10
-rw-r--r--bot/src/storage/activities.js2
13 files changed, 27 insertions, 26 deletions
diff --git a/bot/eslint.config.js b/bot/eslint.config.js
index e9901f8..3e15c48 100644
--- a/bot/eslint.config.js
+++ b/bot/eslint.config.js
@@ -21,6 +21,7 @@ export default [
'@stylistic/js/semi-style': ['error', 'last'],
'@stylistic/js/semi': ['error', 'always'],
'@stylistic/js/indent': ['error', 4],
+ 'object-curly-spacing': ['error', 'always'],
'require-await': 'error'
}
},
diff --git a/bot/src/api/routes/quotes.js b/bot/src/api/routes/quotes.js
index af61174..4c584a9 100644
--- a/bot/src/api/routes/quotes.js
+++ b/bot/src/api/routes/quotes.js
@@ -45,10 +45,10 @@ export function quoteRouter(client) {
submitter: quote.submitterID
});
- await pendingQuote.destroy({ where: {id} });
+ await pendingQuote.destroy({ where: { id } });
res.status(200).send({ message: 'Quote approved' });
} else {
- res.status(404).send({ message: 'Quote not found '});
+ res.status(404).send({ message: 'Quote not found ' });
}
} catch (error) {
console.error('Error approving quote:', error);
@@ -61,7 +61,7 @@ export function quoteRouter(client) {
try {
const quote = await pendingQuote.findByPk(id);
if (quote) {
- await pendingQuote.destroy({ where: {id} });
+ await pendingQuote.destroy({ where: { id } });
if (!req.body.silent) {
client.users.fetch(quote.submitterID).then((user) => {
diff --git a/bot/src/commands/quote.js b/bot/src/commands/quote.js
index 3bc71d3..79f05de 100644
--- a/bot/src/commands/quote.js
+++ b/bot/src/commands/quote.js
@@ -152,7 +152,7 @@ export default {
return await interaction.reply({ embeds: [quoteEmbed] });
} else {
- return await interaction.reply({ content: 'Cannot find quote. Specify the correct quote ID.', flags: MessageFlags.Ephemeral});
+ return await interaction.reply({ content: 'Cannot find quote. Specify the correct quote ID.', flags: MessageFlags.Ephemeral });
}
}
}
diff --git a/bot/src/commands/serverinfo.js b/bot/src/commands/serverinfo.js
index 7ebf6ea..29d3f3e 100644
--- a/bot/src/commands/serverinfo.js
+++ b/bot/src/commands/serverinfo.js
@@ -20,8 +20,8 @@ export default {
.setDescription('Server Information')
.setThumbnail(interaction.guild.iconURL())
.addFields(
- { name: 'Main Information', value: `**Server Name:** ${interaction.guild.name}\n**Server ID:** ${interaction.guild.id}\n**Server Owner:** ${guildOwner.user.username}`},
- { name: 'Join Dates', value: `**Created At:** ${interaction.guild.createdAt.toUTCString()}\n**AleeBot Joined:** ${interaction.guild.joinedAt.toUTCString()}`},
+ { name: 'Main Information', value: `**Server Name:** ${interaction.guild.name}\n**Server ID:** ${interaction.guild.id}\n**Server Owner:** ${guildOwner.user.username}` },
+ { name: 'Join Dates', value: `**Created At:** ${interaction.guild.createdAt.toUTCString()}\n**AleeBot Joined:** ${interaction.guild.joinedAt.toUTCString()}` },
{ name: 'Total Channels (without threads)', value: interaction.guild.channels.channelCountWithoutThreads.toString() },
// { name: 'Channels', value: listedChannels.join(' ') },
{ name: 'Total Members (with bots)', value: interaction.guild.memberCount.toString() },
diff --git a/bot/src/commands/suggest.js b/bot/src/commands/suggest.js
index 7c4b75a..914284c 100644
--- a/bot/src/commands/suggest.js
+++ b/bot/src/commands/suggest.js
@@ -54,7 +54,7 @@ export default {
.addFields({ name: 'Suggestion Content', value: feature })
.setColor(abEmbedColour)
.setFooter({ text: `Sending from ${modalInteraction.guild.name}`, iconURL: modalInteraction.guild.iconURL() })
- ]});
+ ] });
return await modalInteraction.reply({ content: 'Your suggestion has been sent.', flags: MessageFlags.Ephemeral });
})
@@ -101,9 +101,9 @@ export default {
.setDescription(`This is a suggestion from ${interaction.user.username}.`)
.addFields({ name: 'Suggestion Content', value: feature })
.setColor(abEmbedColour)
- ]});
+ ] });
- return await modalInteraction.reply({content: 'Your suggestion has been sent.', flags: MessageFlags.Ephemeral});
+ return await 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 8119a16..311da12 100644
--- a/bot/src/commands/userinfo.js
+++ b/bot/src/commands/userinfo.js
@@ -18,9 +18,9 @@ export default {
.setDescription('User Information')
.setThumbnail(user.avatarURL())
.addFields(
- { name: 'Names', value: `**Display Name:** ${member.displayName}\n**Username:** ${user.username}`},
+ { name: 'Names', value: `**Display Name:** ${member.displayName}\n**Username:** ${user.username}` },
{ name: 'Identity', value: `**User ID:** ${user.id}` },
- { name: 'Create and Join Times', value: `**Created At:** ${user.createdAt.toUTCString()}\n**Joined Guild At:** ${member.joinedAt.toUTCString()}`}
+ { name: 'Create and Join Times', value: `**Created At:** ${user.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 b97af1f..194159b 100644
--- a/bot/src/events/ClientReady.js
+++ b/bot/src/events/ClientReady.js
@@ -52,18 +52,18 @@ export default {
if (process.env.NODE_ENV !== 'development') {
const readyEmbed = new EmbedBuilder()
- .setAuthor({name: 'AleeBot Status', iconURL: client.user.avatarURL()})
+ .setAuthor({ name: 'AleeBot Status', iconURL: client.user.avatarURL() })
.setDescription('AleeBot has started')
.addFields(
- {name: 'Version', value: `${abVersion}`, inline: true},
- {name: 'Node.JS Version', value: `${process.versions.node}`, inline: true},
- {name: 'Discord.JS Version', value: `${version}`, inline: true}
+ { name: 'Version', value: `${abVersion}`, inline: true },
+ { name: 'Node.JS Version', value: `${process.versions.node}`, inline: true },
+ { name: 'Discord.JS Version', value: `${version}`, inline: true }
)
.setColor(abEmbedColour);
let statusChannel = client.channels.cache.get(process.env.STATUS_CHANNEL_ID);
if (!statusChannel) return console.error('The status channel does not exist! Skipping.');
- await 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
index 4e876a9..1ea9df5 100644
--- a/bot/src/events/GuildBanAdd.js
+++ b/bot/src/events/GuildBanAdd.js
@@ -20,7 +20,7 @@ export default {
.setDescription('This user got banned from this server.')
.addFields(
{ name: 'User:', value: `${ban.user.username}` },
- { name: 'User ID:', value: `${ban.user.id}`},
+ { name: 'User ID:', value: `${ban.user.id}` },
{ name: 'Reason:', value: `${banEntry.reason || 'No reason provided'}` }
)
.setColor('#ff021b')
diff --git a/bot/src/events/GuildBanRemove.js b/bot/src/events/GuildBanRemove.js
index b1d2e74..976145d 100644
--- a/bot/src/events/GuildBanRemove.js
+++ b/bot/src/events/GuildBanRemove.js
@@ -13,7 +13,7 @@ export default {
.setDescription('This user got unbanned from this server.')
.addFields(
{ name: 'User:', value: `${ban.user.username}` },
- { name: 'User ID:', value: `${ban.user.id}`}
+ { name: 'User ID:', value: `${ban.user.id}` }
)
.setColor('#ff021b')
.setTimestamp();
diff --git a/bot/src/events/GuildMemberAdd.js b/bot/src/events/GuildMemberAdd.js
index 760b785..9c3df76 100644
--- a/bot/src/events/GuildMemberAdd.js
+++ b/bot/src/events/GuildMemberAdd.js
@@ -15,7 +15,7 @@ export default {
.addFields(
{ name: 'Username: ', value: `${member.user}`, inline: true },
{ name: 'User ID: ', value: `${member.id}`, inline: true },
- { name: 'Created At: ', value: `${member.user.createdAt.toUTCString()}`}
+ { name: 'Created At: ', value: `${member.user.createdAt.toUTCString()}` }
)
.setColor('#4bff31')
.setTimestamp();
diff --git a/bot/src/events/MessageDelete.js b/bot/src/events/MessageDelete.js
index 7c1af1c..d318105 100644
--- a/bot/src/events/MessageDelete.js
+++ b/bot/src/events/MessageDelete.js
@@ -1,4 +1,4 @@
-import {AttachmentBuilder, EmbedBuilder, Events} from 'discord.js';
+import { AttachmentBuilder, EmbedBuilder, Events } from 'discord.js';
import { guildSettings } from '../db/models/guild-settings.js';
export default {
diff --git a/bot/src/plugins/qotd.js b/bot/src/plugins/qotd.js
index 73882be..33d3bb2 100644
--- a/bot/src/plugins/qotd.js
+++ b/bot/src/plugins/qotd.js
@@ -15,24 +15,24 @@ export function QuoteOfTheDay(client) {
.filter(guild => guild.qotdChannelID)
.map(guild => guild.qotdChannelID);
- const quoteList = await quoteDB.findAll({attributes: ['id']});
+ const quoteList = await quoteDB.findAll({ attributes: ['id'] });
const random = crypto.getRandomValues(new Uint32Array(1));
let quoteID = quoteList[random[0] % quoteList.length].id;
- const quote = await quoteDB.findOne({where: {id: quoteID}});
+ 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})
+ .setAuthor({ name: quote.author, iconURL: quote.authorImage })
.setDescription(quote.quote)
.setColor(abEmbedColour)
- .setFooter({text: `- ${quote.year}\nSubmitted by ${userSubmitter.username}`});
+ .setFooter({ text: `- ${quote.year}\nSubmitted by ${userSubmitter.username}` });
for (const channel of channels) {
let qotdChannel = client.channels.cache.get(channel);
- await qotdChannel.send({ content: 'New Quote of the Day!', embeds: [quoteEmbed ]});
+ await qotdChannel.send({ content: 'New Quote of the Day!', embeds: [quoteEmbed ] });
}
});
}
diff --git a/bot/src/storage/activities.js b/bot/src/storage/activities.js
index 9394e15..60e88a0 100644
--- a/bot/src/storage/activities.js
+++ b/bot/src/storage/activities.js
@@ -23,7 +23,7 @@ export const activities = [
{ name: 'Dag dag!', type: 4 },
{ name: 'Developed by Andrew Lee', type: 4 },
{ name: 'When will 2.13 release?', type: 4 },
- { name: 'Alert Irruption !!!', type: 4},
+ { name: 'Alert Irruption !!!', type: 4 },
{ name: 'when', type: 4 },
{ name: 'Frying Shrimpbot', type: 4 },
{ name: 'RADIATION BABY', type: 4 },