Skip to content

Commit 4de5921

Browse files
committed
add: Added help command and big fixes
1 parent 8f37b04 commit 4de5921

File tree

6 files changed

+742
-81
lines changed

6 files changed

+742
-81
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"torquise",
5151
"Unboost",
5252
"Unboosted",
53+
"Unmutes",
5354
"userverdata",
5455
"verificationdata",
5556
"verifybutton",

src/commands/Community/ping.js

-11
This file was deleted.

src/commands/Fun/pepeSign.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515

1616
const signText = interaction.options.getString("text").trim();
1717

18-
if (filter.words.includes(text)) return interaction.reply({ content: `${client.config.filterMessage}`, ephemeral: true});
18+
if (filter.words.includes(signText)) return interaction.reply({ content: `${client.config.filterMessage}`, ephemeral: true});
1919

2020
const maxLineWidth = 60;
2121
let lines = [];

src/commands/Help/help.js

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
const { SlashCommandBuilder, StringSelectMenuBuilder, ButtonStyle, ButtonBuilder, EmbedBuilder, ActionRowBuilder } = require('discord.js');
2+
var timeout = [];
3+
4+
module.exports = {
5+
data: new SlashCommandBuilder()
6+
.setName('help')
7+
.setDescription('Cannot find what you were wishing to? Check this out!')
8+
.addSubcommand(command => command.setName('server').setDescription('Join our official support server for Orbit!'))
9+
.addSubcommand(command => command.setName('manual').setDescription('Get some information on our bot commands and plans.')),
10+
async execute(interaction, client) {
11+
12+
const sub = interaction.options.getSubcommand();
13+
14+
switch (sub) {
15+
case 'server':
16+
17+
const button = new ActionRowBuilder()
18+
.addComponents(
19+
new ButtonBuilder()
20+
.setLabel('Support Server')
21+
.setStyle(ButtonStyle.Link)
22+
.setURL("https://discord.gg/xcMVwAVjSD")
23+
)
24+
25+
26+
const embedHelpServer = new EmbedBuilder()
27+
.setColor(client.config.embedColor)
28+
.setTitle(`${client.user.username} Help Center ${client.config.arrowEmoji}`)
29+
.setFooter({ text: `🚑 ${client.user.username}'s support server`})
30+
.setTimestamp()
31+
.setAuthor({ name: `🚑 Help Command ${client.config.devBy}`})
32+
.setDescription(`> Join our official support server for ${client.user.username}! \n> Get help, report bugs, and more!`)
33+
.setThumbnail(client.user.avatarURL())
34+
.addFields({ name: `Manual link to the Discord server:`, value: `> [SERVER](https://discord.gg/xcMVwAVjSD)`})
35+
36+
await interaction.reply({ embeds: [embedHelpServer], components: [button] })
37+
38+
break;
39+
case 'manual':
40+
41+
const helprow1 = new ActionRowBuilder()
42+
.addComponents(
43+
44+
new StringSelectMenuBuilder()
45+
.setMinValues(1)
46+
.setMaxValues(1)
47+
.setCustomId('selecthelp')
48+
.setPlaceholder('• Select a menu')
49+
.addOptions(
50+
{
51+
label: '• Help Center',
52+
description: 'Navigate to the Help Center.',
53+
value: 'helpcenter',
54+
},
55+
56+
{
57+
label: '• How to add the bot',
58+
description: `Displays how to add ${client.user.username} to your amazing server.`,
59+
value: 'howtoaddbot'
60+
},
61+
62+
{
63+
label: '• Feedback',
64+
description: `Displays how to contribute to the development of ${client.user.username} by giving feedback.`,
65+
value: 'feedback'
66+
},
67+
68+
{
69+
label: '• Commands Help',
70+
description: 'Navigate to the Commands help page.',
71+
value: 'commands',
72+
},
73+
),
74+
);
75+
76+
const embed = new EmbedBuilder()
77+
.setColor(client.config.embedColor)
78+
.setTitle(`${client.user.username} Help Center ${client.config.arrowEmoji}`)
79+
.setAuthor({ name: `🚑 Help Command ${client.config.devBy}`})
80+
.setFooter({ text: `🚑 ${client.user.username}'s help center`})
81+
.setThumbnail(client.user.avatarURL())
82+
.addFields({ name: `• Commands Help`, value: `> Get all **Commands** (**${client.commands.size}** slash & **${client.pcommands.size}** prefix) ${client.user.username} looks over!`})
83+
.addFields({ name: "• How to add Bot", value: `> Quick guide on how to add our **${client.user.username}** \n> to your server.`})
84+
.addFields({ name: "• Feedback", value: "> How to send us feedback and suggestions."})
85+
.addFields({ name: "• Exclusive Functionality", value: `> Guide on how to receive permission to \n> use exclusive functionality (${client.user.username} Beta version).`})
86+
.setTimestamp()
87+
88+
await interaction.reply({ embeds: [embed], components: [helprow1] });
89+
}
90+
}
91+
}

