context

package
v0.0.0-...-9ab1851 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2018 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Bot     *bot.Bot
	Session *discordgo.Session
	Message *discordgo.Message
	Channel *discordgo.Channel
	Guild   *discordgo.Guild
	Author  *discordgo.User
	Prefix  string

	RegisterResponses bool // delete?
	// contains filtered or unexported fields
}

Context represents context object

func New

func New(b *bot.Bot, s *discordgo.Session, msg *discordgo.Message, prefix string) (*Context, error)

New returns new Context object

func (*Context) Arg

func (ctx *Context) Arg(index int) string

func (*Context) ArgArray

func (ctx *Context) ArgArray() []string

func (*Context) Argc

func (ctx *Context) Argc() int

func (*Context) Args

func (ctx *Context) Args(begin, end int) string

func (*Context) Edit

func (ctx *Context) Edit(messageID, content string) (*discordgo.Message, error)

Edit is a wrapper for ChannelMessageEdit

func (*Context) EditComplex

func (ctx *Context) EditComplex(data *discordgo.MessageEdit) (*discordgo.Message, error)

EditComplex is a wrapper for ChannelMessageEdit

func (*Context) ParseContent

func (ctx *Context) ParseContent(content string) error

TODO: arg parser TODO: flag parser

func (*Context) React

func (ctx *Context) React(emoji string) (*discordgo.MessageReaction, error)

experimental, arguments may change React reacts with emoji to given message

func (*Context) Send

func (ctx *Context) Send(content string) (*discordgo.Message, error)

experimental, arguments may change TODO: ChannelMessageSendComplex implementation Send is a wrapper for ChannelMessageSend

func (*Context) SendComplex

func (ctx *Context) SendComplex(data *discordgo.MessageSend) (*discordgo.Message, error)

SendComplex is a wrapper for ChannelMessageSendComplex

Jump to

Keyboard shortcuts

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