discord

package
v0.0.0-...-a56337f Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CastName          = "cast"
	CastOptionChannel = "channel"
)
View Source
const (
	LockName        = "lock"
	LockOptionLimit = "limit"
)
View Source
const (
	QuoteName         = "quote"
	QuoteOptionAuthor = "author"
	QuoteOptionText   = "text"
)
View Source
const (
	RollName        = "roll"
	RollOptionSize  = "size"
	RollOptionCount = "count"
)
View Source
const (
	RollOptionSizeDefault  = die.D100
	RollOptionCountDefault = 1
)
View Source
const (
	UnlockName = "unlock"
)

Variables

View Source
var Cast = &discordgo.ApplicationCommand{
	Name:        CastName,
	Description: "Mention all users in a voice channel",
	Options: []*discordgo.ApplicationCommandOption{
		{
			Name:        CastOptionChannel,
			Description: "Channel to mention",
			Type:        discordgo.ApplicationCommandOptionChannel,
			ChannelTypes: []discordgo.ChannelType{
				discordgo.ChannelTypeGuildVoice,
			},
		},
	},
}
View Source
var Lock = &discordgo.ApplicationCommand{
	Name:        LockName,
	Description: "Set user limit for current voice channel",
	Options: []*discordgo.ApplicationCommandOption{
		{
			Name:        LockOptionLimit,
			Description: "Custom limit value",
			Type:        discordgo.ApplicationCommandOptionInteger,
			MinValue:    &lockOptionLimitMinValue,
			MaxValue:    lockOptionLimitMaxValue,
		},
	},
}
View Source
var Quote = &discordgo.ApplicationCommand{
	Name:        QuoteName,
	Description: "Manage the most stunning quotes of the specified user",
	Options: []*discordgo.ApplicationCommandOption{
		{
			Name:        QuoteOptionAuthor,
			Description: "The user who said that",
			Type:        discordgo.ApplicationCommandOptionUser,
			Required:    true,
		},
		{
			Name:        QuoteOptionText,
			Description: "The text of the quote",
			Type:        discordgo.ApplicationCommandOptionString,
		},
	},
}
View Source
var Roll = buildRoll()
View Source
var Unlock = &discordgo.ApplicationCommand{
	Name:        UnlockName,
	Description: "Remove user limit for current voice channel",
}

Functions

func Connect

func Connect(token string) *discordgo.Session

func RegisterCommands

func RegisterCommands(
	session *discordgo.Session,
	commands map[string]*Command,
	guildID types.ID,
)

func UnregisterCommands

func UnregisterCommands(
	session *discordgo.Session,
	commands map[string]*Command,
	guildID types.ID,
)

Types

type Command

type Command struct {
	Description *discordgo.ApplicationCommand
	Handler     Handler
}

type Config

type Config struct {
	Token string   `conf:"token"`
	Guild types.ID `conf:"guild"`
}

type Handler

type Handler interface {
	Handle(i *discordgo.InteractionCreate)
}

type Probe

type Probe struct {
	// contains filtered or unexported fields
}

func NewProbe

func NewProbe(
	session *discordgo.Session,
) *Probe

func (*Probe) Check

func (p *Probe) Check(_ context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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