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

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