I am not sure if what I am trying to do is even possible. I have a Slack App and via that SlackApp I want to control another Slack App which is not mine.
That's probably too abstract, so let's get into detail:
There is the SlackApp Foodtrain. If you are a user you just type "/lunchtrain Location Time" and it does it's job. I want my App to activate a Lunchtrain but if I just send a Message via Webhook thats '/lunchtrain Location Time' it doesn't activate the command. You can see it in plaintext. Is there any way to do this properly?
Thanks everybody for the help!
The official Slack API does not allow you to issue slash commands, but there is an undocumented API method called chat.command that has this functionality.
Usage example:
https://slack.com/api/chat.command?token=TOKEN&channel=C123456789&command=/who
Check out the documentation for the method on this github for details.
Related
While logging into the bot, using Botframework OAuthPrompt function, user is required to log in on Microsoft page and then asked to copy magic code and paste it in the conversation with bot. Is there a way to automatically pass it without user input ?
Docs says that it should be solved in v4 but in both emulator and my mobile app it is still required.
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=aadv1%2Ccsharp%2Cbot-oauth
I would like to make log in process easier for my users.
There have been improvements to the channels to support new authentication features, such as new WebChat and DirectLineJS libraries to eliminate the need for the 6-digit magic code verification. You can follow these links to prevent the magic code from showing up:
https://github.com/Microsoft/BotBuilder/issues/4632#issuecomment-441957719( refer to #compulim's comment here, who is the developer of Web Chat and has specified the steps to eliminate the magic code flow).
https://github.com/Microsoft/BotFramework-WebChat/pull/1218( pull request for the token server sample).
Also, note that if your browser is set to block 3rd party cookies, it will fallback to magic code flow.
Hope this helps.
For your bot emulator, you can disable this from your bot settings.
Go to bot emulator settings and uncheck the "use sign-in verification code .." option.
1) Is setting up webhook necessary to save json data of a context shared between players of context?
2) How to validate callback url for webhook on facebook developer console? My game is already live on facebook for single player. (No local testing)
3) Can I use my own personal https url to setup webhook?
No, you do not need to use the webhook to save context data. You can use XMLHttpRequest, fetch or a JavaScript SDK for a service like Playfab or Firebase to store data. In fact, we wouldn't even recommend you use a webhook for saving data because if the player turns off messages from your bot you will not receive any webhook callbacks.
You can validate a callback URL using the developer dashboard, including the "Show Recent Errors" button, which is really useful for spotting any issues. You can also get more information from the Webhooks item on the left nav.
You may need to clarify what you mean by "your own personal https url". As long as Facebook can hit your webhook URL, everything will work. You cannot, for example use a localhost URL.
id like to start using telegram bot, i already read the documentation, but still can't get my head, what's the difference between "getUpdates" and "webhooks"
source: telegram docs
can someone explain this in plain language
thanks in advance
The difference between "getupdates" and "webhook" is just like the difference between pull and push!
Using "getupdates" you don't even need to have a sever! You call telegram server prodically by providing bot's token and it will send you new updates if there is any. It means that your bot is always busy calling telegram even if there is just a single update per your 1000 requests!!
Using "webhook", you first notify telegram about your server ip and listening port and your public key. Then telegram will call your sever whenever there is any update.
At last and not the least If you want your bot to be faster you should use webhook.
Two method can get same content, but you can only use one of them at same time.
Webhook is dependent on HTTPS server, usually use in PHP.
If you haven't a web interface, better to choose getUpdates, which doesn't required HTTPS address to receive updates.
I tried to execute gmail api's watch on my two gmail accounts and it works fine.
But when the other user tried to do so, it shows this error:
HTTP error 400 : "Only one user push notification client allowed per developer (call /stop then try again)">
I don't know if the problem is on the pub/sub client configuration or doing stop and watch will resolve the problem?
Can someone explain the meaning of this statement "Only one user push notification client allowed per developer"?
Try using a different project for the Cloud Pub/Sub topic that the other user wants to set up a Gmail API watch on.
You can always renew a watch by first stopping the watch and then immediately initiating a new watch right after. So, try to use users.stop once before you use users.watch.
I have encountered a similar issue. Although this might not be helpful to the OP, for me the solution was to abandon Google's Pub/Sub and use IMAP IDLE instead, which is much better suited for OP's use case of monitoring several inboxes.
Old days many admins use sms-gates for sending important informations from their systems e.g. "Power down, UPS is working now!", "Power Up, UPS is off!" or "CPU Temp too high!". Today in Facebook era we use messenger instead of SMS, so I wonder if I could create a command-line bash or php script for such thing.
The idea - cron checks every 10 minutes the condition and if it is true, sends message to my messenger.
The issues:
I don't want to use my fb account for sending - I'd like to get message
from "System 1", "System 2", because i have more than one system to
admin.
The bash part is easy for me, I need tips for Facebook solutions:
do I have to get FacebookAppId (and do I have to create AppId for
each system or just one AppId)
how to "join/confirm/accept" "System 1" account with my Facebook Account
is it possible to send messages to more than one FBAccount
any other hints what should i look for.
I found Notification App, but i think that it doesn't send message to messenger, so it would be useless.
The Chat API was removed with v2.0 of the Graph API, there is no way to send messages with an API anymore. Btw, messages are for communcation between real users, they should not be used as notification system anyway. SMS is still a good option for those kind of warnings imho.
Using a Page and the /conversations endpoint would not work either:
Pages can only reply to a message - they cannot initiate a conversation. Also, a Page can only respond twice to a particular message, the other party will have to respond before they can reply again.
Source: https://developers.facebook.com/docs/graph-api/reference/v2.3/conversation/messages#publish
I think for your special purpose, twitter may be a better option. Twitter accepts tweets from API. So what you need to do is to set up an account to publish your system status either regularly or event-triggingly and follow it in your own personal account.
And there are already plenty of open source projects focusing on tweeting via API, and t is the one I am currently using.
So there are a couple of command line apps to do this.
There is a libpurple extension (https://github.com/dequis/purple-facebook) which works. However purple doesn't seem to support the idea of message history. This is a shame since I imagine offline messages is the default way most people use facebook.
There is an single use command tool for facebook as well: https://www.npmjs.com/package/fb-messenger-cli which does support history. Unfortunately this is a TUI rather than a command line application and doesn't seem to depend on a separate facebook library.
Some hacking or terrible expect glue could work around this.
I just published a service exactly for that use case :
https://www.nimrod-messenger.io/
It's at an early stage. Feedbacks are more than welcome :-)
Sending facebook message in bash script
IDEA
I needed a script (which work on my work/local mac) that checks server. If there are problems, script will send me messages on Facebook.
Dependencies
need to install: https://github.com/mjkaufer/Messer
Solution, bash script
FB_SENDER_LOGIN=""
FB_SENDER_PASSWORD=""
function send_fb_message {
FB_MESSER_COMAND="messer $FB_SENDER_LOGIN $FB_SENDER_PASSWORD --command='m \"$1\" $2'"
eval "$FB_MESSER_COMAND"
}
RECIPIENT_NAME_DISPLAYED_IN_FACEBOOK_WEBSITE="Vasily Bodnarchuk"
MESSAGE="Houston, we have a problem!!!"
send_fb_message "$RECIPIENT_NAME_DISPLAYED_IN_FACEBOOK_WEBSITE" "$MESSAGE"
Automated Facebook message
I was looking for something like this exactly and found that Messer is the way to go.
Solution
Look at this repo called Messer https://github.com/mjkaufer/Messer
(it works with 2FA too but not with app passwords)
Implementation
See Readme
I needed it to run automatically so I used it's non-interactive mode with a bash script:
message="Hey, what\'s up bro"
FULLPATH/node_modules/.bin/messer --command="m \"Myfriends Name\" $message"
I don't like to install something like this globally through NPM so I used the /node_modules/.bin/messer executable in the project's folder.
Used double quotes escaped instead of single quotes to be able to use variables inside command.
Drawback: Messer can only send, not receive.