Skip to content

Commit 767345e

Browse files
authored
Merge branch 'develop' into feature/forced-plugins
2 parents d2047cf + 37d911f commit 767345e

20 files changed

+546
-293
lines changed

.dockerignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
**
55
!/cogs
66
!/core
7-
!/plugins
8-
!*.py
7+
!bot.py
98
!LICENSE
109
!pdm.lock
1110
!pyproject.toml
1211
!README.md
13-

.github/workflows/docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v3
2929

3030
- name: Log in to the Container registry
31-
uses: docker/login-action@v2
31+
uses: docker/login-action@v3
3232
with:
3333
registry: ${{ env.REGISTRY }}
3434
username: ${{ github.actor }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636

3737
- name: Extract metadata (tags, labels) for Docker
3838
id: meta
39-
uses: docker/metadata-action@v4
39+
uses: docker/metadata-action@v5
4040
with:
4141
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4242
tags: |
@@ -50,11 +50,11 @@ jobs:
5050
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
5151
5252
- name: Build and push Docker image
53-
uses: docker/build-push-action@v3
53+
uses: docker/build-push-action@v5
5454
with:
5555
context: .
5656
push: true
57-
platforms: linux/amd64,linux/arm64, linux/arm64/v7
57+
platforms: linux/amd64,linux/arm64
5858
tags: ${{ steps.meta.outputs.tags }}
5959
labels: ${{ steps.meta.outputs.labels }}
6060
sbom: true

.github/workflows/lint.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.8"]
15+
python-version: ["3.11"]
1616
name: Python ${{ matrix.python-version }} on ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v3
@@ -21,12 +21,16 @@ jobs:
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
architecture: x64
24+
- name: Setup PDM
25+
uses: pdm-project/setup-pdm@v4
26+
with:
27+
cache: true
2428
- name: Install dependencies
2529
run: |
26-
python -m pip install black ruff
30+
pdm install --group dev
2731
- name: Ruff
28-
run: ruff . --no-fix
32+
run: pdm run ruff . --no-fix
2933
continue-on-error: true
3034
- name: Black
3135
run: |
32-
black . --diff --check
36+
pdm run black . --diff --check

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: "23.10.1"
3+
rev: "24.4.2"
44
hooks:
55
- id: black
66
- repo: https://github.com/charliermarsh/ruff-pre-commit
7-
rev: 'v0.1.4'
7+
rev: 'v0.4.9'
88
hooks:
99
- id: ruff
1010
- repo: https://github.com/pdm-project/pdm

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,32 @@ however, insignificant breaking changes do not guarantee a major version bump, s
1010

1111
### Breaking
1212
- Completely rewritten blocklist system. Blocklisting now runs off its own mongoDB collection. This once again introduces backwards incompatible schema changes, so a manual migration is required. You may upgrade from both v4.0 and v4.1 using the `[p]migrate blocklist` command. This removes any need to perform the previous migration steps in v4.1.0, you may upgrade directly to this version. After running the command, blocklist functionality will return and legacy config based blocks will have been deleted. You should always back up your config before migration.
13+
- Remove internal logviewer plugin
1314

1415
### Deprecated
1516
- Legacy blocklist properties are deprecated and no longer function. They now log a warning when used and provide no functionality. They have been replaced with methods in blocklist.py
1617

1718
### Added
1819
- Added `content_type` to attachments stored in the database.
20+
- `?log key <key>` to retrieve the log link and view a preview using a log key. ([PR #3196](https://github.com/modmail-dev/Modmail/pull/3196))
1921
- Add Forced plugins. Allows auto installing un-removable plugins via `FORCED_PLUGINS` environment variable contain a comma separate list of plugins. (GH#5)
2022

2123
### Changed
2224
- Changing a threads title or NSFW status immediately updates the status in the database.
25+
- Replace Pipenv with PDM
26+
- Bump discord.py version to 2.3.2
27+
- Rewrote docker build for PDM
28+
29+
### Removed
30+
- Remove Discord.py dependency version check
31+
- Remove modmail telemetry
32+
- Remove lottie sticker support
2333

2434
### Fixed
2535
- Persistent notes have been fixed after the previous discord.py update.
2636
- `is_image` now is true only if the image is actually an image.
37+
- Fix contact command reporting user was blocked when they weren't.
38+
- Cleanup imports after removing/unloading a plugin. ([PR #3226](https://github.com/modmail-dev/Modmail/pull/3226))
2739

2840
### Internal
2941
- Add `update_title` and `update_nsfw` methods to `ApiClient` to update thread title and nsfw status in the database.
@@ -43,6 +55,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
4355
- Support for trailing space in `?prefix` command, example: `?prefix "mm "` for `mm ping`.
4456
- Added logviewer as built-in local plugin `?plugin load @local/logviewer`.
4557
- `?plugin uninstall` is now an alias for `?plugin remove` ([GH #3260](https://github.com/modmail-dev/modmail/issues/3260))
58+
- `DISCORD_LOG_LEVEL` environment variable to set the log level of discord.py. ([PR #3216](https://github.com/modmail-dev/Modmail/pull/3216))
4659

4760
### Changed
4861
- Guild icons in embed footers and author urls now have a fixed size of 128. ([PR #3261](https://github.com/modmail-dev/modmail/pull/3261))
@@ -67,10 +80,15 @@ however, insignificant breaking changes do not guarantee a major version bump, s
6780
- Fixed uncached member issue in large guild for react_to_contact and ticket creation.
6881
- Fixed blocked roles improperly saving in `blocked_users` config.
6982
- Fixed `?block` command improperly parsing reason as timestamp.
83+
- Rate limit issue when fetch the messages due to reaction linking. ([PR #3306](https://github.com/modmail-dev/Modmail/pull/3306))
84+
- Update command fails when the plugin is invalid. ([PR #3295](https://github.com/modmail-dev/Modmail/pull/3295))
7085

7186
### Internal
7287
- `ConfigManager.get` no longer accepts two positional arguments: the `convert` argument is now keyword-only.
7388

89+
### Internal
90+
- Renamed `Bot.log_file_name` to `Bot.log_file_path`. Log files are now created at `temp/logs/modmail.log`. ([PR #3216](https://github.com/modmail-dev/Modmail/pull/3216))
91+
7492
# v4.0.2
7593

7694
### Breaking

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
3232
I am the developer of [modmail-viewer](https://github.com/khakers/modmail-viewer), which is the recommended way to view
3333
logs for this fork.
34-
Although you can use the built-in logviewer plugin, it is not recommended as it is not as feature-rich as
35-
modmail-viewer, and I do not intend to maintain it.
36-
The logviewer plugin is included with this fork, but it is disabled by default, and it contains extras features and
37-
security fixes that are not present in the original logviewer plugin.
3834

3935
## Features
4036

@@ -91,7 +87,6 @@ This guide assumes you have git, and a supported Python version installed and ad
9187
```console
9288
$ pdm run bot
9389
```
94-
9. Load the logviewer plugin included with Modmail with `?plugin load @local/logviewer`
9590

9691
### Running the Docker Image
9792

app.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
"description": "The id for the server you are hosting this bot for.",
1212
"required": true
1313
},
14-
"MODMAIL_GUILD_ID": {
15-
"description": "The ID of the discord server where the threads channels should be created (receiving server). Default to GUILD_ID.",
16-
"required": false
17-
},
1814
"OWNERS": {
1915
"description": "Comma separated user IDs of people that are allowed to use owner only commands. (eval).",
2016
"required": true
@@ -68,4 +64,4 @@
6864
"required": false
6965
}
7066
}
71-
}
67+
}

0 commit comments

Comments
 (0)