guild

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embed

type Embed struct {
	Enabled   bool   `json:"enabled,omitempty"`
	ChannelID string `json:"channel_id,omitempty"`
}

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 WithNick

func WithNick(name string) MemberSetting

WithNick sets the name of a guild member.

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

func WithAfkChannel(id string) Setting

WithAfkChannel sets the AFK channel ID of a guild.

func WithAfkTimeout

func WithAfkTimeout(sec int) Setting

WithAfkTimeout sets the AFK timeout of a guild.

func WithDefaultMessageNotifications

func WithDefaultMessageNotifications(lvl int) Setting

WithDefaultMessageNotifications sets the default notification level of a guild.

  • 0 for all messages
  • 1 for mentions only

func WithExplicitContentFilter

func WithExplicitContentFilter(lvl int) Setting

WithExplicitContentFilter sets the explicit content filter of a guild.

  • 0 for disabled
  • 1 for member without roles
  • 2 for all members

func WithIcon

func WithIcon(icon string) Setting

WithIcon sets the Guild icon which is a base64 encoded 128x128 jpeg image.

func WithName

func WithName(name string) Setting

WithName sets the name of a guild.

func WithOwner

func WithOwner(id string) Setting

WithOwner sets the owner ID of a guild (must be the guild owner to for this to have effect).

func WithRegion

func WithRegion(region string) Setting

WithRegion sets the region of a guild.

func WithSplash

func WithSplash(splash string) Setting

WithSplash sets the Guild splash (VIP only) which is a base64 encoded 128x128 image.

func WithSystemChannel

func WithSystemChannel(id string) Setting

WithSystemChannel sets the id of the channel to which system messages are sent.

func WithVerificationLevel

func WithVerificationLevel(lvl int) Setting

WithVerificationLevel sets the verification level of a guild.

  • 0 for none (unrestricted)
  • 1 for low (must have verified email on account)
  • 2 for medium (must be registered on Discord for longer than 5 minutes)
  • 3 for high (must be a member of the server for longer than 10 minutes)
  • 4 for very high (must have a verified phone number)

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

func NewSettings(opts ...Setting) *Settings

NewSettings returns new Settings to modify a a guild.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL