Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Latest commit

 

History

History
36 lines (23 loc) · 1.13 KB

README.md

File metadata and controls

36 lines (23 loc) · 1.13 KB

Description

Simple Telegram bot for sending site fragments to chat when users clicks Ctrl+Enter (e.g. when found a typo)

Files

  • bot.rb - bot code, uses telegram-bot-ruby and sinatra gems
  • ctrlEnter.js - site JS code, send selected fragment to bot url, uses jQuery

ENV variables

  • spellbot_token - Telegram bot token
  • spellbot_chat_id - chat id where we should send fragments
  • spellbot_domain - allowed domain for fragment sending (spam prevention)

Bot commands

  • /start - did nothing, just confirm that bot is works
  • /info - returns your chat_id
  • /help - returns commands explanation

How to install

  • Register your bot and get token - https://core.telegram.org/bots
  • Launch bot.rb on your favorite server with your favorite software (I prefer Heroku)
  • Get your chat_id with /info command
  • Add ctrlEnter.js to your site (do not forget change https://yourbot.com to your bot URL)

License and Maintainer

Maintainer: Anton Markelov

License: MIT

P.S.

Thank Ganeshji Marwaha for this article: http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/. I don't know JS and this text helped me a lot.