change: prettier code

This commit is contained in:
TriForMine
2021-10-21 17:38:57 +00:00
committed by GitHub Action
parent 20616e8a36
commit 3a08aa15f4
23 changed files with 76 additions and 63 deletions
+11 -14
View File
@@ -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);