mirror of
https://github.com/danbulant/discord.js
synced 2026-06-22 16:22:01 +00:00
Webpack build for branch master: 7f921883f4
This commit is contained in:
parent
e12625bfd6
commit
b3c65b8f51
2 changed files with 7 additions and 8 deletions
|
|
@ -13729,14 +13729,13 @@ class TextChannel extends GuildChannel {
|
|||
* .then(webhook => console.log(`Created webhook ${webhook}`))
|
||||
* .catch(console.error)
|
||||
*/
|
||||
createWebhook(name, { avatar, reason } = {}) {
|
||||
if (typeof avatar === 'string' && avatar.startsWith('data:')) {
|
||||
return this.client.api.channels[this.id].webhooks.post({ data: {
|
||||
name, avatar,
|
||||
}, reason }).then(data => new Webhook(this.client, data));
|
||||
async createWebhook(name, { avatar, reason } = {}) {
|
||||
if (typeof avatar === 'string' && !avatar.startsWith('data:')) {
|
||||
avatar = await this.client.resolver.resolveImage(avatar);
|
||||
}
|
||||
return this.client.resolver.resolveImage(avatar).then(image =>
|
||||
this.createWebhook(name, { avatar: image, reason }));
|
||||
return this.client.api.channels[this.id].webhooks.post({ data: {
|
||||
name, avatar,
|
||||
}, reason }).then(data => new Webhook(this.client, data));
|
||||
}
|
||||
|
||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||
|
|
|
|||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue