mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-11 19:23:06 +00:00
chore: improve safety of commands
This commit is contained in:
parent
83bbf7b098
commit
7c2a99daf5
28 changed files with 329 additions and 235 deletions
|
@ -7,8 +7,10 @@ const command: Command = {
|
|||
.setName('server')
|
||||
.setDescription('Provides information about the server.'),
|
||||
execute: async (interaction) => {
|
||||
if (!interaction.isChatInputCommand() || !interaction.guild) return;
|
||||
|
||||
await interaction.reply(
|
||||
`The server **${interaction!.guild!.name}** has **${interaction!.guild!.memberCount}** members and was created on **${interaction!.guild!.createdAt}**. It is **${new Date().getFullYear() - interaction!.guild!.createdAt.getFullYear()!}** years old.`,
|
||||
`The server **${interaction.guild.name}** has **${interaction.guild.memberCount}** members and was created on **${interaction.guild.createdAt}**. It is **${new Date().getFullYear() - interaction.guild.createdAt.getFullYear()}** years old.`,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue