mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Added guild.createChannel(name, type)
This commit is contained in:
@@ -72,6 +72,19 @@ class RESTMethods{
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
CreateChannel(guild, channelName, channelType) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.makeRequest('post', Constants.Endpoints.GUILD_CHANNELS(guild.id), true, {
|
||||
name: channelName,
|
||||
type: channelType,
|
||||
})
|
||||
.then(data => {
|
||||
resolve(this.rest.client.actions.ChannelCreate.handle(data).channel);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RESTMethods;
|
||||
|
||||
Reference in New Issue
Block a user