Skip to content

Commit b0d9f23

Browse files
committed
Merge branch 'development'
2 parents bcd1193 + 17dd885 commit b0d9f23

File tree

15 files changed

+3771
-348
lines changed

15 files changed

+3771
-348
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@ 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+
935
# v4.2.0
1036

1137
Upgraded discord.py to version 2.6.3, added support for CV2.

bot.py

Lines changed: 268 additions & 39 deletions
Large diffs are not rendered by default.

cogs/modmail.py

Lines changed: 353 additions & 73 deletions
Large diffs are not rendered by default.

cogs/plugins.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ async def load_plugin(self, plugin):
251251

252252
if stderr:
253253
logger.debug("[stderr]\n%s.", stderr.decode())
254-
logger.error("Failed to download requirements for %s.", plugin.ext_string, exc_info=True)
254+
logger.error(
255+
"Failed to download requirements for %s.",
256+
plugin.ext_string,
257+
exc_info=True,
258+
)
255259
raise InvalidPluginError(f"Unable to download requirements: ```\n{stderr.decode()}\n```")
256260

257261
if os.path.exists(USER_SITE):
@@ -361,7 +365,10 @@ async def plugins_add(self, ctx, *, plugin_name: str):
361365
return
362366

363367
if str(plugin) in self.bot.config["plugins"]:
364-
embed = discord.Embed(description="This plugin is already installed.", color=self.bot.error_color)
368+
embed = discord.Embed(
369+
description="This plugin is already installed.",
370+
color=self.bot.error_color,
371+
)
365372
return await ctx.send(embed=embed)
366373

367374
if plugin.name in self.bot.cogs:
@@ -470,7 +477,8 @@ async def plugins_remove(self, ctx, *, plugin_name: str):
470477
pass # dir not empty
471478

472479
embed = discord.Embed(
473-
description="The plugin is successfully uninstalled.", color=self.bot.main_color
480+
description="The plugin is successfully uninstalled.",
481+
color=self.bot.main_color,
474482
)
475483
await ctx.send(embed=embed)
476484

@@ -486,7 +494,8 @@ async def update_plugin(self, ctx, plugin_name):
486494

487495
async with safe_typing(ctx):
488496
embed = discord.Embed(
489-
description=f"Successfully updated {plugin.name}.", color=self.bot.main_color
497+
description=f"Successfully updated {plugin.name}.",
498+
color=self.bot.main_color,
490499
)
491500
await self.download_plugin(plugin, force=True)
492501
if self.bot.config.get("enable_plugins"):
@@ -570,7 +579,8 @@ async def plugins_reset(self, ctx):
570579
logger.warning("Removing %s.", entry.name)
571580

572581
embed = discord.Embed(
573-
description="Successfully purged all plugins from the bot.", color=self.bot.main_color
582+
description="Successfully purged all plugins from the bot.",
583+
color=self.bot.main_color,
574584
)
575585
return await ctx.send(embed=embed)
576586

@@ -598,7 +608,8 @@ async def plugins_loaded(self, ctx):
598608

599609
if not self.loaded_plugins:
600610
embed = discord.Embed(
601-
description="There are no plugins currently loaded.", color=self.bot.error_color
611+
description="There are no plugins currently loaded.",
612+
color=self.bot.error_color,
602613
)
603614
return await ctx.send(embed=embed)
604615

@@ -666,7 +677,10 @@ async def plugins_registry(self, ctx, *, plugin_name: typing.Union[int, str] = N
666677
matches = get_close_matches(plugin_name, self.registry.keys())
667678

668679
if matches:
669-
embed.add_field(name="Perhaps you meant:", value="\n".join(f"`{m}`" for m in matches))
680+
embed.add_field(
681+
name="Perhaps you meant:",
682+
value="\n".join(f"`{m}`" for m in matches),
683+
)
670684

671685
return await ctx.send(embed=embed)
672686

0 commit comments

Comments
 (0)