Support for the dice plugin

This commit is contained in:
SillyLossy
2023-03-12 00:42:58 +02:00
parent 625f4fe8b4
commit 198526bcbe
2 changed files with 2027 additions and 3 deletions

View File

@ -14,6 +14,7 @@
<script src="scripts/jquery.transit.min.js"></script> <script src="scripts/jquery.transit.min.js"></script>
<script src="scripts/jquery-cookie-1.4.1.min.js"></script> <script src="scripts/jquery-cookie-1.4.1.min.js"></script>
<script src="scripts/showdown.min.js"></script> <script src="scripts/showdown.min.js"></script>
<script src="scripts/popper.js"></script>
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="css/bg_load.css"> <link rel="stylesheet" href="css/bg_load.css">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
@ -93,6 +94,7 @@
WELCOME: 'welcome', WELCOME: 'welcome',
GROUP: 'group', GROUP: 'group',
EMPTY: 'empty', EMPTY: 'empty',
GENERIC: 'generic',
}; };
const system_messages = { const system_messages = {
@ -102,7 +104,7 @@
"is_user":false, "is_user":false,
"is_system": true, "is_system": true,
"is_name":true, "is_name":true,
"mes": "Hi there! The following chat formatting commands are supported in TavernAI:<br><ul><li><tt>*text*</tt> format the actions that your character does</li><li><tt>{*text*}</tt> set the behavioral bias for your character</li></ul><p>Need more help? Visit our wiki <a href=\"https://github.com/TavernAI/TavernAI/wiki\">TavernAI Wiki</a>!</p>" "mes": "Hi there! The following chat formatting commands are supported:<br><ul><li><tt>*text*</tt> format the actions that your character does</li><li><tt>{*text*}</tt> set the behavioral bias for your character</li></ul><p>Need more help? Visit our wiki <a href=\"https://github.com/TavernAI/TavernAI/wiki\">TavernAI Wiki</a>!</p>"
}, },
'group': { 'group': {
"name": systemUserName, "name": systemUserName,
@ -119,7 +121,15 @@
"is_system": true, "is_system": true,
"is_name": true, "is_name": true,
"mes": 'No one hears you. **Hint:** add more members to the group!' "mes": 'No one hears you. **Hint:** add more members to the group!'
} },
'generic': {
"name": systemUserName,
"force_avatar": "img/five.png",
"is_user": false,
"is_system": true,
"is_name": true,
"mes": "Generic system message. User `text` parameter to override the contents",
},
}; };
const world_info_position = { const world_info_position = {
@ -1014,7 +1024,7 @@
return helpTokens.includes(message.trim().toLowerCase()); return helpTokens.includes(message.trim().toLowerCase());
} }
function sendSystemMessage(type) { function sendSystemMessage(type, text) {
const systemMessage = system_messages[type]; const systemMessage = system_messages[type];
if (!systemMessage) { if (!systemMessage) {
@ -1022,6 +1032,11 @@
} }
const newMessage = { ... systemMessage, 'send_date': humanizedISO8601DateTime() }; const newMessage = { ... systemMessage, 'send_date': humanizedISO8601DateTime() };
if (text) {
newMessage.mes = text;
}
chat.push(newMessage); chat.push(newMessage);
addOneMessage(newMessage); addOneMessage(newMessage);
is_send_press = false; is_send_press = false;
@ -4734,6 +4749,7 @@
extensionPrompts: extension_prompts, extensionPrompts: extension_prompts,
setExtensionPrompt: setExtensionPrompt, setExtensionPrompt: setExtensionPrompt,
saveChat: saveChat, saveChat: saveChat,
sendSystemMessage: sendSystemMessage,
}; };
}; };

2008
public/scripts/popper.js Normal file

File diff suppressed because it is too large Load Diff