diff --git a/source/Discord/Commands/Groups.ts b/source/Discord/Commands/Groups.ts index e761ccc..25be58d 100644 --- a/source/Discord/Commands/Groups.ts +++ b/source/Discord/Commands/Groups.ts @@ -108,7 +108,18 @@ export class GroupCommand implements Command, ChatInteractionCommand, Autocomple private create(interaction: ChatInputCommandInteraction): void { const name = interaction.options.getString("name") ?? ''; - const role = interaction.options.getRole("role"); + const role = interaction.options.getRole("role", true); + + if (role.id === interaction.guildId) { + throw new UserError("Creating a group for everyone is not permitted!"); + } + + if (!interaction.member?.roles.cache.has(role?.id) ?? true) { + throw new UserError( + "You are not part of the role, you try to create a group for.", + "Add yourself to the group or ask your admin to do so." + ); + } const group: GroupModel = { id: -1,