refactor(modmail): centralize config into single /modmail config panel
- Remove 5 redundant commands (setup, addcategory, removecategory, enable, disable) - Single /modmail config opens interactive Components V2 panel - Channel select for ticket category, role select for staff, channel select for logs - Toggle enable/disable button - Categories sub-panel: add via modal, remove via select - Fix lint (unused imports/vars, contextlib.suppress) + ruff format
This commit is contained in:
parent
f505b6c552
commit
b736f4cc8b
6 changed files with 251 additions and 157 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from config import DATA_DIR
|
||||
|
||||
|
|
@ -32,6 +31,12 @@ def get_config() -> dict:
|
|||
return _load()
|
||||
|
||||
|
||||
def set_guild_id(guild_id: int):
|
||||
data = _load()
|
||||
data["guild_id"] = guild_id
|
||||
_save(data)
|
||||
|
||||
|
||||
def set_enabled(guild_id: int, enabled: bool):
|
||||
data = _load()
|
||||
data["enabled"] = enabled
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue