95ulisse / ClockworkBot

Telegram bot for Clockwork SMS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clockwork SMS Telegram bot

This is a simple Telegram bot that allows sending SMS through the Clockwork SMS service.

For more information, look at the post on the Telegram blog and the docs.

Note: While the bot itself is free, the Clockwork SMS service is not. For more information, look at their pricing page.

Getting started

First of all, install MongoDB and NodeJS;

Then, clone the repository in a directory of your choice and initialize ClockworkBot:

git clone https://github.com/95ulisse/ClockworkBot.git
cd ClockworkBot
npm init

And finally, start the bot:

node .

Now, you should inform Telegram that there's a new bot ready out there!

curl -X GET https://api.telegram.org/bot<token>/setWebhook\?url\=<urlToReachTheBotServer>

Configuration options

The config file is config.yml. These are the possible configuration options:

  • method: {unix|tcp} Indicates if a unix or tcp socket should be used.
  • bindIp: IP address to bind to when method is tcp.
  • port: Port to bind to when method is tcp.
  • bindSocket: Path of the unix socket when method is unix.
  • socketPermissions: Permissions of the unix socket when method is unix.
  • logPath: Path to the log file
  • mongoConnectionString: MongoDB connection string in the format mongodb://<server>/<database>. For more information look at the MongoDB docs.
  • botKey: API token provided by Telegram's BotFather.

Commands

This is a list of all the commands that the bot accepts:

  • /setapikey <apiKey>: Sets the Clockwork API Key to use to send messages. Pass null to delete the key.
  • /setdefaultfrom <number>: Sets a default sender number to use when not specified in the /sms command. Pass null to delete the default sender.
  • /sms [from <senderNumber> to] <destNumber> <message>: Sends an SMS to . Specifying a sender number is optional, and if not provided will be used the default one (see /setdefaultfrom).
  • /credit: Check the how much credit is left on your Clockwork account
  • /help: Shows the help text.

License

This software is licensed under the MIT license.

About

Telegram bot for Clockwork SMS


Languages

Language:CoffeeScript 99.5%Language:JavaScript 0.5%