Speech.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Text;
  5. using System.ConsoleApp;
  6. using System.ConsoleApp.Commands;
  7. namespace Keln.Commands.Speech {
  8. [ConsoleCommand("speech"), ConsoleCommand("say")]
  9. public class Speech : BaseCommand {
  10. public static bool execute() {
  11. System.Diagnostics.Debug.WriteLine("ConsoleCommand: DeviceEmotion::execute()");
  12. return true;
  13. }
  14. public static string LineStartText() {
  15. return "Speech";
  16. }
  17. [ConsoleCommand("qqq")]
  18. [ConsoleCommand("exit")]
  19. [ConsoleCommand("quit")]
  20. public static bool exit() {
  21. return false;
  22. }
  23. [ConsoleCommand("say")]
  24. public static bool get(string line, string cmd, NameValueCollection arguments) {
  25. string text = arguments["general"];
  26. if (text.Length == 0) {
  27. if (!Input("What to say", ref text, InputStyle.All)) {
  28. return true;
  29. }
  30. }
  31. NameValueCollection value = new NameValueCollection() { { "say", text } };
  32. Leah.Client.GetJson(Leah.Client.eService.Speech, "say.cgi", value);
  33. return true;
  34. }
  35. }
  36. }