mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor: replace "return await" (#354)
This commit is contained in:
@@ -303,11 +303,10 @@ export async function getChannelWebhooks(channelID: string) {
|
|||||||
) {
|
) {
|
||||||
throw new Error(Errors.MISSING_MANAGE_WEBHOOKS);
|
throw new Error(Errors.MISSING_MANAGE_WEBHOOKS);
|
||||||
}
|
}
|
||||||
return await RequestManager.get(
|
|
||||||
|
return RequestManager.get(
|
||||||
endpoints.CHANNEL_WEBHOOKS(channelID),
|
endpoints.CHANNEL_WEBHOOKS(channelID),
|
||||||
) as Promise<
|
) as Promise<WebhookPayload[]>;
|
||||||
WebhookPayload[]
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EditChannelRequest {
|
interface EditChannelRequest {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export async function createGuildChannel(
|
|||||||
type: options?.type || ChannelTypes.GUILD_TEXT,
|
type: options?.type || ChannelTypes.GUILD_TEXT,
|
||||||
})) as ChannelCreatePayload;
|
})) as ChannelCreatePayload;
|
||||||
|
|
||||||
return await structures.createChannel(result);
|
return structures.createChannel(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Delete a channel in your server. Bot needs MANAGE_CHANNEL permissions in the server. */
|
/** Delete a channel in your server. Bot needs MANAGE_CHANNEL permissions in the server. */
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ export async function hasChannelPermissions(
|
|||||||
if (permissions.every((perm) => allowedPermissions.has(perm))) return true;
|
if (permissions.every((perm) => allowedPermissions.has(perm))) return true;
|
||||||
|
|
||||||
// Some permission was not explicitly allowed so we default to checking role perms directly
|
// Some permission was not explicitly allowed so we default to checking role perms directly
|
||||||
return await memberIDHasPermission(memberID, guild.id, permissions);
|
return memberIDHasPermission(memberID, guild.id, permissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This function converts a bitwise string to permission strings */
|
/** This function converts a bitwise string to permission strings */
|
||||||
|
|||||||
Reference in New Issue
Block a user