C
C#2y ago
Ruttie

❔ Better user experience inputting commands

How would I get input from a user, the fancy way? What I mean is that for example when a user types 'could you run {appname}?' that it runs the application. I want a project of mine to be like talking to the program instead of executing commands
4 Replies
Thinker
Thinker2y ago
How advanced do you want this? It's easy to make a few pre-programmed patterns, but if you want something like ChatGPT then you're on a completely separate magnitude of complexity.
Ruttie
RuttieOP2y ago
I think a few pre-programmed patterns would be fine
Thinker
Thinker2y ago
string input = Console.ReadLine() ?? "";

if (input.StartsWith("could you start ", StringComparison.InvariantCultureIgnoreCase))
{
string appName = input[16..];
// etc.
}
string input = Console.ReadLine() ?? "";

if (input.StartsWith("could you start ", StringComparison.InvariantCultureIgnoreCase))
{
string appName = input[16..];
// etc.
}
this is of course very crude, but it could probably work
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server