Browse Source

Improve group module example

pull/1161/head
Still Hsu 7 years ago
parent
commit
ddc3242e71
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      docs/guides/commands/samples/groups.cs

+ 11
- 4
docs/guides/commands/samples/groups.cs View File

@@ -4,15 +4,22 @@ public class AdminModule : ModuleBase<SocketCommandContext>
[Group("clean")] [Group("clean")]
public class CleanModule : ModuleBase<SocketCommandContext> public class CleanModule : ModuleBase<SocketCommandContext>
{ {
// ~admin clean 15
// ~admin clean
[Command] [Command]
public async Task Default(int count = 10) => Messages(count);
public async Task DefaultCleanAsync()
{
// ...
}


// ~admin clean messages 15 // ~admin clean messages 15
[Command("messages")] [Command("messages")]
public async Task Messages(int count = 10) { }
public async Task CleanAsync(int count)
{
// ...
}
} }
// ~admin ban foxbot#0282 // ~admin ban foxbot#0282
[Command("ban")] [Command("ban")]
public async Task Ban(IGuildUser user) { }
public Task BanAsync(IGuildUser user) =>
Context.Guild.AddBanAsync(user);
} }

Loading…
Cancel
Save