Documentation ¶
Index ¶
- type AFKTimeout
- type DefaultNotificationLevel
- type Embed
- type ExplicitContentFilter
- type MemberSetting
- type MemberSettings
- type Setting
- func WithAFKChannel(id string) Setting
- func WithAFKTimeout(t AFKTimeout) Setting
- func WithDefaultMessageNotifications(lvl DefaultNotificationLevel) Setting
- func WithExplicitContentFilter(lvl ExplicitContentFilter) Setting
- func WithIcon(icon string) Setting
- func WithName(name string) Setting
- func WithOwner(id string) Setting
- func WithRegion(region string) Setting
- func WithSplash(splash string) Setting
- func WithSystemChannel(id string) Setting
- func WithVerificationLevel(lvl VerificationLevel) Setting
- type Settings
- type VerificationLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AFKTimeout ¶ added in v0.8.0
type AFKTimeout int
AFKTimeout is the set of allowed values for AFK timeouts.
const ( AFKTimeoutOneMinute AFKTimeout = 60 AFKTimeoutFiveMinutes AFKTimeout = 300 AFKTimeoutFifteenMinutes AFKTimeout = 900 AFKTimeoutThirtyMinutes AFKTimeout = 1800 AFKTimeoutOneHour AFKTimeout = 3600 )
type DefaultNotificationLevel ¶ added in v0.7.0
type DefaultNotificationLevel int
DefaultNotificationLevel determines whether members who have not explicitly set their notification settings receive a notification for every message sent in this server or not.
const ( // DefaultNotificationLevelAll means a notification // will be sent for all messages. DefaultNotificationLevelAll DefaultNotificationLevel = iota // DefaultNotificationLevelMentionOnly means a // notification will be sent for mentions only. DefaultNotificationLevelMentionOnly )
type ExplicitContentFilter ¶ added in v0.7.0
type ExplicitContentFilter int
ExplicitContentFilter determines how the explicit content filter should behave for a server.
const ( // ExplicitContentFilterDisabled disables the filter. ExplicitContentFilterDisabled ExplicitContentFilter = iota // ExplicitContentFilterWithoutRole filters messages from // members without a role. ExplicitContentFilterWithoutRole // ExplicitContentFilterAll filters messages from all members. ExplicitContentFilterAll )
type MemberSetting ¶
type MemberSetting func(*MemberSettings)
MemberSetting is a function that configures a guild member.
func WithChannelID ¶
func WithChannelID(id string) MemberSetting
WithChannelID sets the channel id of a guild member (if connected to voice).
func WithDeaf ¶
func WithDeaf(yes bool) MemberSetting
WithDeaf sets whether a guild member is deafen.
func WithMute ¶
func WithMute(yes bool) MemberSetting
WithMute sets whether a guild member is muted.
func WithRoles ¶
func WithRoles(roleIDs []string) MemberSetting
WithRoles sets the roles of a guild member.
type MemberSettings ¶
type MemberSettings struct { Nick *optional.String `json:"nick,omitempty"` Roles *optional.StringSlice `json:"roles,omitempty"` Mute *optional.Bool `json:"mute,omitempty"` Deaf *optional.Bool `json:"deaf,omitempty"` // ID of channel to move user to (if they are connected to voice). ChannelID *optional.String `json:"channel_id,omitempty"` }
MemberSettings are the settings of a guild member, all fields are optional and only those explicitly set will be modified.
func NewMemberSettings ¶
func NewMemberSettings(opts ...MemberSetting) *MemberSettings
NewMemberSettings returns new Settings to modify a a guild member.
type Setting ¶
type Setting func(*Settings)
Setting is a function that configures a guild.
func WithAFKChannel ¶ added in v0.8.0
WithAFKChannel sets the AFK channel ID of a guild. An empty id will disable the AFK channel.
func WithAFKTimeout ¶ added in v0.8.0
func WithAFKTimeout(t AFKTimeout) Setting
WithAFKTimeout sets the AFK timeout of a guild.
func WithDefaultMessageNotifications ¶
func WithDefaultMessageNotifications(lvl DefaultNotificationLevel) Setting
WithDefaultMessageNotifications sets the default notification level of a guild.
func WithExplicitContentFilter ¶
func WithExplicitContentFilter(lvl ExplicitContentFilter) Setting
WithExplicitContentFilter sets the explicit content filter of a guild.
func WithOwner ¶
WithOwner sets the owner ID of a guild (must be the guild owner to for this to have effect).
func WithSplash ¶
WithSplash sets the Guild splash (VIP only) which is a base64 encoded 128x128 image.
func WithSystemChannel ¶
WithSystemChannel sets the id of the channel to which system messages are sent.
func WithVerificationLevel ¶
func WithVerificationLevel(lvl VerificationLevel) Setting
WithVerificationLevel sets the verification level of a guild.
type Settings ¶
type Settings struct { Name *optional.String `json:"name,omitempty"` Region *optional.String `json:"region,omitempty"` VerificationLevel *optional.Int `json:"verification_level,omitempty"` DefaultMessageNotifications *optional.Int `json:"default_message_notifications,omitempty"` ExplicitContentFilter *optional.Int `json:"explicit_content_filter,omitempty"` AFKChannelID *optional.String `json:"afk_channel_id,omitempty"` AFKTimeout *optional.Int `json:"afk_timeout,omitempty"` Icon *optional.String `json:"icon,omitempty"` OwnerID *optional.String `json:"owner_id,omitempty"` Splash *optional.String `json:"splash,omitempty"` SystemChannelID *optional.String `json:"system_channel_id,omitempty"` }
Settings are the settings of a guild, all fields are optional and only those explicitly set will be modified.
func NewSettings ¶
NewSettings returns new Settings to modify a a guild.
type VerificationLevel ¶ added in v0.7.0
type VerificationLevel int
VerificationLevel is the level of verification that applies on a server. Members must meet criteria before they can send messages or initiate direct message conversations with other guild members. This does not apply for members that have a role assigned to them.
const ( // VerificationLevelNone means there is no verification. VerificationLevelNone VerificationLevel = iota // VerificationLevelLow means a member must have // a verified email on their account. VerificationLevelLow // VerificationLevelMedium means a member must be // registered on Discord for longer than 5 minutes. VerificationLevelMedium // VerificationLevelHigh means a member must be // in this server for longer than 10 minutes. VerificationLevelHigh // VerificationLevelVeryHigh means a member must have // a verified phone number. VerificationLevelVeryHigh )