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 683 B

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