如何在松弛时登录用户的IP

时间:2016-08-29 20:24:21

标签: ip-address slack-api slack

我想设置一个斜杠命令/ ip,它可以给我当前登录用户的ip。我尝试设置相同,但每当我尝试使用/ ip时,它将此作为输出,这绝对不是我的公共IP(这不断变化)。它实际上给了懒惰服务器的IP。

我正在使用this服务来获取ip。 我知道我可以通过this获取用户的IP,但我想要这个付费功能的替代品。

enter image description here

2 个答案:

答案 0 :(得分:3)

我已经能够通过在slack accessLog api中查找用户id来实现这一点,然后你可以找到用户的最后一次登录ip,但是你需要管理范围令牌。

答案 1 :(得分:2)

The Slash Command URL that you are hosting is invoked by the Slack Servers for you, in response to a message in your team. So the IP address that you are interpreting is that of the Slack Server and not of your machine.

I am not sure if what you want to achieve is going to be possible since Slack Infrastructure is in the middle interpreting your commands and calling external integrations (like your Slash Command URL).