mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Guilds helpers
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user