Resolve promise for all botHasChannelPermissions()

This commit is contained in:
ayntee
2020-11-06 23:16:41 -08:00
parent 4254a37467
commit efcf567db0
3 changed files with 137 additions and 56 deletions
+5 -4
View File
@@ -20,11 +20,12 @@ export async function createWebhook(
channelID: string,
options: WebhookCreateOptions,
) {
const hasManageWebhooksPerm = await botHasChannelPermissions(
channelID,
[Permissions.MANAGE_WEBHOOKS],
);
if (
!botHasChannelPermissions(
channelID,
[Permissions.MANAGE_WEBHOOKS],
)
!hasManageWebhooksPerm
) {
throw new Error(Errors.MISSING_MANAGE_WEBHOOKS);
}