i have not committed in years
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index 43a5fd7..ab23bf7 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -1,5 +1,6 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -7,8 +8,27 @@
.setName("ping")
.setDescription("Gets the bot's ping time")
-const callback = (interaction: CommandInteraction) => {
- interaction.reply("Command incomplete [nucleus/ping]");
+const callback = async (interaction: CommandInteraction) => {
+ // WEBSOCKET | Nucleus -> Discord
+ // EDITING | Nucleus -> discord -> nucleus | edit time / 2
+ let initial = new Date().getTime();
+ await interaction.reply({embeds: [new generateEmojiEmbed()
+ .setTitle("Ping")
+ .setDescription(`Checking ping times...`)
+ .setEmoji("NUCLEUS.LOADING")
+ .setStatus("Danger")
+ ], ephemeral: true});
+ let ping = new Date().getTime() - initial;
+ interaction.editReply({embeds: [new generateEmojiEmbed()
+ .setTitle("Ping")
+ .setDescription(
+ `**Ping:** \`${ping}ms\`\n` +
+ `**To Discord:** \`${interaction.client.ws.ping}ms\`\n` +
+ `**From Expected:** \`±${Math.abs((ping / 2) - interaction.client.ws.ping)}ms\``
+ )
+ .setEmoji("CHANNEL.SLOWMODE.OFF")
+ .setStatus("Danger")
+ ]})
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index 7f468fa..c12b950 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -1,14 +1,26 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("stats")
- .setDescription("Gets the bot's statse")
+ .setDescription("Gets the bot's stats")
const callback = (interaction: CommandInteraction) => {
- interaction.reply("Command incomplete [nucleus/stats]");
+ interaction.reply({
+ embeds: [new generateEmojiEmbed()
+ .setTitle("Stats")
+ .setDescription(
+ `**Servers:** ${interaction.client.guilds.cache.size}\n` +
+ `**Ping:** \`${interaction.client.ws.ping*2}ms\``
+ )
+ .setStatus("Success")
+ .setEmoji("GUILD.GRAPHS")
+
+ ], ephemeral: true
+ });
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index e76d49f..36338dc 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -1,14 +1,50 @@
-import { CommandInteraction } from "discord.js";
+import Discord, { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
+import confirmationMessage from "../../utils/confirmationMessage.js";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("suggest")
.setDescription("Sends a suggestion to the developers")
+ .addStringOption(option => option.setName("suggestion").setDescription("The suggestion to send").setRequired(true))
-const callback = (interaction: CommandInteraction) => {
- interaction.reply("Command incomplete [nucleus/suggest]");
+const callback = async (interaction: CommandInteraction) => {
+ // @ts-ignore
+ const { renderUser } = interaction.client.logger
+ let suggestion = interaction.options.getString("suggestion");
+ let confirmation = await new confirmationMessage(interaction)
+ .setEmoji("ICONS.OPP.ADD")
+ .setTitle("Suggest")
+ .setDescription(`**Suggestion:**\n> ${suggestion}\n`
+ + `Your username and ID will also be sent with your suggestion.\n\nAre you sure you want to send this suggestion?`)
+ .setColor("Danger")
+ .send()
+ if (confirmation.success) {
+ await (interaction.client.channels.cache.get('955161206459600976') as Discord.TextChannel).send({
+ embeds: [
+ new generateEmojiEmbed()
+ .setTitle(`Suggestion`)
+ .setDescription(`**From:** ${renderUser(interaction.member.user)}\n**Suggestion:**\n> ${suggestion}`)
+ .setStatus("Danger")
+ .setEmoji("NUCLEUS.LOGO")
+ ]
+ })
+ await interaction.editReply({embeds: [new generateEmojiEmbed()
+ .setEmoji("ICONS.ADD")
+ .setTitle(`Suggest`)
+ .setDescription("Your suggestion was sent successfully")
+ .setStatus("Success")
+ ], components: []})
+ } else {
+ await interaction.editReply({embeds: [new generateEmojiEmbed()
+ .setEmoji("ICONS.OPP.ADD")
+ .setTitle(`Suggest`)
+ .setDescription("No changes were made")
+ .setStatus("Danger")
+ ], components: []})
+ }
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {