Telegram bot for the debit system at the beverage kiosk
TODO
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.
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.
/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.
You have to ask the Botfather for a new Bot-Token.
- Ask the Botfather to create you a bot with an API token. Configure the bot as described in the Botfather chapter.
- Setup a MongoDB and create a new Database with one Collection in it.
- Create a new configuration file as described in [Drinks Configuration](##Drinks Configuration).
- Enter all necessary variables into the config file as described in Configuration.
- Enjoy!