Slack bot to show text as the bot - slack-api

Looking for a simple bot that will just echo the text after the command as the bot user.
Example:
In a channel I type:
/botname Hello!
Then instead of me saying, "Hello!" the bot will say it instead.
botname
Hello!
Quite simple, but I can't find anything out there that does this.

Is there a particular part in this that you are struggling to do? This would be simple to do with any slack framework that supports slash commands, such as botkit. In fact it might actually be even simpler without a framework.
All this would be doing is to respond to the request that Slack makes to your server as a result of the slash command invocation with the content of the text field:
(Image taken from https://api.slack.com/slash-commands)

Related

How do you use two if_value_matches inside of Twilio studio?

I am new to Twilio and have a question regarding the use of the if_value_matches function. If you see below, I have a simple flow promoting the user to say yes or no and to respond to invalid commands. I have confirmed the Yes option and the invalid (referred to 'sorry' in the pic) function correctly. However, if I respond with NO it directs the flow down the invalid line of responses. Am I missing something simple here? Is there a better way to set up this flow?
Maybe try putting the option in Uppercase e.g. NO,No,no
If it's text it for sure makes a difference

Twilio Simple Gather Action

I am trying to do a simple flow with twiml.
example
when the user press 1
play some text
if press 2
play other some text
the problem is that i can not find the way without using the uri action and exposing a new url to only retrieve a say with the speach.
Is it any other way to do something link that without using urls and new endpoints???
It is much easier to do the above using Twilio Studio, give it a go, it is all Serverless and elastic.
Twilio Studio

SMS formatting looks bad

I have been trying to get a well formatted text from zapier to send through twilio, the message should be send like this:
New patient!
Name
Phone Number
email#email.com
Contacting him ASAP!
Instead I'm receiving
New patient!NamePhone Numberemail!email.comContacting him ASAP!
How do I solve this?
David here, from the Zapier Platform team.
I got curious and tested it out. Wasn't able to reproduce your issue:
I just typed a regular "enter" for the newlines and also tried with your copied text. If it's still not working, can you update your question with screenshots of the zap input?

Use mention in dialog Slack

I have developed a slack bot which purpose is to give details about the company's projects.
I tried to use slack dialog to ask for different information such as the name, a description and the people involved in the project.
To do the last part (people involved), I wanted to use mention (#), so that the person who adds the project doesn't have to know the exact name / email of each participants. I'm pretty sure it's not possible but before trying another solution, I wanted to ask since I didn't find anything on internet.
Can we or can we not use mentions in slack dialog ? And if we can, how ?
No, the Slack Dialog currently does not have support for multiple mentions. The text elements will has support for url, email, number and telephone number. But not for mentions.
However, mentions work nicely with slash commands. You can add a list of users after your slash command with a mention and their will be automatically detected and matched to list of Slack user.
So maybe its possible for you to start with a slash command including mentions and use the Dialog to request additional information.

Twitter API: how to know what application was used to follow

In the email notification we can see something like
<username> followed you using <appname>.
It is great. But is there any possible way to know the application name using API?
I took a look through the REST API, and I could not find anything that would support this. My guess is that this is a twitter.com feature that is available in the API (yet).
The most logical places I looked were statuses/followers and friendships/show. In both cases there was nothing definitive. Checking the follower emails for my account, I found multiple followers that used applications (like PeopleBrowr and SocialOomph) to follow the account. In most cases, the source on their latest status object matched the application name used to follow me, but that was definitely not a sure thing.
So, to answer your question directly, no I don't think it can be done through the API (not unless there's an undocumented method out there that does this.)
I can, however, think of a way to get that info. One approach would be to set up the email account receiving the follow notifications to forward a copy to a mailbox that is checked by an automated process. When emails show up, parse them to find the app name used to follow you.
I used the following regular expression (in C#) to find the application's name and URI in the email's body:
Match m = Regex.Match(input, #"followed you using\s*<a[^""]+""(?<appUri>[^""]+)""[^>]+>(?<appName>\w*)</a>");
I used m.Groups["appName"].Value to pull out the application name, and m.Groups["appUri"].Value to pull out the URI from the match.
In order to tie the app info to a user, I had to also find the screen name with:
Match m = Regex.Match(user, #"\(#<a[^>]+>(?<screenName>\w*)</a>\) is now following");
I used m.Groups["screenName"].Value to extract the value from the match.

Resources