Dgrouter Save

router to help speed up bot development in discordgo

Project README

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")
Open Source Agenda is not affiliated with "Dgrouter" Project. README Source: Necroforger/dgrouter
Stars
60
Open Issues
3
Last Commit
3 years ago

Open Source Agenda Badge

Open Source Agenda Rating