Tiesitkö, että Bot Libre tarjoaa myös ilmaisia isännöityjä foorumeita omalle verkkosivustollesi tai mobiilisovellukseen?
Bot Libre Dev : API

RE: API

tekijä admin Lähetetty Feb 5 2016, 17:04

Yes, all of the bots processing is asynchronous.

For the TextInput sense you currently need to set a Writer, and wait for the bot to write to it.

i.e.

boolean hasResponse = false; String response= null; sense.setWriter(new Writer() { public void write(char[] text, int start, int end) { response = new String(text, start, end); hasResponse = true; } public void flush() { } public void close() { } }; sense.input(...); int waits = 0 while (!hasResponse && waits < 100) { Thread.sleep(100); waits++; } return response;


Kind of ugly...
You can also use the Chat sense, which is a little cleaner, then you implement a ChatListener and wait for an event.


Id: 12091280
Lähetetty: Feb 5 2016, 17:04
Päivitetty: Feb 5 2016, 17:05
Vastaukset: 0
Näkymät: 1985, Tänään: 1, Viikolla: 1, Kuukausi: 1
0 0 0.0/5