Adding Entity guides, flowcharts, better sample system. (#2054)
* 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
This commit is contained in:
17
samples/InteractionFramework/Modules/UserCommandModule.cs
Normal file
17
samples/InteractionFramework/Modules/UserCommandModule.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
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}>!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user