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.

UserCommandModule.cs 640 B

1234567891011121314151617
  1. using Discord;
  2. using Discord.Interactions;
  3. using Discord.WebSocket;
  4. using System.Threading.Tasks;
  5. namespace InteractionFramework.Modules
  6. {
  7. // A transient module for executing commands. This module will NOT keep any information after the command is executed.
  8. class UserCommandModule : InteractionModuleBase<SocketInteractionContext<SocketUserCommand>>
  9. {
  10. // This command will greet target user in the channel this was executed in.
  11. [UserCommand("greet")]
  12. public async Task GreetUserAsync(IUser user)
  13. => await RespondAsync(text: $":wave: {Context.User} said hi to you, <@{user.Id}>!");
  14. }
  15. }