* initial * Interaction glossary entry * Sharded Interaction sample * Renames into solution * Debugging samples * Modify target location for webhookclient * Finalizing docs work, resolving docfx errors. * Adding threaduser to user chart * Add branch info to readme. * Edits to user chart * Resolve format for glossary entries * Patch sln target * Issue with file naming fixed * Patch 1/x for builds * Appending suggestions
18 lines
640 B
C#
18 lines
640 B
C#
using Discord;
|
|
using Discord.Interactions;
|
|
using Discord.WebSocket;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace InteractionFramework.Modules
|
|
{
|
|
// A transient module for executing commands. This module will NOT keep any information after the command is executed.
|
|
class UserCommandModule : InteractionModuleBase<SocketInteractionContext<SocketUserCommand>>
|
|
{
|
|
// This command will greet target user in the channel this was executed in.
|
|
[UserCommand("greet")]
|
|
public async Task GreetUserAsync(IUser user)
|
|
=> await RespondAsync(text: $":wave: {Context.User} said hi to you, <@{user.Id}>!");
|
|
}
|
|
}
|
|
|