-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoCompleteHandlerGeneral.cs
41 lines (36 loc) · 1.24 KB
/
AutoCompleteHandlerGeneral.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Discord;
using Discord.Interactions;
using Discord.WebSocket;
using AutoCompleteBot.Commands;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AutoCompleteBot
{
internal class AutoCompleteHandlerGeneral : AutocompleteHandler
{
public override async Task<AutocompletionResult> GenerateSuggestionsAsync(IInteractionContext context, IAutocompleteInteraction autocompleteInteraction, IParameterInfo parameter, IServiceProvider services)
{
AutocompletionResult options = new AutocompletionResult();
var cmdData = (SocketAutocompleteInteractionData)context.Interaction.Data;
switch (cmdData.CommandName)
{
case CMD_Say.SLASH_CMD_ID:
{
CMD_Say cmd = new CMD_Say();
options = cmd.GenerateSuggestions(cmdData.Options);
}
break;
default:
{
Debug.WriteLine($"You executed {cmdData.CommandName}");
}
break;
}
return options;
}
}
}