This commit is contained in:
Skillz4Killz
2021-04-13 17:59:19 +00:00
committed by GitHub
parent c2f2afb211
commit 9446960bb0
8 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -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]),
);
}
+5 -5
View File
@@ -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]),
);
}