【问题标题】:Detecting when a user leaves or enters a channel with hubot使用hubot检测用户何时离开或进入频道
【发布时间】:2012-06-01 02:55:19
【问题描述】:

我正在尝试让 Hubot 检测用户何时进入或离开频道,但到目前为止,我实际上无法找到与此相关的任何信息。

有没有人知道如何做到这一点? :)

提前致谢!

【问题讨论】:

    标签: coffeescript irc hubot


    【解决方案1】:

    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 适配器当前不会触发使这些功能正常工作所需的消息。

    【讨论】:

    猜你喜欢
    • 2018-01-08
    • 2021-02-28
    • 2021-01-28
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    • 2015-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多