Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lus/dgc
A DiscordGo command router with tons of useful features
https://github.com/lus/dgc
bot command discord discordgo router
Last synced: about 2 months ago
JSON representation
A DiscordGo command router with tons of useful features
- Host: GitHub
- URL: https://github.com/lus/dgc
- Owner: lus
- License: mit
- Archived: true
- Created: 2020-05-12T16:10:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-30T19:09:06.000Z (about 3 years ago)
- Last Synced: 2024-09-21T18:25:48.012Z (about 2 months ago)
- Topics: bot, command, discord, discordgo, router
- Language: Go
- Size: 61.5 KB
- Stars: 53
- Watchers: 4
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/Lukaesebrot/dgc)
# dgc
A DiscordGo command router with tons of useful features
If you find any bugs or if you have a feature request, please tell me using an issue.## Deprecation notice
After thinking a lot about how to continue this project, I decided I won't.
The main reason for this is that Discord will make the message content intent privileged in 2022 and thus will force every bot developer to use slash commands.
I don't feel motivated to continue a project which will become pretty much redundant in the next months, especially because a major rewrite of some features would be mandatory for me as I started the project at the beginning of my Go learning period and I evolved a lot since then.
I think I could use the time much better for new, cooler projects.## Basic example
This just shows a very basic example:
```go
func main() {
// Discord bot logic here
session, _ := ...// Create a new command router
router := dgc.Create(&dgc.Router{
Prefixes: []string{"!"},
})// Register a simple ping command
router.RegisterCmd(&dgc.Command{
Name: "ping",
Description: "Responds with 'pong!'",
Usage: "ping",
Example: "ping",
IgnoreCase: true,
Handler: func(ctx *dgc.Ctx) {
ctx.RespondText("Pong!")
},
})// Initialize the router
router.Initialize(session)
}
```## Usage
You can find examples for the more complex usage and all the integrated features in the `examples/*.go` files.
## Arguments
To find out how you can use the integrated argument parser, just look into the `examples/arguments.go` file.