Memcoin for the Memconomy for @borodutcher
- TypeScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github | ||
| src | ||
| types | ||
| .env.sample | ||
| .gitignore | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tslint.json | ||
| yarn.lock | ||
@memecoin_bot
Code of the @memecoin_bot Telegram bot. Reputation + coin economy inside the Telegram chat.
Installation and local launch
- Clone this repo:
git clone https://github.com/backmeupplz/memcoin - Create
.envfile with environment variables listed below - Run
yarn installin the root folder - Run
yarn distribute
Environment variables in .env file
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.
API 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:
GET /user/:id
Gets user data by their chat id
Receives:
id— user chat id
Returns:
- User information in the format:
{
"chatId": 12345,
"name": "Nikita Kolmogorov",
"balance": 10
}
POST /transfer
Transfers memecoins from one user to another
Receives:
senderId— chat id of the user to sendreceiverId— chat id of the user to receiveamount— number of memecoins to transfer
Returns:
- Success JSON if everything is ok:
{ "success": true }
Continuous integration
Any commit pushed to master gets deployed to @memecoin_bot via CI Ninja.
License
MIT — use for any purpose. Would be great if you could leave a note about the original developers. Thanks!