slack-api

slack slash commands show response only to channel

妖精的绣舞 提交于 2019-12-10 20:24:06
问题 slack provides only two types of responses: ephemeral = make the command and response shown to the user only. in_channel = make the command and response shown to all users in channel. ephemeral example: in_channel example: Question: how can i make a slash command show response only in channel and not show both command and response? 回答1: ok so i found my question's answer, it is said in slack's api that The only user-facing difference between immediate responses and delayed responses is that

How to store configuration items in a Slack App

自作多情 提交于 2019-12-10 19:54:58
问题 How do you store permanent data in a Slack Application? For example, the Opsidian slack app has a command to add your AWS keys. Where does it store those keys and how does it know to use specific keys for specific teams? Is this on the Opsidian side? If that's the case does it just use the team.info endpoint and use that every command to match it up? I have searched their documentation and Google with no luck. 回答1: A slack app usually consists of program code (e.g. PHP) and a database (e.g.

Cannot delete a chat message via Slack API

假装没事ソ 提交于 2019-12-10 18:27:00
问题 I have a Slack team with a public channel. My goal is to use the channel only for announcements posted by bot-A. I understand that it is not possible to configure Slack channel to be writable for only one person and read-only for the rest, I created a bot-B (Python thing running on an external machine) that monitors the channel via RTM and if there is any message not coming from bot-A, bot-B's task is to delete the message by calling chat.delete (https://api.slack.com/methods/chat.delete).

Slack bot send an image

笑着哭i 提交于 2019-12-10 15:07:16
问题 I am developing a bot for slack. I am implementing a notification functionality, where it will send a notification for every one hour. Currently, I am sending normal text in notification, but I need to send an image along with text. Is it possible to send an image? 回答1: You can send images as part of the attachments of a message. That can be either a full image or a thumbnail. Just add the image_url property for full images or the thumb_url property for a thumbnail image with a url to an

How to add @ mention in response to slash commands in slack

吃可爱长大的小学妹 提交于 2019-12-10 13:05:37
问题 How can I make slack parse @someone mentions as links to the user instead of plaintext. I've been reading slack documentation on message formatting but still haven't figured it out. Here's an example of what I'm getting now: { "text": "*username:* @alexis", "response_type": "ephemeral" } 回答1: To make a proper "clickable" mention, you need to pass the unique user ID and not the plaintext name. The format of the user ID is: U024BE7LH and a mention would look like this: <@U024BE7LH> Ther user ID

Python asyncio with Slack bot

强颜欢笑 提交于 2019-12-10 10:09:12
问题 I'm trying to make a simple Slack bot using asyncio, largely using the example here for the asyncio part and here for the Slack bot part. Both the examples work on their own, but when I put them together it seems my loop doesn't loop: it goes through once and then dies. If info is a list of length equal to 1, which happens when a message is typed in a chat room with the bot in it, the coroutine is supposed to be triggered, but it never is. (All the coroutine is trying to do right now is print

Confirming AWS SNS Topic Subscription for Slack Webhook

谁说胖子不能爱 提交于 2019-12-08 19:13:55
问题 I am integrating SNS and Slack. I have created a slack app with incoming webhook enabled. I have got the webhook URL. I created a subscription for a SNS Topic with HTTPS protocol and set the Endpoint the webhookURL. Now the subscription is PendingConfirmation. I didnot receive any confirmation message, not in the destined channel. How do I confirm the subscription? 回答1: The reason you're not seeing it in Slack is because the default JSON format for SNS messages doesn't conform to the format

Testing Slack Interactive Messages Locally

主宰稳场 提交于 2019-12-08 04:09:05
问题 I'm currently using SlackConnector Repo https://github.com/noobot/SlackConnector. I've created a bot and it sends interactive messages to my chat. I would like to add functionality to my interactive buttons but upon clicking them i get this response. Darn – that didn’t work. Only Slack Apps can add interactive elements to messages. Manage your apps here: https://api.slack.com/apps/ So it looks like I need a request URL to get my past my current roadblock. Is there a way to Test the

Testing Slack Interactive Messages Locally

不问归期 提交于 2019-12-07 14:32:37
I'm currently using SlackConnector Repo https://github.com/noobot/SlackConnector . I've created a bot and it sends interactive messages to my chat. I would like to add functionality to my interactive buttons but upon clicking them i get this response. Darn – that didn’t work. Only Slack Apps can add interactive elements to messages. Manage your apps here: https://api.slack.com/apps/ So it looks like I need a request URL to get my past my current roadblock. Is there a way to Test the Interactive Message button locally? List<SlackAttachment> attachments = new List<SlackAttachment>(); List

Way to get timestamp of last activity for all Slack users

最后都变了- 提交于 2019-12-07 13:40:06
问题 I am building a Python script which retrieves a set of information for all Slack users of the organization that I work. Currently, I was asked by the stakeholders to retrieve the last time that our organization's users were active on Slack. I came across the users.getPresence method but this can only return a timestamp for the owner of the token. Has anybody worked on that before? Thanks. 回答1: It depends a bit how you define "active on Slack". If getting the date and time a user was logged in