Skip to content
This repository was archived by the owner on Dec 24, 2021. It is now read-only.

Commit 4cd61b7

Browse files
committed
Add test command to create channels
1 parent bfcac75 commit 4cd61b7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/commands/util/create-channel.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const commando = require('../../../src');
2+
3+
module.exports = class CreateChannelCommand extends commando.Command {
4+
constructor(client) {
5+
super(client, {
6+
name: 'create-channel',
7+
aliases: ['create-chan', 'add-channel', 'add-chan'],
8+
group: 'util',
9+
memberName: 'create-channel',
10+
description: 'Creates a channel.',
11+
examples: ['create-channel Test channel'],
12+
guildOnly: true,
13+
clientPermissions: ['MANAGE_CHANNELS'],
14+
userPermissions: ['MANAGE_CHANNELS'],
15+
16+
args: [
17+
{
18+
key: 'name',
19+
label: 'channel name',
20+
prompt: 'What would you like the channel to be called?',
21+
type: 'string'
22+
}
23+
]
24+
});
25+
}
26+
27+
async run(msg, { name }) {
28+
const channel = await msg.guild.channels.create(name);
29+
return msg.reply(`Created ${channel} (${channel.id})`);
30+
}
31+
};

0 commit comments

Comments
 (0)