src/events/interactionCreate.js

-69
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,6 @@ module.exports = {
3535

3636
console.error(`${color.red}[${getTimestamp()}] [INTERACTION_CREATE] Error while executing command. \n${color.red}[${getTimestamp()}] [INTERACTION_CREATE] Please check you are using the correct execute method: "async execute(interaction, client)":`, error);
3737

38-
const channelID = `${client.config.commandErrorChannel}`;
39-
const channel = client.channels.cache.get(channelID);
40-
41-
const embed = new EmbedBuilder()
42-
.setColor("Blue")
43-
.setTimestamp()
44-
.setAuthor({ name: `${client.user.username} Command Error`, iconURL: client.user.avatarURL()})
45-
.setFooter({ text: 'Error Reported At' })
46-
.setTitle('Command Execution Error')
47-
.setDescription('An error occurred while executing the command.')
48-
.addFields(
49-
{ name: '> • Command', value: `\`\`\`${interaction.commandName}\`\`\`` },
50-
{ name: '> • Triggered By', value: `\`\`\`${interaction.user.username}#${interaction.user.discriminator}\`\`\`` },
51-
{ name: '> • Error Stack', value: `\`\`\`${error.stack}\`\`\`` },
52-
{ name: '> • Error Message', value: `\`\`\`${error.message}\`\`\`` });
53-
54-
const yellowButton = new ButtonBuilder()
55-
.setCustomId('change_color_yellow')
56-
.setLabel('Mark As Pending')
57-
.setStyle('1');
58-
59-
const greenButton = new ButtonBuilder()
60-
.setCustomId('change_color_green')
61-
.setLabel('Mark As Solved')
62-
.setStyle('3');
63-
64-
const redButton = new ButtonBuilder()
65-
.setCustomId('change_color_red')
66-
.setLabel('Mark As Unsolved')
67-
.setStyle('4');
68-
69-
const row = new ActionRowBuilder()
70-
.addComponents(yellowButton, greenButton, redButton);
71-
72-
client.on('interactionCreate', async (interaction) => {
73-
try {
74-
if (!interaction.isButton()) return;
75-
if (interaction.message.id !== message.id) return;
76-
77-
const { customId } = interaction;
78-
79-
if (customId === 'change_color_yellow') {
80-
embed.setColor('#FFFF00');
81-
await interaction.reply({
82-
content: 'This error has been marked as pending.',
83-
ephemeral: true,
84-
});
85-
} else if (customId === 'change_color_green') {
86-
embed.setColor('#00FF00');
87-
await interaction.reply({
88-
content: 'This error has been marked as solved.',
89-
ephemeral: true,
90-
});
91-
} else if (customId === 'change_color_red') {
92-
embed.setColor('#FF0000');
93-
await interaction.reply({
94-
content: 'This error has been marked as unsolved.',
95-
ephemeral: true,
96-
});
97-
}
98-
await message.edit({ embeds: [embed], components: [row] });
99-
await interaction.deferUpdate();
100-
} catch (error) {
101-
client.logs.error('[ERROR_LOGGING] Error in button interaction:', error);
102-
}
103-
});
104-
105-
const message = await channel.send({ embeds: [embed], components: [row] });
106-
10738
const errorEmbed = new EmbedBuilder()
10839
.setColor("Red")
10940
.setDescription(`There was an error while executing this command!\n\`\`\`${error}\`\`\``)

0 commit comments

Comments
 (0)