Files
Discord.Net/samples/ShardedClient/Modules/InteractionModule.cs
Mihail Gribkov e2e8c0fd6a Update sample projects & samples in docs (#2823)
* update them all

* more docs

* moar docs
2024-01-11 15:25:56 +00:00

17 lines
626 B
C#

using Discord.Interactions;
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>
{
[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);
}
}