@lf_maple/koishi-plugin-phi-plugin-full 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/core/.github/ISSUE_TEMPLATE/bug.yaml +133 -0
- package/core/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/core/.github/ISSUE_TEMPLATE/enhancement.yml +44 -0
- package/core/.vscode/c_cpp_properties.json +18 -0
- package/core/.vscode/launch.json +24 -0
- package/core/.vscode/settings.json +59 -0
- package/core/CHANGELOG.md +184 -0
- package/core/LICENSE +674 -0
- package/core/README.md +330 -0
- package/core/README_en.md +285 -0
- package/core/apps/Dan.js +129 -0
- package/core/apps/RankList.js +322 -0
- package/core/apps/aliasProposal.js +223 -0
- package/core/apps/apiSetting.js +592 -0
- package/core/apps/b19.js +1329 -0
- package/core/apps/botClient.js +64 -0
- package/core/apps/chart.js +692 -0
- package/core/apps/guessGame/guessIll.js +821 -0
- package/core/apps/guessGame/guessLetter.js +831 -0
- package/core/apps/guessGame/guessTips.js +254 -0
- package/core/apps/guessGame/letterGameUtils.js +74 -0
- package/core/apps/guessGame.js +214 -0
- package/core/apps/help.js +117 -0
- package/core/apps/manage.js +288 -0
- package/core/apps/market.js +243 -0
- package/core/apps/money.js +1064 -0
- package/core/apps/phisong.js +1418 -0
- package/core/apps/session.js +664 -0
- package/core/apps/setting.js +468 -0
- package/core/apps/update.js +541 -0
- package/core/apps/user.js +968 -0
- package/core/components/Config.js +249 -0
- package/core/components/Data.js +304 -0
- package/core/components/FileWatcherRegistry.js +102 -0
- package/core/components/Logger.js +11 -0
- package/core/components/ProcessCleanup.js +113 -0
- package/core/components/Version.js +56 -0
- package/core/components/YamlReader.js +157 -0
- package/core/components/baseClass.js +287 -0
- package/core/components/common.js +47 -0
- package/core/components/index.js +13 -0
- package/core/components/platform/index.js +79 -0
- package/core/components/platform/koishi.js +800 -0
- package/core/components/platform/koishiDatabaseRedis.js +391 -0
- package/core/components/platform/memoryRedis.js +209 -0
- package/core/components/platform/types.d.ts +272 -0
- package/core/components/platform/yunzai.js +604 -0
- package/core/components/segment.js +4 -0
- package/core/config/config//350/277/231/351/207/214/346/230/257/351/205/215/347/275/256/346/226/207/344/273/266/347/233/256/345/275/225.txt +0 -0
- package/core/config/default_config/banGroup.yaml +14 -0
- package/core/config/default_config/config.yaml +159 -0
- package/core/config/default_config/nickconfig.yaml +6 -0
- package/core/config/default_config/otherinfo.yaml +51 -0
- package/core/guoba.support.js +597 -0
- package/core/index.js +85 -0
- package/core/lib/AES.js +40 -0
- package/core/lib/Base64.js +22 -0
- package/core/lib/ByteReader.js +168 -0
- package/core/lib/GameProgress.js +37 -0
- package/core/lib/GameRecord.js +47 -0
- package/core/lib/GameSettings.js +24 -0
- package/core/lib/GameUser.js +19 -0
- package/core/lib/Level.js +6 -0
- package/core/lib/LevelRecord.js +9 -0
- package/core/lib/PhigrosUser.js +135 -0
- package/core/lib/SaveManager.js +117 -0
- package/core/lib/Summary.js +47 -0
- package/core/lib/TapTap/CompleteQRCodeData.js +27 -0
- package/core/lib/TapTap/LCHelper.js +81 -0
- package/core/lib/TapTap/TapTapHelper.js +170 -0
- package/core/lib/TapTap/getQRcode.js +61 -0
- package/core/lib/Util.js +30 -0
- package/core/lib/getQRcode.js +73 -0
- package/core/lib/http.js +105 -0
- package/core/model/README.md +3 -0
- package/core/model/api/aliasProposalService.js +151 -0
- package/core/model/api/apiVersion.js +67 -0
- package/core/model/api/autoSeekApi.js +165 -0
- package/core/model/api/botApiAuth.js +208 -0
- package/core/model/api/botSyncService.js +78 -0
- package/core/model/api/gameRecordPayload.js +24 -0
- package/core/model/api/makeRequest.js +1004 -0
- package/core/model/api/makeRequestFnc.js +17 -0
- package/core/model/api/phiApiClient.js +53 -0
- package/core/model/api/phiApiErrors.js +121 -0
- package/core/model/filesystem/getFile.js +256 -0
- package/core/model/filesystem/path.js +84 -0
- package/core/model/game/Chart.js +57 -0
- package/core/model/game/LevelRecordInfo.js +109 -0
- package/core/model/game/SongsInfo.js +46 -0
- package/core/model/game/b30Analysis.js +93 -0
- package/core/model/game/chartParser/Chart.js +23 -0
- package/core/model/game/chartParser/JudgeLine.js +38 -0
- package/core/model/game/chartParser/base/JudgeLineEvent.js +99 -0
- package/core/model/game/chartParser/base/Note.js +44 -0
- package/core/model/game/chartParser/base/SpeedEvent.js +25 -0
- package/core/model/game/chartParser/base/baseType.js +2 -0
- package/core/model/game/constNum.js +215 -0
- package/core/model/game/fCompute.js +711 -0
- package/core/model/game/getChartTag.js +140 -0
- package/core/model/game/getComment.js +132 -0
- package/core/model/game/getInfo.js +1069 -0
- package/core/model/game/getRksRank.js +77 -0
- package/core/model/game/markdown.js +77 -0
- package/core/model/integrations/Vika.js +103 -0
- package/core/model/integrations/getInfoFromTap.js +80 -0
- package/core/model/render/getPic.js +79 -0
- package/core/model/render/picmodle.js +496 -0
- package/core/model/render/progress-bar.js +44 -0
- package/core/model/render/puppeteer.js +431 -0
- package/core/model/render/renderPressureHistory.js +71 -0
- package/core/model/render/send.js +94 -0
- package/core/model/save/Save.js +953 -0
- package/core/model/save/analyzeSaveHistory.js +413 -0
- package/core/model/save/getBackup.js +328 -0
- package/core/model/save/getSave.js +90 -0
- package/core/model/save/getSaveFromApi.js +46 -0
- package/core/model/save/saveHistory.js +586 -0
- package/core/model/save/scoreHistory.js +101 -0
- package/core/model/theme/catalog.js +192 -0
- package/core/model/theme/installGuard.js +275 -0
- package/core/model/theme/installLock.js +174 -0
- package/core/model/theme/installer.js +398 -0
- package/core/model/theme/manager.js +408 -0
- package/core/model/theme/marketClient.js +294 -0
- package/core/model/theme/paths.js +42 -0
- package/core/model/theme/policy.js +54 -0
- package/core/model/theme/recovery.js +167 -0
- package/core/model/theme/useService.js +187 -0
- package/core/model/type/aliasProposal.d.ts +45 -0
- package/core/model/type/type.js +420 -0
- package/core/model/user/apiPermission.js +62 -0
- package/core/model/user/getBanGroup.js +120 -0
- package/core/model/user/getNotes.js +48 -0
- package/core/model/user/pluginData.js +101 -0
- package/core/model/user/userCredentialStore.js +154 -0
- package/core/model/user/userCredentials.js +860 -0
- package/core/package.json +60 -0
- package/core/resources/0608badSave/save.json +1 -0
- package/core/resources/LICENSE +201 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.art +220 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.css +345 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.html +434 -0
- package/core/resources/html/arcgrosB19/arcgros.png +0 -0
- package/core/resources/html/arcgrosB19/arcgrosB19-orz.html +276 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.art +168 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.css +637 -0
- package/core/resources/html/atlas/atlas-orz.html +313 -0
- package/core/resources/html/atlas/atlas.art +194 -0
- package/core/resources/html/atlas/atlas.css +695 -0
- package/core/resources/html/avatar/-SURREALISM-.png +0 -0
- package/core/resources/html/avatar/Alkaid.png +0 -0
- package/core/resources/html/avatar/Aphasia.png +0 -0
- package/core/resources/html/avatar/Artificial Existence.png +0 -0
- package/core/resources/html/avatar/Bonus Time.png +0 -0
- package/core/resources/html/avatar/Burn.png +0 -0
- package/core/resources/html/avatar/Cereris1.png +0 -0
- package/core/resources/html/avatar/Cereris2.png +0 -0
- package/core/resources/html/avatar/Cereris3.png +0 -0
- package/core/resources/html/avatar/Christmas -2019.png +0 -0
- package/core/resources/html/avatar/Cipher1.png +0 -0
- package/core/resources/html/avatar/Class Memories.png +0 -0
- package/core/resources/html/avatar/Credits.png +0 -0
- package/core/resources/html/avatar/Dash.png +0 -0
- package/core/resources/html/avatar/Dlyrotz.png +0 -0
- package/core/resources/html/avatar/Doppelganger1.png +0 -0
- package/core/resources/html/avatar/Doppelganger2.png +0 -0
- package/core/resources/html/avatar/Drop it.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix1.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix2.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix3.png +0 -0
- package/core/resources/html/avatar/Engine x Start!! (melody mix).png +0 -0
- package/core/resources/html/avatar/Engine x Start!! extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Eradication Catastrophe.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special1.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special2.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2641.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2642.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2643.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2644.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2645.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2646.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2647.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2648.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2649.png +0 -0
- package/core/resources/html/avatar/Find_Me.png +0 -0
- package/core/resources/html/avatar/Geopelia 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 2 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 3 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Geopelia in WEPLAY -by /346/265/267/344/272/247.png +0 -0
- package/core/resources/html/avatar/Gino-AprilFool.png +0 -0
- package/core/resources/html/avatar/Glaciaxion.png +0 -0
- package/core/resources/html/avatar/HumaN.png +0 -0
- package/core/resources/html/avatar/Indelible Scar.png +0 -0
- package/core/resources/html/avatar/Introduction.png +0 -0
- package/core/resources/html/avatar/Khronostasis Katharsis.png +0 -0
- package/core/resources/html/avatar/MARENOL.png +0 -0
- package/core/resources/html/avatar/Marenol extra 1 -by /345/226/265n/350/221/265.png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez (MUG Edit).png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Oblivion +0 -0
- package/core/resources/html/avatar/OblivionPHIN.png +0 -0
- package/core/resources/html/avatar/Para.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz1.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz2.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz3.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 2 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Sein.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special2.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240/345/222/214/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/Snow Desert.png +0 -0
- package/core/resources/html/avatar/Sparkle New Life.png +0 -0
- package/core/resources/html/avatar/Sultan Rage.png +0 -0
- package/core/resources/html/avatar/Winter /342/206/221cube/342/206/223.png +0 -0
- package/core/resources/html/avatar/Xenolith.png +0 -0
- package/core/resources/html/avatar/[PRAW].png +0 -0
- package/core/resources/html/avatar/dB doll.png +0 -0
- package/core/resources/html/avatar/ripper.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2721.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2722.png +0 -0
- package/core/resources/html/avatar//344/270/207/345/220/250/345/214/277/345/220/215/344/277/241.png +0 -0
- package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251 extra 1 -by /345/276/241/345/235/202/346/236/234/345/255/220.png +0 -0
- package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251.png +0 -0
- package/core/resources/html/avatar//345/205/211.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2051.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2052.png +0 -0
- package/core/resources/html/avatar//346/260/264/351/235/222-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
- package/core/resources/html/avatar//346/267/267/344/271/261-Confusion.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2361.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2362.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/201-Special.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2011.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2012.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2013.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2014.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2015.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2016.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2017.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/227-Special.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2271.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2272.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2273.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2611.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2612.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2501.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2502.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275-Special.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275.png +0 -0
- package/core/resources/html/avatar//351/243/216/345/261/277.png +0 -0
- package/core/resources/html/avatar//351/270/240-AprilFool.png +0 -0
- package/core/resources/html/avatar//351/270/240-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
- package/core/resources/html/b19/b19.art +490 -0
- package/core/resources/html/b19/b19.css +1261 -0
- package/core/resources/html/b19/b19666.art +350 -0
- package/core/resources/html/b19/b19666.css +1409 -0
- package/core/resources/html/b19/b19666.html +481 -0
- package/core/resources/html/b19/b19title.css +120 -0
- package/core/resources/html/b19/best19.html +853 -0
- package/core/resources/html/b19/dss2-orz.html +428 -0
- package/core/resources/html/b19/dss2.art +298 -0
- package/core/resources/html/b19/dss2.css +776 -0
- package/core/resources/html/b19/res/666.jpeg +0 -0
- package/core/resources/html/chap/chap-orz.html +93 -0
- package/core/resources/html/chap/chap.art +87 -0
- package/core/resources/html/chap/chap.css +365 -0
- package/core/resources/html/chartImg/chartImg.art +169 -0
- package/core/resources/html/chartImg/chartImg.css +439 -0
- package/core/resources/html/chartImg/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartImg/echarts.js +85796 -0
- package/core/resources/html/chartImg/img/Drag.png +0 -0
- package/core/resources/html/chartImg/img/DragHL.png +0 -0
- package/core/resources/html/chartImg/img/Flick.png +0 -0
- package/core/resources/html/chartImg/img/FlickHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold.png +0 -0
- package/core/resources/html/chartImg/img/HoldHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold_End.png +0 -0
- package/core/resources/html/chartImg/img/Hold_Head.png +0 -0
- package/core/resources/html/chartImg/img/Hold_HeadHL.png +0 -0
- package/core/resources/html/chartImg/img/Tap.png +0 -0
- package/core/resources/html/chartImg/img/TapHL.png +0 -0
- package/core/resources/html/chartInfo/chartInfo-orz.html +250 -0
- package/core/resources/html/chartInfo/chartInfo.art +222 -0
- package/core/resources/html/chartInfo/chartInfo.css +265 -0
- package/core/resources/html/chartInfo/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartInfo/echarts.js +85796 -0
- package/core/resources/html/clg/clg-orz.html +218 -0
- package/core/resources/html/clg/clg.art +88 -0
- package/core/resources/html/clg/clg.css +230 -0
- package/core/resources/html/clg/demo.jpg +0 -0
- package/core/resources/html/common/common.css +319 -0
- package/core/resources/html/common/css/playerInfo.css +136 -0
- package/core/resources/html/common/font/Aldrich-Regular.ttf +0 -0
- package/core/resources/html/common/font/HIMALAYA.TTF +0 -0
- package/core/resources/html/common/font/NotoColorEmoji-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSans-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansArabic.ttf +0 -0
- package/core/resources/html/common/font/NotoSansCanadianAboriginal.ttf +0 -0
- package/core/resources/html/common/font/NotoSansJP.ttf +0 -0
- package/core/resources/html/common/font/NotoSansKannada.ttf +0 -0
- package/core/resources/html/common/font/NotoSansMath-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansSymbols2.ttf +0 -0
- package/core/resources/html/common/font/phi.ttf +0 -0
- package/core/resources/html/common/font//345/220/236/345/274/245/346/201/260/344/277/212.ttf +0 -0
- package/core/resources/html/common/layout/default.art +324 -0
- package/core/resources/html/common/layout/elem.art +21 -0
- package/core/resources/html/common/theme/snow/snow.css +17 -0
- package/core/resources/html/common/theme/snow/snow.js +19 -0
- package/core/resources/html/common/theme/star/star.js +201 -0
- package/core/resources/html/common/theme/topText/topText.css +15 -0
- package/core/resources/html/common/theme/topText/topText.js +30 -0
- package/core/resources/html/difficultyHistory/difficultyHistory-orz.html +361 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.art +102 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.css +205 -0
- package/core/resources/html/guess/guess-orz.html +50 -0
- package/core/resources/html/guess/guess.art +51 -0
- package/core/resources/html/guess/guess.css +33 -0
- package/core/resources/html/help/help-orz.html +73 -0
- package/core/resources/html/help/help.art +84 -0
- package/core/resources/html/help/help.css +266 -0
- package/core/resources/html/historyB30/historyB30-orz.html +168 -0
- package/core/resources/html/historyB30/historyB30.art +143 -0
- package/core/resources/html/historyB30/historyB30.css +270 -0
- package/core/resources/html/ill/ill-orz.html +21 -0
- package/core/resources/html/ill/ill.art +23 -0
- package/core/resources/html/ill/ill.css +79 -0
- package/core/resources/html/jrrp/ShineAfter.removebg.png +0 -0
- package/core/resources/html/jrrp/jrrp-orz.html +68 -0
- package/core/resources/html/jrrp/jrrp.art +58 -0
- package/core/resources/html/jrrp/jrrp.css +251 -0
- package/core/resources/html/list/list-orz.html +35 -0
- package/core/resources/html/list/list.art +67 -0
- package/core/resources/html/list/list.css +259 -0
- package/core/resources/html/lvsco/demo.jpg +0 -0
- package/core/resources/html/lvsco/lvsco-orz.html +334 -0
- package/core/resources/html/lvsco/lvsco.art +314 -0
- package/core/resources/html/lvsco/lvsco.css +706 -0
- package/core/resources/html/market/detail.art +44 -0
- package/core/resources/html/market/market.art +86 -0
- package/core/resources/html/market/market.css +64 -0
- package/core/resources/html/newSong/newSong.art +34 -0
- package/core/resources/html/newSong/newSong.css +48 -0
- package/core/resources/html/newSong/newSong.html +23 -0
- package/core/resources/html/newnotice/newnotice.art +47 -0
- package/core/resources/html/newnotice/newnotice.css +83 -0
- package/core/resources/html/otherimg/0.png +0 -0
- package/core/resources/html/otherimg/1.png +0 -0
- package/core/resources/html/otherimg/2.png +0 -0
- package/core/resources/html/otherimg/3.png +0 -0
- package/core/resources/html/otherimg/4.png +0 -0
- package/core/resources/html/otherimg/5.png +0 -0
- package/core/resources/html/otherimg/A.png +0 -0
- package/core/resources/html/otherimg/B.png +0 -0
- package/core/resources/html/otherimg/C.png +0 -0
- package/core/resources/html/otherimg/F.png +0 -0
- package/core/resources/html/otherimg/FC.png +0 -0
- package/core/resources/html/otherimg/NEW.png +0 -0
- package/core/resources/html/otherimg/Phigros_Icon_3.0.0.png +0 -0
- package/core/resources/html/otherimg/S.png +0 -0
- package/core/resources/html/otherimg/Star1.png +0 -0
- package/core/resources/html/otherimg/Star2.png +0 -0
- package/core/resources/html/otherimg/V.png +0 -0
- package/core/resources/html/otherimg/callback.png +0 -0
- package/core/resources/html/otherimg/chapHelp.png +0 -0
- package/core/resources/html/otherimg/dan_code.png +0 -0
- package/core/resources/html/otherimg/data.png +0 -0
- package/core/resources/html/otherimg/helpDoc.png +0 -0
- package/core/resources/html/otherimg/nickSuggest.png +0 -0
- package/core/resources/html/otherimg/phi.png +0 -0
- package/core/resources/html/otherimg/phigros.png +0 -0
- package/core/resources/html/otherimg/snow1.png +0 -0
- package/core/resources/html/otherimg/snow2.png +0 -0
- package/core/resources/html/otherimg/snow3.png +0 -0
- package/core/resources/html/otherimg/snow4.png +0 -0
- package/core/resources/html/otherimg/title.png +0 -0
- package/core/resources/html/rand/rand-orz.html +62 -0
- package/core/resources/html/rand/rand.art +59 -0
- package/core/resources/html/rand/rand.css +257 -0
- package/core/resources/html/rankingList/rankingList-orz.html +456 -0
- package/core/resources/html/rankingList/rankingList.art +171 -0
- package/core/resources/html/rankingList/rankingList.css +570 -0
- package/core/resources/html/rankingList-old/rankingList-orz.html +300 -0
- package/core/resources/html/rankingList-old/rankingList.art +89 -0
- package/core/resources/html/rankingList-old/rankingList.css +265 -0
- package/core/resources/html/score/score-orz.html +625 -0
- package/core/resources/html/score/score.art +249 -0
- package/core/resources/html/score/score.css +435 -0
- package/core/resources/html/score/scoreOld-orz.html +128 -0
- package/core/resources/html/score/scoreOld.art +230 -0
- package/core/resources/html/score/scoreOld.css +475 -0
- package/core/resources/html/score/scoreRankList-orz.html +613 -0
- package/core/resources/html/score/scoreRankList.art +231 -0
- package/core/resources/html/score/scoreRankList.css +197 -0
- package/core/resources/html/setting/setting-orz.html +123 -0
- package/core/resources/html/setting/setting.art +72 -0
- package/core/resources/html/setting/setting.css +170 -0
- package/core/resources/html/setting/userSetting-orz.html +132 -0
- package/core/resources/html/setting/userSetting.art +48 -0
- package/core/resources/html/setting/userSetting.css +160 -0
- package/core/resources/html/sign/sign-orz.html +262 -0
- package/core/resources/html/sign/sign.art +163 -0
- package/core/resources/html/sign/sign.css +706 -0
- package/core/resources/html/suggest/suggest.art +271 -0
- package/core/resources/html/suggest/suggest.css +300 -0
- package/core/resources/html/table/table-orz.html +228 -0
- package/core/resources/html/table/table.art +163 -0
- package/core/resources/html/table/table.css +401 -0
- package/core/resources/html/tasks/tasks-orz.html +83 -0
- package/core/resources/html/tasks/tasks.art +118 -0
- package/core/resources/html/tasks/tasks.css +334 -0
- package/core/resources/html/update/update-orz.html +735 -0
- package/core/resources/html/update/update.art +259 -0
- package/core/resources/html/update/update.css +676 -0
- package/core/resources/html/userinfo/userinfo-old-orz.html +408 -0
- package/core/resources/html/userinfo/userinfo-old.art +233 -0
- package/core/resources/html/userinfo/userinfo-old.css +466 -0
- package/core/resources/html/userinfo/userinfo-orz.html +543 -0
- package/core/resources/html/userinfo/userinfo.art +288 -0
- package/core/resources/html/userinfo/userinfo.css +757 -0
- package/core/resources/info/DLC/arc.json +412 -0
- package/core/resources/info/DLC/chunithm.json +1172 -0
- package/core/resources/info/DLC/dynamix.json +455 -0
- package/core/resources/info/DLC/fanshi.json +132 -0
- package/core/resources/info/DLC/lanota.json +412 -0
- package/core/resources/info/DLC/maimai.json +1110 -0
- package/core/resources/info/DLC/orz.json +158 -0
- package/core/resources/info/DLC/rizline.json +40 -0
- package/core/resources/info/DLC/rotaeno.json +159 -0
- package/core/resources/info/DLC/ryceam.json +53 -0
- package/core/resources/info/avatar.txt +109 -0
- package/core/resources/info/chaplist.yaml +102 -0
- package/core/resources/info/help/api.json +83 -0
- package/core/resources/info/help.json +436 -0
- package/core/resources/info/info.csv +315 -0
- package/core/resources/info/infolist.json +1758 -0
- package/core/resources/info/jrrp.json +92 -0
- package/core/resources/info/nicklist.yaml +2373 -0
- package/core/resources/info/notesInfo.json +1 -0
- package/core/resources/info/notice.json +11 -0
- package/core/resources/info/oldInfo/100/change.csv +218 -0
- package/core/resources/info/oldInfo/100/info.json +7 -0
- package/core/resources/info/oldInfo/101/change.csv +218 -0
- package/core/resources/info/oldInfo/101/info.json +7 -0
- package/core/resources/info/oldInfo/102/change.csv +223 -0
- package/core/resources/info/oldInfo/102/info.json +7 -0
- package/core/resources/info/oldInfo/103/change.csv +224 -0
- package/core/resources/info/oldInfo/103/info.json +7 -0
- package/core/resources/info/oldInfo/104/change.csv +225 -0
- package/core/resources/info/oldInfo/104/info.json +7 -0
- package/core/resources/info/oldInfo/105/change.csv +228 -0
- package/core/resources/info/oldInfo/105/info.json +7 -0
- package/core/resources/info/oldInfo/106/change.csv +229 -0
- package/core/resources/info/oldInfo/106/info.json +7 -0
- package/core/resources/info/oldInfo/108/change.csv +233 -0
- package/core/resources/info/oldInfo/108/info.json +7 -0
- package/core/resources/info/oldInfo/109/change.csv +235 -0
- package/core/resources/info/oldInfo/109/info.json +7 -0
- package/core/resources/info/oldInfo/110/change.csv +235 -0
- package/core/resources/info/oldInfo/110/info.json +7 -0
- package/core/resources/info/oldInfo/111/change.csv +242 -0
- package/core/resources/info/oldInfo/111/info.json +7 -0
- package/core/resources/info/oldInfo/112/change.csv +242 -0
- package/core/resources/info/oldInfo/112/info.json +7 -0
- package/core/resources/info/oldInfo/113/change.csv +244 -0
- package/core/resources/info/oldInfo/113/info.json +7 -0
- package/core/resources/info/oldInfo/115/change.csv +247 -0
- package/core/resources/info/oldInfo/115/info.json +7 -0
- package/core/resources/info/oldInfo/116/change.csv +249 -0
- package/core/resources/info/oldInfo/116/info.json +7 -0
- package/core/resources/info/oldInfo/118/change.csv +252 -0
- package/core/resources/info/oldInfo/118/info.json +7 -0
- package/core/resources/info/oldInfo/119/change.csv +255 -0
- package/core/resources/info/oldInfo/119/info.json +7 -0
- package/core/resources/info/oldInfo/120/change.csv +255 -0
- package/core/resources/info/oldInfo/120/info.json +7 -0
- package/core/resources/info/oldInfo/121/change.csv +257 -0
- package/core/resources/info/oldInfo/121/info.json +7 -0
- package/core/resources/info/oldInfo/122/change.csv +260 -0
- package/core/resources/info/oldInfo/122/info.json +7 -0
- package/core/resources/info/oldInfo/123/change.csv +260 -0
- package/core/resources/info/oldInfo/123/info.json +7 -0
- package/core/resources/info/oldInfo/124/change.csv +262 -0
- package/core/resources/info/oldInfo/124/info.json +7 -0
- package/core/resources/info/oldInfo/125/change.csv +266 -0
- package/core/resources/info/oldInfo/125/info.json +7 -0
- package/core/resources/info/oldInfo/126/change.csv +269 -0
- package/core/resources/info/oldInfo/126/info.json +7 -0
- package/core/resources/info/oldInfo/127/change.csv +270 -0
- package/core/resources/info/oldInfo/127/info.json +7 -0
- package/core/resources/info/oldInfo/128/change.csv +273 -0
- package/core/resources/info/oldInfo/128/info.json +7 -0
- package/core/resources/info/oldInfo/129/change.csv +274 -0
- package/core/resources/info/oldInfo/129/info.json +7 -0
- package/core/resources/info/oldInfo/130/change.csv +275 -0
- package/core/resources/info/oldInfo/130/info.json +7 -0
- package/core/resources/info/oldInfo/131/change.csv +278 -0
- package/core/resources/info/oldInfo/131/info.json +7 -0
- package/core/resources/info/oldInfo/132/change.csv +280 -0
- package/core/resources/info/oldInfo/132/info.json +7 -0
- package/core/resources/info/oldInfo/133/change.csv +284 -0
- package/core/resources/info/oldInfo/133/info.json +7 -0
- package/core/resources/info/oldInfo/134/change.csv +286 -0
- package/core/resources/info/oldInfo/134/info.json +7 -0
- package/core/resources/info/oldInfo/135/change.csv +290 -0
- package/core/resources/info/oldInfo/135/info.json +7 -0
- package/core/resources/info/oldInfo/136/change.csv +290 -0
- package/core/resources/info/oldInfo/136/info.json +7 -0
- package/core/resources/info/oldInfo/137/change.csv +293 -0
- package/core/resources/info/oldInfo/137/info.json +7 -0
- package/core/resources/info/oldInfo/138/change.csv +295 -0
- package/core/resources/info/oldInfo/138/info.json +7 -0
- package/core/resources/info/oldInfo/139/change.csv +295 -0
- package/core/resources/info/oldInfo/139/info.json +7 -0
- package/core/resources/info/oldInfo/140/change.csv +298 -0
- package/core/resources/info/oldInfo/140/info.json +7 -0
- package/core/resources/info/oldInfo/141/change.csv +300 -0
- package/core/resources/info/oldInfo/141/info.json +7 -0
- package/core/resources/info/oldInfo/142/change.csv +302 -0
- package/core/resources/info/oldInfo/142/info.json +7 -0
- package/core/resources/info/oldInfo/143/change.csv +303 -0
- package/core/resources/info/oldInfo/143/info.json +7 -0
- package/core/resources/info/oldInfo/144/change.csv +303 -0
- package/core/resources/info/oldInfo/144/info.json +7 -0
- package/core/resources/info/oldInfo/145/change.csv +305 -0
- package/core/resources/info/oldInfo/145/info.json +7 -0
- package/core/resources/info/oldInfo/146/change.csv +305 -0
- package/core/resources/info/oldInfo/146/info.json +7 -0
- package/core/resources/info/oldInfo/148/change.csv +307 -0
- package/core/resources/info/oldInfo/148/info.json +7 -0
- package/core/resources/info/oldInfo/149/change.csv +307 -0
- package/core/resources/info/oldInfo/149/info.json +7 -0
- package/core/resources/info/oldInfo/151/change.csv +309 -0
- package/core/resources/info/oldInfo/151/info.json +7 -0
- package/core/resources/info/oldInfo/152/change.csv +312 -0
- package/core/resources/info/oldInfo/152/info.json +7 -0
- package/core/resources/info/oldInfo/153/change.csv +313 -0
- package/core/resources/info/oldInfo/153/info.json +7 -0
- package/core/resources/info/oldInfo/154/change.csv +315 -0
- package/core/resources/info/oldInfo/154/info.json +7 -0
- package/core/resources/info/oldInfo/92/change.csv +204 -0
- package/core/resources/info/oldInfo/92/info.json +7 -0
- package/core/resources/info/oldInfo/93/change.csv +206 -0
- package/core/resources/info/oldInfo/93/info.json +7 -0
- package/core/resources/info/oldInfo/94/change.csv +209 -0
- package/core/resources/info/oldInfo/94/info.json +7 -0
- package/core/resources/info/oldInfo/95/change.csv +211 -0
- package/core/resources/info/oldInfo/95/info.json +7 -0
- package/core/resources/info/oldInfo/96/change.csv +216 -0
- package/core/resources/info/oldInfo/96/info.json +7 -0
- package/core/resources/info/oldInfo/98/change.csv +216 -0
- package/core/resources/info/oldInfo/98/info.json +7 -0
- package/core/resources/info/oldInfo/99/change.csv +217 -0
- package/core/resources/info/oldInfo/99/info.json +7 -0
- package/core/resources/info/oldNotesInfo.json +1 -0
- package/core/resources/info/sentences.json +1 -0
- package/core/resources/info/spinfo.json +362 -0
- package/core/resources/info/tips.txt +278 -0
- package/core/resources/otherill//351/233/252/351/231/215SP.png +0 -0
- package/core/resources/song-select.html +535 -0
- package/core/resources/themes/README.md +24 -0
- package/core/resources/themes/milthm/A.png +0 -0
- package/core/resources/themes/milthm/B.png +0 -0
- package/core/resources/themes/milthm/C.png +0 -0
- package/core/resources/themes/milthm/F.png +0 -0
- package/core/resources/themes/milthm/FC.png +0 -0
- package/core/resources/themes/milthm/S.png +0 -0
- package/core/resources/themes/milthm/V.png +0 -0
- package/core/resources/themes/milthm/arcgrosB19.css +36 -0
- package/core/resources/themes/milthm/b19.art +464 -0
- package/core/resources/themes/milthm/b19.css +1314 -0
- package/core/resources/themes/milthm/bg.png +0 -0
- package/core/resources/themes/milthm/clg.css +37 -0
- package/core/resources/themes/milthm/difficultyHistory.css +42 -0
- package/core/resources/themes/milthm/font.ttf +0 -0
- package/core/resources/themes/milthm/help.css +36 -0
- package/core/resources/themes/milthm/historyB30.css +48 -0
- package/core/resources/themes/milthm/info.yaml +45 -0
- package/core/resources/themes/milthm/list.css +39 -0
- package/core/resources/themes/milthm/phi.png +0 -0
- package/core/resources/themes/milthm/setting.css +37 -0
- package/core/resources/themes/milthm/sign.css +81 -0
- package/core/resources/themes/milthm/suggest.css +40 -0
- package/core/resources/themes/milthm/table.css +54 -0
- package/core/resources/themes/milthm/update.css +68 -0
- package/core/tests/aliasProposalService.test.js +82 -0
- package/core/tests/apiAccountDeletion.test.js +125 -0
- package/core/tests/apiPermission.test.js +44 -0
- package/core/tests/apiVersion.test.js +55 -0
- package/core/tests/b30Analysis.test.js +38 -0
- package/core/tests/backgroundIllustration.test.js +21 -0
- package/core/tests/botApiAuthRecovery.test.js +148 -0
- package/core/tests/botSyncService.test.js +42 -0
- package/core/tests/fileWatcherRegistry.test.js +44 -0
- package/core/tests/gameRecordPayload.test.js +34 -0
- package/core/tests/guessLetter.test.js +79 -0
- package/core/tests/makeRequestHandling.test.js +118 -0
- package/core/tests/marketOverflow.test.js +31 -0
- package/core/tests/platformTemplateCache.test.js +92 -0
- package/core/tests/pluginDataThemePreference.test.js +36 -0
- package/core/tests/processCleanup.test.js +58 -0
- package/core/tests/puppeteerShutdown.test.js +17 -0
- package/core/tests/renderPressureHistory.test.js +59 -0
- package/core/tests/saveStats.test.js +26 -0
- package/core/tests/themeInstallGuard.test.js +289 -0
- package/core/tests/themeManager.test.js +625 -0
- package/core/tests/themeManagerInit.test.js +11 -0
- package/core/tests/themeMarket.test.js +855 -0
- package/core/tests/themePageRouting.test.js +431 -0
- package/core/tests/themePolicy.test.js +28 -0
- package/core/tests/themeStorageRecovery.test.js +192 -0
- package/core/tests/userCredentialModuleBoundaries.test.js +41 -0
- package/core/tests/userCredentials.test.js +285 -0
- package/core/tsconfig.json +32 -0
- package/core/types/vendor.d.ts +14 -0
- package/lib/index.cjs +358 -0
- package/lib/index.d.cts +182 -0
- package/lib/index.d.ts +182 -0
- package/lib/index.js +320 -0
- package/package.json +74 -0
- package/readme.md +3 -0
package/lib/index.cjs
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name2 in all)
|
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
Config: () => Config,
|
|
33
|
+
apply: () => apply,
|
|
34
|
+
inject: () => inject,
|
|
35
|
+
name: () => name
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
39
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
40
|
+
var import_node_url = require("url");
|
|
41
|
+
var import_node_module = require("module");
|
|
42
|
+
var import_yaml = __toESM(require("yaml"), 1);
|
|
43
|
+
var import_koishi = require("koishi");
|
|
44
|
+
var import_meta = {};
|
|
45
|
+
var currentDir;
|
|
46
|
+
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
47
|
+
currentDir = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
48
|
+
} else {
|
|
49
|
+
currentDir = __dirname;
|
|
50
|
+
}
|
|
51
|
+
var packageRoot = import_node_path.default.resolve(currentDir, "..");
|
|
52
|
+
var coreRoot = import_node_path.default.join(packageRoot, "core");
|
|
53
|
+
var displayName = "phi-plugin";
|
|
54
|
+
var inject = ["database"];
|
|
55
|
+
var HOST_ONLY_KEYS = /* @__PURE__ */ new Set([
|
|
56
|
+
"master",
|
|
57
|
+
"admins",
|
|
58
|
+
"masterAuthority",
|
|
59
|
+
"adminAuthority"
|
|
60
|
+
]);
|
|
61
|
+
var RUNTIME_KEYS = /* @__PURE__ */ new Set([
|
|
62
|
+
"apiBotClientId",
|
|
63
|
+
"apiBotClientSecret",
|
|
64
|
+
"apiBotSecretVersion"
|
|
65
|
+
]);
|
|
66
|
+
var Config = import_koishi.Schema.intersect([
|
|
67
|
+
import_koishi.Schema.object({
|
|
68
|
+
master: import_koishi.Schema.array(String).description("\u89C6\u4E3A phi-plugin Bot \u4E3B\u4EBA\u7684\u7528\u6237 ID\uFF08\u901A\u5E38\u65E0\u9700\u586B\u5199\uFF0C\u9ED8\u8BA4\u6309 Koishi \u6743\u9650\u7B49\u7EA7\u5224\u65AD\uFF09"),
|
|
69
|
+
admins: import_koishi.Schema.array(String).description("\u989D\u5916\u89C6\u4E3A\u7BA1\u7406\u5458\uFF08\u53EF\u6267\u884C setnick / ban \u7B49\uFF09\u7684\u7528\u6237 ID"),
|
|
70
|
+
masterAuthority: import_koishi.Schema.number().min(0).max(10).default(4).description("\u8FBE\u5230\u8BE5 Koishi \u6743\u9650\u7B49\u7EA7\u5373\u89C6\u4E3A phi-plugin \u4E3B\u4EBA"),
|
|
71
|
+
adminAuthority: import_koishi.Schema.number().min(0).max(10).default(3).description("\u8FBE\u5230\u8BE5 Koishi \u6743\u9650\u7B49\u7EA7\u5373\u89C6\u4E3A\u7FA4/\u9891\u9053\u7BA1\u7406\u5458")
|
|
72
|
+
}).description("\u6743\u9650\u8BBE\u7F6E"),
|
|
73
|
+
import_koishi.Schema.object({
|
|
74
|
+
renderScale: import_koishi.Schema.number().min(50).max(200).default(100).description("\u6E32\u67D3\u7CBE\u5EA6\uFF08%\uFF09"),
|
|
75
|
+
randerQuality: import_koishi.Schema.number().min(50).max(100).default(100).description("\u6E32\u67D3\u8D28\u91CF\uFF08%\uFF09"),
|
|
76
|
+
timeout: import_koishi.Schema.number().min(1e3).max(12e4).default(2e4).description("\u6E32\u67D3\u8D85\u65F6\u65F6\u95F4\uFF08ms\uFF09"),
|
|
77
|
+
waitingTimeout: import_koishi.Schema.number().min(1e3).max(12e4).default(1e4).description("\u7B49\u5F85\u6E32\u67D3\u961F\u5217\u8D85\u65F6\u65F6\u95F4\uFF08ms\uFF09"),
|
|
78
|
+
renderNum: import_koishi.Schema.number().min(1).max(10).default(1).description("\u5E76\u884C\u6E32\u67D3\u5668\u6570\u91CF\uFF08\u4FEE\u6539\u540E\u9700\u91CD\u8F7D\u63D2\u4EF6\uFF09"),
|
|
79
|
+
commentsAPage: import_koishi.Schema.number().min(1).max(20).default(10).description("\u66F2\u76EE\u8BC4\u8BBA\u6BCF\u9875\u6E32\u67D3\u6761\u6570"),
|
|
80
|
+
B19MaxNum: import_koishi.Schema.number().min(22).max(1e3).default(50).description("B19 \u56FE\u7247\u53EF\u67E5\u8BE2\u7684\u6700\u5927\u6570\u91CF"),
|
|
81
|
+
HistoryDayNum: import_koishi.Schema.number().min(2).max(1e4).default(10).description("/update \u5386\u53F2\u6210\u7EE9\u5355\u65E5\u6700\u5927\u6570\u91CF"),
|
|
82
|
+
HistoryScoreNum: import_koishi.Schema.number().min(10).max(1e4).default(50).description("/update \u5386\u53F2\u6210\u7EE9\u603B\u6570\u91CF"),
|
|
83
|
+
HistoryScoreDate: import_koishi.Schema.number().min(1).max(100).default(10).description("/update \u5386\u53F2\u6210\u7EE9\u5C55\u793A\u5929\u6570"),
|
|
84
|
+
listScoreMaxNum: import_koishi.Schema.number().min(3).max(1e4).default(180).description("/list \u6700\u5927\u6E32\u67D3\u6210\u7EE9\u6570\u91CF")
|
|
85
|
+
}).description("\u6E32\u67D3\u8BBE\u7F6E"),
|
|
86
|
+
import_koishi.Schema.object({
|
|
87
|
+
defaultGlobal: import_koishi.Schema.boolean().default(false).description("\u9ED8\u8BA4\u4F7F\u7528\u56FD\u9645\u670D\uFF08\u5173 = \u56FD\u670D\uFF09"),
|
|
88
|
+
watchInfoPath: import_koishi.Schema.boolean().default(false).description("\u76D1\u542C\u66F2\u5E93\u4FE1\u606F\u6587\u4EF6\u53D8\u5316"),
|
|
89
|
+
allowComment: import_koishi.Schema.boolean().default(true).description("\u5F00\u542F\u66F2\u76EE\u8BC4\u8BBA\u529F\u80FD"),
|
|
90
|
+
allowChartTag: import_koishi.Schema.boolean().default(false).description("\u5F00\u542F\u8C31\u9762\u6807\u7B7E\u529F\u80FD"),
|
|
91
|
+
onLinePhiIllUrl: import_koishi.Schema.union([
|
|
92
|
+
import_koishi.Schema.const(1).description("GitHub raw"),
|
|
93
|
+
import_koishi.Schema.const(2).description("Gitee raw"),
|
|
94
|
+
import_koishi.Schema.const(3).description("\u5F26\u5854\u8D44\u6E90\u7AD9"),
|
|
95
|
+
import_koishi.Schema.const(4).description("cnb.cool")
|
|
96
|
+
]).default(1).description("\u5728\u7EBF\u66F2\u7ED8\u6765\u6E90\uFF08\u672A\u4E0B\u8F7D\u66F2\u7ED8\u65F6\u4F7F\u7528\uFF09"),
|
|
97
|
+
downIllUrl: import_koishi.Schema.string().default("https://github.com/Catrong/phi-plugin-ill.git").description("/phi downill \u4F7F\u7528\u7684\u66F2\u7ED8\u4ED3\u5E93"),
|
|
98
|
+
githubProxy: import_koishi.Schema.string().default("https://gh-proxy.com").description("GitHub \u4EE3\u7406\u5730\u5740\uFF0C\u586B false \u4E0D\u4F7F\u7528\u4EE3\u7406"),
|
|
99
|
+
autoPullPhiIll: import_koishi.Schema.boolean().default(false).description("\u66F4\u65B0\u63D2\u4EF6\u65F6\u81EA\u52A8\u66F4\u65B0\u66F2\u7ED8"),
|
|
100
|
+
isGuild: import_koishi.Schema.boolean().default(false).description("\u9891\u9053\u6A21\u5F0F\uFF1A\u6587\u5B57\u7248\u4EC5\u9650\u79C1\u804A\u3001\u7FA4\u804A\u53D1\u9001\u56FE\u7247/\u957F\u6D88\u606F"),
|
|
101
|
+
WordB19Img: import_koishi.Schema.boolean().default(false).description("\u6587\u5B57\u7248 B19 \u9644\u5E26\u66F2\u7ED8"),
|
|
102
|
+
WordSuggImg: import_koishi.Schema.boolean().default(false).description("\u6587\u5B57\u7248 suggest \u9644\u5E26\u66F2\u7ED8"),
|
|
103
|
+
TapTapLoginQRcode: import_koishi.Schema.boolean().default(true).description("TapTap \u626B\u7801\u7ED1\u5B9A\u53D1\u9001\u4E8C\u7EF4\u7801\uFF08\u5173 = \u4EC5\u53D1\u9001\u94FE\u63A5\uFF09"),
|
|
104
|
+
cmdhead: import_koishi.Schema.string().default("phi").description("\u547D\u4EE4\u5934\uFF08\u6B63\u5219\u7247\u6BB5\uFF09\uFF0C\u4F8B\u5982 #phi\u3001/phi \u4E2D\u7684 phi"),
|
|
105
|
+
openPhiPluginApi: import_koishi.Schema.boolean().default(true).description("\u542F\u7528 Phigros \u8054\u5408\u67E5\u5206 API"),
|
|
106
|
+
enableCustomThemeApi: import_koishi.Schema.boolean().default(true).description("\u5141\u8BB8\u4ECE API \u83B7\u53D6/\u5B89\u88C5\u81EA\u5B9A\u4E49\u4E3B\u9898"),
|
|
107
|
+
enableScoreStatisticsApi: import_koishi.Schema.boolean().default(true).description("\u5141\u8BB8\u8C03\u7528\u65E0\u9700\u8BA4\u8BC1\u7684\u7EDF\u8BA1/\u8C31\u9762\u5206\u6790\u63A5\u53E3"),
|
|
108
|
+
enableOnlineScoreApi: import_koishi.Schema.boolean().default(true).description("\u5141\u8BB8\u8C03\u7528\u9700\u8981\u7528\u6237\u8BA4\u8BC1\u7684\u5728\u7EBF\u67E5\u5206\u63A5\u53E3"),
|
|
109
|
+
themeMarketDownloadOrigin: import_koishi.Schema.string().default("https://lyh.org.cn:18473").description("\u4E3B\u9898\u5E02\u573A\u4E34\u65F6\u4E0B\u8F7D\u94FE\u63A5\u5141\u8BB8\u7684\u552F\u4E00\u6765\u6E90"),
|
|
110
|
+
debug: import_koishi.Schema.number().min(0).max(1).default(0).description("\u8F93\u51FA\u6D4B\u8BD5\u65E5\u5FD7"),
|
|
111
|
+
chartPath: import_koishi.Schema.string().description("\u8C31\u9762\u6587\u4EF6\u8DEF\u5F84\uFF08\u9009\u586B\uFF09"),
|
|
112
|
+
mutiNickWaitTimeOut: import_koishi.Schema.number().min(1).max(120).default(10).description("\u540C\u540D\u66F2\u76EE\u9009\u62E9\u7B49\u5F85\u65F6\u95F4\uFF08s\uFF09"),
|
|
113
|
+
otherinfo: import_koishi.Schema.union([
|
|
114
|
+
import_koishi.Schema.const(0).description("\u4EC5\u539F\u7248\u66F2\u5E93"),
|
|
115
|
+
import_koishi.Schema.const(1).description("\u539F\u7248 + \u81EA\u5B9A\u4E49"),
|
|
116
|
+
import_koishi.Schema.const(2).description("\u4EC5\u81EA\u5B9A\u4E49")
|
|
117
|
+
]).default(0).description("\u81EA\u5B9A\u4E49\u66F2\u5E93\u6A21\u5F0F")
|
|
118
|
+
}).description("\u7CFB\u7EDF\u8BBE\u7F6E"),
|
|
119
|
+
import_koishi.Schema.object({
|
|
120
|
+
LetterNum: import_koishi.Schema.number().min(1).max(99).default(8).description("\u5F00\u5B57\u6BCD\u6761\u6570"),
|
|
121
|
+
LetterMarkdown: import_koishi.Schema.boolean().default(true).description("\u5F00\u5B57\u6BCD\u4E0E\u4E3B\u9898\u5E02\u573A\u4F7F\u7528\u4EA4\u4E92\u5F0F Markdown"),
|
|
122
|
+
LetterIllustration: import_koishi.Schema.union([
|
|
123
|
+
import_koishi.Schema.const("\u539F\u7248").description("\u539F\u7248"),
|
|
124
|
+
import_koishi.Schema.const("\u6C34\u5370\u7248").description("\u6C34\u5370\u7248"),
|
|
125
|
+
import_koishi.Schema.const("\u4E0D\u53D1\u9001").description("\u4E0D\u53D1\u9001")
|
|
126
|
+
]).default("\u6C34\u5370\u7248").description("\u731C\u5BF9\u540E\u53D1\u9001\u7684\u66F2\u7ED8"),
|
|
127
|
+
LetterGuessCd: import_koishi.Schema.number().min(0).max(120).default(0).description("\u5F00\u5B57\u6BCD\u56DE\u7B54\u51B7\u5374\uFF08s\uFF09"),
|
|
128
|
+
LetterRevealCd: import_koishi.Schema.number().min(0).max(120).default(0).description("\u5F00\u5B57\u6BCD\u7FFB\u5F00\u51B7\u5374\uFF08s\uFF09"),
|
|
129
|
+
LetterTipCd: import_koishi.Schema.number().min(0).max(120).default(0).description("\u5F00\u5B57\u6BCD\u63D0\u793A\u51B7\u5374\uFF08s\uFF09"),
|
|
130
|
+
LetterTimeLength: import_koishi.Schema.number().min(10).max(36e4).default(300).description("\u5F00\u5B57\u6BCD\u6700\u957F\u65F6\u957F\uFF08s\uFF09")
|
|
131
|
+
}).description("\u5F00\u5B57\u6BCD\u8BBE\u7F6E"),
|
|
132
|
+
import_koishi.Schema.object({
|
|
133
|
+
GuessTipRecall: import_koishi.Schema.boolean().default(false).description("\u731C\u66F2\u7ED8\u4E0B\u4E00\u6761\u63D0\u793A\u53D1\u51FA\u65F6\u64A4\u56DE\u4E0A\u4E00\u6761"),
|
|
134
|
+
GuessTipCd: import_koishi.Schema.number().min(1).max(120).default(15).description("\u731C\u66F2\u7ED8\u63D0\u793A\u95F4\u9694\uFF08s\uFF09")
|
|
135
|
+
}).description("\u731C\u66F2\u7ED8\u8BBE\u7F6E"),
|
|
136
|
+
import_koishi.Schema.object({
|
|
137
|
+
GuessTipsTipCD: import_koishi.Schema.number().min(0).max(120).default(5).description("\u63D0\u793A\u731C\u6B4C\u63D0\u793A\u51B7\u5374\uFF08s\uFF09"),
|
|
138
|
+
GuessTipsTipNum: import_koishi.Schema.number().min(0).max(17).default(6).description("\u63D0\u793A\u731C\u6B4C\u63D0\u793A\u6761\u6570"),
|
|
139
|
+
GuessTipsTimeout: import_koishi.Schema.number().min(30).max(600).default(600).description("\u63D0\u793A\u731C\u6B4C\u6700\u957F\u65F6\u957F\uFF08s\uFF09"),
|
|
140
|
+
GuessTipsAnsTime: import_koishi.Schema.number().min(5).max(600).default(30).description("\u53D1\u9001\u66F2\u7ED8\u540E\u591A\u4E45\u516C\u5E03\u7B54\u6848\uFF08s\uFF09")
|
|
141
|
+
}).description("\u63D0\u793A\u731C\u6B4C\u8BBE\u7F6E"),
|
|
142
|
+
import_koishi.Schema.object({
|
|
143
|
+
VikaToken: import_koishi.Schema.string().role("secret").description("\u6BB5\u4F4D\u8BA4\u8BC1 Token\uFF08\u586B\u540E\u8BF7\u91CD\u8F7D\u63D2\u4EF6\uFF09")
|
|
144
|
+
}).description("\u5176\u4ED6\u8BBE\u7F6E")
|
|
145
|
+
]);
|
|
146
|
+
var logger = console;
|
|
147
|
+
async function loadEsm(file) {
|
|
148
|
+
return import((0, import_node_url.pathToFileURL)(file).href);
|
|
149
|
+
}
|
|
150
|
+
function pickCoreConfig(cfg) {
|
|
151
|
+
const out = {};
|
|
152
|
+
for (const [key, value] of Object.entries(cfg || {})) {
|
|
153
|
+
if (HOST_ONLY_KEYS.has(key) || RUNTIME_KEYS.has(key)) continue;
|
|
154
|
+
if (value === void 0 || value === null) continue;
|
|
155
|
+
out[key] = value === "false" ? false : value;
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
function prepareDataRoot(ctx) {
|
|
160
|
+
const pluginDataName = process.env.PHI_PLUGIN_KOISHI_DATA_NAME || displayName;
|
|
161
|
+
const koishiRoot = import_node_path.default.join(ctx.baseDir, "data", pluginDataName);
|
|
162
|
+
process.env.PHI_PLUGIN_KOISHI_ROOT = koishiRoot;
|
|
163
|
+
import_node_fs.default.mkdirSync(koishiRoot, { recursive: true });
|
|
164
|
+
const defaultDir = import_node_path.default.join(coreRoot, "config", "default_config");
|
|
165
|
+
const userConfigDir = import_node_path.default.join(koishiRoot, "config", "config");
|
|
166
|
+
import_node_fs.default.mkdirSync(userConfigDir, { recursive: true });
|
|
167
|
+
const defaultFiles = import_node_fs.default.readdirSync(defaultDir).filter((f) => f.endsWith(".yaml"));
|
|
168
|
+
for (const file of defaultFiles) {
|
|
169
|
+
const target = import_node_path.default.join(userConfigDir, file);
|
|
170
|
+
if (!import_node_fs.default.existsSync(target)) import_node_fs.default.copyFileSync(import_node_path.default.join(defaultDir, file), target);
|
|
171
|
+
}
|
|
172
|
+
return { koishiRoot, userConfigDir };
|
|
173
|
+
}
|
|
174
|
+
function syncCoreConfig(ctx, cfg) {
|
|
175
|
+
const { userConfigDir } = prepareDataRoot(ctx);
|
|
176
|
+
const cfgFile = import_node_path.default.join(userConfigDir, "config.yaml");
|
|
177
|
+
const defaults = import_yaml.default.parse(import_node_fs.default.readFileSync(import_node_path.default.join(coreRoot, "config", "default_config", "config.yaml"), "utf8")) || {};
|
|
178
|
+
let existing = {};
|
|
179
|
+
try {
|
|
180
|
+
existing = import_yaml.default.parse(import_node_fs.default.readFileSync(cfgFile, "utf8")) || {};
|
|
181
|
+
} catch {
|
|
182
|
+
existing = {};
|
|
183
|
+
}
|
|
184
|
+
const merged = {
|
|
185
|
+
...defaults,
|
|
186
|
+
...existing,
|
|
187
|
+
...pickCoreConfig(cfg)
|
|
188
|
+
};
|
|
189
|
+
import_node_fs.default.writeFileSync(cfgFile, import_yaml.default.stringify(merged), "utf8");
|
|
190
|
+
return cfgFile;
|
|
191
|
+
}
|
|
192
|
+
async function enrichSessionPermissions(ctx, e, session, cfg) {
|
|
193
|
+
const userId = String(e.user_id || e.userId || session?.userId || "");
|
|
194
|
+
let authority = Number(session?.user?.authority);
|
|
195
|
+
if (!Number.isFinite(authority) && ctx.database) {
|
|
196
|
+
try {
|
|
197
|
+
const user = await ctx.database.getUser(session.platform, session.userId);
|
|
198
|
+
authority = Number(user?.authority);
|
|
199
|
+
} catch {
|
|
200
|
+
authority = NaN;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
authority = Number.isFinite(authority) ? authority : 0;
|
|
204
|
+
const masterIds = new Set(String(cfg.master || "").split(",").map((x) => x.trim()).filter(Boolean));
|
|
205
|
+
const adminIds = new Set(String(cfg.admins || "").split(",").map((x) => x.trim()).filter(Boolean));
|
|
206
|
+
const masterAuthority = Number(cfg.masterAuthority ?? 4);
|
|
207
|
+
const adminAuthority = Number(cfg.adminAuthority ?? 3);
|
|
208
|
+
const isMaster = masterIds.has(userId) || authority >= masterAuthority;
|
|
209
|
+
const isAdmin = isMaster || adminIds.has(userId) || authority >= adminAuthority;
|
|
210
|
+
e.isMaster = isMaster;
|
|
211
|
+
e.isAdmin = isAdmin;
|
|
212
|
+
e.is_admin = isAdmin;
|
|
213
|
+
e.authority = authority;
|
|
214
|
+
e.member = {
|
|
215
|
+
...e.member || {},
|
|
216
|
+
is_admin: isAdmin
|
|
217
|
+
};
|
|
218
|
+
return e;
|
|
219
|
+
}
|
|
220
|
+
function registerApps(ctx, apps, adapter, cfg) {
|
|
221
|
+
const instances = [];
|
|
222
|
+
for (const App of Object.values(apps || {})) {
|
|
223
|
+
if (typeof App !== "function") continue;
|
|
224
|
+
try {
|
|
225
|
+
const instance = new App();
|
|
226
|
+
if (instance) instances.push(instance);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
logger.warn(`[${displayName}] \u5E94\u7528\u7C7B\u521D\u59CB\u5316\u5931\u8D25\uFF1A${App?.name || "anonymous"}`);
|
|
229
|
+
logger.warn(error);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
instances.sort((a, b) => Number(a.priority || 5e3) - Number(b.priority || 5e3));
|
|
233
|
+
ctx.middleware(async (session, next) => {
|
|
234
|
+
let e;
|
|
235
|
+
try {
|
|
236
|
+
e = adapter.fromSession(session);
|
|
237
|
+
} catch (error) {
|
|
238
|
+
logger.warn(`[${displayName}] Koishi \u4F1A\u8BDD\u5305\u88C5\u5931\u8D25\uFF1A`, error);
|
|
239
|
+
return next();
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
await enrichSessionPermissions(ctx, e, session, cfg);
|
|
243
|
+
} catch (error) {
|
|
244
|
+
logger.warn(`[${displayName}] \u4F1A\u8BDD\u6743\u9650\u83B7\u53D6\u5931\u8D25\uFF1A`, error);
|
|
245
|
+
}
|
|
246
|
+
for (const instance of instances) {
|
|
247
|
+
const context = instance.getKoishiContext?.(e);
|
|
248
|
+
if (!context) continue;
|
|
249
|
+
const handler = instance[context.name];
|
|
250
|
+
if (typeof handler !== "function") continue;
|
|
251
|
+
instance.e = e;
|
|
252
|
+
try {
|
|
253
|
+
const result = await handler.call(instance, e);
|
|
254
|
+
if (result !== false) return null;
|
|
255
|
+
} catch (error) {
|
|
256
|
+
logger.warn(`[${displayName}] \u4E0A\u4E0B\u6587\u5904\u7406\u5668 ${context.name} \u5F02\u5E38\uFF1A`, error);
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
for (const instance of instances) {
|
|
261
|
+
for (const rule of instance.rule || []) {
|
|
262
|
+
let reg = rule.reg;
|
|
263
|
+
if (!(reg instanceof RegExp)) {
|
|
264
|
+
try {
|
|
265
|
+
reg = new RegExp(reg);
|
|
266
|
+
} catch {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (!reg.test(e.msg || "")) continue;
|
|
271
|
+
const handler = instance[rule.fnc];
|
|
272
|
+
if (typeof handler !== "function") continue;
|
|
273
|
+
instance.e = e;
|
|
274
|
+
try {
|
|
275
|
+
const result = await handler.call(instance, e);
|
|
276
|
+
if (result !== false) return null;
|
|
277
|
+
} catch (error) {
|
|
278
|
+
logger.error(`[${displayName}] \u5904\u7406\u5668 ${rule.fnc} \u5F02\u5E38\uFF1A`, error);
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return next();
|
|
284
|
+
});
|
|
285
|
+
return instances;
|
|
286
|
+
}
|
|
287
|
+
function registerTasks(ctx, instances) {
|
|
288
|
+
for (const instance of instances) {
|
|
289
|
+
const task = instance.task;
|
|
290
|
+
if (!task || typeof task.fnc !== "function") continue;
|
|
291
|
+
const cron = String(task.cron || "");
|
|
292
|
+
const hourly = /(^|\s)0(\s|$)/.test(cron);
|
|
293
|
+
if (!hourly) {
|
|
294
|
+
logger.warn(`[${displayName}] \u6682\u4E0D\u652F\u6301 cron \u201C${cron}\u201D\uFF0C\u5DF2\u8DF3\u8FC7\u5B9A\u65F6\u4EFB\u52A1 ${task.name || ""}`);
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
logger.info(`[${displayName}] \u6CE8\u518C\u5B9A\u65F6\u4EFB\u52A1\uFF1A${task.name || cron}`);
|
|
298
|
+
let lastRunMinute = -1;
|
|
299
|
+
ctx.setInterval(() => {
|
|
300
|
+
const now = /* @__PURE__ */ new Date();
|
|
301
|
+
const minute = now.getHours() * 60 + now.getMinutes();
|
|
302
|
+
if (minute === lastRunMinute) return;
|
|
303
|
+
lastRunMinute = minute;
|
|
304
|
+
Promise.resolve(task.fnc.call(instance)).catch((error) => {
|
|
305
|
+
logger.error(`[${displayName}] \u5B9A\u65F6\u4EFB\u52A1 ${task.name || ""} \u5931\u8D25\uFF1A`, error);
|
|
306
|
+
});
|
|
307
|
+
}, 60 * 1e3);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
var name = displayName;
|
|
311
|
+
async function apply(ctx, cfg = {}) {
|
|
312
|
+
logger = ctx.logger(displayName);
|
|
313
|
+
syncCoreConfig(ctx, cfg || {});
|
|
314
|
+
const koishiAdapterModule = await loadEsm(import_node_path.default.join(coreRoot, "components", "platform", "koishi.js"));
|
|
315
|
+
let nodeRequire;
|
|
316
|
+
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
317
|
+
nodeRequire = (0, import_node_module.createRequire)(import_meta.url);
|
|
318
|
+
} else {
|
|
319
|
+
nodeRequire = (0, import_node_module.createRequire)(__filename);
|
|
320
|
+
}
|
|
321
|
+
let koishiVersion = "";
|
|
322
|
+
try {
|
|
323
|
+
koishiVersion = nodeRequire("koishi/package.json").version || "";
|
|
324
|
+
} catch {
|
|
325
|
+
koishiVersion = "";
|
|
326
|
+
}
|
|
327
|
+
let botConfig = {};
|
|
328
|
+
try {
|
|
329
|
+
botConfig = ctx.bots?.[0]?.config || ctx.config || {};
|
|
330
|
+
} catch {
|
|
331
|
+
botConfig = {};
|
|
332
|
+
}
|
|
333
|
+
const adapter = koishiAdapterModule.useKoishiAdapter(ctx, {
|
|
334
|
+
h: import_koishi.h,
|
|
335
|
+
database: true,
|
|
336
|
+
rootPath: ctx.baseDir,
|
|
337
|
+
botConfig,
|
|
338
|
+
packageVersion: koishiVersion || "koishi"
|
|
339
|
+
});
|
|
340
|
+
const coreIndex = await loadEsm(import_node_path.default.join(coreRoot, "index.js"));
|
|
341
|
+
const apps = coreIndex.apps || {};
|
|
342
|
+
const instances = registerApps(ctx, apps, adapter, cfg || {});
|
|
343
|
+
registerTasks(ctx, instances);
|
|
344
|
+
ctx.on("dispose", () => {
|
|
345
|
+
try {
|
|
346
|
+
delete process.env.PHI_PLUGIN_KOISHI_ROOT;
|
|
347
|
+
} catch {
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
logger.info(`${displayName} Koishi \u79FB\u690D\u7248\uFF08TS \u6E90\u7801\u5165\u53E3\uFF09\u52A0\u8F7D\u5B8C\u6210\uFF0C\u5171\u6CE8\u518C ${instances.length} \u4E2A\u529F\u80FD\u6A21\u5757`);
|
|
351
|
+
}
|
|
352
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
353
|
+
0 && (module.exports = {
|
|
354
|
+
Config,
|
|
355
|
+
apply,
|
|
356
|
+
inject,
|
|
357
|
+
name
|
|
358
|
+
});
|
package/lib/index.d.cts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as cosmokit from 'cosmokit';
|
|
2
|
+
import { Schema, Context } from 'koishi';
|
|
3
|
+
|
|
4
|
+
declare const inject: string[];
|
|
5
|
+
interface Config {
|
|
6
|
+
/** 视为 phi-plugin Bot 主人的用户 ID(通常无需填写) */
|
|
7
|
+
master?: string[];
|
|
8
|
+
/** 额外视为管理员(可执行 setnick / ban 等)的用户 ID */
|
|
9
|
+
admins?: string[];
|
|
10
|
+
/** 达到该 Koishi 权限等级即视为 phi-plugin 主人 */
|
|
11
|
+
masterAuthority?: number;
|
|
12
|
+
/** 达到该 Koishi 权限等级即视为管理员 */
|
|
13
|
+
adminAuthority?: number;
|
|
14
|
+
renderScale?: number;
|
|
15
|
+
randerQuality?: number;
|
|
16
|
+
timeout?: number;
|
|
17
|
+
waitingTimeout?: number;
|
|
18
|
+
renderNum?: number;
|
|
19
|
+
commentsAPage?: number;
|
|
20
|
+
B19MaxNum?: number;
|
|
21
|
+
HistoryDayNum?: number;
|
|
22
|
+
HistoryScoreNum?: number;
|
|
23
|
+
HistoryScoreDate?: number;
|
|
24
|
+
listScoreMaxNum?: number;
|
|
25
|
+
defaultGlobal?: boolean;
|
|
26
|
+
watchInfoPath?: boolean;
|
|
27
|
+
allowComment?: boolean;
|
|
28
|
+
allowChartTag?: boolean;
|
|
29
|
+
onLinePhiIllUrl?: 1 | 2 | 3 | 4;
|
|
30
|
+
downIllUrl?: string;
|
|
31
|
+
githubProxy?: string;
|
|
32
|
+
autoPullPhiIll?: boolean;
|
|
33
|
+
isGuild?: boolean;
|
|
34
|
+
WordB19Img?: boolean;
|
|
35
|
+
WordSuggImg?: boolean;
|
|
36
|
+
TapTapLoginQRcode?: boolean;
|
|
37
|
+
cmdhead?: string;
|
|
38
|
+
openPhiPluginApi?: boolean;
|
|
39
|
+
enableCustomThemeApi?: boolean;
|
|
40
|
+
enableScoreStatisticsApi?: boolean;
|
|
41
|
+
enableOnlineScoreApi?: boolean;
|
|
42
|
+
themeMarketDownloadOrigin?: string;
|
|
43
|
+
debug?: number;
|
|
44
|
+
chartPath?: string;
|
|
45
|
+
mutiNickWaitTimeOut?: number;
|
|
46
|
+
otherinfo?: 0 | 1 | 2;
|
|
47
|
+
LetterNum?: number;
|
|
48
|
+
LetterMarkdown?: boolean;
|
|
49
|
+
LetterIllustration?: '原版' | '水印版' | '不发送';
|
|
50
|
+
LetterGuessCd?: number;
|
|
51
|
+
LetterRevealCd?: number;
|
|
52
|
+
LetterTipCd?: number;
|
|
53
|
+
LetterTimeLength?: number;
|
|
54
|
+
GuessTipRecall?: boolean;
|
|
55
|
+
GuessTipCd?: number;
|
|
56
|
+
GuessTipsTipCD?: number;
|
|
57
|
+
GuessTipsTipNum?: number;
|
|
58
|
+
GuessTipsTimeout?: number;
|
|
59
|
+
GuessTipsAnsTime?: number;
|
|
60
|
+
VikaToken?: string;
|
|
61
|
+
}
|
|
62
|
+
declare const Config: Schema<Schemastery.ObjectS<{
|
|
63
|
+
master: Schema<string[], string[]>;
|
|
64
|
+
admins: Schema<string[], string[]>;
|
|
65
|
+
masterAuthority: Schema<number, number>;
|
|
66
|
+
adminAuthority: Schema<number, number>;
|
|
67
|
+
}> | Schemastery.ObjectS<{
|
|
68
|
+
renderScale: Schema<number, number>;
|
|
69
|
+
randerQuality: Schema<number, number>;
|
|
70
|
+
timeout: Schema<number, number>;
|
|
71
|
+
waitingTimeout: Schema<number, number>;
|
|
72
|
+
renderNum: Schema<number, number>;
|
|
73
|
+
commentsAPage: Schema<number, number>;
|
|
74
|
+
B19MaxNum: Schema<number, number>;
|
|
75
|
+
HistoryDayNum: Schema<number, number>;
|
|
76
|
+
HistoryScoreNum: Schema<number, number>;
|
|
77
|
+
HistoryScoreDate: Schema<number, number>;
|
|
78
|
+
listScoreMaxNum: Schema<number, number>;
|
|
79
|
+
}> | Schemastery.ObjectS<{
|
|
80
|
+
defaultGlobal: Schema<boolean, boolean>;
|
|
81
|
+
watchInfoPath: Schema<boolean, boolean>;
|
|
82
|
+
allowComment: Schema<boolean, boolean>;
|
|
83
|
+
allowChartTag: Schema<boolean, boolean>;
|
|
84
|
+
onLinePhiIllUrl: Schema<1 | 2 | 3 | 4, 1 | 2 | 3 | 4>;
|
|
85
|
+
downIllUrl: Schema<string, string>;
|
|
86
|
+
githubProxy: Schema<string, string>;
|
|
87
|
+
autoPullPhiIll: Schema<boolean, boolean>;
|
|
88
|
+
isGuild: Schema<boolean, boolean>;
|
|
89
|
+
WordB19Img: Schema<boolean, boolean>;
|
|
90
|
+
WordSuggImg: Schema<boolean, boolean>;
|
|
91
|
+
TapTapLoginQRcode: Schema<boolean, boolean>;
|
|
92
|
+
cmdhead: Schema<string, string>;
|
|
93
|
+
openPhiPluginApi: Schema<boolean, boolean>;
|
|
94
|
+
enableCustomThemeApi: Schema<boolean, boolean>;
|
|
95
|
+
enableScoreStatisticsApi: Schema<boolean, boolean>;
|
|
96
|
+
enableOnlineScoreApi: Schema<boolean, boolean>;
|
|
97
|
+
themeMarketDownloadOrigin: Schema<string, string>;
|
|
98
|
+
debug: Schema<number, number>;
|
|
99
|
+
chartPath: Schema<string, string>;
|
|
100
|
+
mutiNickWaitTimeOut: Schema<number, number>;
|
|
101
|
+
otherinfo: Schema<0 | 1 | 2, 0 | 1 | 2>;
|
|
102
|
+
}> | Schemastery.ObjectS<{
|
|
103
|
+
LetterNum: Schema<number, number>;
|
|
104
|
+
LetterMarkdown: Schema<boolean, boolean>;
|
|
105
|
+
LetterIllustration: Schema<"原版" | "水印版" | "不发送", "原版" | "水印版" | "不发送">;
|
|
106
|
+
LetterGuessCd: Schema<number, number>;
|
|
107
|
+
LetterRevealCd: Schema<number, number>;
|
|
108
|
+
LetterTipCd: Schema<number, number>;
|
|
109
|
+
LetterTimeLength: Schema<number, number>;
|
|
110
|
+
}> | Schemastery.ObjectS<{
|
|
111
|
+
GuessTipRecall: Schema<boolean, boolean>;
|
|
112
|
+
GuessTipCd: Schema<number, number>;
|
|
113
|
+
}> | Schemastery.ObjectS<{
|
|
114
|
+
GuessTipsTipCD: Schema<number, number>;
|
|
115
|
+
GuessTipsTipNum: Schema<number, number>;
|
|
116
|
+
GuessTipsTimeout: Schema<number, number>;
|
|
117
|
+
GuessTipsAnsTime: Schema<number, number>;
|
|
118
|
+
}> | Schemastery.ObjectS<{
|
|
119
|
+
VikaToken: Schema<string, string>;
|
|
120
|
+
}>, {
|
|
121
|
+
master: string[];
|
|
122
|
+
admins: string[];
|
|
123
|
+
masterAuthority: number;
|
|
124
|
+
adminAuthority: number;
|
|
125
|
+
} & cosmokit.Dict & {
|
|
126
|
+
renderScale: number;
|
|
127
|
+
randerQuality: number;
|
|
128
|
+
timeout: number;
|
|
129
|
+
waitingTimeout: number;
|
|
130
|
+
renderNum: number;
|
|
131
|
+
commentsAPage: number;
|
|
132
|
+
B19MaxNum: number;
|
|
133
|
+
HistoryDayNum: number;
|
|
134
|
+
HistoryScoreNum: number;
|
|
135
|
+
HistoryScoreDate: number;
|
|
136
|
+
listScoreMaxNum: number;
|
|
137
|
+
} & {
|
|
138
|
+
defaultGlobal: boolean;
|
|
139
|
+
watchInfoPath: boolean;
|
|
140
|
+
allowComment: boolean;
|
|
141
|
+
allowChartTag: boolean;
|
|
142
|
+
onLinePhiIllUrl: 1 | 2 | 3 | 4;
|
|
143
|
+
downIllUrl: string;
|
|
144
|
+
githubProxy: string;
|
|
145
|
+
autoPullPhiIll: boolean;
|
|
146
|
+
isGuild: boolean;
|
|
147
|
+
WordB19Img: boolean;
|
|
148
|
+
WordSuggImg: boolean;
|
|
149
|
+
TapTapLoginQRcode: boolean;
|
|
150
|
+
cmdhead: string;
|
|
151
|
+
openPhiPluginApi: boolean;
|
|
152
|
+
enableCustomThemeApi: boolean;
|
|
153
|
+
enableScoreStatisticsApi: boolean;
|
|
154
|
+
enableOnlineScoreApi: boolean;
|
|
155
|
+
themeMarketDownloadOrigin: string;
|
|
156
|
+
debug: number;
|
|
157
|
+
chartPath: string;
|
|
158
|
+
mutiNickWaitTimeOut: number;
|
|
159
|
+
otherinfo: 0 | 1 | 2;
|
|
160
|
+
} & {
|
|
161
|
+
LetterNum: number;
|
|
162
|
+
LetterMarkdown: boolean;
|
|
163
|
+
LetterIllustration: "原版" | "水印版" | "不发送";
|
|
164
|
+
LetterGuessCd: number;
|
|
165
|
+
LetterRevealCd: number;
|
|
166
|
+
LetterTipCd: number;
|
|
167
|
+
LetterTimeLength: number;
|
|
168
|
+
} & {
|
|
169
|
+
GuessTipRecall: boolean;
|
|
170
|
+
GuessTipCd: number;
|
|
171
|
+
} & {
|
|
172
|
+
GuessTipsTipCD: number;
|
|
173
|
+
GuessTipsTipNum: number;
|
|
174
|
+
GuessTipsTimeout: number;
|
|
175
|
+
GuessTipsAnsTime: number;
|
|
176
|
+
} & {
|
|
177
|
+
VikaToken: string;
|
|
178
|
+
}>;
|
|
179
|
+
declare const name = "phi-plugin";
|
|
180
|
+
declare function apply(ctx: Context, cfg?: Config): Promise<void>;
|
|
181
|
+
|
|
182
|
+
export { Config, apply, inject, name };
|