Falchoin bot and api. https://sh.cfbrk.de/fc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Markus Becker dea7a818fb Allow CORS on API 1 year ago
choin Allow CORS on API 1 year ago
.gitignore Documentation and docker 2 years ago
Dockerfile Documentation and docker 2 years ago
README.md Add webhooks 1 year ago
setup.py Add requests to Dockerfile 1 year ago



Falchoin bot and api.


pip3 install git+ssh://git@cfbrk.de/code.mtib.dev/falchoin.git#egg=falchoin

Move into a working directory that falchoin is supposed to use and create a secrets.json file, then run falchoin.


  1. Check out the repo.
pip3 install -e .
  1. Create a feature branch.
  2. Do changes.
  3. Commit.
  4. Create a merge request.



docker build -t "falchoin:$TAG" .


You need to create a directory for falchoin to use for storing the database and a file in that directory for configuration. The following commands assume this directory is $PWD/secrets.

docker run -it -v $CONF_DIR:/app -p 7473:$OUT_PORT --rm falchoin:$TAG

Assuming you have a file "secrets.json" the form:

	"client_id": "[client_id]",
	"client_secret": "[discord-secret]",
	"client_token": "<discord-token>"

running the container will create a "fcoin.db" in your secrets folder. This allows persistence between runs.




Returns transaction details and status.


Returns user details, balance and outstanding (unaccepted) transactions.


Returns list of all users.


Returns list of all transactions.



Sends money using your secret key.

With body:

  "from": "sender-id",
  "to": "receiver-id",
  "key": "sender-key",
  "amount": 1337


Posts a request for money transfer.

With body:

  "from": "sender-id",
  "to": "receiver-id",
  "key": "receiver-key",
  "webhook": "url (optional)",
  "amount": 1337

Will cause the bot to contact the sender with the info and require authentication.

Immediate Response

  "success": true,
  "id": "transaction-id"

Then the application will have to regularly check the transaction ID for fulfilment (before sending whatever was paid). The server will send a POST request to the provided webhook as soon as the sender has accepted or refused. The body is identical to the updated /v1/transactions/transaction-id.


Responds to a requested money transfer.

This way if someone requests you to send them money you can programmatically accept. Maybe we could even let users register webhooks for when they receive a request. This uses the secret key of the money-sender. This key can only be received from the discord bot by using the secret command.

  "id": "transaction-id",
  "key": "sender-key",
  "accept": true