-
-
Notifications
You must be signed in to change notification settings - Fork 18
Contributing
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.
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.
- 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 UtilityModuleinside of theUtilitycommands folder. Make sure the namespace is NOTVolte.Commands.Modules.<ModuleNameHere>!
- If they're, for example, in the Utility module, you'd do
- 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>Asyncand be a public async method returning Task (where T isActionResult).- 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 isActionResult) if that is the case.
- If a command method doesn't do anything asynchronously, it may not be async. It needs to return a
- If a command is in the Moderator or Admin/AdminUtility module, you must use the
RequireGuildModeratororRequireGuildAdminattribute (respectively).- If the bot is doing any admin actions you must also include the
RequireBotGuildPermissionorRequireBotChannelPermissionattribute.
- If the bot is doing any admin actions you must also include the
- If a command is in the BotOwner module, you must use the
RequireBotOwnerattribute. If this is omitted, the Pull Request WILL be rejected. - Commands must return an ActionResult as of V3. Do so by returning
Ok(),BadRequest(), andNone().- 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.
Not finding anything you're looking for? Feel free to join Volte's Discord Guild for help or questions!