2012-05-25 10 views

risposta

7

classe di Hubot Robot ha funzioni enter e leave che il fuoco una richiamata quando si dà qualsiasi utente entra o esce dalla stanza. Quella richiamata prende uno Response, che ha una proprietà message di tipo Message, che a sua volta ha una proprietà user di tipo User.

module.exports = (robot) -> 
    robot.enter (response) -> 
    # at this point you can get the user's name with: 
    # response.message.user.name 
    # works the same for robot.leave 

Tuttavia, it appears che l'adattatore IRC per hubot attualmente non sparare i messaggi necessari per ottenere quelle funzioni per lavorare.

+0

Ehi John! Grazie mille per la tua risposta! – Eax

+1

Per riferimento futuro, non sono stato in grado di trovare alcuna documentazione su ciò che Robot e le altre classi possono fare, ma la [documentazione in codice nel repository hubot] (https://github.com/github/hubot/ tree/master/src) ... esiste. –