Skip to content

Commit d15acee

Browse files
authored
Merge branch 'development' into fix-plugin-help
2 parents 49ebca0 + 6e75c44 commit d15acee

27 files changed

Lines changed: 7126 additions & 1461 deletions

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ LOG_URL=https://logviewername.herokuapp.com/
33
GUILD_ID=1234567890
44
OWNERS=Owner1ID,Owner2ID,Owner3ID
55
CONNECTION_URI=mongodb+srv://mongodburi
6+
DISABLE_AUTOUPDATES=true

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
patreon: kyber
1+
buy_me_a_coffee: modmaildev

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
- Heroku
2121
- Systemd
2222
- PM2
23-
- Patreon
23+
- Buy Me A Coffee / Patreon
2424
- Other
2525
validations:
2626
required: true

CHANGELOG.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,79 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
77
however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/modmail-dev/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section.
88

9+
# v4.2.1
10+
11+
### Added
12+
* `unsnooze_history_limit`: Limits the number of messages replayed when unsnoozing (genesis message and notes are always shown).
13+
* `snooze_behavior`: Choose between `delete` (legacy) or `move` behavior for snoozing.
14+
* `snoozed_category_id`: Target category for `move` snoozing; required when `snooze_behavior` is `move`.
15+
* Thread-creation menu: Adds an interactive select step before a thread channel is created.
16+
* Commands:
17+
* `threadmenu toggle`: Enable/disable the menu.
18+
* `threadmenu show`: List current top-level options.
19+
* `threadmenu option add`: Interactive wizard to create an option.
20+
* `threadmenu option edit/remove/show`: Manage or inspect an existing option.
21+
* `threadmenu submenu create/delete/list/show`: Manage submenus.
22+
* `threadmenu submenu option add/edit/remove`: Manage options inside a submenu.
23+
* Configuration / Behavior:
24+
* Per-option `category` targeting when creating a thread; falls back to `main_category_id` if invalid/missing.
25+
* Optional selection logging (`thread_creation_menu_selection_log`) posts the chosen option in the new thread.
26+
* Anonymous prompt support (`thread_creation_menu_anonymous_menu`).
27+
28+
### Changed
29+
- Renamed `max_snooze_time` to `snooze_default_duration`. The old config will be invalidated.
30+
- When `snooze_behavior` is set to `move`, the snoozed category now has a hard limit of 49 channels. New snoozes are blocked once it’s full until space is freed.
31+
- When switching `snooze_behavior` to `move` via `?config set`, the bot reminds admins to set `snoozed_category_id` if it’s missing.
32+
- Thread-creation menu options & submenu options now support an optional per-option `category` target. The interactive wizards (`threadmenu option add` / `threadmenu submenu option add`) and edit commands allow specifying or updating a category. If the stored category is missing or invalid at selection time, channel creation automatically falls back to `main_category_id`.
33+
34+
35+
# v4.2.0
36+
37+
Upgraded discord.py to version 2.6.3, added support for CV2.
38+
Forwarded messages now properly show in threads, rather than showing as an empty embed.
39+
40+
### Fixed
41+
- Make Modmail keep working when typing is disabled due to an outage caused by Discord.
42+
- Resolved an issue where forwarded messages appeared as empty embeds.
43+
- Fixed internal message handling and restoration processes.
44+
- Eliminated duplicate logs and notes.
45+
- Addressed inconsistent use of `logkey` after ticket restoration.
46+
- Fixed issues with identifying the user who sent internal messages.
47+
- Solved an ancient bug where closing with words like `evening` wouldn't work.
48+
- Fixed the command from being included in the reply in rare conditions.
49+
50+
### Added
51+
Commands:
52+
* `snooze`: Initiates a snooze action.
53+
* `snoozed`: Displays snoozed items.
54+
* `unsnooze`: Reverses the snooze action.
55+
* `clearsnoozed`: Clears all snoozed items.
56+
57+
Configuration Options:
58+
* `max_snooze_time`: Sets the maximum duration for snooze.
59+
* `snooze_title`: Customizes the title for snooze notifications.
60+
* `snooze_text`: Customizes the text for snooze notifications.
61+
* `unsnooze_text`: Customizes the text for unsnooze notifications.
62+
* `unsnooze_notify_channel`: Specifies the channel for unsnooze notifications.
63+
* `thread_min_characters`: Minimum number of characters required.
64+
* `thread_min_characters_title`: Title shown when the message is too short.
65+
* `thread_min_characters_response`: Response shown to the user if their message is too short.
66+
* `thread_min_characters_footer`: Footer displaying the minimum required characters.
67+
68+
# v4.1.2
69+
70+
### Fixed
71+
- Members not caching correctly for large servers. ([PR #3365](https://github.com/modmail-dev/Modmail/pull/3365))
72+
73+
# v4.1.1
74+
75+
### Fixed
76+
- `?msglink` now supports threads with multiple recipients. ([PR #3341](https://github.com/modmail-dev/Modmail/pull/3341))
77+
- Fixed persistent notes not working due to discord.py internal change. ([PR #3324](https://github.com/modmail-dev/Modmail/pull/3324))
78+
79+
### Added
80+
- Support for custom activities with `?activity custom <text>` ([PR #3352](https://github.com/modmail-dev/Modmail/pull/3352))
81+
982
# v4.1.0
1083

1184
Drops support for Python 3.9. Python 3.10 and Python 3.11 are now the only supported versions.
@@ -14,7 +87,7 @@ Drops support for Python 3.9. Python 3.10 and Python 3.11 are now the only suppo
1487
- GIF stickers no longer cause the bot to crash.
1588
- `?alias make/create` as aliases to `?alias add`. This improves continuity between the bot and its command structure. ([PR #3195](https://github.com/kyb3r/modmail/pull/3195))
1689
- Loading the blocked list with the `?blocked` command takes a long time when the list is large. ([PR #3242](https://github.com/kyb3r/modmail/pull/3242))
17-
- Reply not being forwarded from DM. (PR [#3239](https://github.com/modmail-dev/modmail/pull/3239))
90+
- Reply not being forwarded from DM. ([PR #3239](https://github.com/modmail-dev/modmail/pull/3239))
1891
- Cleanup imports after removing/unloading a plugin. ([PR #3226](https://github.com/modmail-dev/Modmail/pull/3226))
1992
- Fixed a syntactic error in the close message when a thread is closed after a certain duration. ([PR #3233](https://github.com/modmail-dev/Modmail/pull/3233))
2093
- Removed an extra space in the help command title when the command has no parameters. ([PR #3271](https://github.com/modmail-dev/Modmail/pull/3271))

Dockerfile

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
FROM python:3.10 as py
1+
FROM python:3.11-slim-bookworm as base
22

3-
FROM py as build
3+
RUN apt-get update && \
4+
apt-get install --no-install-recommends -y \
5+
# Install CairoSVG dependencies.
6+
libcairo2 && \
7+
# Cleanup APT.
8+
apt-get clean && \
9+
rm -rf /var/lib/apt/lists/* && \
10+
# Create a non-root user.
11+
useradd --shell /usr/sbin/nologin --create-home -d /opt/modmail modmail
412

5-
RUN apt update && apt install -y g++ git
13+
FROM base as builder
614

7-
COPY requirements.txt /
8-
RUN pip install --prefix=/inst -U -r /requirements.txt
15+
COPY requirements.txt .
916

10-
FROM py
17+
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip wheel && \
18+
python -m venv /opt/modmail/.venv && \
19+
. /opt/modmail/.venv/bin/activate && \
20+
pip install --no-cache-dir --upgrade -r requirements.txt
1121

12-
COPY --from=build /inst /usr/local
22+
FROM base
1323

14-
ENV USING_DOCKER yes
15-
RUN useradd --system --no-create-home modmail
16-
USER modmail
24+
# Copy the entire venv.
25+
COPY --from=builder --chown=modmail:modmail /opt/modmail/.venv /opt/modmail/.venv
26+
27+
# Copy repository files.
28+
WORKDIR /opt/modmail
29+
USER modmail:modmail
30+
COPY --chown=modmail:modmail . .
31+
32+
# This sets some Python runtime variables and disables the internal auto-update.
33+
ENV PYTHONUNBUFFERED=1 \
34+
PYTHONDONTWRITEBYTECODE=1 \
35+
PATH=/opt/modmail/.venv/bin:$PATH \
36+
USING_DOCKER=yes
1737

18-
WORKDIR /modmailbot
1938
CMD ["python", "bot.py"]
20-
COPY --chown=modmail:modmail . /modmailbot

Pipfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,27 @@ verify_ssl = true
77
bandit = ">=1.7.5"
88
black = "==23.11.0"
99
pylint = "==3.0.2"
10-
typing-extensions = "==4.8.0"
10+
tomli = "==2.2.1" # Needed for black on Python < 3.11
1111

1212
[packages]
13-
aiohttp = "==3.9.0"
13+
aiohttp = "==3.13.2"
14+
async-timeout = {version = "==5.0.1", markers = "python_version < '3.11'"} # Required by aiohttp
15+
typing-extensions = ">=4.12.2" # Required by aiohttp
1416
colorama = "==0.4.6"
15-
"discord.py" = {version = "==2.3.2", extras = ["speed"]}
17+
"discord.py" = {version = "==2.6.3", extras = ["speed"]}
1618
emoji = "==2.8.0"
1719
isodate = "==0.6.1"
18-
motor = "==3.3.2"
20+
motor = "==3.7.1"
1921
natural = "==0.2.0" # Why is this needed?
2022
packaging = "==23.2"
2123
parsedatetime = "==2.6"
22-
pymongo = {extras = ["srv"], version = "*"} # Required by motor
24+
dnspython = ">=2.8,<3" # Required by pymongo
25+
pymongo = ">=4.9,<5" # Required by motor
2326
python-dateutil = "==2.8.2"
2427
python-dotenv = "==1.0.0"
2528
uvloop = {version = ">=0.19.0", markers = "sys_platform != 'win32'"}
26-
lottie = {version = "==0.7.0", extras = ["pdf"]}
29+
lottie = {version = "==0.7.2", extras = ["pdf"]}
30+
setuptools = "*" # Needed for lottie
2731
requests = "==2.31.0"
2832

2933
[scripts]

0 commit comments

Comments
 (0)