Skip to main content
Module

x/biscuit/mod.ts>Guild

A Discord library that is easy to use but reliable on its core 🥠
Latest
class Guild
implements Model
extends BaseGuild
Re-export
import { Guild } from "https://deno.land/x/biscuit@0.2.4/mod.ts";

Represents a guild.

Constructors

new
Guild(session: Session, data: DiscordGuild)

Properties

channels: Map<Snowflake, GuildChannel>

A map with the guild's channels.

defaultMessageNotificationLevel: DefaultMessageNotificationLevels

The default message notification level.

optional
discoverySplashHash: bigint

Only present for guilds with the "DISCOVERABLE" feature

emojis: Map<Snowflake, GuildEmoji>

A map with the guild's emojis.

explicitContentFilterLevel: ExplicitContentFilterLevels

The explicit content filter level.

readonly
maxEmojis: maximunEmojis

Returns the maximum number of emoji slots

readonly
maxStickers: maximunStickers

Returns the maximum number of custom sticker slots

members: Map<Snowflake, Member>

A map with the guild's members.

ownerId: Snowflake

ID of the guild owner.

premiumTier: PremiumTiers

Premium tier (Server Boost level).

roles: Map<Snowflake, Role>

A map with the guild's roles.

optional
splashHash: bigint

The guild's splash hash.

vefificationLevel: VerificationLevels

Verification level required for the guild.

optional
widgetChannelId: Snowflake

The channel id that the widget will generate an invite to, or undefined if set to no invite.

widgetEnabled: boolean

True if the server widget is enabled

Methods

addRole(
memberId: Snowflake,
roleId: Snowflake,
reason?: string,
): Promise<void>

adds a role to a user in the guild.

banMember(memberId: Snowflake, options: CreateGuildBan): Promise<void>

bans a member from the guild.

creates an emoji in the guild.

createRole(options: CreateRole): Promise<Role>

creates a role in the guild.

delete(): Promise<void>

Deletes the guild.

deleteEmoji(id: Snowflake, reason?: string): Promise<void>

deletes an emoji from the guild.

deleteInvite(inviteCode: string): Promise<void>

deletes an invite from the guild.

deleteRole(roleId: Snowflake): Promise<void>

deletes a role from the guild.

edit(options: GuildEditOptions): Promise<Guild>

Edits a guild and returns its data.

editBotNickname(options: editBotNickOptions): Promise<(string | undefined)>

edits the bot's nickname in the guild. 'null' would reset the nickname.

edits an emoji in the guild.

editMember(memberId: Snowflake, options: ModifyGuildMember): Promise<Member>

edits a member in the guild.

editRole(roleId: Snowflake, options: ModifyGuildRole): Promise<Role>

edits a role in the guild.

fetchBan(userId: Snowflake): Promise<GuildBan>

Fetches user ban in the guild

fetchBans(options?: Routes.GetBans): Promise<GuildBan[]>

Fetches bans in the guild

Fetches preview of the guild

fetchInvite(inviteCode: string, options: Routes.GetInvite): Promise<Invite>

gets an invite from the guild.

fetchInvites(): Promise<Invite[]>

gets all invites from the guild.

fetchVanityURL(): Promise<Partial<Invite>>

Fetches vanity url invite

gets the voice regions available for the guild.

fetchWidget(): Promise<Widget>

Fetches widget in the guild

Fetches settings for Widget in the guild

getActiveThreads(): Promise<Omit<ReturnThreadsArchive, "hasMore">>

gets the active threads in the guild.

getPruneCount(): Promise<number>

gets the number of members that would be pruned.

kickMember(memberId: Snowflake, reason?: string): Promise<void>

kicks a member from the guild.

leave(): Promise<void>

Leaves the guild.

moveRoles(options: ModifyRolePositions[]): Promise<Role[]>

the roles moved.

pruneMembers(options: BeginGuildPrune): Promise<number>

prunes members from the guild.

removeRole(
memberId: Snowflake,
roleId: Snowflake,
reason?: string,
): Promise<void>

removes a role from a user in the guild.

setBanner(banner: string): Promise<Guild>

sets a new banner for the guild. Same as Guild.edit({..., banner: 'bannerURL'})

setDiscoverySplash(discoverySplash: string): Promise<Guild>

Sets a new guild discovery splash image. Same as Guild.edit({..., discoverySplashURL: 'discoverySplashURL'})

setSplash(splash: string): Promise<Guild>

sets a new splash for the guild. Same as Guild.edit({..., splash: 'splashURL'})

unbanMember(memberId: Snowflake): Promise<void>

unbans a member from the guild.

Static Methods

create(session: Session, options: GuildCreateOptions): Promise<Guild>

Creates a guild and returns its data, the bot joins the guild This was modified from discord.js to make it compatible precondition: Bot should be in less than 10 servers