Need messages in single line from Slack Bot Webhook app - slack

I'm using slackBot webhook curls to send messages to slack, but i see the message being spilled over to multiple lines.
Is there any way i can make them appear in single line.
Below one is the message coming from webhook but i am wishing to have it like the way its depicted in top message of the image.
I've already tired to use coded blocks as well but even that didnt help me much.

Related

forward a message with slack API getting invalid_blocks error

I'm trying to simply get a message from one channel and forward it to another.
all I do is listen to messages on the channel, get the blocks, i.e.:
[{"type":"rich_text","block_id":"AHdW3","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"z"}]}]}]
and send them to another channel
client.chat.postMessage({
blocks: blocks,
channel: context.targetChannel,
});
I'm getting an invalid_blocks error, even tho this must be valid blocks since they are generated by slack themselves.
any ideas here?
I also tried to remove the block_id but got the same result.
I'm using bolt framework btw, but that shouldn't matter.
Turns out the blocks from 1st client slack apps are rich_text, which isn't supported in the api.
so the way to go is grab the text from the message and post that as is.
See here for context
https://github.com/slackapi/bolt-js/issues/1324

How do I notify users on Slack that aren't in the channel?

What we are trying to do
I am working on automation which posts messages to a Slack channel using Incoming Webhooks on a custom Slack App. The messages mentions people.
What works
We can send a message just fine, it has formatted content, and usernames are correctly resolved using the link-names flag.
What isn't working
The whole point of the notification is to inform a dynamic set of people about something they should care about. The set of people we tag varies hugely (think people who contributed to a pull request) and so not all possible recipients are in the channel these automated messages go to.
We assumed that given the usernames are being directly #-mentioned, they would be notified by Slack. However, two of the users we've tested with and #-mentioned confirm they never received a notification they had been tagged.
This is different to "human" behaviour, where if you #-mention someone in Slack, you get a little message reminding you that person isn't in this channel and offers to invite them or let them know.
As far as we can tell, sending the message programmatically is doing the equivalent of "Do nothing" in the picture above. I want to do either of the other two options, preferably "Let them know".
How can I notify people they've been mentioned? I've looked at all the API documentation and nothing discusses notifying users who aren't in the channel that they are mentioned.
This can't be an uncommon issue.... right?
Notes:
We aren't directly calling chat.postMessage, it's just the only documentation on link_names I could find to link to. We are using Incoming Webhooks, which has minimal documentation on the parameters - it seems to be the same as chat.postMessage.
We would prefer not to move off Incoming Webhooks, but we can do a custom integration with the API if we have to.
You need to invite the user to the channel first, using the Python client that's:
client.channels_invite(
channel=channel_id,
user=user_id
)

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.

Is it posible to send multiple message to Google Home through DialogFlow?

On facebook Chatbot or others platform we can send message directly to the user.
So for one question we can send multiple answer.
Now, that i'm developing for Google Home, I need to do the same.
I didn't find this opttion.
Dialogflow HTTP call to my server is the only output available.
So is there anything i missed to send message back to user in case I have a multiple messages answer?
(Or do I have to bufferise very message my hook creates before sending it back?)
Thanks
The conversation model for the Google Assistant is different - you can only send a message to the user in response to the user sending you a message. You can only send a single response, but it may have multiple parts (up to two Simple responses, containing messages, plus other features such as cards and carousels).
If you need to send multiple things back - you may need to rethink how you're doing it or how much you're sending back at a time. The Assistant is primarily for audible responses, and a long audible response is generally not a good UX.

Sending MMSs with a subject line

We have been recently asked to add ability to send and receive MMS to our FLEX application. Our initial plan was to use our existing functionality instead i.e. send an SMS with a subject line. When the client responses to the message with an MMS (because the SMS will become an MMS when the client attaches the required picture) the message will be routed to MMSC who has been requested to forward that message to us an email (because again our application already has ability to receive and process emails built in).
Based on my research I've found that:
1. If you add a subject line to an SMS, the SMS automatically because an MMS meaning we will need to add ability to interact with the MMS gateway. I'm fine with this.
Now my question is, if we send an MMS with a specific subject line, when that the client receives and responds to the MMS, will the subject line be automatically carried back to us like it is done on emails? The information that we will be carrying on that subject line is very important for the correct routing of that reply. Secondly, does anyone know of a website that already has MMS sending functionality. I would like to test this before going further with my design.

Resources