botman / internals Goto Github PK
View Code? Open in Web Editor NEWIssues board used for BotMan internals discussions.
Issues board used for BotMan internals discussions.
In order to facilitate App distribution the Slack Driver can support the OAuth flow, here's the Slack docs: https://api.slack.com/docs/oauth
Before activating public distribution, please remove any hard-coded information from your app, such as OAuth tokens and webhook URLs. Going forward, you should authorize your app for use on your workspace with OAuth, just like anybody installing your app on their own workspace would do.
Laravel has artisan command php artisan route:cache
that caches all routes in order to increase app speed.
I am not sure how significant speed increase that would be but we could cache is similar way commands and events.
Consider the case where on one server is bot and web access point, admin dashboard for example. route/botman.php
is loaded (processed) on every page hit.
If a developer wants to quick access some fields in a conversation, he can extends the Conversation class and add those fields. In case those fields needs to be instantiated, the extended class can implements a "initialize" method that will be executed before the run method.
Add to User.php:
class User implements UserInterface
{
/**
* @return string
*/
public function getLanguageCode() {
}
}
The function MUST return the IETF language tag of the user's language if available, null otherwise.
Note:
Botman should support the share_contents
field for the button of type element_share
.
Here's the facebook documentation: https://developers.facebook.com/docs/messenger-platform/reference/buttons/login#example_body
and here an example of the payload:
"buttons": [
{
"type": "element_share",
"share_contents": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "I took Peter's 'Which Hat Are You?' Quiz",
"subtitle": "My result: Fez",
"image_url": "https://bot.peters-hats.com/img/hats/fez.jpg",
"default_action": {
"type": "web_url",
"url": "http://m.me/petershats?ref=invited_by_24601"
},
"buttons": [
{
"type": "web_url",
"url": "http://m.me/petershats?ref=invited_by_24601",
"title": "Take Quiz"
}
]
}
]
}
}
}
}
]
Some drivers have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot โ or an auth token to connect the user's Telegram account to their account on some external service.
class IncomingMessage
{
/**
* @return string
*/
public function getParameter() {
}
}
This function MUST return the parameter passed in the link.
Note:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.