mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
5.1
This commit is contained in:
23
src/NadekoBot/Modules/Utility/Ai/UtilityCommands.cs
Normal file
23
src/NadekoBot/Modules/Utility/Ai/UtilityCommands.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using NadekoBot.Modules.Administration;
|
||||
|
||||
namespace NadekoBot.Modules.Utility;
|
||||
|
||||
public partial class UtilityCommands
|
||||
{
|
||||
public class PromptCommands : NadekoModule<IAiAssistantService>
|
||||
{
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task Prompt([Leftover] string query)
|
||||
{
|
||||
await ctx.Channel.TriggerTypingAsync();
|
||||
var res = await _service.TryExecuteAiCommand(ctx.Guild, ctx.Message, (ITextChannel)ctx.Channel, query);
|
||||
}
|
||||
|
||||
private string GetCommandString(NadekoCommandCallModel res)
|
||||
=> $"{_bcs.Data.Prefix}{res.Name} {res.Arguments.Select((x, i) => GetParamString(x, i + 1 == res.Arguments.Count)).Join(" ")}";
|
||||
|
||||
private static string GetParamString(string val, bool isLast)
|
||||
=> isLast ? val : "\"" + val + "\"";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user