Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
NoSkill33 committed Jan 29, 2025
1 parent 5821aaf commit 3dbf8ff
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/commands/dev/botStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { SlashCommandBuilder, version } = require('discord.js');
const os = require('os');
const { execSync } = require('child_process');
const createEmbed = require('../../utils/embedBuilder');
//const config = require('../../../config/config.json');
const packageInfo = require('../../../package.json');
const si = require('systeminformation');

Expand Down Expand Up @@ -53,7 +52,6 @@ module.exports = {
`• CPU: ${(await si.cpu()).manufacturer || 'N/A'} ${(await si.cpu()).brand}\n` +
`• Uptime: ${formatUptime(os.uptime())}\n` +
`• Avaiable Memory: ${(os.totalmem() / (1024 * 1024)).toFixed(2)}MB\n` +
//`• Memory Usage: ${(process.memoryUsage().rss / (1024 * 1024)).toFixed(2)} MB\n` +
`• Memory Usage: ${getMemoryUsage().usedMemMB.toFixed(
2,
)}MB (${getMemoryUsage().usedMemPercent.toFixed(2)}%)\n` +
Expand All @@ -67,7 +65,6 @@ module.exports = {
`• Bot Version: ${packageInfo.version}\n` +
`• Discord.js Version: ${version}\n` +
`• Client Ping: ${(await interaction.fetchReply()).createdTimestamp - interaction.createdTimestamp}ms\n` +
//`• Websocket Ping: ${client.ws.ping}ms\n` +
`• Guild Count: ${client.guilds.cache.size}\n` +
`• User Count: ${totalUsers}\n` +
`• Channel Count: ${client.channels.cache.size}\n\`\`\``,
Expand Down
2 changes: 0 additions & 2 deletions src/commands/dev/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
titleText: '**Restart**',
};

// create embed
embed = createEmbed.createEmbed(embedOptions);

await interaction.editReply({
Expand All @@ -46,7 +45,6 @@ module.exports = {
titleText: '**Restart**',
};

// create embed
embed2 = createEmbed.createEmbed(embedOptions2);

await interaction.followUp({
Expand Down
1 change: 0 additions & 1 deletion src/commands/utilities/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const {
ButtonStyle,
} = require('discord.js');
const createEmbed = require('../../utils/embedBuilder');
//const config = require('../../../config/config.json');

module.exports = {
data: new SlashCommandBuilder()
Expand Down
6 changes: 3 additions & 3 deletions src/utils/componentHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function loadComponents(client) {
});
}

// @note: synchronize the interaction with the corresponding component
//@note: synchronize the interaction with the corresponding component
async function synchronizeComponent(interaction, client) {
if (
!interaction.isButton() &&
Expand All @@ -51,7 +51,7 @@ async function synchronizeComponent(interaction, client) {

let component;
if (interaction.isButton()) {
// @note: extract the base part of the customId (e.g., 'toggle_' or 'deny_')
//@note: extract the base part (e.g., 'toggle_' or 'deny_')
const baseId = interaction.customId.split('_')[0] + '_';
component =
client.buttons.get(interaction.customId) || client.buttons.get(baseId);
Expand All @@ -69,7 +69,7 @@ async function synchronizeComponent(interaction, client) {
}

try {
// @note: execute the matched component
//@note: execute the matched component
await component.execute(interaction, client);
} catch (error) {
console.error('Error executing component:', error);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/embedBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function createEmbed({

//@optional: set title if provided
if (titleText) {
embed.setTitle(/*'**' + config.bot_name2 + '** - ' + */titleText);
embed.setTitle(titleText);
}

//@optional: Set description if provided and non-empty
Expand Down

0 comments on commit 3dbf8ff

Please sign in to comment.