Giter Site home page Giter Site logo

susancat / draftbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from draftbot-a-discord-adventure/draftbot

0.0 0.0 0.0 10.26 MB

A Discord adventure bot with web3 features

License: MIT License

JavaScript 0.13% TypeScript 99.85% Dockerfile 0.03%

draftbot's Introduction

Couronne DraftBot

DraftBot is a bot developed in Node.js by @BastLast based on a text adventure game. The story takes place in a medieval world, and the player embodies an adventurer who wants to win a competition launched by the king, to win the princess' hand. To achieve this, he must travel and earn points by going through a lot of danger, including thieves, wilderness, and scary children. Every few hours, the player can get a random event by using the /report command: they interact with a multiple choice system, using reactions below the report. Each choice has multiple issues, which could hurt the character, heal them, or even give them some stuff. During the journey, they earn money, stuff, and points, and can use them to buy potions, stuff or effects in the shop, fight other players, and ascend the leaderboard.


How to launch the bot

Before creating your own instance, please note that you can add the bot to your server through the link available on the bot's discord

If you decide to work on the creation of your own instance of the bot, you are supposed to have a minimum of computer skills. Bot support team will prioritize players of the main instance and will only provide very limited assistance. We will fix bugs you report, but we will not teach you how to code a discord bot.

Please do not copy and paste the commands we provide in this readme without :

  • Understanding the command
  • Replacing the relevant parts with your data
  • Having read the whole document

Only the code available in the "release" tab is considered "stable".

Without docker

Here is a short start guide. (windows)

  • install git : https://git-scm.com/download/win
  • download the bot : git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure
  • install NodeJS http://nodejs.org/fr/ (nodejs 12 minimum is required)
  • install Yarn npm install --global yarn
  • install the bot : yarn install
  • install and launch a mariadb database (with or without docker). Keep the credentials for the config file. If you choose to use docker, we provide a tutorial below.
  • create the config file by copying the file config.default.toml in a new file config.toml
  • Edit the file config.toml with the correct data
  • Launch the bot : yarn start

Here is the same guide for linux (or if you have a git terminal on Windows)

  • install git : apt-get install git
  • download the bot : git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure
  • install NodeJS apt-get install nodejs (nodejs 12 minimum is required)
  • install yarn npm install -g yarn (you may have to install npm and use sudo)
  • install the bot : yarn install
  • install and launch a mariadb database (with or without docker). Keep the credentials for the config file. If you choose to use docker, we provide a tutorial below.
  • create the config file : cp config/config.default.toml config/config.toml
  • Edit the file config.toml with the correct data
  • Launch the bot : yarn start

Updating the bot

  • Be sure to use yarn install and yarn start each time you update the bot.
  • Migrations will run automatically, but be sure to check them as they are created for our database, they may cause issues in yours.

With docker

Make sure to have docker installed on your machine. Please follow the "without docker" steps until the yarn install step (you don't need to do it).

Compile the docker image

We have a docker hub account, so you may not need to compile the image yourself! You can find it there: https://hub.docker.com/u/draftbot. If you really want to compile it yourself, follow the next step.

In the project folder (previously downloaded with git), run:

docker build . -t draftbot/draftbot

Install a database

Create a docker (or not) mariadb database with the following command :

docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret_password -e MARIADB_ROOT_PASSWORD=super_secret_password -v /path/to/volumes/mariadb:/var/lib/mysql -p 3306:3306 mariadb:latest

or with docker compose :

services:
  mariadb:
    image: mariadb
    container_name: mariadb
    ports:
      - 3306:3306
    volumes:
      - /path/to/volumes/mariadb:/var/lib/mysql
    environment:
      MARIADB_USER: draftbot
      MARIADB_PASSWORD: secret_password
      MARIADB_ROOT_PASSWORD: super_secret_password

Run the docker container

Once you compiled the bot image and a database is ready, you have to start a draftbot container.

You need to have a config.toml file filled. The config template can be found at config/config.default.toml

docker run -d --name draftbot -v /path/to/config.toml:/draftbot/config/config.toml:ro -v /path/to/logs:/draftbot/logs draftbot/draftbot

or with docker compose :

services:
  draftbot:
    image: draftbot/draftbot
    container_name: draftbot
    volumes:
      - /path/to/config.toml:/draftbot/config/config.toml:ro
      - /path/to/logs:/draftbot/logs

Screenshots

image

Links

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.