Skip to content

Commit 3c3608f

Browse files
authored
Add threadmenu toggle notice (#3411)
* Add threadmenu toggle notice Adds a notice to the `threadmenu toggle` command. It gets displayed if the advancedmenu plugin is part of the bot and checks if its enabled at the same time. useful for users because both would interrupt eachother. * Threadmenu toggle notice link Adds a link to the migration guide for the legacy plugin.
1 parent 6e094af commit 3c3608f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cogs/threadmenu.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ async def threadmenu_toggle(self, ctx):
8787
conf["enabled"] = not conf["enabled"]
8888
await self._save_conf(conf)
8989
await ctx.send(f"Thread-creation menu is now {'enabled' if conf['enabled'] else 'disabled'}.")
90+
advancedmenu_plugin = self.bot.get_cog("AdvancedMenu")
91+
if (
92+
advancedmenu_plugin
93+
and hasattr(advancedmenu_plugin, "config")
94+
and advancedmenu_plugin.config.get("enabled")
95+
and advancedmenu_plugin.config["enabled"] is True
96+
and conf["enabled"]
97+
):
98+
await ctx.send(
99+
"**Warning:** You are using both the core threadmenu feature and the advancedmenu plugin.\n"
100+
"It is recommended to disable/uninstall the advancedmenu plugin to avoid interruption.\n"
101+
"Migration guide can be found at: <https://docs.modmail.dev/usage-guide/threadmenu#advanced-legacy-usage>"
102+
)
90103

91104
@checks.has_permissions(PermissionLevel.ADMINISTRATOR)
92105
@threadmenu.command(name="show")

0 commit comments

Comments
 (0)