Skip to content

Contributing

GreemDev edited this page Jan 26, 2020 · 13 revisions

Most trivial contributions are welcome. Fixing grammar (although my grammar is very good, accidents happen), non-breaking changes, etc.

If you want to make a breaking change, e.g. renaming a GuildData property name, then you need to ask me on Discord. Easiest way to do so is to join my Discord guild and ask. If I say no, then the best idea is for you to not make that pull request, as the changes won't be accepted. Chances are, that if I say no I'm already planning to make it myself (and I have a specific way of doing so) or I don't want it in the bot.

You don't need to ask for permission if I've said in my Discord guild that I want to add it. If you follow these guidelines, you're probably gonna be good.

Do not make a Pull Request that completely nukes a dependency.

I.e. do not make a PR that removes Qmmands entirely because Discord.Commands exists. Hint: there's a reason why I don't use Discord.Commands. Plus, Discord.Commands was removed as a dependency in V3.x.

Contributing Commands:

  • File name must be <CommandName>Command.
  • File name must be, if multiple commands are in that file, <CommandGroupName>Commands.
    • Completely unrelated commands need to be in their own file.
  • Make them public, sealed, partial classes of the Module they belong to.
    • If they're, for example, in the Utility module, you'd do public sealed partial class UtilityModule inside of the Utility commands folder. Make sure the namespace is NOT Volte.Commands.Modules.<ModuleNameHere>!
  • Command methods MUST have a name, relevant aliases, a Description, and a Usage remark even if it doesn't take any arguments.
  • Command method must be <CommandName>Async and be a public async method returning Task (where T is ActionResult).
    • If a command method doesn't do anything asynchronously, it may not be async. It needs to return a Task.FromResult(), but still be a Task (where T is ActionResult) if that is the case.
  • If a command is in the Moderator or Admin/AdminUtility module, you must use the RequireGuildModerator or RequireGuildAdmin attribute (respectively).
    • If the bot is doing any admin actions you must also include the RequireBotGuildPermission or RequireBotChannelPermission attribute.
  • If a command is in the BotOwner module, you must use the RequireBotOwner attribute. If this is omitted, the Pull Request WILL be rejected.
  • Commands must return an ActionResult as of V3. Do so by returning Ok(), BadRequest(), and None().
    • You can see the possible parameter values in the source code. None() does not take any arguments, ever, unless it's a lambda expression for separate logic (like in the Ping command.)

An example of a fully-compliant command can be found here.

Clone this wiki locally