Skip to main content
Module

x/harmony/mod.ts>Guild

An easy to use Discord API Library for Deno.
Latest
class Guild
extends SnowflakeBase
Re-export
import { Guild } from "https://deno.land/x/harmony@v2.9.0/mod.ts";

Constructors

new
Guild(client: Client, data: GuildPayload)

Properties

optional
afkChannelID: string
optional
afkTimeout: number
optional
applicationID: string
optional
approximateNumberCount: number
optional
approximatePresenceCount: number
optional
banner: string
bans: GuildBans
optional
defaultMessageNotifications: MessageNotification
optional
description: string
optional
discoverySplash: string
optional
explicitContentFilter: ContentFilter
optional
features: GuildFeatures[]
optional
icon: string
invites: InviteManager
optional
joinedAt: string
optional
large: boolean
optional
maxMembers: number
optional
maxPresences: number
optional
maxVideoChannelUsers: number
optional
memberCount: number
optional
mfaLevel: string
optional
name: string
optional
nsfw: boolean
optional
owner: boolean
optional
ownerID: string
optional
permissions: string
optional
preferredLocale: string
optional
premiumSubscriptionCount: number
optional
premiumTier: number
optional
publicUpdatesChannelID: string
optional
region: string
optional
rulesChannelID: string
readonly
shardID: number

Get Shard ID of Guild on which it is

optional
splash: string
stickers: GuildStickersManager
optional
systemChannelFlags: string
optional
systemChannelID: string
threads: ThreadsManager
unavailable: boolean
optional
vanityURLCode: string
optional
verificationLevel: Verification
voiceStates: GuildVoiceStatesManager
optional
widgetChannelID: string
optional
widgetEnabled: boolean

Methods

awaitAvailability(timeout?: number): Promise<Guild>

Fulfills promise when guild becomes available

bannerURL(format?: ImageFormats, size?: ImageSize): string | undefined

Gets guild banner URL

chunk(
options: RequestMembersOptions,
wait?: boolean,
timeout?: number,
): Promise<Guild>

Chunks the Guild Members, i.e. cache them.

createChannel(options: CreateChannelOptions): Promise<GuildChannels>

Create a new Guild Channel

createIntegration(id: string, type: string): Promise<Guild>

Attach an integration object from the current user to the guild.

createRole(options?: CreateGuildRoleOptions): Promise<Role>

Create a new Guild Role

createTemplate(name: string, description?: string | null): Promise<Template>

Creates a template for the guild.

delete(): Promise<Guild>

Deletes the guild.

deleteIntegration(id: string): Promise<Guild>

Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one.

deleteTemplate(code: string): Promise<Guild>

Deletes the template. Requires the MANAGE_GUILD permission.

discoverSplashURL(format?: ImageFormats, size?: ImageSize): string | undefined

Gets guild discover splash URL

edit(options: GuildModifyOptions): Promise<Guild>

Edits the guild.

editIntegration(id: string, data: { expireBehavior?: number | null; expireGracePeriod?: number | null; enableEmoticons?: boolean | null; }): Promise<Guild>

Modify the behavior and settings of an integration object for the guild.

editTemplate(code: string, data: { name?: string; description?: string; }): Promise<Template>

Modifies the template's metadata.

editWidget(data: { enabled?: boolean; channel?: string | GuildChannels; }): Promise<Guild>

Modify a guild widget object for the guild.

fetchAuditLog(options?: { user?: string | User; actionType?: AuditLogEvents; before?: string; limit?: number; }): Promise<AuditLog>

Fetches Guild's Integrations (Webhooks, Bots, etc.)

getEveryoneRole(): Promise<Role>

Gets Everyone role of the Guild

getPruneCount(options?: { days?: number; includeRoles?: Array<Role | string>; }): Promise<number>
getTemplates(): Promise<Template[]>

Returns an array of template objects.

getVanity(): Promise<{ code: string | null; uses: number; }>

Returns a partial invite object for guilds with that feature enabled.

Returns the widget for the guild.

getWidgetImageURL(style?:
| "shield"
| "banner1"
| "banner2"
| "banner3"
| "banner4"
): string

Returns a PNG (URL) image widget for the guild.

iconURL(format?: ImageFormats, size?: ImageSize): string | undefined

Gets guild icon URL

leave(): Promise<Client>

Leave a Guild.

me(): Promise<Member>

Gets current client's member in the Guild

preview(): Promise<GuildPreview>

Gets a preview of the guild. Returns GuildPreview.

prune(options?: { days?: number; computePruneCount?: true; includeRoles?: Array<Role | string>; }): Promise<number>
prune(options?: { days?: number; computePruneCount: false; includeRoles?: Array<Role | string>; }): Promise<null>
splashURL(format?: ImageFormats, size?: ImageSize): string | undefined

Gets guild splash URL

syncIntegration(id: string): Promise<Guild>

Sync an integration.

syncTemplate(code: string): Promise<Template>

Syncs the template to the guild's current state.