cmd

package
v0.0.0-...-d98e327 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiNooter

type ApiNooter interface {
	NootMessage(msg string)
}

This is the general nooter interface. If you want your command to work with all platforms, Noot this way

type CatHttp

type CatHttp struct {
	Url string `json:"url"`
	Id  string `json:"id"`
}

type Command

type Command struct {
	Name        string // The command string to search for
	Description string // The command's description and usage
	Handler     Commander
}

type Commander

type Commander interface {
	Handle(ApiNooter, Message)
}

type DiscordNooter

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

This is a discord specific nooter. If you want to use special discord features, Noot this way

func NewDiscordNooter

func NewDiscordNooter(channel string, session *discordgo.Session) *DiscordNooter

func (*DiscordNooter) NootComplexMessage

func (d *DiscordNooter) NootComplexMessage(complexMessage *discordgo.MessageSend) *discordgo.Message

func (*DiscordNooter) NootDeleteMessage

func (d *DiscordNooter) NootDeleteMessage(msgId string)

func (*DiscordNooter) NootMessage

func (d *DiscordNooter) NootMessage(msg string)

func (*DiscordNooter) NootReact

func (d *DiscordNooter) NootReact(msgId string, reaction string)

type DogHttp

type DogHttp struct {
	Message string
	// contains filtered or unexported fields
}

type EchoCommander

type EchoCommander struct {
}

func (EchoCommander) Handle

func (c EchoCommander) Handle(n ApiNooter, msg Message)

type InfoCommander

type InfoCommander struct {
	Content string
}

func NewInfoCommander

func NewInfoCommander(commands []Command) *InfoCommander

func (*InfoCommander) Handle

func (c *InfoCommander) Handle(s ApiNooter, m Message)

type JavaCommander

type JavaCommander struct{}

The `!java` command generates a random Java variable assignment

func (JavaCommander) Handle

func (jc JavaCommander) Handle(n ApiNooter, msg Message)

type Message

type Message struct {
	Id     string        // Message id
	Author User          // This is the person who sent the Message
	Parsed ParsedMessage // This is the parsed message
}

type NootCommander

type NootCommander struct{}

func (NootCommander) Handle

func (c NootCommander) Handle(s ApiNooter, m Message)

type NootlangCommander

type NootlangCommander struct{}

func (NootlangCommander) Handle

func (c NootlangCommander) Handle(n ApiNooter, msg Message)

type NotificationCommander

type NotificationCommander struct {
	NotifierId            string
	NotificationChannelId string
	NotificationEmoji     string
}

func NewNotificationCommander

func NewNotificationCommander(configPath string) NotificationCommander

func (NotificationCommander) Handle

func (c NotificationCommander) Handle(s ApiNooter, m Message)

type ParsedMessage

type ParsedMessage struct {
	Command string // This is the command that was detected
	Prefix  string // This is string before the command
	Postfix string // This is the string after the command
}

type PollCommander

type PollCommander struct{}

func (PollCommander) Handle

func (c PollCommander) Handle(s ApiNooter, m Message)

type PossibleArgs

type PossibleArgs []string

func (PossibleArgs) Has

func (list PossibleArgs) Has(a string) bool

type RandomCommander

type RandomCommander struct{}

func (RandomCommander) Handle

func (c RandomCommander) Handle(s ApiNooter, m Message)

type RecursionCommander

type RecursionCommander struct {
}

func (RecursionCommander) Handle

func (c RecursionCommander) Handle(n ApiNooter, msg Message)

type User

type User struct {
	Id   string // This is the channel id. I think this can't change?
	Name string // This is the users current display name. I think this can change
}

type WeatherCommander

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

mapped to the cmd command !weather

func NewWeatherCommander

func NewWeatherCommander(tokenFile string) WeatherCommander

func (WeatherCommander) Handle

func (c WeatherCommander) Handle(s ApiNooter, m Message)

Main functionality of the command which handles getting the weather, parsing the json response, then outputting the proper weather report with the apporiate units and associated weather emoji

type WeatherHTTP

type WeatherHTTP struct {
	Weather []wWeather `json:"weather"`
	Main    wMain      `json:"main"`
}

the main struct to handle all of the json response from weather api

Jump to

Keyboard shortcuts

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