Skip to content

Commit

Permalink
♻️ refactor(project): Complete preliminary refactor of the project.
Browse files Browse the repository at this point in the history
Complete preliminary refactor of the project.

BREAKING CHANGE: Config files need to be modified to adapt this update.

Signed-off-by: Kuribohrn <[email protected]>
  • Loading branch information
Kuribohrn committed Oct 19, 2022
1 parent f563de1 commit 72476e3
Show file tree
Hide file tree
Showing 60 changed files with 2,552 additions and 2,162 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
*.pyc
.vscode/
data/
!data/README.md
config/config.json
config/config.secret
data/b01lers-bot.db
data/b01lers-bot-*.db
logs/bot-*.log
logs/bot.log
venv/
tags
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Basic setup
FROM alpine:edge

# Metadata
MAINTAINER Kuribohrn "[email protected]"

# Commands
# Update systme-wide dependencies
RUN apk update

# Add Alpine testing repository
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories

# Update all repositories
RUN apk update

# Install git and pypy3
RUN apk add git pypy3

# Add and switch to bot user
RUN addgroup -S bot && adduser -S bot -G bot
USER bot

# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8

# Ensure local pypy3 is preferred over distribution pypy3, and ensure pip is in path
ENV PATH /usr/lib/pypy/bin:/home/bot/.local/bin:$PATH

# Ensure pip is installed and latest
RUN pypy3 -m ensurepip
RUN pypy3 -m pip install --upgrade pip

# Clone project from repo
RUN git clone https://github.com/b01lers/b01lers-bot /home/bot/b01lers-bot
WORKDIR /home/bot/b01lers-bot

# Install project dependencies and run!
RUN pip install -r requirements.txt
RUN pypy3 main.py
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# b01lers-bot
The b01lers Discord Bot

# Requirements
## Permissions
* Message intent
* Privileged message content intent
* Server members intent
## System
Any with Python 3.8+ installed.

# Development
## Some Useful Resources
* [Built-in Checks for the commands extension of discord py](https://gist.github.com/Painezor/eb2519022cd2c907b56624105f94b190)
Loading

0 comments on commit 72476e3

Please sign in to comment.