mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Add role support to emoji creation (#1141)
* add role support to emojis * specify types
This commit is contained in:
committed by
Schuyler Cebulskie
parent
18729b25c7
commit
565c640bc6
@@ -559,9 +559,11 @@ class RESTMethods {
|
||||
.then(data => data.pruned);
|
||||
}
|
||||
|
||||
createEmoji(guild, image, name) {
|
||||
return this.rest.makeRequest('post', `${Constants.Endpoints.guildEmojis(guild.id)}`, true, { name, image })
|
||||
.then(data => this.client.actions.GuildEmojiCreate.handle(data, guild).emoji);
|
||||
createEmoji(guild, image, name, roles) {
|
||||
const data = { image, name };
|
||||
if (roles) data.roles = roles.map(r => r.id ? r.id : r);
|
||||
return this.rest.makeRequest('post', `${Constants.Endpoints.guildEmojis(guild.id)}`, true, data)
|
||||
.then(emoji => this.client.actions.GuildEmojiCreate.handle(emoji, guild).emoji);
|
||||
}
|
||||
|
||||
updateEmoji(emoji, _data) {
|
||||
|
||||
Reference in New Issue
Block a user