Code of the @memecoin_bot Telegram bot. Reputation + coin economy inside the Telegram chat.
- Clone this repo:
git clone https://github.com/backmeupplz/memcoin
- Create
.env
file with environment variables listed below - Run
yarn install
in the root folder - Run
yarn distribute
USERNAME
— Telegram bot usernameTOKEN
— Telegram bot tokenMONGO
— URL of the mongo dbSECRET
— Secret key to generate auth tokenPORT
— Port for API serverADMIN_ID
— ID of the super admin chat
Please, consider refering to provided env.sample
for further docs.
In order to use API, you will have to obtain an API token from @borodutch. After you obtain the API token, you can see it with the /token
command in private chat with @memecoin_bot. All requests to the API should contain token
header with your API token as a string.
API contains of the following methods sent to http://188.166.96.198:1337
:
Gets user data by their chat id
id
— user chat id
- User information in the format:
{
"chatId": 12345,
"name": "Nikita Kolmogorov",
"balance": 10
}
Transfers memecoins from one user to another
senderId
— chat id of the user to sendreceiverId
— chat id of the user to receiveamount
— number of memecoins to transfer
- Success JSON if everything is ok:
{ "success": true }
Any commit pushed to master gets deployed to @memecoin_bot via CI Ninja.
MIT — use for any purpose. Would be great if you could leave a note about the original developers. Thanks!