Categorygithub.com/ethanent/discordgo-scm/v3
modulepackage
3.0.2
Repository: https://github.com/ethanent/discordgo-scm.git
Documentation: pkg.go.dev

# README

discordgo-scm

Slash commands manager for discordgo

Go Reference

Install

go get github.com/ethanent/discordgo-scm/v3

Usage

SCM is based around the concept of a Feature. It's meant to be a somewhat futureproof way to handle all kinds of Discord interactions.

You may create Features for a number of different interaction types, including ApplicationCommand, ApplicationCommandAutocomplete, and MessageComponent.

Interaction TypeRelevant Feature Properties
discordgo.InteractionApplicationCommandType, Handler, ApplicationCommand
discordgo.InteractionApplicationCommandAutocompleteType, Handler, ApplicationCommand
discordgo.InteractionMessageComponentType, Handler, CustomID

Now, to actually use the library, you must create an SCM and add Features.

Create an SCM:

m := scm.NewSCM()

Add a Feature to your SCM:

m.AddFeature(myFeature)

Have your SCM handle interactions with a bot:

s.AddHandler(m.HandleInteractionCreate)

Register ApplicationCommands with your bot:

// Where s is your discordgo session

err := m.CreateCommands(s, "")
// Please handle your errors :)

Delete ApplicationCommands once bot shuts down:

m.DeleteCommands(s, "")

See the godoc for full details.

# Functions

No description provided by the author

# Structs

Feature is a handler for various events.
No description provided by the author