Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Dec 28, 2023
1 parent f12cbba commit acdb4da
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/webserver/banshare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ModalActionRowComponentBuilder,
TextInputBuilder,
PermissionsBitField,
TextInputStyle,
} from 'discord.js';
import { Button } from '../handlers/button.handler';

Expand All @@ -29,12 +30,10 @@ const banButton = new Button(
ephemeral: true,
});
}
console.count() // 1
const reason =
'simulated banshare: ' +
(interaction.message.embeds[0].fields[3].value ??
'no reason provided');
console.count() // 2
const modal = new ModalBuilder()
.setCustomId(`ban`)
.setTitle(`Ban <@${data.userId}>`)
Expand All @@ -43,12 +42,11 @@ const banButton = new Button(
new TextInputBuilder()
.setCustomId('banReason')
.setLabel('Ban reason')
.setStyle(TextInputStyle.Short)
.setValue(reason)
)
);
console.count() // 3
await interaction.showModal(modal);
console.count() // 4
interaction
.awaitModalSubmit({
filter: (interaction) =>
Expand Down

0 comments on commit acdb4da

Please sign in to comment.