Git Product home page Git Product logo

present's Introduction

Present

A Discord bot for managing giveaways.

GitHub Workflow Status GitHub Issues MIT License

About

Present is a Discord bot which manages giveaways in your server. It is capable of allowing multiple winners, as well as excluding specific users and roles form being able to win.

Installing and configuring Present

Present runs in a Docker container, and there is a docker-compose.yaml file which simplifies this process.

Clone the repository

To start off, clone the repository into your desired directory:

git clone https://github.com/BrackeysBot/Present.git

Step into the Present directory using cd Present, and continue with the steps below.

Setting things up

The bot's token is passed to the container using the DISCORD_TOKEN environment variable. Define this environment variable whichever way is most convenient for you.

Two directories are required to exist for Docker compose to mount as container volumes. A folder for persistent data, and a folder for logs:

sudo mkdir /etc/brackeysbot/present
sudo mkdir /var/log/brackeysbot/present

Copy the example config.example.json to /etc/brackeysbot/present/config.json, and assign the necessary config keys. Below is breakdown of the config.json layout:

{
  "GUILD_ID": {
    "logChannel": /* The ID of the log channel */,
    "giveawayColor": /* The primary branding colour, as a 24-bit RGB integer. Defaults to #7837FF */
  }
}

The logs directory is used to store logs in a format similar to that of a Minecraft server. latest.log will contain the log for the current day and current execution. All past logs are archived.

The data directory is used to store persistent state of the bot, such as config values and the infraction database.

Launch Present

To launch Present, simply run the following commands:

sudo docker-compose build
sudo docker-compose up --detach

Updating Present

To update Present, simply pull the latest changes from the repo and restart the container:

git pull
sudo docker-compose stop
sudo docker-compose build
sudo docker-compose up --detach

Using Present

For further usage breakdown and explanation of commands, see USAGE.md.

License

This bot is under the MIT License.

Disclaimer

This bot is tailored for use within the Brackeys Discord server. While this bot is open source and you are free to use it in your own servers, you accept responsibility for any mishaps which may arise from the use of this software. Use at your own risk.

present's People

Contributors

oliverbooth avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

present's Issues

Entrants are not loaded from database on app start

When loading active giveaways from the cache,

Logger.Debug($"Tracking giveaway {giveaway.Id} ({giveaway.Title}) in guild {giveaway.GuildId}. {giveaway.Entrants.Count} entrants");

The output given is:

[Present.Services.ActiveGiveawayService] Tracking giveaway X in guild N. 0 entrants

This forces the embed to display 0 entrants on its next update.

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.