Browse Source

added an example of `ComponentInteraction` with `ignoreGroupNames = true`

pull/2374/head
Misha133 2 years ago
parent
commit
7d2f27f3ad
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      docs/guides/int_framework/samples/intro/groupmodule.cs

+ 6
- 1
docs/guides/int_framework/samples/intro/groupmodule.cs View File

@@ -16,6 +16,11 @@ public class CommandGroupModule : InteractionModuleBase<SocketInteractionContext
// group-name subcommand-group-name echo
[SlashCommand("echo", "Echo an input")]
public async Task EchoSubcommand(string input)
=> await RespondAsync(input);
=> await RespondAsync(input, components: new ComponentBuilder().WithButton("Echo", $"echoButton_{input}").Build());

// Component interaction with ignoreGroupNames set to true
[ComponentInteraction("echoButton_*", true)]
public async Task EchoButton(string input)
=> await RespondAsync(input);
}
}

Loading…
Cancel
Save