Class

Guild

Represents a Fluxer guild (server).

Extends Base

Constructor

new Guild(client: Client, data: GuildData)

Construct a guild from API data.

ParamTypeDescription
clientClient
dataGuildData

API guild from GET /guilds/{id} or gateway GUILD_CREATE

Properties

afkChannelId: string | null

AFK voice channel ID, or null if none.

afkTimeout: number

AFK timeout in seconds.

bannerHeight?: number | null

Banner height in pixels.

bannerWidth?: number | null

Banner width in pixels.

channels: Collection<string, GuildChannel>

Cached channels in this guild.

client: Client (readonly)

The Client that instantiated this guild.

defaultMessageNotifications: DefaultMessageNotifications

Default notification level for members.

emojis: Collection<string, GuildEmoji>

Cached emojis in this guild.

explicitContentFilter: GuildExplicitContentFilter

Explicit content filter level.

features: GuildFeature[]

Features enabled for this guild.

icon: string | null

Icon hash (use iconURL to get full CDN URL).

id: string (readonly)

Snowflake ID of this guild.

Member manager for this guild (fetch/add/remove members).

mfaLevel: GuildMFALevel

MFA level required for moderation actions.

name: string

Guild name.

nsfwLevel: GuildNSFWLevel

NSFW level for this guild.

ownerId: string

User ID of the guild owner.

roles: Collection<string, Role>

Cached roles in this guild.

rulesChannelId: string | null

Rules channel ID (for Community guilds), or null if none.

splash: string | null

Invite splash hash (use splashURL to get full CDN URL).

splashHeight?: number | null

Splash height in pixels.

splashWidth?: number | null

Splash width in pixels.

stickers: Collection<string, GuildSticker>

Cached stickers in this guild.

systemChannelId: string | null

System messages channel ID, or null if none.

vanityURLCode: string | null

Vanity invite code if the guild has one.

verificationLevel: GuildVerificationLevel

Verification level required for members to send messages.

Methods

applyForDiscovery(body: DiscoveryApplicationOptions): Promise<DiscoveryApplicationPayload>

Apply for guild discovery.

ParamTypeDescription
bodyDiscoveryApplicationOptions
ban(userId: string, options?: GuildBanOptions): Promise<void>

Ban a user from the guild. Requires Ban Members. `ban_duration_seconds`: 0 = permanent.

ParamTypeDescription
userIdstring
options?GuildBanOptions
bannerURL(options?: { size?: number; }): string | null

Get the full CDN URL for the guild's banner (or null).

ParamTypeDescription
options?{ size?: number; }
cloneEmoji(sourceEmojiId: string): Promise<GuildEmoji>

Clone an emoji from another guild. Requires Manage Emojis and Stickers.

ParamTypeDescription
sourceEmojiIdstring
cloneSticker(sourceStickerId: string): Promise<GuildSticker>

Clone a sticker from another guild. Requires Manage Emojis and Stickers.

ParamTypeDescription
sourceStickerIdstring
createChannel(data: ChannelCreateRequest): Promise<GuildChannel>

Create a channel. `data.type`: 0=text, 2=voice, 4=category, 998=link (set `url`). Requires Manage Channels.

ParamTypeDescription
dataChannelCreateRequest
createEmoji(options: { name: string; image: string; }): Promise<GuildEmoji>

Create a new emoji in this guild. Requires Manage Emojis and Stickers.

ParamTypeDescription
options{ name: string; image: string; }
createEmojisBulk(emojiList: Array<{ name: string; image: string }>): Promise<{ success: GuildEmoji[]; failed: Array<{ name: string; error: string }> }>

Create multiple emojis at once (bulk operation).

ParamTypeDescription
emojiListArray<{ name: string; image: string }>
createRole(options: RoleCreateOptions): Promise<Role>

Create a role. `permissions` accepts a bitfield string or PermissionResolvable.

ParamTypeDescription
optionsRoleCreateOptions
createSticker(options: { name: string; image: string; description?: string | null; tags?: string[]; }): Promise<GuildSticker>

Create a new sticker in this guild. Requires Manage Emojis and Stickers.

ParamTypeDescription
options{ name: string; image: string; description?: string | null; tags?: string[]; }
createStickersBulk(stickerList: Array<{ name: string; image: string; description?: string; tags?: string[] }>): Promise<{ success: GuildSticker[]; failed: Array<{ name: string; error: string }> }>

Create multiple stickers at once (bulk operation).

ParamTypeDescription
stickerListArray<{ name: string; image: string; description?: string; tags?: string[] }>
delete(options?: SudoVerificationOptions): Promise<void>

