Add DiscordShardedClient sample project & Client FAQ entry. (#1177)
* Add DiscordShardedClient sample project & Client FAQ entry. * Revise language, fix typo, add xrefs * Adjust placement of message handler. * Resolve DI issue with initialized client; properly initialize command handling service.
This commit is contained in:
committed by
Christopher F
parent
fb8dbcae4b
commit
00097d3c27
17
samples/03_sharded_client/Modules/PublicModule.cs
Normal file
17
samples/03_sharded_client/Modules/PublicModule.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
|
||||
namespace _03_sharded_client.Modules
|
||||
{
|
||||
// Remember to make your module reference the ShardedCommandContext
|
||||
public class PublicModule : ModuleBase<ShardedCommandContext>
|
||||
{
|
||||
[Command("info")]
|
||||
public async Task InfoAsync()
|
||||
{
|
||||
var msg = $@"Hi {Context.User}! There are currently {Context.Client.Shards} shards!
|
||||
This guild is being served by shard number {Context.Client.GetShardFor(Context.Guild).ShardId}";
|
||||
await ReplyAsync(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user