create custom slash command in slack using #botname instead of /botname - slack

I tried to create a slack application using the link, its working as /botname str.
is there any way that we could invoke application in slack using #botname str instead of /botname str. tried searching various places, couldn't get on how to do, can anyone help on it.

To use #botname instead of \botname, you'll need to change approach of implementation.
You need to implement by subscribing to 'Slack Events'.
This should help you to start:
https://api.slack.com/apis/connections/events-api
https://api.slack.com/events/app_mention

Related

How to implement regex function in Microsoft bot composer

How to implement regex in Bot composer ?
Below I have a scenario where user can enter any thing like: Qna-1234, Qna-{1234} etc.
From above I want to display only 1234 in the response. How can I achieve this it will
be very helpful if provided some solution.
Yes, there is a workaround to achieve this requirement without regex. You can update the expected user responses section. You can define an entity to extract just an Id from user expressions. Refer below screenshots for details.
You can see here that adaptive expressions only have one regular expression function, and it returns a Boolean value. If you would like the Bot Framework team to create a new prebuilt function for you, you can make a feature request here: https://github.com/microsoft/botframework-sdk/issues/new/choose
In the meantime, you can create your own custom actions by following these instructions: https://learn.microsoft.com/composer/how-to-add-custom-action

What to use for embedded arrays?

Is there support for embedded arrays in form? Like list of emails or phone numbers (these entities do not exist as standalone resource so it is impossible to use Reference* fields/inputs). SelectArrayInput looks promising, but it needs to know in advance possible options which is not the case (maybe there is an easy way to modify it to accept any option after hiting an enter button?).
Not currently, you'll have to make a custom input. If you do, please make it an addon and we'll reference it in the documentation.
Also note that someone started an addon about this: https://github.com/marmelab/admin-on-rest/pull/697

invoking Luis by replaceDialog or any other way

Bot builder comes with LuisRecognizer and other inbuilt classes that does the work of posting the message and getting back the intents and entities.
like replaceDialog helps to start a new waterfall/closure, is there a way to use in built botbuilder classes to post to Luis and based on the match invoke the respective waterfall sequence?
I tried the following.
session.replaceDialog('/'). This does not seem to invoke the luis recognizer again and therefore dialog.matches are not even invoked.
bot.receive(message). this does not do the luis call nor match the intent for the message well. plus, it also seems to go into a wrong sequence ( parent sequence which invokes bot.receive ) again, by default.
IntentDialog.recognize and intentDialog.invokeAction. recognize fails to recognise the message.
What am I doing wrong? is there a way to reuse botbuilder classes?
I can think of writing a simple rest client to invoke Luis api. but that is the last resort, as the purpose of botbuilder's recognizer and intentdialog classes are exactly the same.
flag setting does the trick. Now the modeller gets invoked on every beginDialog.
dialog = new builder.IntentDialog({
recognizeMode : builder.RecognizeMode.onBegin,
});

Is it possible to chain commands via FormFlow?

Dialog can do almost everything according to the bot framework documentation, but it will take a lot more time to investigate than FormFlow. I failed to find a place that have lots of samples of bot framework yet. At the moment, before I spend a lot of time to try dialog, anyone know if it's possible to chain commands using FormFlow.
The work I am trying to do is to code a chain of commands:
query records
select a record from the results
actions/operations on the record
etc...
Really appreciate if anyone familiar with Bot Framework can help me on this.
Use the IDialogStack.Call method in your FormFlow handlers to call another dialog and push it on the stack.
Then use the IDialogStack.Done method to pop it off the stack. Both described here.

Getting parameters from applicationManager

I am basically executing the following luna-send command and trying to get those parameters from applicationManager:
luna-send -n 1 palm://com.palm.power/timeout/set '{"wakeup":true, "key":"myKey",
"uri":"palm://com.palm.applicationManager/launch","params":{"id":"com.my.app",
"params":{"test":true,"test1:true}},"in":"00:00:15"}'
After executing this command, my app gets launched by applicationManager, but I don't know how to get those params in my app. I am using enyo 2.0. I was trying to use onWindowsParamsChange handler, but ApplicationEvents is deprecated for 2.0. Can anyone help me with this?
Thanks
Under Enyo 1.0 it was enyo.windowParams. Under Enyo 2.0 I believe this functionality is gone. These parameters may be available through Cordova, but I'm not positive right now as I don't have the source handy. In any case, this was loaded from PalmSystem.launchParams so you should be able to access that.
If you're handling relaunch then you'll have a little more work to do. I think you'll need to define a Mojo.relaunch on the window object to detect when the launch parameters change.

Resources