2012-05-25 22 views

回答

7

Hubot的Robot類具有以下功能:enterleave將火的時候,任何用戶進入或離開房間,你給一個回調。該回調需要Response,其具有類型Message的屬性message,其具有類型User類型的屬性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 

然而,it appears對於hubot的IRC適配器目前不火讓那些職能工作所需的信息。

+0

嘿約翰!謝謝你的回答! – Eax

+1

爲了您將來的參考,我無法找到關於Robot和其他類可以執行的任何文檔,但是[hubot repo中的代碼內文檔](https://github.com/github/hubot/樹/主/ src)...存在。 –

相關問題