Skip to content

Latest commit

 

History

History
89 lines (54 loc) · 2.89 KB

README.md

File metadata and controls

89 lines (54 loc) · 2.89 KB

Telegram Space Kiosk Bot

Telegram bot for the debit system at the beverage kiosk

Run the Bot

TODO

Drinks Configuration

The Drinks Configuration is setup via a .csv/.txt file on an WebDav Directory.

The scheme is: <name of beverage>;<price as float>;<ean-code>\n

When you create a .csv file, this scheme is provided automatically.

Bot

Configuration

To configure the bot fully you need to provide either the config.json in the /credentials folder, or an empty one when using environment variables instead (recommended usage for the docker images).

{
  "telegramBotToken" : "TelegramBotToken",
  "webdavUserId" : "userNameForWebdavAccess",
  "webdavPassword" : "passwordForWebdavAccess",
  "webdavURI" : "fullWebdavURI",
  "webdavFileName : "fullFilename",
  "mongoDBHostName" : "mongoDBHostname",
  "mongoDBHostPort" : "mongoDBPort",
  "mongoDBDatabaseName" : "mongoDBDatabaseName",
  "mongoDBCollectionName" : "mongoDBCollectionName"
}

telegramBotToken: (Required) The bot token generated by the Botfather.

webdavUserId: (Required) Username for accessing the beverage configuration file on the remote server.

webdavPassword: (Required) Password for accessing the beverage configuration file on the remote server.

webdavURI: (Required) The full WebDav URI to the remote server.

webdavFileName: (Required) The filename of the beverage configuration file on the remote server including the filetype.

mongoDBHostName: (Required) MongoDB Hostname. e.g.: localhost

mongoDBHostPort: (Required) MongoDB Port. Normally 27017

mongoDBDatabaseName: (Required) Name of the MongoDB Database.

mongoDBCollectionName: (Required) Name of the MongoDB Collection.

Commands

/start: The initial start command.

/register: Register a new user. An user consists of the name provided by Telegram, the chatId, the creation date and the current balance.

/info: All stored information will be communicated to you.

/code: Manual entry of the ean code.

/update: Triggers the refresh mechanism for updating the beverage list.

/add: Adds new credit to the current amount.

/get: Current amount on the debit-system.

/remove : Removes manual amount from the debit-system.

/transponder : Add your tag ID to your account. Can also be used to connect an existing credit to your new Account.

/name: If you want to set a new name.

/delete: If you want to delete all data stored about you.

Botfather

You have to ask the Botfather for a new Bot-Token.

Setup procedure

  1. Ask the Botfather to create you a bot with an API token. Configure the bot as described in the Botfather chapter.
  2. Setup a MongoDB and create a new Database with one Collection in it.
  3. Create a new configuration file as described in [Drinks Configuration](##Drinks Configuration).
  4. Enter all necessary variables into the config file as described in Configuration.
  5. Enjoy!