mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
change: prettier code
This commit is contained in:
committed by
GitHub Action
parent
20616e8a36
commit
3a08aa15f4
@@ -9,24 +9,21 @@ import type { Bot } from "../../bot.ts";
|
||||
* So it does not cache the guild, you must do it manually.
|
||||
* */
|
||||
export async function getGuild(
|
||||
bot: Bot,
|
||||
guildId: bigint,
|
||||
options: { counts?: boolean; addToCache?: boolean } = {
|
||||
counts: true,
|
||||
addToCache: true,
|
||||
}
|
||||
bot: Bot,
|
||||
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), {
|
||||
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,
|
||||
{
|
||||
guild: result,
|
||||
shardId: Number((BigInt(guildId) >> 22n) % BigInt(ws.botGatewayData.shards))
|
||||
}
|
||||
);
|
||||
const guild = await bot.transformers.guild(bot, {
|
||||
guild: result,
|
||||
shardId: Number((BigInt(guildId) >> 22n) % BigInt(ws.botGatewayData.shards)),
|
||||
});
|
||||
|
||||
if (options.addToCache) {
|
||||
await bot.cache.guilds.set(guild.id, guild);
|
||||
|
||||
Reference in New Issue
Block a user