Adding Entity guides, flowcharts, better sample system. (#2054)
* initial * Interaction glossary entry * Sharded Interaction sample * Renames into solution * Debugging samples * Modify target location for webhookclient * Finalizing docs work, resolving docfx errors. * Adding threaduser to user chart * Add branch info to readme. * Edits to user chart * Resolve format for glossary entries * Patch sln target * Issue with file naming fixed * Patch 1/x for builds * Appending suggestions
This commit is contained in:
18
samples/ShardedClient/Modules/InteractionModule.cs
Normal file
18
samples/ShardedClient/Modules/InteractionModule.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Discord.Interactions;
|
||||
using Discord.WebSocket;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ShardedClient.Modules
|
||||
{
|
||||
// A display of portability, which shows how minimal the difference between the 2 frameworks is.
|
||||
public class InteractionModule : InteractionModuleBase<ShardedInteractionContext<SocketSlashCommand>>
|
||||
{
|
||||
[SlashCommand("info", "Information about this shard.")]
|
||||
public async Task InfoAsync()
|
||||
{
|
||||
var msg = $@"Hi {Context.User}! There are currently {Context.Client.Shards.Count} shards!
|
||||
This guild is being served by shard number {Context.Client.GetShardFor(Context.Guild).ShardId}";
|
||||
await RespondAsync(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
samples/ShardedClient/Modules/PublicModule.cs
Normal file
17
samples/ShardedClient/Modules/PublicModule.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Discord.Commands;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ShardedClient.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.Count} 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