FANDOM


__NOWYSIWYG__

This bot demonstrates how to use a text transformer: YesNo.txt

/* class=gwtchat.server.JavascriptBot */
 
var YesNoTransformer = Transformer.recall(wiki, 'YesNo.txt');
 
function greet(chatter) {
  chat.say("Hi, "+chatter.name+"! Do you love honey?");
}
 
function hear(chatter, message) {
  var yesNo = YesNoTransformer.transform(message);
  if (yesNo=='yes')
    chat.say("Great, me too!");
  else if (yesNo=='no')
    chat.say("That's impossible! You probably ran into a cheese that looks like honey.");
  else {
    chat.say("I didn't understand, do you love honey or not?");
    var myAnswer = YesNoTransformer.untransform('yes');   // choose a random way to say "yes"
    chat.say("I would say '"+myAnswer+"'!");
  }
}
End of bot Pooh.js

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.