slack

Webhook incoming with event subscription create loop

半世苍凉 提交于 2020-01-21 20:23:07
问题 I am using a web service api to receive message from a slack channel (event subscription) and the same web service api to send message (Incoming webhook) to the user on the same slack channel. But when I send a message, this same message is send back to my api by the slack event subscription. That create an infinite loop. How can I declare my message that I am sending to the channel which I can check when I receive back by the event subscription ? 回答1: This is normal behavior of Slack and can

How to measure Latency between client to bot and bot to Client (Not response time)

一世执手 提交于 2020-01-16 17:03:24
问题 I have created at bot for slack and deployed to Azure, for this bot I have a client requirement, My client wants to measure latency between slack client to Bot and vice a versa. i.e only time taken by user message to reach to Bot and time taken by response to slack user. I have been exploring Azure application insight from three days , but could not find any helpful service. I can not change my bot code , Is there any way in azure service by that I can monitor latency? 来源: https:/

Python can't find installed module slackclient on MacOs. Any suggestions?

大城市里の小女人 提交于 2020-01-16 09:19:29
问题 I'm developing a slackbot. After importing slackclient, I got ModuleNotFoundError: No module named 'slackclient' . I tried all the options and followed suggestions showed in the post here- Python can't find installed module ('slackclient'). By those suggestions, I installed slack but got the following error while importing WebClient. >>> from slack import WebClient Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'WebClient' from 'slack' (

How to get username/userID in slack bot

可紊 提交于 2020-01-14 09:57:08
问题 https://github.com/DeronLee/starbot.git I created a slack bot and it worked fine. But when somebody sends message to the bot, I'm not able to tell who sent it. I tried msg.user msg.username , but all of them are undefined. I just want my output to look like this abc: @starbot hello starbot: hello. abc finally. I got it. slack.users.info({ token: config('SLACK_TOKEN'), user: msg.user }, (err, data) => { if (err) throw err var text = makeMessage.makeMessage(msg.text, data.user.name);

How can I trigger a slash command in Slack every day at a certain time

假装没事ソ 提交于 2020-01-13 20:36:04
问题 I want to trigger a slash command in Slack every day at a certain time. Specifically, I want to clear my status every night at midnight. From the documentation it seems like the only way to do this would be via an Incoming Webhook. However POSTing with the following JSON body just creates a message in Slack /status clear and does not actually run the command. '{"text":"/status clear"}' It also posts the message on behalf of the app associated with the webhook, not under my username. Is there

How can I trigger a slash command in Slack every day at a certain time

六眼飞鱼酱① 提交于 2020-01-13 20:35:06
问题 I want to trigger a slash command in Slack every day at a certain time. Specifically, I want to clear my status every night at midnight. From the documentation it seems like the only way to do this would be via an Incoming Webhook. However POSTing with the following JSON body just creates a message in Slack /status clear and does not actually run the command. '{"text":"/status clear"}' It also posts the message on behalf of the app associated with the webhook, not under my username. Is there

How can I trigger a slash command in Slack every day at a certain time

不羁的心 提交于 2020-01-13 20:35:05
问题 I want to trigger a slash command in Slack every day at a certain time. Specifically, I want to clear my status every night at midnight. From the documentation it seems like the only way to do this would be via an Incoming Webhook. However POSTing with the following JSON body just creates a message in Slack /status clear and does not actually run the command. '{"text":"/status clear"}' It also posts the message on behalf of the app associated with the webhook, not under my username. Is there

How to fix missing scope error in Slack (rtm.connect) API?

江枫思渺然 提交于 2020-01-13 16:23:50
问题 When I try to use the rtm.connect method with own token, tester returns me a false response. URL : https://slack.com/api/rtm.connect?token=xoxp-532016xxxxx-53xxxxxx-536743xxxxxx-9211bedc4bfe9ddfexxxxxxxxxxxxxx&pretty=1 { "ok": false, "error": "missing_scope", "needed": "rtm:stream", "provided": "identify,incoming-webhook,channels:history,im:history,channels:read,im:read,team:read,users:read,users:read.email,users.profile:read,chat:write:user,files:write:user" } What am I missing in request?

Access Slack files from a slack bot

大城市里の小女人 提交于 2020-01-12 12:54:30
问题 I need a slack bot that's able to receive and save files send from slack chatrooms. The problem is: slack doesn't send file contents, but an array of links pointing to the file. Most of them, including download link are private and cannot be accessed via bot. It does send one public link, but that link points at the file preview, which does not have the file itself (here's an example). So the question is: how can I access uploaded files via bot? 回答1: You can access private URLs from your bot

Access Slack files from a slack bot

早过忘川 提交于 2020-01-12 12:52:50
问题 I need a slack bot that's able to receive and save files send from slack chatrooms. The problem is: slack doesn't send file contents, but an array of links pointing to the file. Most of them, including download link are private and cannot be accessed via bot. It does send one public link, but that link points at the file preview, which does not have the file itself (here's an example). So the question is: how can I access uploaded files via bot? 回答1: You can access private URLs from your bot