Files
Discord.Net/samples/ShardedClient/Modules/InteractionModule.cs
Armano den Boef 47de5a2fb4 Greatly reduce code complexity & make IF samples functional (#2205)
* Greatly reduce code complexity

* Fixes sharded client IF implementation
2022-03-26 09:37:30 -03:00

19 lines
693 B
C#

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>
{
[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);
}
}
}