add +gemini
This commit is contained in:
parent
ef1d27e79e
commit
ddd98b32ee
1 changed files with 13 additions and 0 deletions
|
@ -33,6 +33,19 @@ public class VM
|
|||
this.cvm.UserRenamed += (_, e) => CheckUsername(e.User);
|
||||
this.cvm.UserJoined += (_, e) => CheckUsername(e);
|
||||
this.cvm.RegisterCommand("+quote", QuoteCommand);
|
||||
this.cvm.RegisterCommand("+gemini", Gemini);
|
||||
}
|
||||
|
||||
private async void Gemini(string username, string prompt)
|
||||
{
|
||||
var http = new HttpClient();
|
||||
var response = await http.GetStringAsync("https://mail.elijahr.dev/gemini.php?cvm=1&q=" + Uri.EscapeDataString(prompt));
|
||||
var outs = response.Split('\n');
|
||||
foreach (var line in outs)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line)) continue;
|
||||
await cvm.SendXSSChat(WebUtility.HtmlEncode(line));
|
||||
}
|
||||
}
|
||||
|
||||
private async void QuoteCommand(string username, string[] args)
|
||||
|
|
Loading…
Reference in a new issue