{"id":19532577,"url":"https://github.com/zackartz/cmdlr2","last_synced_at":"2025-06-25T00:07:05.300Z","repository":{"id":55104789,"uuid":"328340899","full_name":"zackartz/cmdlr2","owner":"zackartz","description":"Command handler for disgord. Based off of the excellent command handler dgc","archived":false,"fork":false,"pushed_at":"2021-09-06T01:50:14.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T03:31:42.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zackartz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-10T08:55:03.000Z","updated_at":"2021-09-06T01:48:17.000Z","dependencies_parsed_at":"2022-08-14T12:10:13.617Z","dependency_job_id":null,"html_url":"https://github.com/zackartz/cmdlr2","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/zackartz/cmdlr2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackartz%2Fcmdlr2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackartz%2Fcmdlr2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackartz%2Fcmdlr2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackartz%2Fcmdlr2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackartz","download_url":"https://codeload.github.com/zackartz/cmdlr2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackartz%2Fcmdlr2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261777690,"owners_count":23208125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:52:18.340Z","updated_at":"2025-06-25T00:07:04.724Z","avatar_url":"https://github.com/zackartz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmdlr2\n\ncmdlr2 is a command handler framework for the discord wrapper [disgord](https://github.com/andersfylling/disgord). It is heavily inspired (some files are the same) to a framework for discordgo called [dgc](https://github.com/lus/dgc/). I in no way claim to be the original creator of this, this is only a fork for disgord. \n\nExample starter app:\n\n```go\npackage main\n\nimport (\n\t\"github.com/andersfylling/disgord\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/zackartz/cmdlr2\"\n\t\"os\"\n)\n\nvar log = \u0026logrus.Logger{\n\tOut:       os.Stderr,\n\tFormatter: new(logrus.TextFormatter),\n\tHooks:     make(logrus.LevelHooks),\n\tLevel:     logrus.DebugLevel,\n}\n\nfunc main() {\n\t// Set up a new Disgord client\n\tclient := disgord.New(disgord.Config{\n\t\tBotToken: os.Getenv(\"DISCORD_TOKEN\"),\n\t\tLogger:   log,\n\t})\n\tdefer client.Gateway().StayConnectedUntilInterrupted()\n\n\trouter := cmdlr2.Create(\u0026cmdlr2.Router{\n\t\tPrefixes:         []string{\"$\"},\n\t\tClient:           client,\n\t\tBotsAllowed:      false,\n\t\tIgnorePrefixCase: true,\n\t})\n\n\trouter.RegisterCMD(\u0026cmdlr2.Command{\n\t\tName:        \"ping\",\n\t\tDescription: \"It pings.. and yknow.. pongs\",\n\t\tUsage:       \"ping\",\n\t\tExample:     \"ping\",\n\t\tHandler: func(ctx *cmdlr2.Ctx) {\n\t\t\tctx.ResponseText(\"pong\")\n\t\t},\n\t})\n\n\trouter.RegisterDefaultHelpCommand(client)\n\n\trouter.Initialize(client)\n}\n```\n\nIn this case make sure to set the DISCORD_TOKEN environment variable to the value of your discord token. \n\n### CONSIDER THIS BETA SOFTWARE\n\nI have a bot that it is using this and it is working however, you may have problems with dgc's implementation of middleware.\n\nGood luck.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackartz%2Fcmdlr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackartz%2Fcmdlr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackartz%2Fcmdlr2/lists"}