slack-api

Slack API message.im event is not triggered for other users

ぐ巨炮叔叔 提交于 2020-03-16 07:41:05
问题 I am trying to make my app watch for every kind of messages (public/private channels and direct messages) using event subscriptions, no bot. I made my app subscribe to message.channels , message.groups , message.im and message.mpim events. I've setup an endpoint URL with the challenge parameter, and I've authorized and deployed my app. I'm successfully notified when : A message is posted in a public channel A message is posted in a private channel (even if my personal account is not invited

How to upload file using Slack API as user?

拈花ヽ惹草 提交于 2020-03-03 03:05:53
问题 Right now, the token used when uploading files via files.upload is associated with my Slack user account. So any uploads performed using this token appears to have been made by me. However, I'd like to specify something like as_user (which is available when using chat.PostMessage), which will make the upload appear as if it was uploaded by specified Slack user. Is this possible? I have this: upload_file(filepath='/path/to/file.jpg', channels='#uploads', title='my image', initial_comment='pls

How to upload file using Slack API as user?

别来无恙 提交于 2020-03-03 03:05:52
问题 Right now, the token used when uploading files via files.upload is associated with my Slack user account. So any uploads performed using this token appears to have been made by me. However, I'd like to specify something like as_user (which is available when using chat.PostMessage), which will make the upload appear as if it was uploaded by specified Slack user. Is this possible? I have this: upload_file(filepath='/path/to/file.jpg', channels='#uploads', title='my image', initial_comment='pls

How to upload file using Slack API as user?

谁都会走 提交于 2020-03-03 03:05:45
问题 Right now, the token used when uploading files via files.upload is associated with my Slack user account. So any uploads performed using this token appears to have been made by me. However, I'd like to specify something like as_user (which is available when using chat.PostMessage), which will make the upload appear as if it was uploaded by specified Slack user. Is this possible? I have this: upload_file(filepath='/path/to/file.jpg', channels='#uploads', title='my image', initial_comment='pls

How to upload file using Slack API as user?

久未见 提交于 2020-03-03 03:04:10
问题 Right now, the token used when uploading files via files.upload is associated with my Slack user account. So any uploads performed using this token appears to have been made by me. However, I'd like to specify something like as_user (which is available when using chat.PostMessage), which will make the upload appear as if it was uploaded by specified Slack user. Is this possible? I have this: upload_file(filepath='/path/to/file.jpg', channels='#uploads', title='my image', initial_comment='pls

How to remove Ephemeral Messages

梦想与她 提交于 2020-02-27 06:21:40
问题 I'm trying to figure out the mechanism to post an ephemeral message to a user and then remove it and replace it with a message visible to all. Similar behavior to giphy in which the Slash Command shows an interactive ephemeral message and creates a channel message once the user decides which gif to send. I'm also curious about updating the ephemeral message. I assume this can be done by the response_url if we use an interactive ephemeral message. I initially figured I'd just create a

How to remove Ephemeral Messages

大憨熊 提交于 2020-02-27 06:18:15
问题 I'm trying to figure out the mechanism to post an ephemeral message to a user and then remove it and replace it with a message visible to all. Similar behavior to giphy in which the Slash Command shows an interactive ephemeral message and creates a channel message once the user decides which gif to send. I'm also curious about updating the ephemeral message. I assume this can be done by the response_url if we use an interactive ephemeral message. I initially figured I'd just create a

Slack Events API: Events are posted (multiple times) for responses of own bot user

北城以北 提交于 2020-02-05 04:41:45
问题 I seem to have a problem when responding to incoming messages via the Slack Events API (im.message event). When a user (in this case UQ364CBPF ) sends a message to my App Home, the events API correctly posts an event to my backend (=first line in the logs below). I respond to the event with an HTTP 200 OK, and in my code (see below), I trigger a response from my Bot User. This response is sent correctly in Slack. But : after that, the events API keeps posting events that my own bot user has

send direct message to slack user from a app bot but not in app channel

江枫思渺然 提交于 2020-01-30 10:34:06
问题 Is there a way to send direct message to from a bot(myapp/user) to a user say xyz or to a user's slackbot. The message needs to appear against the user and not on the mybot app. I am using the python slack-client . Using below code to send the message: user_id="<touser>" im_channel=self.open_dm(user_id) slack_client.api_call("chat.postMessage",channel=im_channel,text="hi buddy", as_user=True) The above code posts the message in the myapp app channel. Is there a way for the bot to send the

How to upload an image to Slack using node.js on Windows?

瘦欲@ 提交于 2020-01-25 08:05:26
问题 I'm trying to upload an image via Slack using node.js and the request package, but not having much luck. Either I receive invalid_array_arg or no_file_data errors from the API. Here is my request: var options = { method: 'POST', url: 'https://slack.com/api/files.upload', headers: { 'cache-control': 'no-cache', 'content-type': 'application/x-www-form-urlencoded' }, form: { token: SLACK_TOKEN, channels: SLACK_CHANNEL, file: fs.createReadStream(filepath) } }; request(options, function (error,