channel

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mention added in v0.14.0

type Mention struct {
	ID      string `json:"id"`
	GuildID string `json:"guild_id"`
	Type    Type   `json:"type"`
	Name    string `json:"name"`
}

Mention represents a channel mention.

type Setting

type Setting func(*Settings)

Setting is a function that configures a channel.

func WithBitrate

func WithBitrate(bitrate int) Setting

WithBitrate sets the bit rate of a channel (audio only).

func WithNSFW

func WithNSFW(yes bool) Setting

WithNSFW sets whether a channel is not safe for work.

func WithName

func WithName(name string) Setting

WithName sets the name of a channel.

func WithParent

func WithParent(id string) Setting

WithParent sets the parent ID channel of a channel.

func WithPermissions

func WithPermissions(perms []permission.Overwrite) Setting

WithPermissions sets the permission overwrites of a channel. Pass an empty array to remove all permission overwrites.

func WithPosition

func WithPosition(pos int) Setting

WithPosition sets the position of a channel.

func WithRateLimitPerUser

func WithRateLimitPerUser(rateLimit int) Setting

WithRateLimitPerUser sets the rate limit per user (text only).

func WithTopic

func WithTopic(topic string) Setting

WithTopic sets the topic of a channel (text only).

func WithType

func WithType(t Type) Setting

WithType sets the name of a channel.

func WithUserLimit

func WithUserLimit(limit int) Setting

WithUserLimit sets the user limit of a channel (audio only).

type Settings

type Settings struct {
	Name      *optional.String `json:"name,omitempty"` // 2-100 characters.
	Type      *optional.Int    `json:"type"`
	Topic     *optional.String `json:"topic"` // 0-1000 characters.
	Bitrate   *optional.Int    `json:"bitrate,omitempty"`
	UserLimit *optional.Int    `json:"user_limit,omitempty"`
	// RateLimitPerUser is the amount of seconds a user has to wait before sending
	// another message (0-120); bots, as well as users with the permission
	// 'manage_messages' or 'manage_channel', are unaffected.
	RateLimitPerUser *optional.Int `json:"rate_limit_per_user"`
	// Sorting position of the channel.
	Position    *optional.Int          `json:"position"`
	Permissions []permission.Overwrite `json:"permission_overwrites,omitempty"`
	ParentID    *optional.String       `json:"parent_id,omitempty"`
	NSFW        *optional.Bool         `json:"nsfw,omitempty"`
}

Settings describes a channel creation or update.

func NewSettings

func NewSettings(opts ...Setting) *Settings

NewSettings returns new Settings to modify a a channel.

type Type

type Type int

Type describes the type of a channel. Different fields are set or not depending on the channel's type.

const (
	TypeGuildText Type = iota
	TypeDM
	TypeGuildVoice
	TypeGroupDM
	TypeGuildCategory
	TypeGuildNews
	TypeGuildStore
)

Supported channel types:

Jump to

Keyboard shortcuts

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