Coder Social home page Coder Social logo

discordtipbot's Introduction

discordtipbot

Build Status

Highly configurable tip bot for the chat plattform discord. DO NOT RUN THIS CODE UNLESS YOU KNOW WHAT YOU ARE DOING!

Instead of executing this code yourself, feel free to contact me at https://discord.gg/r3NspwB to discuss me hosting it for you.

If you collect some kind of bounty or donation(s), I'd appreciate you forwarding some of it after your hosting costs.

Terms

In no event shall this bot or it's dev be responsible in the event of lost, stolen or misdirected funds.

About

  • First we launch the main watcher at src/discordtipbot.cr
  • This reads the config file
  • It then launches a fiber for each bot

Dependencies

  • docker

Initial setup

  • Create a overlay network: docker network create -d overlay --attachable dtb
  • Clone and cd into this repository: git clone https://github.com/greenbigfrog/discordtipbot.git
  • Create a directory which will contain all the tipbot related stuff: mkdir tipbot
  • Copy and edit sample-config.json into tipbot
  • Modify scripts/postgres-init.sh to reflect the various coins, which will both create the required databases, as well as initialize a empty schema
  • Launch watchtower to automatically watch for changes to the images (in usual build process made by Travis): docker run -d --name watchtower --network dtb -v /var/run/docker.sock:/var/run/docker.sock v2tec/watchtower
  • Start a docker container called database, which'll mount a folder called postgres-data in the local directory: docker run -d --name database --network dtb -v $PWD/postgres-data:/var/lib/postgresql/data -v $PWD/../sql/schema.sql:/schema.sql -v $PWD/../scripts/postgres-init.sh:/docker-entrypoint-initdb.d/postgres-init.sh -d postgres:11.1-alpine

Building

scripts/deploy_to_docker.bash contains instructions to build both a dtb-launcher and dtb-website image which will then contain binaries.

Running

  • Make sure you are in the directory with the config file and postgres data
  • Database: docker run -d --name database --network dtb -v $PWD/postgres-data:/var/lib/postgresql/data postgres:11.1-alpine
  • TipBot: docker run -d --name discordbot --network dtb -v $PWD/config.json:/config.json greenbigfrog/dtb-launcher:latest
  • Website: docker run -d --name website --network dtb -v $PWD/config.json:/config.json greenbigfrog/dtb-website:latest
  • Wallet: docker run -d --name dogecoind --network dtb -v ~/.dogecoin/:/dogecoin/.dogecoin/ greenbigfrog/dogecoin -printtoconsole

The website requires a CF origin certificate to be stored in docker config at /origin_cert.pub and the key at /origin_cert.priv

  • cli: docker run --rm -ti --network dtb -v ~/.dogecoin/:/dogecoin/.dogecoin/ greenbigfrog/dogecoin dogecoin-cli -rpcconnect=dogecoind -rpcuser=a -rpcpassword=b getinfo
  • psql: docker run --rm -ti --network dtb postgres:11.1-alpine psql -h database -U docker dogecoin

Development

Preferably run your wallets in testnet mode by adding testnet=1 to each wallets config file during development

Contributing

  1. Fork it ( https://github.com/greenbigfrog/discordtipbot/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • greenbigfrog Jonathan B. - creator, maintainer
  • z64 Zac Nowicki - advisor, reviewer

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.