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.
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>
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 whenmethod
is tcp.port
: Port to bind to whenmethod
is tcp.bindSocket
: Path of the unix socket whenmethod
is unix.socketPermissions
: Permissions of the unix socket whenmethod
is unix.logPath
: Path to the log filemongoConnectionString
: MongoDB connection string in the formatmongodb://<server>/<database>
. For more information look at the MongoDB docs.botKey
: API token provided by Telegram's BotFather.
This is a list of all the commands that the bot accepts:
/setapikey <apiKey>
: Sets the Clockwork API Key to use to send messages. Passnull
to delete the key./setdefaultfrom <number>
: Sets a default sender number to use when not specified in the/sms
command. Passnull
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.
This software is licensed under the MIT license.