dgplus

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name                string
	Aliases             []string
	IgnoreCaseSensitive bool
	IgnoreRequirePrefix bool
	HandlerFunc         func(*MessageCreateData)
}

type DGPSession

type DGPSession struct {
	DGSession             *discordgo.Session
	CommandsCaseSensitive bool
	RequirePrefix         bool   // Whether a message should be checked for CommandPrefix
	CommandPrefix         string // ignored if RequirePrefix false
	Commands              []*Command
}

func New

func New(token string, CommandsCaseSensitive bool, RequirePrefix bool, CommandPrefix string) (s *DGPSession, e error)

func (*DGPSession) Close

func (s *DGPSession) Close() error

func (*DGPSession) Notify added in v0.1.4

func (s *DGPSession) Notify(a ...interface{})

Notify wraps the channel notify code necessary for the bot into a method. Prints a using fmt.Println

func (*DGPSession) Open

func (s *DGPSession) Open() error

Open sets intents to IntentsAllWithoutPrivileged, adds the command message handler, and opens the session

func (*DGPSession) RegisterCommand

func (s *DGPSession) RegisterCommand(name string, aliases []string, ignoreCaseSensitive bool, ignoreRequirePrefix bool, handler func(*MessageCreateData)) (cmd *Command, e error)

type MessageCreateData

type MessageCreateData struct {
	DGPSession *DGPSession
	DGSession  *discordgo.Session
	Message    *discordgo.MessageCreate
	Command    string
	Args       []string
	Content    string
	ChannelID  string
	AuthorID   string
	GuildID    string
}

func (*MessageCreateData) Send

func (msg *MessageCreateData) Send(message string) (*discordgo.Message, error)

func (*MessageCreateData) SendComplex

func (msg *MessageCreateData) SendComplex(content *discordgo.MessageSend) (*discordgo.Message, error)

func (*MessageCreateData) SendEmbed

func (msg *MessageCreateData) SendEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)

func (*MessageCreateData) SendReply

func (msg *MessageCreateData) SendReply(content string) (*discordgo.Message, error)

Jump to

Keyboard shortcuts

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