Get current conversation/channel id in Slack Api - slack

I am trying to create global shortcut that displays a modal. In it I need to have a channel select field as I will later post a message to it, and I wish to have the opened channel as the default option.
I see in the docs that only message shortcuts get a channel_id on the body, but I know that apps like simple poll manage to achieve this so there must be some kind of workaround.
simple poll modal that default to opened channel
I can't seem to find any conversation_id in the payload I am getting for the global shortcut, and can't seem to find a way to filter the conversations API to retrieve the one I am focusing on

Related

Need a slack workspace to send an email for any activity

I have a client who's a member of a lightly used, but important to him, slack workspace. He rarely opens (or even looks at) the Slack app, but he wants to know right away when there's any new activity in the workspace. He'd love to get an email whenever there's new activity, but there doesn't seem to be a way to set that up. He'll get an email when he's mentioned, or there's activity in a thread he follows, or when he's DM'd of course, but I can't see any way to configure his Slack settings and preferences so he gets an email any time there's a regular ol posting in a channel. Is that possible? If so, how?

How to send direct message in Slackbot

I would like to send messages to users through Slackbot, just like integration apps such as Zapier.
If I set the channel ID to the user ID it sends a 1:1 message showing up in the Apps tab, but what I really would like to do is to send a message in Slackbot, as I want to create a seamless experience for a Workflow I'm creating.
Then, if I try adding the Slackbot channel ID it returns channel_not_found and there's no way to add the App there.
My current bot token scope to send messages is: chat:write and I'm sending a message using chat.postMessage
Do I need a different scope? Different API method? I've tried going through some other questions/answers, but they look outdated

Microsoft Teams go to a conversation using a deeplink

we have an app for MS Teams which users can start a conversation and send messages to. The app does some processing and returns the response back. I am looking for the ability to open an precreated conversation using a link. I have needed information like conversation id etc. How do i create a link that can be used for this navigation?
To be more specific this doc is not helpful https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-a-chat
The link i need is for the conversation. Currently it is possible to manually copy that link by right clicking on any conversation and use "Copy link". Is there a way to get it or generate it when user creates the conversation. A sample link copied from looks like below
https://teams.microsoft.com/l/message/19:a0a0088174a644cb91409f4d8f79d888#thread.tacv2/1612324568748?tenantId=04e930f3-0866-4a6d-b07c-a4737e8f9865&groupId=087bf290-deb5-4790-b159-bf86914765b4&parentMessageId=1612324568748&teamName=Sales%20Team&channelName=FlashCX%20Sales&createdTime=1612324568748
So trying to see if i can either get this the URL using apis or can generate with the parts involved
#Moblize - Currently you can create Deep-link to chat for particular conversation. You cannot create a link which will redirect to a particular message in channel. Please check this docs for info.

Unable to get timestamp of the message posted by Slack App

Whenever my app posts ephemeral message to Slack channel (in response to a query by a user), I am unable to get the timestamp of my Slack app response. As I want to delete it once the user has made a selection using one of the buttons. Although I have subscribed to 'message.channels' event, I don't get a notification to my app whenever my app posts in the channel (in response to the user input), therefore, I am unable to get the timestamp of the message which I'll use to delete it. All I want is the timestamp of the message posted by my app so that I can delete it but I am unable to receive the timestamp. Please help!
For e.g. in Giphy app for Slack. Let's say the user invokes the app by calling '/giphy [dog]' where 'dog' is just an example of a search term. The app responds by sending a gif and user can either send it, shuffle to the next one or cancel it. I want a similar capability of cancelling the app response but I need the timestamp of the message in order to do so therefore I am asking for help.
Thanks.
Your approach can not work, because Slack is handling ephemeral messages differently from "normal" messages. They are only visible by one user and can not be modified by API methods (e.g. deletion).
But of course its possible to replace ephemeral messages. Here is how:
Your app can just reply to the interactive message request from Slack with a new message. That new message will by default override the original message including ephemeral messages.
You can reply in two ways:
Directly reply to the request from Slack with a message within 3 seconds
Send a message to the response_url from the Slack request within 30 minutes.
See here for the official documentation on how to respond to interactive messages.
This approach works both with interactive messages and slash commands.
See also this answer for a similar situation.

create a slack message and edit before sending

I have created a bot using Botkit and am working on creating an interactive message. What I want to do is when the user clicks on the button in the interactive message, a new message will be created pulling som info from the original interactive message, BUT WILL NOT BE SENT. I need to continue editing the message before choosing to send it. Does anybody know whether this is possible or not? I have been googling and searching slack's docs and botkit's docs, but haven't been able to find an answer.
If you want to let the user edit a message before sending you can use the Dialog feature from Slack. It will allow you to show an input text field, where the user can make his edits. I am not familiar with Botkit though and can not say if it supports Dialogs.

Resources