Skip to content

Commit

Permalink
be readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Szedann committed Dec 28, 2023
1 parent b4b1dca commit 6151a3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/webserver/banshare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Button } from '../handlers/button.handler';
const banButton = new Button(
'ban',
async (interaction, data: { userId: string }) => {
const user = await interaction.client.users.fetch(data.userId)
if (
!(interaction.member as GuildMember)?.permissions.has(
PermissionsBitField.Flags.BanMembers
Expand All @@ -34,13 +35,14 @@ const banButton = new Button(
'no reason provided');
const modal = new ModalBuilder()
.setCustomId(`ban`)
.setTitle(`Ban <@${data.userId}>`)
.setTitle(`Ban ${user.username}`)

.addComponents(
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
new TextInputBuilder()
.setCustomId('banReason')
.setLabel('Ban reason')
.setStyle(TextInputStyle.Short)
.setStyle(TextInputStyle.Paragraph)
.setValue(reason)
)
);
Expand Down

0 comments on commit 6151a3d

Please sign in to comment.