You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

InteractionModule.cs 693 B

123456789101112131415161718
  1. using Discord.Interactions;
  2. using Discord.WebSocket;
  3. using System.Threading.Tasks;
  4. namespace ShardedClient.Modules
  5. {
  6. // A display of portability, which shows how minimal the difference between the 2 frameworks is.
  7. public class InteractionModule : InteractionModuleBase<ShardedInteractionContext>
  8. {
  9. [SlashCommand("info", "Information about this shard.")]
  10. public async Task InfoAsync()
  11. {
  12. var msg = $@"Hi {Context.User}! There are currently {Context.Client.Shards.Count} shards!
  13. This guild is being served by shard number {Context.Client.GetShardFor(Context.Guild).ShardId}";
  14. await RespondAsync(msg);
  15. }
  16. }
  17. }