Split help command into pages

This commit is contained in:
Cohee
2023-07-05 01:06:24 +03:00
parent 093379dba9
commit 27ab509caf
2 changed files with 68 additions and 10 deletions

View File

@@ -319,10 +319,28 @@ async function sendCommentMessage(_, text) {
saveChatConditional();
}
function helpCommandCallback() {
sendSystemMessage(system_message_types.HELP);
function helpCommandCallback(_, type) {
switch (type?.trim()) {
case 'slash':
case '1':
sendSystemMessage(system_message_types.SLASH_COMMANDS);
break;
case 'format':
case '2':
sendSystemMessage(system_message_types.FORMATTING);
break;
case 'hotkeys':
case '3':
sendSystemMessage(system_message_types.HOTKEYS);
break;
default:
sendSystemMessage(system_message_types.HELP);
break;
}
}
window['displayHelp'] = (page) => helpCommandCallback(null, page);
function setBackgroundCallback(_, bg) {
if (!bg) {
return;