How to get and add URL of message originated in one slack channel to another slack channel - slack-api

i'm new to slack programing so bear with me.
In my company we have slack bot that users can use to alert other users, by posting an alert in one slack channel relevant user will get alerted in other channel. The problem is that user that was alerted don't know from which channel or thread the alert originated and have to manually search multiple channels.
The question is how can i accomplish this so that the user will get alerted and in addition get link to channel or thread where the alert was triggered from.

It depends on how users trigger alters, but you'll usually get a Channel ID in the payload from Slack.
When you're alerting the other users, if you include that channel ID in the message, but wrap it <#[channelid]> e.g. <#CHJ9HDXE1>, then the Slack clients will convert that into a link to the channel, or you could also use chat.getPermalink to convert a message_ts into a clickable link.

Related

How can I get 'seen' status of chat message in microsoft-teams graph api?

I am developing a extraction tool to extract microsoft-teams conversation.
It is easy to retrieve Chat Message list and its attributes (e.g. sender, html body and attachments etc) using Graph API as following.
https://graph.microsoft.com/beta/users/{user-id}/chats/{chat-id}/messages?$top=50
https://graph.microsoft.com/beta/users/{user-id}/chats/{chat-id}/messages/{msg-id}
But I cannot find 'seen' status of the message as its attribute, and/or I cannot find how to retrieve 'seen' status of the message.
For reference, microsoft-teams chat message data is defined as:
https://learn.microsoft.com/en-us/graph/api/resources/chatmessage?view=graph-rest-beta
What I want to retrieve is the 'eye' icon status as attached image.
MS Graph currently does not expose or support the "seen/read" property of the chat message resource.
I see a feature request for it here that I suggest you upvote so that it may be implemented in future.

Is there any possible way to read message in ms teams before clicking the send button

I am trying to create a teams app that will detect the message that user has typed in before the message is sent on clicking the send button or on the send button click event or before the recipient receives the message. The idea is to read the message and using AI grammatically correct the text or detect if any inappropriate message is being sent that violets office rules, kind of like Grammarly. My question is it possible to detect this text through any possible means like graph api. i am open to any suggestion, not just teams app it can be some kind of windows application that can interact with teams app . Will be taking care of AI part myself.
This isn't supported, there is no No event when user is typing message. You can get an event when user sends the message. For more info here

How to send a message to Activity in the side rail in Ms Teams?

How to send a message (with link to navigate to the personal app) to Activity in the side rail to notify certain users in Teams.
Your question's not actually all that clear, but it sounds like what you're looking for could be a "Notification Only" bot.
You could achieve this by sending a proactive message form the bot once the app is installed in teams. Here is a sample code for Proactive message in Teams. When you reply to bot, add below code. It will send a notification to user in feed.
notify.TeamsNotifyUser();

Slack post by bot not always containing

I'm using the "incoming webhooks" feature of Slack to post notifications to a channel. I'm also using the "icon_emoji" feature to decorate the messages and to highlight the different types of messages. However I find that the image doesn't show up consistently:
Ie. only when it says BOT does the image also show up.
Any ideas what the issue is? Ideally I would like for the image to show up each message so that they can be scanned easily (some messages are more informative and others need to be acted upon in a timely manner).
Slack is automatically consolidating consecutive messages that are sent within a certain time frame. So the bot icon will show for the first message only and consecutive messages will display beneath the first without the bot icon.
This is standard behavior of Slack and works the same for user messages. Don't believe there is any way to turn that off.

Send a message in a channel "only visible to you"

I can not see in the slack API documentation the way for a bot to send a message in a channel that response to a user.
The same way slackbot does reply when doing /help.
Anyone can let me know if that is possible?
Notice the "Only visible to you". In the RTM manual they say that the messsage is of the same type as the event message. I don't see any attributes that would say it is visible only to a certain user.
Sending private messages in channels with the "Only visible to you" tag is called "ephemeral" and is now possible through the Slack API.
https://api.slack.com/methods/chat.postEphemeral
(I'm not sure since when)

Resources