Slackbot can be configured to respond something when you say some selected key words. Can that feature be use to trigger actions.
For example, when I say meeting, can it execute the command /todo #me meeting due today?
You can setup custom triggers for the slackbot, but it won't do what you're looking for because the todo-bot actions don't seem to trigger from another bot.
To setup custom slackbot responses you'd go to Customize Slack, then select the tab option for the Slackbot. From here, if the word in the left column is seen in a channel, slackbot will respond with the text on the right. It can't grab any info like the channel name or user name, just respond with text. This is useful for reminders like the wifi password or some brief custom help message.
Todo-bot now has webhooks. I haven't used it myself, but I've linked to the introduction page below. You can't do this entirely from within slack; An outside piece of software or server would need to be setup to monitor slack for triggers and create custom prefabricated todo's.
https://help.todobot.io/hc/en-us/articles/115010096748-Incoming-Webhooks
Related
When I put the Telegram Token in DialogFlow, I get the error Bot was not started. I have started the bot in Telegram app. How do I solve this?
let’s say we will make the bot to give answers about programming language
steps:
create new agent
create entities
create the words contained in the entities
create intents
enter training phases (DialogFlow will recognise parts of the phases containing entities you just created. it will give different colors for different entities)
set default responses
add google assistant (if needed)
add response for Google Assistant. activate Google Assistant Response. choose basic card. add the image link (we can do this later). put the search text
https://google.com/search?q=how+to+le...
add more responses (telegram, slack, web demo, twitter, facebook messenger, etc.). you will get a token for activating the integration (in this example) i use Telegram
add response to Telegram. add card. fill in the card. don’t forget to add the search terms (you can add image url later)
at action and parameters section, set prompts for responses if needed
go to integrations. choose telegram (or whatever you chose before)
follow the instructions on how to create a bot in a telegram here: https://cloud.google.com/dialogflow/d...
copy the generated token
press start
there you go! now you have your own bot :)
Update: June 30, 2020
After more testing, I have details that might help someone recognize my problem.
The issue seems to be that Slack is sending data to Azure Bot Services, but that data isn't being forwarded to my code. Ive been able to use the Bot Emulator without any problems and the Azure Web Chat works fine.
I know that the Slack configuration for the OAuth Redirect URL is correct (I was able to add my bot to Slack) and the Request URL for Events is correct (they sent the 'challenge' and it's verified). I've subscribed to the exact Scopes and Events that are in the Microsoft documentation and I've verified that the Interactivity and Events options are enabled.
When a user types text in my bot's Slack channel, my app receives "message" activity and my code can send a response, so it looks like Microsoft can communicate end-to-end for normal messages. I do not receive any data when users first join my bot (like a ConversationUpdate) or if they click a button in a dialog. I can see Slack sending data when a button is pressed, it just never arrives.
As a test, I copied the Messaging Endpoint from my Azure bot settings and pasted it into Slack's Interactivity "Request URL" and when I click a button in Slack I can see the data that Slack is sending (sadly in a format that my code can't handle).
Original Post
I have a Bot Framework app (v4) that I've written in nodejs. It works well and I have an ActivityHandler that responds to people being added to a conversation and when they send messages. I was able to get pro-active messaging functioning and everything was great until I tried to get interactivity working.
I started off using some sample button code from Microsoft's documentation:
let reply = MessageFactory.suggestedActions(['Red', 'Yellow', 'Blue'], 'What is the best color?');
await turnContext.sendActivity(reply);
This works fine in the emulator, but in Slack it renders as a bulleted list. It looks like that's the way that "suggested actions" are handled in Slack.
I changed my code to use a "hero card":
let card = CardFactory.heroCard(
'What is the best color?',
undefined,
CardFactory.actions([
{
type: 'imBack',
title: 'Color Red',
value: 'Red Value'
}
])
);
let reply = MessageFactory.attachment(card);
await turnContext.sendActivity(reply);
This works okay in the emulator, except my app thinks the user typed "Red Value" and the button stays on-screen and is still clickable. I might be able to work around that, but the button doesn't work at all in Slack. It is rendered fine, but I don't get a notification in my app.
Clicking the button shows an HTTP request to:
https://{MY_SLACK}.slack.com/api/chat.attachmentAction?_x_id=f8d003c3-1592436018.632&_x_csid=NcWi3y50lFU&slack_route={OTHER_SLACK_STUFF}
And I can see that the request POSTs all sorts of data including:
payload: {"actions":[{"id":"1","name":"imBack","text":"Color Red","type":"button","value":"Red Value","style":"default"}],"attachment_id":"2","callback_id":"{MAGIC_NUMBER}:{TEAM_ID}","channel_id":"{CHANNEL_ID}","message_ts":"1592435983.056000","prompt_app_install":false,"team_id":"{TEAM_ID}"}
I'm not sure how to see anything useful in the Azure Portal - the analytics option for my bot doesn't seem to work and the activities option only says "Write a Bot Service". I don't see any sign of the message going from Slack to Azure.
I'm developing locally and configured ngrok so that my messaging endpoint in Azure could be set to https://69fe1382ce17.ngrok.io/api/messages On the Slack side of things, I've configured the Interactivity Request URL to be https://slack.botframework.com/api/Actions The Event Subscription Request URL is https://slack.botframework.com/api/Events/{MY_BOT_NAME}
What I would like is a set of buttons with different options and when the user clicks one, my bot gets some sort of "value" instead of message text. I'd also like for the button to go away so the user can't send repeated commands. It would be nice if the hero card collapsed with just the prompt being displayed.
Are there any interactive options that work for Slack and other channels?
Thanks!
Lee
I know linking to another site with no additional detail is frowned upon, but I don't have enough expertise to answer your question. I suspect the link here might move you in the right direction:
Choice Prompts are not translated over to Slack format #3974
Good luck!
Your question is multifaceted so I'll try to break it down into smaller pieces.
What's the deal with suggested actions in Slack?
Suggested actions are not supported in Slack, but the Bot Builder SDK thinks they are. This is a longstanding bug. I've just reported it again on the docs page you linked: https://github.com/MicrosoftDocs/bot-docs/issues/1742
This means you would encounter problems if you were trying to have the choice factory automatically generate the right kind of choices for your channel. You're not doing that, so you should be fine. Hero cards are supposed to work in Slack.
Why aren't hero cards working in Slack?
First I need to mention that hero cards only work with the Slack connector and not the Slack adapter. You seem to be using the connector so you should be fine.
I suspect your problem is related to how you've configured your bot's settings on the Slack side. There is a step in the Bot Framework doc that seems to be important if you want to get buttons to work. If you've followed the doc exactly and you still can't get buttons to work, it may be worthwhile to dig into the Slack API documentation.
How do I only allow a button to be clicked once?
You can update or delete the activity. There's no easy way to do this, but if you voice your support for my cards library then it can be done for you automatically.
The Slack connector actually puts a lot of relevant information in the incoming activity's channel data, and you can use that to figure out what activity the incoming activity came from. That would take some experimentation on your part.
There's another approach that works on more channels than just Slack. It's real complicated, but if you wanna tackle this then here are the basic steps:
You need to put an ID in the action data to help your bot identify the action.
You need to save the activity ID that gets returned when you send the action to Slack.
You need to associate the returned activity ID with the ID you put in the action data.
You need to retrieve the activity ID using the action data ID when the user clicks the button.
You need to use that activity ID to update or delete the activity.
Unfortunately there's no centralized guide to help you do this, but there are many examples explaining it scattered across Stack Overflow. Here is a good one: https://stackoverflow.com/a/55174866/2122672
I have tried many different methods but it is not working properly.Please any one can help me how to send a reply when user uploads any attachments in a chatbot.
To be able to achieve your objective, it is important to understand what dialogflow events are: Events allow you to invoke intents based on something that has happened instead of what a user communicates. Dialogflow supports events from several platforms (like Google Assistant, Slack, and more) based on actions users take on those platforms.
When a user attaches a file or shares location, Kommunicate sends a custom event KOMMUNICATE_MEDIA_EVENT to your bot along with the attached file information. To have an upload intent respond to the KOMMUNICATE_MEDIA_EVENT, follow these steps to create this custom event in your dialogflow bot:
How to add an event to an intent
Go to the Events section of the intent.
Type the name of the event you'd like your intent to respond to (KOMMUNICATE_MEDIA_EVENT).
Press enter.
Click SAVE.
Also remember to add your response that the bot will deliver to a user when they upload a document.
References:
https://cloud.google.com/dialogflow/docs/events-overview
https://docs.kommunicate.io/docs/bot-custom-integration#send-attachments-to-bot
https://cloud.google.com/dialogflow/docs/quick/build-agent
I hope this helps?
Clicking https://www.messenger.com/t/xxxxxxxx will take you to a bot and continue the conversation, if there was no conversation it'll begin it's 'firstRun' sequence.
Is it possible to create links that will execute a specific dialog and pass in data? It should ignore previous dialog state/stack and start a new stack with the specified data as argument to that dialog.
This is not possible. The url is used to identify the user/bot in messenger. The bot doesn't see the url so it can't read from it.
I would suggest taking a different approach. You could let the user pass in the code instead of adding it to the url.
There is a new functionality in Messenger platform that allows you to send specific messages to a bot: https://developers.facebook.com/docs/messenger-platform/referral-params
I haven't tested it yet, but it may help you.
At work we have a Slack channel where each person posts their daily scrum updates. The format is something like this:
Yesterday:
- Did something
- Did something else
Today:
- Did something
- Did something else
Blocks:
- This is blocking my progress
Now, I'm trying to find a way in which I can have this preformatted for my colleagues i.e. like placeholder text in HTML
Is there a way to achieve this in Slack?
The options I have considered so far are as seen here
1. Create a / command on Slack that would respond with this text when a user types /daily and populate the response (I'm not sure about the feasibility of this, I have only created slash commands that triggered an external process, not returned any text to Slack)
2. Create a custom application and integrate with Slack
I realize that the answer to this can be opinionated, and that that is discouraged in the community, but I'm thinking others might also have come across this issue or will, in the future, and the answer is relatively objective here, not purely subjective.
I have been developing a several Slack apps and came across similar requirements. Slack does currently not offer good options for entering structured data in my opinion, so I would recommend to rather use a HTML page with a simple form for entering the data which then automatically posts the update on Slack.
Options with pure Slack
You can use slash commands or a bot to receive the input from your user, but in both cases the user has to enter data command line style and is it not possible to use something like HTML placeholders. Your options are either to use keywords or to have a conversation between the user and the bot. The input is free text and will need to be parsed by your app.
Example for slash commands with keywords:
/daily yesterday "this and that"
/daily today "this and that"
/daily blocks "this and that"
Example for a bot conversation:
#scrumbot daily
"What is your update for yesterday?"
#scrumbot this and that
"What is your update for today"
#scrumbot this and that
etc.
I have been using both approached in my apps, but they are pretty clumsy and not very user friendly for entering larger amount of structured text.
Slack with HTML page
My recommendation would therefor be to rather use a simple HTML form to enter the text and then automatically post the result in the Slack channel. You can either use Sign-in with Slack or let the user click a generated link on Slack to connect a generated HTML page to the correct Slash user. The first offers better security, the later is more user-friendly.
Example:
/daily
"Please click *here* to enter your daily update"
Then a generated HTML page opens in the browser which allows the user to enter his data in a form. After submit the input is posted on Slack in the correct channel
Btw. the Slack team is planning to implement input field for Slack in the future, but this is currently scheduled for mid term, so I would not expect it to be available in the near future. See "Interactive messages Stage 3" on the Slack Plattform Roadmap.
Update September 2017
The Slack team have introduced a new method to enable users to enter structured data called dialogs.
Dialogs are similar to forms in HTML and allow to create modal dialog windows with multiple input field of various types (currently text, textarea, select) within Slack. They can be triggered as response to a slash command or an interactive message (buttons, menus).
The new dialog feature would now be the best choice to get structured input from the user like requested in this question.