mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 18:23:12 +00:00
Optimize code
This commit is contained in:
parent
c27ba95c14
commit
72e48cea63
35 changed files with 914 additions and 912 deletions
15
.github/workflows/docker-image.yml
vendored
15
.github/workflows/docker-image.yml
vendored
|
@ -17,8 +17,7 @@ jobs:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Docker meta
|
||||||
name: Docker meta
|
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
|
@ -31,25 +30,21 @@ jobs:
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
-
|
- name: Set up Docker Buildx
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
- name: Login to Docker Hub
|
||||||
name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
- name: Login to GHCR
|
||||||
name: Login to GHCR
|
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
-
|
- name: Build and push
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|
|
@ -16,7 +16,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
# Run the linter.
|
# Run the linter.
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [ --fix ]
|
||||||
# Run the formatter.
|
# Run the formatter.
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# Contributing to Luminara
|
# Contributing to Luminara
|
||||||
|
|
||||||
Thank you for your interest in contributing to Lumi! We welcome contributions from the community to help improve and expand the bot's functionality. Please follow these guidelines when contributing:
|
Thank you for your interest in contributing to Lumi! We welcome contributions from the community to help improve and
|
||||||
|
expand the bot's functionality. Please follow these guidelines when contributing:
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
@ -28,17 +29,21 @@ Thank you for your interest in contributing to Lumi! We welcome contributions fr
|
||||||
|
|
||||||
1. **Create a Branch:** Create a new branch for your changes.
|
1. **Create a Branch:** Create a new branch for your changes.
|
||||||
2. **Code Style:** Adhere to the existing code style and formatting conventions.
|
2. **Code Style:** Adhere to the existing code style and formatting conventions.
|
||||||
3. **Strict Typing:** Always use strict typing (e.g., `str`, `int`, `List[str]`) for better code quality and maintainability.
|
3. **Strict Typing:** Always use strict typing (e.g., `str`, `int`, `List[str]`) for better code quality and
|
||||||
4. **Pre-Commit Checks:** Before committing, run pre-commit checks to ensure your code passes linting and formatting standards.
|
maintainability.
|
||||||
|
4. **Pre-Commit Checks:** Before committing, run pre-commit checks to ensure your code passes linting and formatting
|
||||||
|
standards.
|
||||||
5. **Clear Commit Messages:** Write clear and concise commit messages that describe the changes you made.
|
5. **Clear Commit Messages:** Write clear and concise commit messages that describe the changes you made.
|
||||||
|
|
||||||
## Submitting Changes
|
## Submitting Changes
|
||||||
|
|
||||||
1. **Create a Pull Request:** Create a pull request (PR) from your branch to the `main` branch of the original repository.
|
1. **Create a Pull Request:** Create a pull request (PR) from your branch to the `main` branch of the original
|
||||||
|
repository.
|
||||||
2. **Review:** Your PR will be reviewed by the Sourcery & Lumi maintainers. Address any feedback or requested changes.
|
2. **Review:** Your PR will be reviewed by the Sourcery & Lumi maintainers. Address any feedback or requested changes.
|
||||||
3. **Merge:** Once approved, your PR will be merged into the main branch.
|
3. **Merge:** Once approved, your PR will be merged into the main branch.
|
||||||
|
|
||||||
## Additional Notes
|
## Additional Notes
|
||||||
|
|
||||||
* **Documentation:** If you add new functionality or change existing behavior, update or add the docstrings accordingly.
|
* **Documentation:** If you add new functionality or change existing behavior, update or add the docstrings accordingly.
|
||||||
|
|
||||||
Thank you for your contributions!
|
Thank you for your contributions!
|
||||||
|
|
|
@ -2,14 +2,15 @@
|
||||||
|
|
||||||
![Lumi art](https://git.wlinator.org/assets/img/logo.png)
|
![Lumi art](https://git.wlinator.org/assets/img/logo.png)
|
||||||
|
|
||||||
|
|
||||||
## Self-Hosting
|
## Self-Hosting
|
||||||
|
|
||||||
Self-hosting refers to running Luminara on your own server or computer, rather than using the publicly hosted version. This approach offers the ability to manage your own instance of the bot and give it a custom name and avatar.
|
Self-hosting refers to running Luminara on your own server or computer, rather than using the publicly hosted version.
|
||||||
|
This approach offers the ability to manage your own instance of the bot and give it a custom name and avatar.
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
Before you begin, make sure you have the following installed on your system:
|
Before you begin, make sure you have the following installed on your system:
|
||||||
|
|
||||||
- [Docker](https://docs.docker.com/get-docker/)
|
- [Docker](https://docs.docker.com/get-docker/)
|
||||||
- [Docker Compose](https://docs.docker.com/compose/install/)
|
- [Docker Compose](https://docs.docker.com/compose/install/)
|
||||||
|
|
||||||
|
@ -25,7 +26,8 @@ Additionally, you'll need to create a Discord bot application and obtain a token
|
||||||
|
|
||||||
### Running Luminara:
|
### Running Luminara:
|
||||||
|
|
||||||
1. Copy the contents from [`docker-compose.prod.yml`](docker-compose.prod.yml) to a new file named `docker-compose.yml` in an empty directory.
|
1. Copy the contents from [`docker-compose.prod.yml`](docker-compose.prod.yml) to a new file named `docker-compose.yml`
|
||||||
|
in an empty directory.
|
||||||
|
|
||||||
2. Copy the contents from [`.env.example`](.env.example) to a new file named `.env` in the same directory.
|
2. Copy the contents from [`.env.example`](.env.example) to a new file named `.env` in the same directory.
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
Versions currently being supported with security updates.
|
Versions currently being supported with security updates.
|
||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
|---------|--------------------|
|
||||||
| 2.x | :white_check_mark: |
|
| 2.x | :white_check_mark: |
|
||||||
| 1.x | :x: |
|
| 1.x | :x: |
|
||||||
| < 1.0 | :x: |
|
| < 1.0 | :x: |
|
||||||
|
|
|
@ -54,7 +54,7 @@ async def view_all_cases_in_guild(ctx, guild_id: int):
|
||||||
|
|
||||||
pages_list = []
|
pages_list = []
|
||||||
for i in range(0, len(cases), 10):
|
for i in range(0, len(cases), 10):
|
||||||
chunk = cases[i : i + 10]
|
chunk = cases[i: i + 10]
|
||||||
embed = create_case_list_embed(
|
embed = create_case_list_embed(
|
||||||
ctx,
|
ctx,
|
||||||
chunk,
|
chunk,
|
||||||
|
@ -79,7 +79,7 @@ async def view_all_cases_by_mod(ctx, guild_id: int, moderator: discord.Member):
|
||||||
|
|
||||||
pages_list = []
|
pages_list = []
|
||||||
for i in range(0, len(cases), 10):
|
for i in range(0, len(cases), 10):
|
||||||
chunk = cases[i : i + 10]
|
chunk = cases[i: i + 10]
|
||||||
embed = create_case_list_embed(
|
embed = create_case_list_embed(
|
||||||
ctx,
|
ctx,
|
||||||
chunk,
|
chunk,
|
||||||
|
|
1210
poetry.lock
generated
1210
poetry.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue