Open gamelaster opened 8 years ago
Could you.. rewrite your question? We got lost in translation :)
Sorry for bad explain. For sample: I (the logged user) send the message (or action). When is the message sent and delivered, the "message" event will be emitted.
Sorry. Some pseudo-code of what you're trying to accomplish would make it easier for me to understand.
client.say("#neko", "Hello all!");
//after send, the this event will be emitted
client.addListener('message', function (nick, to, text, message) {
/*
nick = gamelaster
to = #neko
text = Hello all!
message = Message object
*/
});
Ok. i get what you're trying to do now;
You want to listen to a message only after another one has been sent, correct? If yes, then you have to:
1) create a listener on #neko for all messages;
2) send message to #neko sayin "hello, all"
2.1) set a flag to "listen for any messages after hello" (pex: sentHello = true
)
3) on the listener we created on the first bullet, create a condition "if (sentHello === true)
3.1) if the above condition is true, check if message === "hello neko"
3.2) if true do what you gotta do :)
is that it ?
Hello, is possible to emit message, action etc. when I send message, action etc, best when the message is sent? Thanks