Skip to content

Commit 8e6111a

Browse files
committed
feat(add): handle missing member or role arguments in add commands
1 parent 14d1046 commit 8e6111a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/commands/slash/add.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ module.exports = class AddSlashCommand extends SlashCommand {
9595
const member = interaction.options.getMember('member', true);
9696
const role = interaction.options.getRole('role', false);
9797

98+
if (!member && !role) {
99+
return await interaction.editReply({
100+
embeds: [
101+
new ExtendedEmbedBuilder({
102+
iconURL: interaction.guild.iconURL(),
103+
text: ticket.guild.footer,
104+
})
105+
.setColor(ticket.guild.errorColour)
106+
.setTitle(getMessage('commands.slash.add.no_args.title'))
107+
.setDescription(getMessage('commands.slash.add.no_args.description')),
108+
],
109+
});
110+
}
98111

99112
if (member) {
100113

src/i18n/en-GB.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ commands:
5151
not_staff:
5252
description: Only staff members can add members to others' tickets.
5353
title: ❌ Error
54+
no_args:
55+
description: You must specify a member or a role to add to the ticket.
56+
title: ❌ Missing arguments
5457
options:
5558
member:
5659
description: The member to add to the ticket

0 commit comments

Comments
 (0)