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