Skip to content

Guild

Implementation of Discord’s Guild object as a Luau builder.

See Discord’s documentation for more information about the allow and deny fields:

https://discord.com/developers/docs/resources/guild

Summary

Guild.name  :: string?

The name of the guild.

Guild.verificationLevel  :: VerificationLevel

Verification level setting for the guild.

Guild.defaultMessageNotifications  :: DefaultMessageNotification

Default message notification level.

Guild.explicitContentFilter  :: ExplicitContentFilterLevel

Explicit content filter level setting.

Guild.afkChannelId  :: string?

ID of the AFK voice channel.

Guild.afkTimeout  :: number?

AFK timeout duration in seconds.

Guild.icon  :: string?

Base64 encoded icon for the guild.

Guild.ownerId  :: string?

User ID of the owner of the guild.

Guild.splash  :: string?

Base64 splash image for the guild.

Guild.discoverySplash  :: string?

Base64 discovery splash image for the guild.

Guild.banner  :: string?

Base64 banner image for the guild.

Guild.systemChannelId  :: string?

ID of the system messages channel.

Guild.systemChannelFlags  :: number?

Flags for the system channel.

Guild.rulesChannelId  :: string?

ID of the rules channel.

Guild.publicUpdatesChannelId  :: string?

ID of the public updates channel.

Guild.preferredLocale  :: LanguageLocales?

Preferred language/locale for the guild.

Guild.features  :: GuildFeature }

List of enabled guild features.

Guild.description  :: string?

Description of the guild.

Guild.premiumProgressBarEnabled  :: boolean?

Whether boost progress bar is enabled.

Guild.safetyAlertsChannelId  :: string?

ID of the safety alerts channel.

Guild : setName ( name )  -> Guild

Set the name for this guild.

Parameters

name: string

Returns

Guild
Guild : setVerificationLevel ( verificationLevel )  -> Guild

Set the explicit verification level for this guild.

Parameters

verificationLevel: VerificationLevel

Returns

Guild
Guild : setDefaultMessageNotifications ( defaultMessageNotifications )  -> Guild

Set the explicit default message notifications for this guild.

Parameters

defaultMessageNotifications: DefaultMessageNotification

Returns

Guild
Guild : setExplicitContentFilter ( explicitContentFilter )  -> Guild

Set the explicit content filter level for this guild.

Parameters

explicitContentFilter: ExplicitContentFilterLevel

Returns

Guild
Guild : setAfkChannelId ( afkChannelId )  -> Guild

Set the id for the AFK channel.

Parameters

afkChannelId: Snowflake

Returns

Guild
Guild : setAfkTimeout ( afkTimeout )  -> Guild

Set the AFK timeout in seconds. Can be one of: 60, 300, 900, 1800, 3600.

Parameters

afkTimeout: number

Returns

Guild
Guild : setIcon ( source )  -> Guild

Set the base64 1024x1024 PNG/JPEG/GIF image for the guild icon.

Parameters

source: string

Returns

Guild
Guild : setOwnerId ( ownerId )  -> Guild

Set the user ID to transfer guild ownership to (must be owner).

Parameters

ownerId: Snowflake

Returns

Guild
Guild : setSplash ( source )  -> Guild

Set the base64 16:9 PNG/JPEG image for the guild splash.

Parameters

source: string

Returns

Guild
Guild : setDiscoverySplash ( source )  -> Guild

Set the base64 16:9 PNG/JPEG image for the discovery splash of the guild.

Parameters

source: string

Returns

Guild
Guild : setBanner ( source )  -> Guild

Set the base64 16:9 PNG/JPEG/GIF image for the guild banner.

Parameters

source: string

Returns

Guild
Guild : setSystemChannelId ( systemChannelId )  -> Guild

Set the ID of the system channel.

Parameters

systemChannelId: Snowflake

Returns

Guild
Guild : setSystemChannelFlags ( systemChannelFlags )  -> Guild

Set the system channel flags.

Parameters

systemChannelFlags: number

Returns

Guild
Guild : setRulesChannelId ( rulesChannelId )  -> Guild

Set the ID of the rules channel.

Parameters

rulesChannelId: Snowflake

Returns

Guild
Guild : setPublicUpdatesChannelId ( publicUpdatesChannelId )  -> Guild

Set the ID of the public updates channel.

Parameters

publicUpdatesChannelId: Snowflake

Returns

Guild
Guild : setPreferredLocale ( preferredLocale )  -> Guild

Set the preferred locale of the guild.

Parameters

preferredLocale: LanguageLocales

Returns

Guild
Guild : addFeature ( feature )  -> Guild

Enable a specific guild feature.

Parameters

feature: GuildFeature

Returns

Guild
Guild : setDescription ( description )  -> Guild

Set the description for the guild.

Parameters

description: string

Returns

Guild
Guild : setPremiumProgressBarEnabled ( premiumProgressBarEnabled )  -> Guild

Set whether the guild’s boost progress bar should be enabled.

Parameters

premiumProgressBarEnabled: boolean

Returns

Guild
Guild : setSafetyAlertsChannelId ( safetyAlertsChannelId )  -> Guild

Set the ID of the safety alerts channel.

Parameters

safetyAlertsChannelId: Snowflake

Returns

Guild
Guild : build ( )  -> JSON

Responsible for building the Guild JSON that can be parsed by the Discord API.

Returns

JSON
Guild . new ( resource )  -> Guild

Construct a new Guild object.

Parameters

resource: {
name: string?,
verificationLevel: apiTypes.VerificationLevel?,
defaultMessageNotifications: apiTypes.DefaultMessageNotification?,
explicitContentFilter: apiTypes.ExplicitContentFilterLevel?,
afkChannelId: apiTypes.Snowflake?,
afkTimeout: number?,
icon: string?,
ownerId: apiTypes.Snowflake?,
splash: string?,
discoverySplash: string?,
banner: string?,
systemChannelId: apiTypes.Snowflake?,
systemChannelFlags: number?,
rulesChannelId: apiTypes.Snowflake?,
publicUpdatesChannelId: apiTypes.Snowflake?,
preferredLocale: apiTypes.LanguageLocales?,
features: { apiTypes.GuildFeature,
}

Returns

Guild