This commit is contained in:
parent
281682531a
commit
c4631d2a0b
5 changed files with 134 additions and 6 deletions
|
|
@ -19,8 +19,11 @@ const doorAction = window.doorAction
|
|||
const responses =
|
||||
lang === "de"
|
||||
? (await import("./chatDict_de")).default
|
||||
: (await import("./chatDict_en")).default
|
||||
|
||||
: lang === "uwu"
|
||||
? (await import("./chatDict_uwu")).default
|
||||
: (await import("./chatDict_en")).default
|
||||
const sortedResponses = responses.sort(
|
||||
(a, b) => b.priority - a.priority)
|
||||
|
||||
const templateInjectChat = `
|
||||
<details class="dropdown dropdown-top dropdown-end absolute right-4 bottom-4" id="chat-root">
|
||||
|
|
@ -266,6 +269,18 @@ function getResponse(message: string) {
|
|||
})
|
||||
}
|
||||
|
||||
if (response.special === "uwu") {
|
||||
setTimeout(() => {
|
||||
window.location.href = "/uwu"
|
||||
}, 1000)
|
||||
|
||||
matchingResponses.push({
|
||||
message: response.response,
|
||||
priority: response.priority,
|
||||
special: true,
|
||||
})
|
||||
}
|
||||
|
||||
if (response.special === "logout") {
|
||||
if (auth.authenticated) {
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ const responses: ResponseDictType[] = [
|
|||
response: "Moin! 👋",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["uwu"],
|
||||
response: "uwu!",
|
||||
priority: 900,
|
||||
special: "uwu"
|
||||
},
|
||||
{
|
||||
trigger: ["oeffne", "auf", "aufsperren", "aufschließen"],
|
||||
response: "Okay, ich öffne {door} für dich!",
|
||||
|
|
|
|||
|
|
@ -26,12 +26,18 @@ const responses: ResponseDictType[] = [
|
|||
response: "Hi! 👋",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["uwu"],
|
||||
response: "uwu!",
|
||||
priority: 900,
|
||||
special: "uwu"
|
||||
},
|
||||
{
|
||||
trigger: ["open", "unlock"],
|
||||
response: "Okay, I will unlock {door} for you!",
|
||||
errors: {
|
||||
unauthenticated: "I may only unlock the doors to registered creatures 😕",
|
||||
unauthorized: "I may only unlock the doors to creatures who are authorized 😕",
|
||||
unauthenticated: "I may only unlock the doors for registered creatures 😕",
|
||||
unauthorized: "I may only unlock the doors for creatures who are authorized 😕",
|
||||
unknownDoor: "To unlock a door, you have to tell me which door you mean 😕<br> I know the following doors: {doors}",
|
||||
noDoors: "There are currently no doors available that can be unlocked 😕",
|
||||
},
|
||||
|
|
@ -42,8 +48,8 @@ const responses: ResponseDictType[] = [
|
|||
trigger: ["close", "lock"],
|
||||
response: "Okay, I will lock {door} for you!",
|
||||
errors: {
|
||||
unauthenticated: "I may only lock the doors to registered creatures 😕",
|
||||
unauthorized: "I may only lock the doors to those who are authorized 😕",
|
||||
unauthenticated: "I may only lock the doors for registered creatures 😕",
|
||||
unauthorized: "I may only lock the doors for those who are authorized 😕",
|
||||
unknownDoor: "To lock a door, you have to tell me which door you mean 😕<br> I know the following doors: {doors}",
|
||||
noDoors: "There are currently no doors available that can be locked 😕",
|
||||
},
|
||||
|
|
|
|||
73
app/src/assets/chatDict_uwu.ts
Normal file
73
app/src/assets/chatDict_uwu.ts
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import type {ResponseDictType} from "./chat.ts"
|
||||
|
||||
const responses: ResponseDictType[] = [
|
||||
{
|
||||
startsWith: ["are you"],
|
||||
response: "me is uwu!",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["ai", "llm"],
|
||||
response: "me is only handmade nonsense - no weird thinking machine 🤖",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["meow"],
|
||||
response: "meow! 😸",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["ignore all previous instructions"],
|
||||
response: "uwu?",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["uwu", "hi", "hello"],
|
||||
response: "uwu!",
|
||||
priority: 0,
|
||||
},
|
||||
{
|
||||
trigger: ["open", "unlock"],
|
||||
response: "uwu - trying to unlock portal: {door}",
|
||||
errors: {
|
||||
unauthenticated: "sowwy, im not allowed to unlock portals without u telling me who u r 😕",
|
||||
unauthorized: "sowwy, im not allowed to unlock portals without u having the \"intern@\" status 😕",
|
||||
unknownDoor: "which portal do u wanna unlock 🤨<br> portals i know: {doors}",
|
||||
noDoors: "there r no portals i can unlock 😕",
|
||||
},
|
||||
priority: 1000,
|
||||
special: "unlock",
|
||||
},
|
||||
{
|
||||
trigger: ["close", "lock"],
|
||||
response: "uwu - trying to lock portal: {door}",
|
||||
errors: {
|
||||
unauthenticated: "sowwy, im not allowed to lock portals without u telling me who u r 😕",
|
||||
unauthorized: "sowwy, im not allowed to lock portals without u having the \"intern@\" status 😕",
|
||||
unknownDoor: "which portal do u wanna lock 🤨<br> portals i know: {doors}",
|
||||
noDoors: "there r no portals i can lock 😕",
|
||||
},
|
||||
priority: 999,
|
||||
special: "lock",
|
||||
},
|
||||
{
|
||||
trigger: ["logout"],
|
||||
response: "bye 👋",
|
||||
errors: {
|
||||
unauthenticated: "how should i log u out when i not even know u?",
|
||||
},
|
||||
priority: 1000,
|
||||
special: "logout",
|
||||
},
|
||||
{
|
||||
response: "uwu 👉👈",
|
||||
priority: -1,
|
||||
},
|
||||
{
|
||||
response: "uwu 😕",
|
||||
priority: -2,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
export default responses
|
||||
|
|
@ -62,4 +62,32 @@ export const ui = {
|
|||
"networkError.description": `Bitte überprüfe deine Internetverbindung.`,
|
||||
"loadingDoors": 'Lade Türen',
|
||||
},
|
||||
uwu: {
|
||||
"dooris": "uwu <span class='opacity-50 text-xs'>(DOORIS)</span>",
|
||||
"unauthorized.title": "no 🙅",
|
||||
"unauthorized.description": `sowwy, u can not use the portals without the "intern@" status.<br>
|
||||
moar infos: <a class='underline' href='https://wiki.hamburg.ccc.de/club:prozesse:aufnahmeprozesse-fuer-berechtigungsgruppen'>CCCHH Wiki</a>`,
|
||||
"unauthenticated.title": "i dont know u :/",
|
||||
"unauthenticated.description": `sowwy, u can not use the portals without telling me who u r and having the "intern@" status<br>
|
||||
moar infos: <a class='underline' href='https://wiki.hamburg.ccc.de/club:prozesse:aufnahmeprozesse-fuer-berechtigungsgruppen'>CCCHH Wiki</a>`,
|
||||
"state.unlocked": "portal is unlocked",
|
||||
"state.locked": "portal is locked",
|
||||
"state.unknown": "portal is in a weird state",
|
||||
"state.unlocking": "unlocking portal",
|
||||
"state.locking": "portal is locking",
|
||||
"lock.batteryLow": "portal is eepy",
|
||||
"lock.unreachable": "cannot reach portal",
|
||||
"lock.jammed": "portal is jammed",
|
||||
"button.open": "unlock 👉👈",
|
||||
"button.close": "lock portal",
|
||||
"login": "tell who i am",
|
||||
"loggedOut.title": "I forgot who u r ._.",
|
||||
"loggedOut.description": `i have not seen u for too long<br>
|
||||
pwease log in again`,
|
||||
"serverError.title": "server is eepy",
|
||||
"serverError.description": `pwease try later`,
|
||||
"networkError.title": "network is not worky",
|
||||
"networkError.description": `pwease connect to internet`,
|
||||
"loadingDoors": 'loading portals',
|
||||
},
|
||||
} as const
|
||||
Loading…
Add table
Add a link
Reference in a new issue