wrussell1999 / food-flex-discord

🍔 Discord bot for rating your friends food
https://foodflex.wrussell.co.uk
MIT License
15 stars 3 forks source link
discord discord-api discord-bot discord-py food-flex hacktoberfest ssh

Food Flex Discord Bot

What does the bot do?

Food Flex is bot that manages:

Submissions (Monday 10:00 - Sunday 8:59)

When a user uploads a picture of their food to the chat, they are automatically entered into the competition. Users can only submit once. Additional photos will overwrite the existing submission so your last photo sent will be the one saved.

Voting (Sunday 9:00 - Sunday 21:59)

Submissions are closed and a voting poll is displayed. Users can vote for their favourite by sending the letter that corresponds to the user. Users can only vote once, and not for themselves. The bot will won't count additional votes. Also, anyone who submitted, and hasn't voted by 21:00, will received a private message to remind them to vote. You will receive a private message to confirm your vote.

NOTE: If you submit a picture and don't vote, you are disqualified.

Results (Sunday 22:00)

Voting is closed and a results message will be sent to the chat.

Leaderboard

This is a read-only channel that updates every day once there are new results. This shows the overall scores over a period of time. This can be a month, university term, or a year. You can also see the leaderboard at here.

Docs

See the wiki for documentation on commands, json data and more.

Setup For Bot

Go into the bot folder

Debian-based

Install dependencies:

virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt

To run:

python app/bot.py

Docker Compose

The Compose can also be used to run the application.

  1. cp example.env .env
  2. Configure the variables as equivilent to config *
  3. Pull: docker-compose pull
  4. Launch: docker-compose up -d
  5. View logs: docker-compose logs -f

Configuration

Environment Variables

Will out the .env file.

TOKEN=
SERVER_ID=
COMMAND_PREFIX=
ADMIN_IDS=
MAIN_CHANNEL_ID=
LEADERBOARD_CHANNEL_ID=
DATA_ROOT=

* The only thing to note here is that admin_id should be in the form of 1111, 2222, 3333 when using environment variables.

Meaning of each key

Getting a token

This guide will show you how to create a Discord Bot for your Discord server.

Getting IDs

Go to Discord and turn on Developer Mode. With this, you can now right-click on guilds, channels, catergories, users, messages, etc. and get their ID (an integer).

Contributors

License

MIT License for all the code written by Will and Dan.

DejaVuSans font - Bitstream Vera Fonts Copyright