mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
deno fmt
This commit is contained in:
@@ -11,12 +11,12 @@ export async function getChannelWebhooks(channelId: string) {
|
||||
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.CHANNEL_WEBHOOKS(channelId)
|
||||
endpoints.CHANNEL_WEBHOOKS(channelId),
|
||||
)) as DiscordWebhook[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((webhook) => snakeKeysToCamelCase<Webhook>(webhook))
|
||||
.map((webhook) => [webhook.id, webhook])
|
||||
.map((webhook) => [webhook.id, webhook]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { endpoints } from "../../util/constants.ts";
|
||||
export async function getChannels(guildId: string, addToCache = true) {
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_CHANNELS(guildId)
|
||||
endpoints.GUILD_CHANNELS(guildId),
|
||||
)) as DiscordChannel[];
|
||||
|
||||
return new Collection(
|
||||
@@ -21,19 +21,19 @@ export async function getChannels(guildId: string, addToCache = true) {
|
||||
result.map(async (res) => {
|
||||
const discordenoChannel = await structures.createDiscordenoChannel(
|
||||
res,
|
||||
guildId
|
||||
guildId,
|
||||
);
|
||||
if (addToCache) {
|
||||
await cacheHandlers.set(
|
||||
"channels",
|
||||
discordenoChannel.id,
|
||||
discordenoChannel
|
||||
discordenoChannel,
|
||||
);
|
||||
}
|
||||
|
||||
return discordenoChannel;
|
||||
})
|
||||
}),
|
||||
)
|
||||
).map((c) => [c.id, c])
|
||||
).map((c) => [c.id, c]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ export async function getEmojis(guildId: string, addToCache = true) {
|
||||
cacheHandlers.set("guilds", guildId, guild);
|
||||
}
|
||||
|
||||
return new Collection(result.map(e => [e.id!, e]));
|
||||
return new Collection(result.map((e) => [e.id!, e]));
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ export async function getChannelInvites(channelId: string) {
|
||||
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.CHANNEL_INVITES(channelId)
|
||||
endpoints.CHANNEL_INVITES(channelId),
|
||||
)) as DiscordInvite[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((invite) => snakeKeysToCamelCase<Invite>(invite))
|
||||
.map((invite) => [invite.code, invite])
|
||||
.map((invite) => [invite.code, invite]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ export async function getInvites(guildId: string) {
|
||||
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_INVITES(guildId)
|
||||
endpoints.GUILD_INVITES(guildId),
|
||||
)) as DiscordInvite[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((invite) => snakeKeysToCamelCase<Invite>(invite))
|
||||
.map((invite) => [invite.code, invite])
|
||||
.map((invite) => [invite.code, invite]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ export async function getRoles(guildId: string) {
|
||||
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_ROLES(guildId)
|
||||
endpoints.GUILD_ROLES(guildId),
|
||||
)) as DiscordRole[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((role) => snakeKeysToCamelCase<Role>(role))
|
||||
.map((role) => [role.id, role])
|
||||
.map((role) => [role.id, role]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ export async function getGuildTemplates(guildId: string) {
|
||||
|
||||
const templates = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_TEMPLATES(guildId)
|
||||
endpoints.GUILD_TEMPLATES(guildId),
|
||||
)) as DiscordTemplate[];
|
||||
|
||||
return new Collection(
|
||||
templates.map((template) => [
|
||||
template.code,
|
||||
structures.createTemplateStruct(template),
|
||||
])
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ export async function getWebhooks(guildId: string) {
|
||||
|
||||
const result = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_WEBHOOKS(guildId)
|
||||
endpoints.GUILD_WEBHOOKS(guildId),
|
||||
)) as DiscordWebhook[];
|
||||
|
||||
return new Collection(
|
||||
result
|
||||
.map((webhook) => snakeKeysToCamelCase<Webhook>(webhook))
|
||||
.map((webhook) => [webhook.id, webhook])
|
||||
.map((webhook) => [webhook.id, webhook]),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user