https://github.com/eminarican/disgomd
Disgo command utility
https://github.com/eminarican/disgomd
bot command discord disgo disgord go golang slash-command
Last synced: about 1 month ago
JSON representation
Disgo command utility
- Host: GitHub
- URL: https://github.com/eminarican/disgomd
- Owner: eminarican
- License: gpl-3.0
- Created: 2022-07-23T13:46:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-07T09:58:36.000Z (over 3 years ago)
- Last Synced: 2024-12-28T03:42:37.007Z (over 1 year ago)
- Topics: bot, command, discord, disgo, disgord, go, golang, slash-command
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Disgomd
## Todo
- write a readme :P
- add slash commands support
## Example usage
```go
func main() {
cli, err := disgo.New(os.Getenv("bot_token"),
bot.WithGatewayConfigOpts(
gateway.WithIntents(
gateway.IntentGuildMessages,
gateway.IntentMessageContent,
),
),
)
defer cli.Close(context.TODO())
if err != nil {
fmt.Println("Couldn't create client")
os.Exit(1)
}
cmd.Init(cli, "!")
cmd.Register(cmd.New("test", "just a test command", nil, TestCommand{}))
err = cli.OpenGateway(context.TODO())
if err != nil {
fmt.Println("Couldn't open gateway")
os.Exit(1)
}
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-s
}
type TestCommand struct{}
func (TestCommand) Run(ctx cmd.Context) discord.MessageCreate {
return discord.NewMessageCreateBuilder().
SetContent("Hi this is a test message :)").Build()
}
```
thanks to [dragonfly](https://github.com/df-mc/dragonfly) contributors for command system