bot

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlreadyUpToDateEmbed

func AlreadyUpToDateEmbed(cfg Config, hash string) *discordgo.MessageEmbed

AlreadyUpToDateEmbed is the blurple "no change" embed.

func FailureEmbed

func FailureEmbed(tail string) *discordgo.MessageEmbed

FailureEmbed is the red ephemeral failure embed carrying the log tail.

func IsAdmin

func IsAdmin(i *discordgo.InteractionCreate) bool

IsAdmin reports whether the interaction member has Administrator permission.

func Start

func Start(cfg Config) (func(), error)

Start opens the gateway, sets presence, registers commands. Always returns a non-nil closer. (noop, nil) if Token is empty.

func SuccessEmbed

func SuccessEmbed(cfg Config, fromHash, toHash string) *discordgo.MessageEmbed

SuccessEmbed is the green from->to embed.

func VerifyResponse

func VerifyResponse(cfg Config) *discordgo.InteractionResponse

VerifyResponse builds the ephemeral build-identity embed response.

Types

type Command

type Command struct {
	Def     *discordgo.ApplicationCommand
	Handler func(*discordgo.Session, *discordgo.InteractionCreate)
}

Command is an app-supplied slash command and its handler.

type Config

type Config struct {
	Name              string
	Token             string
	AppID             string
	GuildID           string
	RepoURL           string
	Build             contract.VerifyInfo
	DeployAgentURL    string
	DeployAgentSecret string
	SharedRoleID      string
	Extra             []Command
}

Config holds everything the bot needs. DeployAgentURL/Secret enable /updateserver.

Jump to

Keyboard shortcuts

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