{"action":"created","issue":{"url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/307","repository_url":"https://api.github.com/repos/DSharpPlus/DSharpPlus","labels_url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/307/comments","events_url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/307/events","html_url":"https://github.com/DSharpPlus/DSharpPlus/issues/307","id":337655646,"node_id":"MDU6SXNzdWUzMzc2NTU2NDY=","number":307,"title":"Commands w/ body defined in abstract classes aren't registered in subclasses unless virtual & overriden","user":{"login":"uwx","id":13633343,"node_id":"MDQ6VXNlcjEzNjMzMzQz","avatar_url":"https://avatars0.githubusercontent.com/u/13633343?v=4","gravatar_id":"","url":"https://api.github.com/users/uwx","html_url":"https://github.com/uwx","followers_url":"https://api.github.com/users/uwx/followers","following_url":"https://api.github.com/users/uwx/following{/other_user}","gists_url":"https://api.github.com/users/uwx/gists{/gist_id}","starred_url":"https://api.github.com/users/uwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwx/subscriptions","organizations_url":"https://api.github.com/users/uwx/orgs","repos_url":"https://api.github.com/users/uwx/repos","events_url":"https://api.github.com/users/uwx/events{/privacy}","received_events_url":"https://api.github.com/users/uwx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-02T20:41:14Z","updated_at":"2018-07-02T20:57:01Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# Summary\r\nCommands declared in abstract classes extending `BaseCommandModule` do not propagate into their subclasses unless they are implemented or overriden in the subclass. This is both a bug report and a feature request, since it seems to be an oversight.\r\n\r\n# Details\r\n### Expected behavior\r\nRegistering a command in an abstract class, the command is propagated into whatever modules inherit that class\r\n\r\n### Actual behavior\r\nThe registered command doesn't appear in the subclass.\r\n\r\n# Steps to reproduce\r\n```cs\r\n    public abstract class BaseTestModule : BaseCommandModule\r\n    {\r\n        // works: subclass is required to override the method, and the command is registered there\r\n        [Command(\"atest\")]\r\n        public abstract Task Test1(CommandContext ctx);\r\n\r\n        // works only if the subclass registers an `override` method for it\r\n        [Command(\"atest2\")]\r\n        public virtual Task Test2(CommandContext ctx)\r\n        {\r\n            Console.WriteLine(\"Super\");\r\n            return Task.CompletedTask;\r\n        }\r\n\r\n        // doesn't work, method is not registered in the subclass\r\n        [Command(\"atest3\")]\r\n        public Task Test3(CommandContext ctx)\r\n        {\r\n            Console.WriteLine(\"Super\");\r\n            return Task.CompletedTask;\r\n        }\r\n    }\r\n\r\n    [Group(\"test\")]\r\n    public class TestImplementation : BaseTestModule\r\n    {\r\n        // works, will print test1\r\n        public override Task Test1(CommandContext ctx)\r\n        {\r\n            Console.WriteLine(\"test1\");\r\n            return Task.CompletedTask;\r\n        }\r\n\r\n        // works, will print test2\r\n        public override Task Test2(CommandContext ctx)\r\n        {\r\n            Console.WriteLine(\"test2\");\r\n            return Task.CompletedTask;\r\n        }\r\n        \r\n        // atest3 doesn't work, doesn't print anything\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/comments/401932914","html_url":"https://github.com/DSharpPlus/DSharpPlus/issues/307#issuecomment-401932914","issue_url":"https://api.github.com/repos/DSharpPlus/DSharpPlus/issues/307","id":401932914,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTkzMjkxNA==","user":{"login":"nathan130200","id":14365254,"node_id":"MDQ6VXNlcjE0MzY1MjU0","avatar_url":"https://avatars2.githubusercontent.com/u/14365254?v=4","gravatar_id":"","url":"https://api.github.com/users/nathan130200","html_url":"https://github.com/nathan130200","followers_url":"https://api.github.com/users/nathan130200/followers","following_url":"https://api.github.com/users/nathan130200/following{/other_user}","gists_url":"https://api.github.com/users/nathan130200/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan130200/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan130200/subscriptions","organizations_url":"https://api.github.com/users/nathan130200/orgs","repos_url":"https://api.github.com/users/nathan130200/repos","events_url":"https://api.github.com/users/nathan130200/events{/privacy}","received_events_url":"https://api.github.com/users/nathan130200/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T20:57:01Z","updated_at":"2018-07-02T20:57:01Z","author_association":"NONE","body":"😂 😝 "}}
{"actor":{"display_login":"nathan130200"}}