slack-api

Gevent task with endless loop seems to block every other task aswell

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 03:16:10
问题 I'm quite new to Gevent/Greenlet and have gone through the tutorials. I would like to run a bot for each registered team. for bot in self.bots: events.append(gevent.spawn(bot.start)) gevent.joinall(events) The interesting part is that if I don't use a while true loop, I get the bot_id of both bots shown in the console. def start(self): while True: for reply in self.slack_client.rtm_read(): self.input(reply) time.sleep(0.1) logger.info("Log:{0}".format(self.bot_id)) But as soon as I use a

slack bot respond to messages with a mention

寵の児 提交于 2020-01-06 02:57:49
问题 I have a simple slack bot that can respond to messages that start with a specific string. What I would prefer is that the bot only responds to messages that have a mention of the bot. I'm using slackclient and getting messages via: new_evts = sc.rtm_read() I can see the my client_id in the message but searching message stings doesn't seem to be the right approach. u'text': u'<@U0TP3B7HU>: test message' There has to be a more slack-onic way of handling messages with mentions. What am I missing

Decoding body parameters with Spring

折月煮酒 提交于 2020-01-04 04:41:07
问题 I'm developing a REST API backend with Spring for a Slack App. I was able to receive messages from Slack (the slash commands) but I'm not able to properly receive component interactions (button clicks). The official documentation says: Your Action URL will receive a HTTP POST request, including a payload body parameter, itself containing an application/x-www-form-urlencoded JSON string. therefore I have written the following @RestController : @RequestMapping(method = RequestMethod.POST, value

Slack Webhook - Getting Invalid_Payload

邮差的信 提交于 2020-01-04 02:57:10
问题 I am attempting to set up a webhook to Slack, but am getting an Error message of "Invalid_Payload" I've looked through Stack, Slack, and Github... but cant' find the answer I seek. "CustomLink" in there for privacy, actual link is begin used. CODE: var request = require('request') var webhook = "https://hooks.slack.com/services/CUSTOMLINK" var payload={"text":"This is via an integration from Me - It is a test"} request.post({url: webhook, payload: payload}, function(err, res){ if(err){console

How do I set a reminder via the Slack API?

对着背影说爱祢 提交于 2020-01-02 03:40:29
问题 I'd like to be able to create messages that use the /remind slash command in Slack via an API (probably either with an incoming webhook or the web API. When I post a message via the web API, however, the command just comes through like a "regular" message, for example, /remind me in 1 month to follow up with the Boss — it doesn't trigger an actual reminder. Is there a way to set a reminder (or, more generally, use slash commands) programmatically in Slack? 回答1: It looks like it was added

Can a Slack bot get the thread id that a slash command was sent from?

天涯浪子 提交于 2020-01-01 14:12:50
问题 Suppose a user types a slash command inside a thread, as opposed to inside the main channel. Is it possible for to include this information in the request sent to the bot? I want the bot to know where exactly the message came from so that it can reply in the same location (i.e. inside the thread and not in the main channel) Judging by the docs, it seems information about threads is not sent. Here is the POST object that the docs say is sent: token=gIkuvaNzQIHg97ATvDxqgjtO &team_id=T0001 &team

Can a Slack bot get the thread id that a slash command was sent from?

社会主义新天地 提交于 2020-01-01 14:11:44
问题 Suppose a user types a slash command inside a thread, as opposed to inside the main channel. Is it possible for to include this information in the request sent to the bot? I want the bot to know where exactly the message came from so that it can reply in the same location (i.e. inside the thread and not in the main channel) Judging by the docs, it seems information about threads is not sent. Here is the POST object that the docs say is sent: token=gIkuvaNzQIHg97ATvDxqgjtO &team_id=T0001 &team

generate SLACK_APP_TOKEN for slack application

喜欢而已 提交于 2019-12-31 03:38:28
问题 let's say I've created slack app and I have client id and secret. What is the easiest way to get SLACK_APP_TOKEN in my hands that will be able to create channel? 回答1: If you want a proper access token that is related to your Slack App the only way to get it is to install your Slack app with the OAuth process as described here in the Slack documentation. You will need a mini website with a script (e.g. PHP) to perform the installation. The so called test token will also allow you use the Slack

“no_file_data” error when trying to upload file to slack

人走茶凉 提交于 2019-12-31 02:57:08
问题 when I try to upload any kidn of file through my SlackApp(via c# using HttpClient), I allways get the following response: {"ok":false,"error":"no_file_data"} I checked my ByteArray (I stream the file to an array and then try to upload) and wrote my data back into a .txt and .jpg - I tried both types of data. When i write them back they are exact copies from the original, so I guess my streaming and writing to an ByteArray works fine. But something is off with my upload. I'll show you my code:

slack incoming webhook - send message to another channel

人盡茶涼 提交于 2019-12-31 02:01:44
问题 I am trying to post message to any channel in a slack team. My webhook has been properly created and installed into my test team. As part of the install process, I selected " Post to #channel1 " When I review permissions, I see my app has been granted Other/Post to specific channels in Slack (#channel1). From there, I am able to post into #channel1 with a basic JSON request: { "text":"Hello, World!" } Now I want to validate I can use same webhook to post to any other channel of the same team.