|
| 1 | +--- |
| 2 | +description: Instructions on using the threadmenu function of the bot. |
| 3 | +--- |
| 4 | + |
| 5 | +# Thread Menu |
| 6 | + |
| 7 | +{% hint style="info" %} |
| 8 | +This page will provide information on using the `?threadmenu` core bot functionality. If you are still using the `advanced-menu` plugin from Sebkuip, please migrate away from the plugin before attempting to use these features. |
| 9 | + |
| 10 | +Migration Instructions are at the bottom of this page. |
| 11 | +{% endhint %} |
| 12 | + |
| 13 | +The Thread Menu `?threadmenu` function allows recipients to choose an option to better clarify what kind of help they are recieving. It supports submenus, command, and text-based replys allowing a complex and efficient thread routing system. |
| 14 | + |
| 15 | +## Config Options |
| 16 | + |
| 17 | +| Config Variable Name | Type | Default | Details | |
| 18 | +| - | - | - | - | |
| 19 | +| thread_creation_menu_anonymous_menu | Boolean (`yes/no`) | No | If enabled, the initial menu prompt relayed to staff (after creation) is anonymized; only selection details are logged, not the original prompt message author context. | |
| 20 | +| thread_creation_menu_close_on_timeout | Boolean (`yes/no`) | No | Silently aborts thread creation if the user does not select an option before the timeout expires. | |
| 21 | +| thread_creation_menu_dropdown_placeholder | Text | "Select an option to contact the staff team." | Placeholder text displayed in the dropdown before selection. | |
| 22 | +| thread_creation_menu_embed_color | Hex Code (or Discord Color) | Green | Color for the menu embed's side strip. Accepts hex (e.g. #5865F2) or one of the supported color names (e.g. "blurple"). | |
| 23 | +| thread_creation_menu_embed_footer | Text | Empty (no footer) | Optional footer text at the bottom of the menu embed. | |
| 24 | +| thread_creation_menu_embed_footer_icon_url | URL | Empty (no icon) | Optional URL for the small footer icon displayed next to the footer text. | |
| 25 | +| thread_creation_menu_embed_image_url | URL | Empty (no image) | Optional large hero image displayed in the body of the menu embed. If set, this image is shown prominently and takes precedence over the thumbnail. | |
| 26 | +| thread_creation_menu_embed_large_image | Boolean (`yes/no`) | No | Promotes the thumbnail to a large hero image when no `thread_creation_menu_embed_image_url` is set. Useful if you want a big image without specifying a separate URL. | |
| 27 | +| thread_creation_menu_embed_text | Text | "Please select an option." | Text shown in the embed above the selection dropdown in the user's DM. | |
| 28 | +| thread_creation_menu_embed_thumbnail_url | URL | Empty (no thumbnail) | Optional thumbnail image shown in the top-right of the menu embed. | |
| 29 | +| thread_creation_menu_embed_title | Text | Empty (no title) | Optional title at the top of the thread-creation menu embed in the user's DM. | |
| 30 | +| thread_creation_menu_precreate_channel | Boolean (`yes/no`) | No | When enabled, a thread channel is created immediately upon the user's first DM even if the thread creation menu is enabled. The menu is still shown but selection becomes optional and happens after channel creation. | |
| 31 | +| thread_creation_menu_selection_log | Boolean (`yes/no`) | Yes | When disabled, the staff will not see an automatic message with the selection details though commands may still act. | |
| 32 | +| thread_creation_menu_timeout | Time in Seconds | 30 | If the timeout is reached, `thread_creation_menu_close_on_timeout` controls whether the attempt is aborted or the user is asked to message again.| |
| 33 | + |
| 34 | + |
| 35 | +## Commands |
| 36 | + |
| 37 | +- threadmenu |
| 38 | +├─ dump_config - Dump the current core thread menu config to a file. |
| 39 | +├─ load_config - Load the thread menu config from an attached file. |
| 40 | +├─ option - Manage main-menu options (add/remove/edit/show). |
| 41 | + ├─ add - Interactive wizard to add a main-menu option. |
| 42 | + ├─ edit - Interactive wizard to edit a main-menu option. |
| 43 | + ├─ remove - Remove a main-menu option by label. |
| 44 | + └─ show - Show detailed information about a main-menu option. |
| 45 | +├─ reset - Reset ALL thread-creation menu settings to their defaults. |
| 46 | +├─ show - Show all current main-menu options. |
| 47 | +├─ submenu - Manage submenus (create/delete/list/show and options within). |
| 48 | + ├─ create - Create an empty submenu that can hold nested options. |
| 49 | + ├─ delete - Delete a submenu and all its options. |
| 50 | + ├─ list - List all submenu keys currently configured. |
| 51 | + ├─ option - Manage options within a specific submenu (add/remove/edit). |
| 52 | + ├─ add - Interactive wizard to add an option inside a submenu. |
| 53 | + ├─ edit - Interactive wizard to edit a submenu option. |
| 54 | + └─ remove - Remove an option from a submenu via an interactive prompt. |
| 55 | + └─ show - Show the options configured inside a submenu. |
| 56 | +└─ toggle - Enable or disable the thread-creation menu. |
| 57 | + |
| 58 | +## Example Flowchart and Command Order |
| 59 | + |
| 60 | +{% hint style="info" %} |
| 61 | +This feature allows the creation of very complex menu systems. If you are intending to create a complex menu system, it is recommended to think through the required submenus and options and make your submenus first. Drawing these out in a flowchart like below is a good way to begin this process. |
| 62 | +{% endhint %} |
| 63 | + |
| 64 | +{% tabs %} |
| 65 | + |
| 66 | +{% tab title="Flowchart Example" %} **In Progress by theonlystephen** {% endtab %} |
| 67 | + |
| 68 | +{% tab title="Commands Example" %} **In Progress by theonlystephen** {% endtab %} |
| 69 | + |
| 70 | +{% tab title="Flowchart Template" %} **In Progress by theonlystephen** {% endtab %} |
| 71 | + |
| 72 | +{% endtabs %} |
| 73 | + |
| 74 | +## Advanced/Legacy Usage |
| 75 | + |
| 76 | +<details> |
| 77 | + |
| 78 | +<summary>Migrating from Legacy `advanced-menu` Plugin</summary> |
| 79 | + |
| 80 | +Migration from the legacy plugin, to core function requires permission to modify the menu. In both, by default, this level is ADMINISTRATOR [4]. |
| 81 | + |
| 82 | +**Step 1: Export Config from `advanced-menu`** |
| 83 | + |
| 84 | +Run the `?advancedmenu dump_config` command to dump the menu config from `advanced-menu`. This will export your menu configuration to a `config.json` file. |
| 85 | + |
| 86 | +<figure><img src="../.gitbook/assets/transfer-threadmenu-1.png" alt="Screenshot of output of dump_config subcommand on advanced-menu"><figcaption><p>The bot will provide you a correcly formatted config.json file. <strong>Do not modify this file</strong></p></figcaption></figure> |
| 87 | + |
| 88 | +**Step 2: Download `config.json` to your local computer** |
| 89 | + |
| 90 | +Press the download button and keep track of where the file was saved. You will need it in the next step. |
| 91 | + |
| 92 | +**Step 3: Import Config to Thread Menu** |
| 93 | + |
| 94 | +Run the `?threadmenu load_config` command, while attaching the downloaded `config.json` to your message. |
| 95 | + |
| 96 | +<div> |
| 97 | + |
| 98 | +<figure><img src="../.gitbook/assets/transfer-threadmenu-2.png" alt="Attach the config.json file directly to your message."><figcaption><p>Attach the config.json file directly to your message.</p></figcaption></figure> |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +<figure><img src="../.gitbook/assets/transfer-threadmenu-3.png" alt="The bot will provide you a success confirmation message after successful import."><figcaption><p>The import was successful if you see: <strong>Successfully loaded config into core.</strong></p></figcaption></figure> |
| 103 | + |
| 104 | +</div> |
| 105 | + |
| 106 | +**You're done!** |
| 107 | + |
| 108 | +Good job! You have successfully migrated your `advanced-menu` config to the Thread Menu feature introduced in Modmail 4.2.0. |
| 109 | + |
| 110 | +</details> |
| 111 | +<details> |
| 112 | + |
| 113 | +<summary>Menu `.json` File Structure</summary> |
| 114 | + |
| 115 | +{% hint style="warning" %} |
| 116 | +This is an **advanced** concept, and is **not** required to make full use of this feature. If you do not have significant experience working with `.json` files, you should not be using any of the information in this section. |
| 117 | +{% endhint %} |
| 118 | + |
| 119 | +The `?threadmenu dump_config` command exports your set menu configuration to a `.json` file. |
| 120 | + |
| 121 | +By default, the file is now called `thread_creation_menu_config.json`. You can rename this file without any issue while reimporting. |
| 122 | + |
| 123 | +Note: the `"category_id":` in each menu option is optional, and not required for successful import. |
| 124 | + |
| 125 | +See an example dumped config below: |
| 126 | +```json |
| 127 | +{ |
| 128 | + "enabled": true, |
| 129 | + "options": { |
| 130 | + "discord_events_issues": { |
| 131 | + "label": "Discord Events Issues", |
| 132 | + "description": "I have questions about Discord Events", |
| 133 | + "emoji": "⚠️", |
| 134 | + "type": "command", |
| 135 | + "callback": "move 1341094680229843026 && anonreply Please provide additional details about the event and the issues you encountered so we can help you out." |
| 136 | + }, |
| 137 | + "report_member(s)": { |
| 138 | + "label": "Report Member(s)", |
| 139 | + "description": "I want to report a Discord member", |
| 140 | + "emoji": "🚨", |
| 141 | + "type": "command", |
| 142 | + "callback": "move 1341094680229843031 && anonreply Please share any relevant information regarding the member(s) involved, along with a description of the incident.", |
| 143 | + "category_id": 1341094680229843031 |
| 144 | + }, |
| 145 | + "discord_related_issues": { |
| 146 | + "label": "Discord Related issues", |
| 147 | + "description": "I have questions regarding the server", |
| 148 | + "emoji": "🛠️", |
| 149 | + "type": "command", |
| 150 | + "callback": "move 1341094680770642004 && anonreply Please describe the issue you're facing in detail so that we can help resolve it as quickly as possible.", |
| 151 | + "category_id": 1341094680770642004 |
| 152 | + }, |
| 153 | + "discord_appeal": { |
| 154 | + "label": "Discord Appeal", |
| 155 | + "description": "I want to appeal a Discord ban", |
| 156 | + "emoji": "🎟️", |
| 157 | + "type": "command", |
| 158 | + "callback": "move 1341094680770642007 && anonreply Please provide any additional context or evidence that supports your appeal, and we'll review it promptly.", |
| 159 | + "category_id": 1341094680770642007 |
| 160 | + }, |
| 161 | + "others": { |
| 162 | + "label": "Others", |
| 163 | + "description": "My question was not listed", |
| 164 | + "emoji": "❓", |
| 165 | + "type": "command", |
| 166 | + "callback": "move 1341094680770642004 && reply Please let us know the details of your request so we can assist you appropriately.", |
| 167 | + "category_id": 1341094680770642004 |
| 168 | + } |
| 169 | + }, |
| 170 | + "submenus": {}, |
| 171 | + "timeout": 45, |
| 172 | + "close_on_timeout": true, |
| 173 | + "anonymous_menu": false, |
| 174 | + "embed_text": "Please select an option.", |
| 175 | + "dropdown_placeholder": "Select an option to contact the staff team." |
| 176 | +} |
| 177 | +``` |
| 178 | + |
| 179 | +</details> |
0 commit comments