Skip to content

router to help speed up bot development in discordgo

Notifications You must be signed in to change notification settings

auttaja/dgrouter

 
 

Repository files navigation

dgrouter

Router to simplify command routing in discord bots. exrouter provides some extra features like wrapping the router type to add command handlers which typecast to its own Context type.

If you make any interesting changes feel free to submit a Pull Request

Features

example

router.On("ping", func(ctx *exrouter.Context) { ctx.Reply("pong")}).Desc("responds with pong")

router.On("avatar", func(ctx *exrouter.Context) {
	ctx.Reply(ctx.Msg.Author.AvatarURL("2048"))
}).Desc("returns the user's avatar")

router.Default = router.On("help", func(ctx *exrouter.Context) {
	var text = ""
	for _, v := range router.Routes {
		text += v.Name + " : \t" + v.Description + "\n"
	}
	ctx.Reply("```" + text + "```")
}).Desc("prints this help menu")

About

router to help speed up bot development in discordgo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%