Code Monkey home page Code Monkey logo

memcoin's Introduction

Code of the @memecoin_bot Telegram bot. Reputation + coin economy inside the Telegram chat.

Installation and local launch

  1. Clone this repo: git clone https://github.com/backmeupplz/memcoin
  2. Create .env file with environment variables listed below
  3. Run yarn install in the root folder
  4. Run yarn distribute

Environment variables in .env file

  • USERNAME — Telegram bot username
  • TOKEN — Telegram bot token
  • MONGO — URL of the mongo db
  • SECRET — Secret key to generate auth token
  • PORT — Port for API server
  • ADMIN_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 send
  • receiverId — chat id of the user to receive
  • amount — 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!

memcoin's People

Contributors

backmeupplz avatar deletedev avatar dependabot[bot] avatar mixaile avatar usernametrue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.