Skip to content

Commit

Permalink
Merge formatting
Browse files Browse the repository at this point in the history
Merge formatting into main
  • Loading branch information
github-actions[bot] authored Aug 21, 2023
2 parents 2c458f0 + 05edcd2 commit 9455ec8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
33 changes: 18 additions & 15 deletions src/commands/ping.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, SlashCommandBuilder } = require('discord.js');
const {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
SlashCommandBuilder,
} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
Expand All @@ -10,22 +15,20 @@ module.exports = {

.setColor("#5865f4")
.setTitle(":ping_pong: Pong!")
.addFields(
{
name: "**Api** latency",
value: `> **${Math.round(client.ws.ping)}**ms`,
inline: false,
}
)
.addFields({
name: "**Api** latency",
value: `> **${Math.round(client.ws.ping)}**ms`,
inline: false,
})
.setTimestamp();

const button = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setLabel('Discord Ping')
.setStyle(5)
.setEmoji('💻')
.setURL('https://discordstatus.com/'),
);
const button = new ActionRowBuilder().addComponents(
new ButtonBuilder()
.setLabel("Discord Ping")
.setStyle(5)
.setEmoji("💻")
.setURL("https://discordstatus.com/"),
);

await interaction.reply({
embeds: [pingembed],
Expand Down
21 changes: 16 additions & 5 deletions src/events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { ChalkAdvanced } = require("chalk-advanced");

module.exports = async (client) => {
const commandFiles = readdirSync("./src/commands/").filter((file) =>
file.endsWith(".js")
file.endsWith(".js"),
);

const commands = [];
Expand All @@ -27,17 +27,28 @@ module.exports = async (client) => {
await rest.put(Routes.applicationCommands(client.user.id), {
body: commands,
});
console.log(`${ChalkAdvanced.white("Boilerplate Bot")} ${ChalkAdvanced.gray(">")} ${ChalkAdvanced.green("Successfully registered commands globally")}`);

console.log(
`${ChalkAdvanced.white("Boilerplate Bot")} ${ChalkAdvanced.gray(
">",
)} ${ChalkAdvanced.green(
"Successfully registered commands globally",
)}`,
);
} else {
await rest.put(
Routes.applicationGuildCommands(client.user.id, process.env.GUILD_ID),
{
body: commands,
}
},
);

console.log(`${ChalkAdvanced.white("Boilerplate Bot")} ${ChalkAdvanced.gray(">")} ${ChalkAdvanced.green("Successfully registered commands locally")}`);
console.log(
`${ChalkAdvanced.white("Boilerplate Bot")} ${ChalkAdvanced.gray(
">",
)} ${ChalkAdvanced.green(
"Successfully registered commands locally",
)}`,
);
}
} catch (err) {
if (err) console.error(err);
Expand Down

0 comments on commit 9455ec8

Please sign in to comment.