Skip to content

Commit e4a0b06

Browse files
committed
added testChannelCreation command to test for rate limits
1 parent e8acb3a commit e4a0b06

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {
2+
ChatInputCommandInteraction,
3+
MessageFlags,
4+
PermissionFlagsBits,
5+
SlashCommandBuilder,
6+
} from 'discord.js'
7+
8+
export default {
9+
data: new SlashCommandBuilder()
10+
.setName('test-channel-creation')
11+
.setDescription('try to create a blank channel')
12+
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
13+
14+
async execute(interaction: ChatInputCommandInteraction) {
15+
try {
16+
await interaction.guild!.channels.create({
17+
name: 'test-channel',
18+
type: 0,
19+
})
20+
await interaction.editReply(`channel created successfully`)
21+
} catch (err: any) {
22+
console.error(err)
23+
await interaction.editReply(`could not create channel: ${err}`)
24+
}
25+
},
26+
}

0 commit comments

Comments
 (0)