From 248b42c3ffaf9340d510cc0892961a5b12756bba Mon Sep 17 00:00:00 2001 From: Benny Guo Date: Sun, 10 Sep 2023 23:29:57 +0800 Subject: [PATCH] fix: dia bot not able to be initialised in version 2+ --- src/utils/aurora-dia/index.ts | 3 +- .../messages/{cn.json => zh-CN.json} | 0 src/utils/aurora-dia/messages/zh-TW.json | 173 ++++++++++++++++++ templates/index.html | 2 +- 4 files changed, 175 insertions(+), 3 deletions(-) rename src/utils/aurora-dia/messages/{cn.json => zh-CN.json} (100%) create mode 100644 src/utils/aurora-dia/messages/zh-TW.json diff --git a/src/utils/aurora-dia/index.ts b/src/utils/aurora-dia/index.ts index cdca24ed..3ca41ef5 100644 --- a/src/utils/aurora-dia/index.ts +++ b/src/utils/aurora-dia/index.ts @@ -187,10 +187,9 @@ class AuroraBotSoftware { if (botScript !== undefined) { botScriptKeys = Object.keys(botScript) - if (botScriptKeys.length > 0) { botScriptKeys.forEach(key => { - this.botTips[key] = botScript[key] + this.botTips = { ...this.botTips, [key]: botScript[key] } }) } } diff --git a/src/utils/aurora-dia/messages/cn.json b/src/utils/aurora-dia/messages/zh-CN.json similarity index 100% rename from src/utils/aurora-dia/messages/cn.json rename to src/utils/aurora-dia/messages/zh-CN.json diff --git a/src/utils/aurora-dia/messages/zh-TW.json b/src/utils/aurora-dia/messages/zh-TW.json new file mode 100644 index 00000000..67837c70 --- /dev/null +++ b/src/utils/aurora-dia/messages/zh-TW.json @@ -0,0 +1,173 @@ +{ + "messages": [ + "妳好,我是 Dia,好高興遇見妳~", + "好久不見,日子過得好快呢……", + "大壞蛋!妳都多久沒理人家了呀,嚶嚶嚶~", + "嗨~快來逗我玩吧!", + "拿小拳拳錘妳胸口!", + "學習使我們快樂,快樂使我們更想學習~", + "showQuote" + ], + "console": "哈哈,妳打開了控制臺,是想要看看我的小秘密嗎?", + "copy": "妳都復制了些什麽呀,轉載要記得加上出處哦!", + "visibility_change": "老朋友,妳怎麽才回來呀~", + "welcome": { + "5_7": "早上好!一日之計在於晨,美好的一天就要開始了。", + "7_11": "上午好!工作順利嘛,不要久坐,多起來走動走動哦!", + "11_13": "中午了,工作了一個上午,現在是午餐時間!", + "13_17": "午後很容易犯睏呢,今天的運動目標完成了嗎?", + "17_19": "傍晚了!窗外夕陽的景色很美麗呢,最美不過夕陽紅~", + "19_21": "晚上好,今天過得怎麽樣?", + "21_23": ["已經這麽晚了呀,早點休息吧,晚安~", "深夜時要愛護眼睛呀!"], + "24": "妳是夜貓子呀?這麽晚還不睡覺,明天起的來嘛?" + }, + "referrer": { + "self": "歡迎來到「[PLACEHOLDER]」", + "baidu": "Hello!來自 百度搜索 的朋友
妳是搜索 「[PLACEHOLDER]」 找到的我嗎?", + "so": "Hello!來自 360搜索 的朋友
妳是搜索 「[PLACEHOLDER]」 找到的我嗎?", + "google": "Hello!來自 谷歌搜索 的朋友
歡迎閱讀「[PLACEHOLDER]」", + "site": "Hello!來自 [PLACEHOLDER] 的朋友", + "other": "歡迎閱讀 [PLACEHOLDER]" + }, + "mouseover": [ + { + "selector": "#Aurora-Dia", + "text": [ + "哇啊啊啊啊啊啊... 妳想幹嘛? O.O", + "請您輕一點,我是很昂貴的機器人哦! O.O", + "領導,我在呢! 我有什麽可以幫到妳呢? O.O" + ] + }, + { + "selector": "[data-menu='Home']", + "text": [ + "點擊前往首頁,想回到上一頁可以使用瀏覽器的後退功能哦。", + "點它就可以回到首頁啦!", + "回首頁看看吧。" + ] + }, + { + "selector": "[data-menu='About']", + "text": [ + "妳想知道我家主人是誰嗎?", + "這裏有一些關於我家主人的秘密哦,要不要看看呢?", + "發現主人出沒地點!" + ] + }, + { + "selector": "[data-menu='Archives']", + "text": ["這裏存儲了主人的所有作品哦!", "想看看主人的圖書館嗎?"] + }, + { + "selector": "[data-menu='Tags']", + "text": [ + "點擊就可以看文章的標簽啦!", + "使用標簽可以更好的分類妳的文章哦~" + ] + }, + { + "selector": "[data-dia='language']", + "text": "主人的博客支持多種語言。" + }, + { + "selector": "[data-dia='light-switch']", + "text": "您可以點擊這裏切換黑白模式哦!" + }, + { + "selector": "[data-dia='author']", + "text": [ + "這是我主人的簡介。", + "點擊其中任何一個鏈接都可以傳送到我主人的其他世界。" + ] + }, + { + "selector": "[data-dia='jump-to-comment']", + "text": ["妳想看看評論嗎?", "點擊這裏可以幫助妳直接跳轉到評論部分。"] + } + ], + "click": [ + { + "selector": "[data-dia='search']", + "text": [ + "沒有看到妳想要的文章,那麽就輸入妳想搜索的關鍵詞吧~", + "可以使用 ctrl/cmd + k 快捷鍵打開搜索哦~" + ] + }, + { + "selector": "[data-dia='article-link']", + "text": [ + "希望妳會喜歡這篇文章:「{text}」.", + "您的選擇真的不錯哦!好好享受這篇文章吧~", + "希望您能從 「{text}」這篇文章中學到點東西。" + ] + }, + { + "selector": ".gt-header-textarea", + "text": [ + "要吐槽些什麽呢?", + "一定要認真填寫喵~", + "有什麽想說的嗎?", + "如果覺得文章不錯的話,就給博主留個言吧~" + ] + }, + { + "selector": ".veditor", + "text": [ + "要吐槽些什麽呢?", + "一定要認真填寫喵~", + "有什麽想說的嗎?", + "如果覺得文章不錯的話,就給博主留個言吧~" + ] + } + ], + "events": [ + { + "date": "01/01", + "text": "元旦了呢,新的一年又開始了,今年是{year}年~" + }, + { + "date": "02/14", + "text": "又是一年情人節,{year}年找到對象了嘛~" + }, + { + "date": "03/08", + "text": "今天是國際婦女節!" + }, + { + "date": "03/12", + "text": "今天是植樹節,要保護環境呀!" + }, + { + "date": "04/01", + "text": "悄悄告訴妳一個秘密~今天是愚人節,不要被騙了哦~" + }, + { + "date": "05/01", + "text": "今天是五一勞動節,計劃好假期去哪裏了嗎~" + }, + { + "date": "06/01", + "text": "兒童節了呢,快活的時光總是短暫,要是永遠長不大該多好啊…" + }, + { + "date": "09/03", + "text": "中國人民抗日戰爭勝利紀念日,銘記歴史、緬懷先烈、珍愛和平、開創未來。" + }, + { + "date": "09/10", + "text": "教師節,在學校要給老師問聲好呀~" + }, + { + "date": "10/01", + "text": "國慶節到了,為祖國母親慶生!" + }, + { + "date": "11/05-11/12", + "text": "今年的雙十一是和誰一起過的呢~" + }, + { + "date": "12/20-12/31", + "text": "這幾天是聖誕節,主人肯定又去剁手買買買了~" + } + ] +} diff --git a/templates/index.html b/templates/index.html index 2c1d0bb2..3bb03a08 100644 --- a/templates/index.html +++ b/templates/index.html @@ -19,7 +19,7 @@ src="https://unpkg.com/gitalk@^1.8.0/dist/gitalk.min.js" >