Guilds helpers

This commit is contained in:
TriForMine
2021-10-21 19:38:09 +02:00
parent baf8583976
commit 20616e8a36
29 changed files with 156 additions and 167 deletions
+3 -4
View File
@@ -1,8 +1,7 @@
import { rest } from "../../rest/rest.ts";
import type { GuildPreview } from "../../types/guilds/guild_preview.ts";
import { endpoints } from "../../util/constants.ts";
import type { Bot } from "../../bot.ts";
/** Returns the guild preview object for the given id. If the bot is not in the guild, then the guild must be Discoverable. */
export async function getGuildPreview(guildId: bigint) {
return await rest.runMethod<GuildPreview>("get", endpoints.GUILD_PREVIEW(guildId));
export async function getGuildPreview(bot: Bot, guildId: bigint) {
return await bot.rest.runMethod<GuildPreview>(bot.rest,"get", bot.constants.endpoints.GUILD_PREVIEW(guildId));
}