(fields: EditWebhookFields)
| 48 | } |
| 49 | |
| 50 | edit(fields: EditWebhookFields) { |
| 51 | const currentGuildId = getCurrentGuildId() |
| 52 | if (this.guildId !== currentGuildId) { |
| 53 | if (!this.token) { |
| 54 | throw new Error("Can't edit webhooks for other guilds if no token is provided") |
| 55 | } |
| 56 | |
| 57 | return editWebhookWithToken(this.id, this.token, fields) |
| 58 | } else { |
| 59 | return editWebhook(this.id, fields) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | delete() { |
| 64 | const currentGuildId = getCurrentGuildId() |
no test coverage detected