reporting.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. module.exports = class Reporting {
  2. help(room, mobile, input) {
  3. var topic = input.join(" ").trim();
  4. switch(topic) {
  5. case "buglist":
  6. libs.Output.toMobile(mobile.id, "Development is ongoing, so as people play they may come across bugs that have already been reported. Use this command to see if there are any reports for a bug you have encountered.");
  7. libs.Output.toMobile(mobile.id, "* buglist - requests a list of bugs from the Trello board");
  8. return true;
  9. case "wishlist":
  10. case "featurelist":
  11. libs.Output.toMobile(mobile.id, "Development is ongoing, so as people play they may be inspired to request new features. Use this command to see if there are any requests for features you want.");
  12. libs.Output.toMobile(mobile.id, "* wishlist - requests a list of features from the Trello board");
  13. return true;
  14. case "bug":
  15. libs.Output.toMobile(mobile.id, "If you have found a bug that isn't already reported (check the {hint}buglist{/hint}, you can add one.");
  16. libs.Output.toMobile(mobile.id, "* bug [description] - submits a new bug to the Trello board");
  17. return true;
  18. case "feature":
  19. libs.Output.toMobile(mobile.id, "If you want to request a feature that isn't already requested (check the {hint}wishlist{/hint}, you can add one.");
  20. libs.Output.toMobile(mobile.id, "* feature [description] - submits a new feature to the Trello board");
  21. return true;
  22. }
  23. }
  24. bug(room, mobile, input) {
  25. var bugmessage = input.join(" ");
  26. libs.Trello.reportBug(bugmessage, function(status, result) {
  27. if(status != "error") {
  28. libs.Output.toMobile(mobile.id, "You add '" + bugmessage + "' to the buglist", mobile);
  29. } else {
  30. libs.Output.toMobile(mobile.id, "Adding to the buglist failed: " + result.error, mobile);
  31. }
  32. })
  33. libs.Output.toMobile(mobile.id, "Sending bug report", mobile);
  34. return true;
  35. }
  36. buglist(room, mobile, input){
  37. libs.Trello.requestBugList(function(status, bugs){
  38. for(var i in bugs) {
  39. var bug = bugs[i];
  40. libs.Output.toMobile(mobile.id, bug.pos + ":" + bug.name, mobile);
  41. }
  42. });
  43. libs.Output.toMobile(mobile.id, "Retrieving buglist from ("+config.trelloUrl+")", mobile);
  44. return true;
  45. }
  46. feature(room, mobile, input) {
  47. var featuremessage = input.join(" ");
  48. libs.Trello.requestFeature(featuremessage, function(status, result) {
  49. if(status != "error") {
  50. libs.Output.toMobile(mobile.id, "You add '" + bugmessage + "' to the buglist", mobile);
  51. } else {
  52. libs.Output.toMobile(mobile.id, "Adding to the buglist failed: " + result.error, mobile);
  53. }
  54. })
  55. libs.Output.toMobile(mobile.id, "Sending bug report", mobile);
  56. }
  57. featurelist(room, mobile, input) {
  58. libs.Trello.requestFeatures(function(status, features){
  59. for(var i in features) {
  60. var feature = features[i];
  61. libs.Output.toMobile(mobile.id, feature.pos + ":" + feature.name, mobile);
  62. }
  63. });
  64. libs.Output.toMobile(mobile.id, "Retrieving features from ("+config.trelloUrl+")", mobile);
  65. return true;
  66. }
  67. wishlist(room, mobile, input) {
  68. return this.featurelist(room, mobile, input);
  69. }
  70. mud_getErrorMessage() {
  71. return "It sounds like no one is {error}listening{/error}.";
  72. }
  73. };