botinfo

package
v0.0.0-...-19a1b97 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package botinfo implements commands that return info about the bot.

Index

Constants

This section is empty.

Variables

View Source
var Commands = [...]basecommand.Command{
	{
		Name:       "botinfo",
		Aliases:    []string{"bot", "info", "botinfo", "about", "ping"},
		Desc:       "Replies with info about the bot.",
		Permission: permission.Normal,
		Handler: func(msg *base.IncomingMessage, args []arg.Arg) ([]*base.Message, error) {
			var resp strings.Builder
			fmt.Fprintf(&resp, "Beep boop, this is Airbot running as %s in %s", msg.Resources.Platform.Username(), msg.Message.Channel)
			fmt.Fprintf(&resp, " with prefix %s on %s.", msg.Prefix, msg.Resources.Platform.Name())
			fmt.Fprintf(&resp, " Made by airforce2700, source available on GitHub ( %ssource )", msg.Prefix)
			return []*base.Message{
				{
					Channel: msg.Message.Channel,
					Text:    resp.String(),
				},
			}, nil
		},
	},
	{
		Name:       "prefix",
		Desc:       "Replies with the prefix in this channel.",
		Permission: permission.Normal,
		Handler: func(msg *base.IncomingMessage, args []arg.Arg) ([]*base.Message, error) {
			return []*base.Message{
				{
					Channel: msg.Message.Channel,
					Text:    "This channel's prefix is " + msg.Prefix,
				},
			}, nil
		},
	},
	{
		Name:       "source",
		Desc:       "Replies a link to the bot's source code.",
		Permission: permission.Normal,
		Handler: func(msg *base.IncomingMessage, args []arg.Arg) ([]*base.Message, error) {
			return []*base.Message{
				{
					Channel: msg.Message.Channel,
					Text:    "Source code for Airbot available at https://github.com/airforce270/airbot",
				},
			}, nil
		},
	},
	{
		Name:       "stats",
		Desc:       "Replies with stats about the bot.",
		Permission: permission.Normal,
		Handler:    stats,
	},
}

Commands contains this package's commands.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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