Delete this guild (owner only). User accounts may need sudo/MFA in `options`.

ParamTypeDescription
options?SudoVerificationOptions
edit(options: GuildEditOptions): Promise<this>

Edit guild settings. Requires guild owner or Administrator.

ParamTypeDescription
optionsGuildEditOptions
editDiscoveryApplication(body: DiscoveryApplicationOptions): Promise<DiscoveryApplicationPayload>

Edit an existing discovery application.

ParamTypeDescription
bodyDiscoveryApplicationOptions
editVanityURL(code: string | null): Promise<VanityURLPayload>

Edit the guild's vanity invite code.

ParamTypeDescription
codestring | null
fetchAuditLogs(options?: { limit?: number; before?: string; after?: string; userId?: string; actionType?: AuditLogActionType; }): Promise<AuditLogFetchPayload>

Fetch audit log entries. Requires View Audit Log.

ParamTypeDescription
options?{ limit?: number; before?: string; after?: string; userId?: string; actionType?: AuditLogActionType; }
fetchBans(): Promise<GuildBan[]>

Fetch all bans in this guild. Requires Ban Members.

fetchChannels(): Promise<GuildChannel[]>

Fetch all channels in this guild from the API.

fetchDiscoveryStatus(): Promise<DiscoveryStatusPayload>

Fetch the guild's discovery status.

fetchEmoji(emojiId: string): Promise<GuildEmoji>

Fetch a specific emoji by ID.

ParamTypeDescription
emojiIdstring
fetchEmojis(): Promise<GuildEmoji[]>

Fetch all emojis in this guild from the API.

fetchInvite(codeOrUrl: string): Promise<Invite>

Fetch a specific invite by code or URL.

ParamTypeDescription
codeOrUrlstring
fetchInvites(): Promise<Invite[]>

Fetch all invites in this guild. Requires Manage Guild.

fetchMe(): Promise<GuildMember>

Fetch the bot's own member object in this guild.

fetchMember(userId: string): Promise<GuildMember>

Fetch a guild member by user ID.

ParamTypeDescription
userIdstring
fetchRole(roleId: string): Promise<Role>

Fetch a specific role by ID.

ParamTypeDescription
roleIdstring
fetchRoles(): Promise<Role[]>

Fetch all roles in this guild from the API.

fetchSticker(stickerId: string): Promise<GuildSticker>

Fetch a specific sticker by ID.

ParamTypeDescription
stickerIdstring
fetchStickers(): Promise<GuildSticker[]>

Fetch all stickers in this guild from the API.

fetchVanityURL(): Promise<VanityURLPayload>

Fetch the guild's vanity invite URL (if available).

fetchWebhooks(): Promise<Webhook[]>

Fetch all webhooks in this guild.

iconURL(options?: { size?: number; }): string | null

Get the full CDN URL for the guild's icon (or null).

ParamTypeDescription
options?{ size?: number; }
kick(userId: string): Promise<void>

Kick a user from the guild. Requires Kick Members.

ParamTypeDescription
userIdstring
resetRoleHoistPositions(): Promise<Role[]>

Reset all role hoist positions to zero. Returns cached Role instances.

resolveRoleId(arg: string): Promise<string | null>

Resolve role mention, snowflake, or name to a role ID.

ParamTypeDescription
argstring
setChannelPositions(updates: ChannelPositionUpdate[]): Promise<void>

Update channel positions (reordering).

ParamTypeDescription
updatesChannelPositionUpdate[]
setRoleHoistPositions(updates: Array<{ id: string; hoistPosition?: number }>): Promise<Role[]>

Update role hoist positions (visual separator groups). Returns cached Role instances.

ParamTypeDescription
updatesArray<{ id: string; hoistPosition?: number }>
setRolePositions(updates: Array<{ id: string; position?: number }>): Promise<Role[]>

Update role positions (reordering). Returns cached Role instances.

ParamTypeDescription
updatesArray<{ id: string; position?: number }>
splashURL(options?: { size?: number; }): string | null

Get the full CDN URL for the guild's invite splash (or null).

ParamTypeDescription
options?{ size?: number; }
transferOwnership(newOwnerId: string, password?: string): Promise<void>

Transfer guild ownership to another user (owner only).

ParamTypeDescription
newOwnerIdstring
password?string
unban(userId: string): Promise<void>

Unban a user from the guild. Requires Ban Members.

ParamTypeDescription
userIdstring
withdrawDiscoveryApplication(): Promise<void>

Withdraw the guild's discovery application.