bot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(l zerolog.Logger, b *Bot, c *cmd.Conf)

Types

type Bot

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

func NewBot

func NewBot(lc fx.Lifecycle, l zerolog.Logger, c *cmd.Conf, cmds []commands.Command, p *player.Players, storage *storage.StormDB, a *acl.ACL) *Bot

func (*Bot) AddCommand

func (b *Bot) AddCommand(c commands.Command)

func (*Bot) DisplayCommandHelp

func (b *Bot) DisplayCommandHelp(s *discordgo.Session, m *discordgo.MessageCreate, cmd string)

DisplayCommandHelp will display the help section for a given command

func (*Bot) DisplayGlobalHelp

func (b *Bot) DisplayGlobalHelp(s *discordgo.Session, m *discordgo.MessageCreate)

DisplayGlobalHelp will cycle through the available command and display a global help

func (*Bot) GetInvitingUser

func (b *Bot) GetInvitingUser(s *discordgo.Session, g *discordgo.GuildCreate) string

func (*Bot) GuildCreatedHandler

func (b *Bot) GuildCreatedHandler(s *discordgo.Session, g *discordgo.GuildCreate)

func (*Bot) InitialCheck

func (b *Bot) InitialCheck(s *discordgo.Session, m *discordgo.MessageCreate) bool

InitialCheck will perform basic checks, unrelated to commands It will check if the prefix is present in the message, whether or not the sender is a bot, or if the sender is itself If this method returns true then it is safe to proceed

func (*Bot) MessageCreatedHandler

func (b *Bot) MessageCreatedHandler(s *discordgo.Session, m *discordgo.MessageCreate)

func (*Bot) MessageInviter

func (b *Bot) MessageInviter(s *discordgo.Session, g *discordgo.GuildCreate)

type CommandMap

type CommandMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*CommandMap) Get

func (cm *CommandMap) Get(c string) (commands.Command, bool)

Jump to

Keyboard shortcuts

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