Skip to content

Conversation

@hmd-ali
Copy link
Contributor

@hmd-ali hmd-ali commented Nov 4, 2025

No description provided.

@hmd-ali hmd-ali requested a review from wiktoriavh November 4, 2025 11:38
Comment on lines +14 to +20
if (!guild) {
await interaction.reply({
content: 'This command can only be used in a server.',
flags: MessageFlags.Ephemeral,
});
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea for future: should add a custom function that does exactly this check.

@wiktoriavh wiktoriavh changed the title feat: onboarding feat: add functionality to give role to users Nov 4, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo file names should be kebab-case

Comment on lines 22 to 40
export async function addRoleToUser(
member: GuildMember,
role: Role,
interaction: ComponentInteraction
) {
const hasRole = member.roles.cache.has(role.id);
if (hasRole) {
await interaction.reply({
content: `You already have the ${role.name} role.`,
flags: MessageFlags.Ephemeral,
});
} else {
await member.roles.add(role);
await interaction.reply({
content: `You have been given the ${role.name} role!`,
flags: MessageFlags.Ephemeral,
});
}
}
Copy link
Contributor Author

@hmd-ali hmd-ali Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should handle only the the role part, i.e checking for the role we're assigning and adding it to the user. It should return a boolean that we can use to then handle what we want to do in the consuming file
in this case we would reply to the interaction.

wiktoriavh
wiktoriavh previously approved these changes Nov 12, 2025
@hmd-ali hmd-ali merged commit fcc0789 into main Nov 16, 2025
1 check passed
@hmd-ali hmd-ali deleted the feat/onboarding branch November 16, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants