mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
nukes everything
This commit is contained in:
@@ -13,21 +13,16 @@ export async function getGuild(
|
||||
guildId: bigint,
|
||||
options: { counts?: boolean; addToCache?: boolean } = {
|
||||
counts: true,
|
||||
addToCache: true,
|
||||
}
|
||||
) {
|
||||
const result = await bot.rest.runMethod<Guild>(bot.rest, "get", bot.constants.endpoints.GUILDS_BASE(guildId), {
|
||||
with_counts: options.counts,
|
||||
});
|
||||
|
||||
const guild = await bot.transformers.guild(bot, {
|
||||
const guild = bot.transformers.guild(bot, {
|
||||
guild: result,
|
||||
shardId: bot.utils.calculateShardId(bot.gateway, guildId),
|
||||
});
|
||||
|
||||
if (options.addToCache) {
|
||||
await bot.cache.guilds.set(guild.id, guild);
|
||||
}
|
||||
|
||||
return guild;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user