server

package
v0.0.0-...-32366e0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleServer

func HandleServer(server *ServerState) error

Takes discord bot and creates a server session that listens to messages on the server

func ServerInit

func ServerInit(amigo cli.AmigoExecutionContext) error

func ServerMessageHandler

func ServerMessageHandler(server *ServerState) func(*discordgo.Session, *discordgo.MessageCreate)

func ServerReactionAddHandler

func ServerReactionAddHandler(server *ServerState) func(*discordgo.Session, *discordgo.MessageReactionAdd)

func ServerReactionRemoveHandler

func ServerReactionRemoveHandler(server *ServerState) func(*discordgo.Session, *discordgo.MessageReactionRemove)

func ServerScheduledActionHandler

func ServerScheduledActionHandler(server *ServerState)

Types

type AmiBot

type AmiBot struct {
	ServerState *ServerState
	// contains filtered or unexported fields
}

func InitBot

func InitBot(s *ServerState) AmiBot

func (*AmiBot) HandleCommand

func (ami *AmiBot) HandleCommand(command AmiCommandContext)

func (*AmiBot) Help

func (ami *AmiBot) Help(msgCtx *MessageContext)

type AmiCommandContext

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

type AmiCommandHandler

type AmiCommandHandler func(server *ServerState, commandContext AmiCommandContext)

type AmiCommandSpec

type AmiCommandSpec map[string]AmiCommandHandler

type MessageContext

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

type ServerState

type ServerState struct {
	Session          *discordgo.Session
	ExecutionContext cli.AmigoExecutionContext
	// contains filtered or unexported fields
}

DiscordBot is a wrapper struct that will contain all metadata for a bot's running session

Jump to

Keyboard shortcuts

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