Documentation
¶
Index ¶
- func HasPermission(s *discordgo.Session, userID string, channelID string, reqPerm int64) (bool, error)
- func ParseArgs(s string) []string
- type Command
- type Context
- func (c *Context) GetArgIndex(idx int) (string, error)
- func (c *Context) GetArgIndexDefault(idx int, def string) string
- func (c *Context) GetImage(idx uint) (image.Image, error)
- func (c *Context) GetMember(idx int) (*discordgo.Member, error)
- func (c *Context) GetPreviousMessage() (*discordgo.Message, error)
- func (c *Context) GetSenderVoiceChannel() (*discordgo.Channel, error)
- func (c *Context) GetUser(idx int) (*discordgo.User, error)
- func (c *Context) Reply(m string) (*discordgo.Message, error)
- func (c *Context) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)
- func (c *Context) ReplyFile(name string, r io.Reader) (*discordgo.Message, error)
- func (c *Context) ReplyGIFImg(img *gif.GIF, name string) (*discordgo.Message, error)
- func (c *Context) ReplyJPGImg(img image.Image, name string) (*discordgo.Message, error)
- func (c *Context) ReplyPNGImg(img image.Image, name string) (*discordgo.Message, error)
- func (c *Context) TakeRest() string
- type ErrAddCommand
- type EventListener
- type Hanamaru
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPermission ¶
Types ¶
type Context ¶
type Context struct { Hanamaru *Hanamaru Command *Command *discordgo.MessageCreate Args []string }
func NewContext ¶
func NewContext(h *Hanamaru, cmd *Command, m *discordgo.MessageCreate) *Context
func (*Context) GetArgIndexDefault ¶
func (*Context) GetPreviousMessage ¶
func (*Context) GetSenderVoiceChannel ¶
func (*Context) ReplyEmbed ¶
func (*Context) ReplyGIFImg ¶
func (*Context) ReplyJPGImg ¶
This is name without extension btw, the following function will add it by itself
func (*Context) ReplyPNGImg ¶
ReplyPNGImg Sends img into the chat where the command is executed. Name excludes the extension
type ErrAddCommand ¶
type ErrAddCommand struct {
// contains filtered or unexported fields
}
func (ErrAddCommand) Error ¶
func (e ErrAddCommand) Error() string
type EventListener ¶
type Hanamaru ¶
type Hanamaru struct { Prefix string *discordgo.Session VoiceContext *voice.Context Commands []*Command EventListeners []*EventListener Db *sql.DB // contains filtered or unexported fields }
func (*Hanamaru) AddCommand ¶
func (*Hanamaru) AddEventListener ¶
func (h *Hanamaru) AddEventListener(listener *EventListener) error
AddEventListener adds and event listener to the bot.
func (*Hanamaru) AddEventListenerOnce ¶
func (h *Hanamaru) AddEventListenerOnce(listener *EventListener) error
func (*Hanamaru) EnableHelpCommand ¶
func (h *Hanamaru) EnableHelpCommand()
Click to show internal directories.
Click to hide internal directories.