Categorygithub.com/dougrich/go-discordbot
modulepackage
0.0.0-20220413032243-5c04f8a87d86
Repository: https://github.com/dougrich/go-discordbot.git
Documentation: pkg.go.dev

# README

go-discordbot

This is a bot built on top of bwmarrin's discordgo aimed at providing a more high level & ergonomic method for slash commands and simplifying a lot of the API.

Bots are composed of multiple packages:

func main() {
    discordbot.New(bottoken, config)
        .Include(...package...)
        .Include(...package...)
        .Start()
}

Each package is pretty simple:

type DiscordbotPackage interface {
    Name() string
    Register(*discordbot.Bot) (error)
}

Inside of the Register function, the package can repeatedly call bot.AddCommand(name, options, description, handler) which will automatically populate the help information & sort out how to respond to slash commands. Additionally, any background tasks here can be started and their cleanup can be connected with bot.Defer

For example, a simple add command see go-discordbot/examples/cmd/add:

# Packages

No description provided by the author

# Functions

retrieves the guild id from a given slash command context.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Wrapper for a slash commands arguments.
instance of a discordbot.
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author