How to trigger an existing Slack Workflow from a Slack Bot - slack

I've built myself a slackbot which listens to emojis posted on a message.
I would like to be able to trigger a slack workflow (which I had build using the Saclk workflow builder) whenever a user tags a message using an emoji but I can't find any information on how I can do that.
Any help would be greatly appreciated.

Related

Slack Workflow API Call to get Data

I want to create a Slack Workflow that is triggered via an Emoji. As part of the Workflow, I need to make an API call to get some data as one of the steps. Specifically, I am looking for a Workflow where you can react with a help emoji on a question, the workflow would find out who is oncall, and then ping that person to help with the request.
Is this possible?

How to make Slack app send a private message via an incoming webhook to someone specific?

I created a Slack app that sends a series of interactive messages to a channel. In my Slack API dashboard, I see that I can create and remove hooks. Right now the hook url that I have set up in my code is the one for the Slackbot channel.
But the problem is that such a message only gets sent to me.
I want to send the Slackbot messages to Alice in situation A, and to Bob in situation B. Not just to myself, the guy who configured the app.
What's the best way to do this?
I would suggest that you should not use hooks for this. A more sane way to do this right would be via chat.postMessage Web API method which is documented here!
This is because hooks are tied to specific conversations and that approach quickly hits a wall on what it can really achieve, especially messaging different people. Once you start using the web API it's pretty simple. Just ask for the scope during app installation (remember to add that scope in your dashboard), subscribe to the event in your API dashboard and then you are good to go.
Everytime you send a message via that method, Slack will send you a payload which you can use for testing and logging etc.
You can see all the different ways to message programmatically inside Slack here.

Sending messages to my bot via Slack gets no response

I have a bot deployed to our Azure subscription. Using the webchat channel, I can interact with the bot using the url:
http://mybotname.azurewebsites.net/
We have added the bot to Slack as an app. We followed all the instructions given by the documentation on how to add a bot into Slack - https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-service-3.0
When I send a message to the bot in the Slack channel we have created, I get no response. There is not error message, or in fact anything, returned.
Whereabouts can I start looking to see what the problem could be? Suggestions for error logs, traces, etc would be appreciated. I enabled App insights for the Azure Web App which the bot runs under, but nothing comes up as an error, or warning, or anything. I'm a bit lost here, any suggestions would be appreciated.
Note that I was made aware that, for Slack, I may need to tailor the responses in order for Slack to render them e.g. FormFlow define options for string field
I'm not sure how to do that, or even if this is a case that my bot simply isn't working in Slack regardless of how I'd format the responses.

Will the Microsoft-Teams bot get any event when bot is added by editing an existing message?

When a Microsoft-teams bot is added to an existing message on a channel, by editing the message, would it be possible to notify the bot about the message?
I tried this scenario and looks like bot is not receiving any events for such cases. Is there any interface or mechanism available to notify the bot about the message?
When you edit a Teams message and add any # mention - whether it's to a user or a bot - it doesn't generate new notifications. This has been a gap ever since we added the ability to edit messages.

Creating a Slackbot that adds

Hey in my team's slack (messaging system for those who don't know) we have an automatic response, so that when anyone says "trump", slackbot automatically responds with "the wall just got ten feet higher". Now I want to make a counter that essentially allows slackbot to state "the wall just got ten feet higher, wall height:(have a updated value according to number of times "trump" has been stated)" So basically I want a way to have a value that updates the wall height but I am lost on how to do that within slackbot. Any help is much appreciated, thanks to all!
The default features provided by Slackbot only allows it to respond to keywords, but not much more. So to provide that additional feature you would need to develop a custom bot.
For your use case I would recommend building a so called internal integration for Slack using the Events API.
Internal integration allows you to add custom functions for your Slack team only (as opposed to a full fledged Slack app, that could also be installed and used for other Slack teams).
The Events API allows you to set up a bot that listens to messages and can react to keywords like "trump".
An alternative approach to the events API would be the outgoing webhook. However this function is now deprecated and should no longer be used. Also it only works with public channels.
To set this up you will need to develop a small webservice (e.g. in PHP) that listens on a webserver for requests from the events API, keeps count of how many times the keyword has been invoked in the past and sends an appropriate message back to your Slack team every time the keyword is used.
I can recommend reading the excellent official Slack API documentation if you want to learn more.
If you are familiar with PHP this can be done easily using the Slackbot Framework. It supports Events API allowing you to listen to messages in channels or direct messages (depending on the permission scopes of your APP). So all the conversations on Slack can be sent to your server and you can search for the specific keyword in every message. Then send back an appropriate message to Slack. In summary, the first step is to create an APP for your slack team at https://api.slack.com/apps?new_app=1. Next step is to install the Slackbot Framework which is explained here. Hope this is helpful.
That can also be done by integrating custom slack bot using Django. You'll have to subscribe events and based on events, Slack will send conversation message to the given url, and based on the event, you can write your logic to increase count and post message back to slack work space.

Resources