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