Skip to content

ploebb/ioBroker.telegram

 
 

Repository files navigation

Logo ioBroker telegram Adapter

NPM version Downloads Tests

NPM

Ask @BotFather to create new bot /newbot.

You will be asked to enter name of the bot and then the username. After that you will get the Token.

Screenshot

You should set password for communication in configuration dialog.

To authenticate user by Bot write "/password phrase", where phrase is your configured password.

Note: you can use short form "/p phrase".

You can send message to all authenticated users over messageBox sendTo('telegram', 'Test message') or to specific user sendTo('telegram', '@userName Test message'). User must be authenticated before. You can specifiy user in that way too:

sendTo('telegram', {user: 'UserName', text: 'Test message'}, function (res) {
    console.log('Sent to ' + res + ' users');
});

You can send message over state too, just set state "telegram.INSTANCE.communicate.response" with value "@userName Test message".

Usage

You can use telegram with text2command adapter. There are predefined communication schema and you can command to you home in text form.

To send photo, just send a path to file instead of text: sendTo('telegram', 'absolute/path/file.png').

Changelog

0.2.0 (2016-04-12)

  • (bluefox) add send photo possibility

0.1.0 (2016-02-20)

  • (bluefox) fix double responses.
  • (bluefox) inform about new start

0.0.2 (2016-02-15)

  • (bluefox) fix error with sendTo

0.0.1 (2016-02-13)

  • (bluefox) intial commit

License

The MIT License (MIT)

Copyright (c) 2016, bluefox[email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Use Telegram service to communicate with ioBroker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.7%
  • HTML 10.3%