mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
ref
This commit is contained in:
@@ -45,8 +45,8 @@ export async function createChannel(
|
||||
},
|
||||
)) as DiscordChannel;
|
||||
|
||||
const channelStruct = await structures.createChannelStruct(result);
|
||||
await cacheHandlers.set("channels", channelStruct.id, channelStruct);
|
||||
const discordenoChannel = await structures.createDiscordenoChannel(result);
|
||||
await cacheHandlers.set("channels", discordenoChannel.id, discordenoChannel);
|
||||
|
||||
return channelStruct;
|
||||
return discordenoChannel;
|
||||
}
|
||||
|
||||
@@ -14,13 +14,17 @@ export async function getChannel(channelId: string, addToCache = true) {
|
||||
endpoints.CHANNEL_BASE(channelId),
|
||||
)) as DiscordChannel;
|
||||
|
||||
const channelStruct = await structures.createChannelStruct(
|
||||
const discordenoChannel = await structures.createDiscordenoChannel(
|
||||
result,
|
||||
result.guild_id,
|
||||
);
|
||||
if (addToCache) {
|
||||
await cacheHandlers.set("channels", channelStruct.id, channelStruct);
|
||||
await cacheHandlers.set(
|
||||
"channels",
|
||||
discordenoChannel.id,
|
||||
discordenoChannel,
|
||||
);
|
||||
}
|
||||
|
||||
return channelStruct;
|
||||
return discordenoChannel;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,18 @@ export async function getChannels(guildId: string, addToCache = true) {
|
||||
) as DiscordChannel[]);
|
||||
|
||||
return Promise.all(result.map(async (res) => {
|
||||
const channelStruct = await structures.createChannelStruct(res, guildId);
|
||||
const discordenoChannel = await structures.createDiscordenoChannel(
|
||||
res,
|
||||
guildId,
|
||||
);
|
||||
if (addToCache) {
|
||||
await cacheHandlers.set("channels", channelStruct.id, channelStruct);
|
||||
await cacheHandlers.set(
|
||||
"channels",
|
||||
discordenoChannel.id,
|
||||
discordenoChannel,
|
||||
);
|
||||
}
|
||||
|
||||
return channelStruct;
|
||||
return discordenoChannel;
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ export async function getPins(channelId: string) {
|
||||
)) as DiscordMessage[];
|
||||
|
||||
return Promise.all(
|
||||
result.map((res) => structures.createMessageStruct(res)),
|
||||
result.map((res) => structures.createDiscordenoMessage(res)),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user