2017-03-08 114 views

回答

1

您可以使用controller.on('event_name', function (bot, message) { ... })處理程序掛鉤不同的事件。 docs中列出了Slack事件的完整列表。在我看來,你可以使用team_join事件。當新用戶接受邀請加入團隊並簽名時,會觸發此事件。

實施例:

controller.on('team_join', function (bot, message) { 
    bot.api.chat.postMessage({channel: response.channel.id, text: 'Welcome', as_user: true}, function (err, response) { 
     // Process postMessage error and response 
    }) 
}) 
相關問題