slack

Execute slash command as slack bot

早过忘川 提交于 2019-11-27 20:44:57
I'm writing a simple slack bot which should execute other slack commands upon being called. Everything is up and running, however the slack commands this bot issues don't seem to be executed. For instance my bot posts /giphy kitten every hour and the message appears just like that in the channel (so the sending side seems to work), but the slash command itself isn't executed. If I post the same command into the same channel myself it works as expected. Are bots not allowed to execute slash commands? Erik Kalkoken Bots can use the undocumented API method chat.command to invoke slash commands.

How do you invoke the /poll command using the Slack API?

ぐ巨炮叔叔 提交于 2019-11-27 18:34:53
问题 My slack channel supports the /poll command from the Simple Poll app. How do you invoke this command using the Slack API? Using the python slack(er) API module: from slacker import Slacker # Using what's now called a "legacy token" slack = Slacker('my-token') slack.chat.post_message( '#test', '/poll "Do you prefer cats or dogs?" "Cats" "Dogs"', as_user=False, username="Poll Bot", icon_emoji=':question:', parse='full') The message just shows up in the #test channel as plain text, not converted

How to integrate internal APIs (Not accessible outside office network) to slack slash commands

六月ゝ 毕业季﹏ 提交于 2019-11-27 16:25:44
I am trying to use slash commands to my one of the slack channel. I tried to do a POC using git API and it worked fine. I first created a slash command from this link : https://api.slack.com/censored/slash-commands Commnad: /poc Request URL: http://jsonplaceholder.typicode.com/posts This worked fine when I type /opc on slack chat box of my channel. It returns some data. But when I change the Request URL to an internal API, which is accessible only from the office domain, I get error: Darn – that slash command didn't work (error message: Failure when receiving data from the peer ). Manage the

How to upload any file on Slack via Slack-App in c#

血红的双手。 提交于 2019-11-27 16:25:21
I need help with uploading files to Slack. I have a Slack-App that is working with my code(below) so far. But all I can do is post messages. I can not attach images to the messages - because I do not understand how to use the so called "methods" and the syntax Slack is "showing" on their API-page. This creates my "content" and below its just a Stream for reading a file I could upload: public class PostMessage { public FormUrlEncodedContent Content(string message, string file) { var values = new Dictionary<string, string> { {"token", "xoxp-myToken"}, { "username", "X"}, { "channel", "myChannel"

Slack dialog doesn't close after form submission

不羁的心 提交于 2019-11-27 16:24:05
I created a slack dialog/form to collect some information from users; The form renders just fine and I can fill out the form without a problem but it doesn't close after I click Submit, instead it gives an error: We had some trouble connecting. Try again? I've already sent back a 200 status OK as in the documentation . // menu is the end point of my interactive messages app.post('/menu', (req, res) => { console.log('from form submission:', req.body.payload) res.sendStatus(200); }) What could be wrong? I can see the console log for my app, fyi. Sending a 200 OK is not enough. It also has to be

What is the simplest way to find a slack team ID and a channel ID?

北慕城南 提交于 2019-11-27 09:22:48
问题 We are trying to setup deep linking into slack, as described here: https://api.slack.com/docs/deep-linking The document states that to open a specific team, the following URL should be used: slack://open?team={TEAM_ID} Open Slack and switch teams to the specified team. The provided TEAM_ID should be a string, like T12345. Furthermore, to open a channel in a team, the following URL should be used: slack://channel?team={TEAM_ID}&id={CHANNEL_ID} Open the channel specified by the CHANNEL_ID

Slack Interactive message menu select multiple

南笙酒味 提交于 2019-11-27 07:03:45
问题 I want to develop a feature such a way that user can select multiple options from message menu. Is it possible to select multiple options from the interactive menu at the same time ?? 回答1: You can currently only select one option. Slack does not support choosing more than one option in a message. But there are 2 alternatives: Dialogs Dialogs are modal and allow you to use up to 10 elements each including select menus. And they have a "submit" and "cancel" button. This allows you to implement

Slack PHP API - Avoid Timeout error

陌路散爱 提交于 2019-11-27 06:47:06
问题 I am trying to use Slack Custom command and not pretty sure how to use delayed messages since the Yoda Speak External API takes more than 3 seconds to respond. I have done the following: Sent the slack command /Yoda in my case and received the reponse_url . Used the following to post the following to the response URL. $data_string = '{"response_type": "in_channel", "text":"Checking,please wait..."}' ; $chs = curl_init(); curl_setopt($chs, CURLOPT_URL, $response_url); curl_setopt($chs, CURLOPT

Can i send custom properties/data in slack message attachments?

偶尔善良 提交于 2019-11-27 05:31:48
I want to send some custom properties in the attachment for interactive messages and retrieve them back in the action response. is there a way to do this? Yes, that is possible. However, it only works well for small sets of data. Assuming we are talking about buttons the normal approach would be to use the value field of an action to transfer custom data based on which button the user clicked back to your app. The field is a normal string within a JSON message, which is send by POST request to your app. So it can in principle contain a whole data set, not only a single value. All you need to

How to send direct messages to a user as app in app channel

有些话、适合烂在心里 提交于 2019-11-27 05:07:07
How is it possible to send message in slack directly to the user, by user.id as application. this application has scope: bot,channels:write,emoji:read,users:read,users:read.email I find how to send message only as DM or by webhooks, but there is no scope for that. Any one has idea? If I understand your question correctly, you want to send direct messages to users in the app channel instead of the standard slackbot channel. In order to do that you need to Your app needs the bot scope and a bot user Open a direct message channel from your app with the user with im.open . You get back a direct