assistant-adapter-telegram
v0.1.1
Published
Connect a Telegram bot to an Assistant
Downloads
3
Readme
Assistant Adapter for Telegram
Assistant is a self-hosted bot service similar to Hubot (except it's not written in coffeescript!) that executes arbitrary commands to perform certain actions with a variety of adapters to allow it to run on any platform, simultaneously.
This is the telegram
adapter, which allows you to interact with your assistant by messaging a Telegram bot back and
forth.
$ npm install --save assistant-adapter-telegram
To get started, add the following to your assistant's package.json
:
{
"assistant-adapters": {
"telegram": "assistant-adapter-telegram"
},
"assistant-config": {
"adapters": {
"telegram": {
"token": "1926482dcb7fac2585775a65a7b98611ed969af"
}
}
}
}
(Ensure the key of the assistant-adapters object is the same as the assistant-config.adapters object!)
Now you can start your Assistant, and if it boots without crashes you're almost ready to start interacting with your Assistant.
Finally, you have to set the Telegram web-hook in order to receive real-time updates from your bot conversations.
This usually involves calling the setWebhook
endpoint of the Telegram API to {your-assistant-url}/telegram
. You can
set the route name (if you'd prefer to not mount it at /telegram
) like so:
{
"assistant-adapters": {
"telegram": "assistant-adapter-telegram"
},
"assistant-config": {
"adapters": {
"telegram": {
"route": "/awesome-telegram",
"token": "1926482dcb7fac2585775a65a7b98611ed969af"
}
}
}
}
Which will make the Telegram adapter available at {your-assistant-url}/awesome-telegram
:smile: