@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/core/apps/Dan.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// import plugin from '../../../lib/plugins/plugin.js'
|
|
2
|
+
// import Config from '../components/Config.js'
|
|
3
|
+
// import send from '../model/render/send.js'
|
|
4
|
+
// import get from '../model/getdata.js'
|
|
5
|
+
// import Vika from '../model/integrations/Vika.js'
|
|
6
|
+
// import { segment } from 'oicq'
|
|
7
|
+
// import getSave from '../model/save/getSave.js'
|
|
8
|
+
// import getBanGroup from '../model/user/getBanGroup.js';
|
|
9
|
+
|
|
10
|
+
// const read = 'https://www.bilibili.com/read/cv27354116'
|
|
11
|
+
// const sheet = 'https://f.kdocs.cn/g/fxsg4EM2/'
|
|
12
|
+
// const word = get.getimg('dan_code')
|
|
13
|
+
|
|
14
|
+
// const cancanneed = Vika.PhigrosDan ? true : false
|
|
15
|
+
|
|
16
|
+
// if (!cancanneed) {
|
|
17
|
+
// logger.info(`[Phi-Plugin]未填写 Vika Token ,将禁用段位认证。`)
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
// export class phiDan extends plugin {
|
|
21
|
+
// constructor() {
|
|
22
|
+
// super({
|
|
23
|
+
// name: 'phi-dan',
|
|
24
|
+
// dsc: 'phigros屁股肉段位',
|
|
25
|
+
// event: 'message',
|
|
26
|
+
// priority: 1000,
|
|
27
|
+
// rule: [
|
|
28
|
+
// {
|
|
29
|
+
// reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(Dan|dan)(\\s*)update$`,
|
|
30
|
+
// fnc: 'danupdate'
|
|
31
|
+
// },
|
|
32
|
+
// {
|
|
33
|
+
// reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(Dan|dan).*$`,
|
|
34
|
+
// fnc: 'dan'
|
|
35
|
+
// }
|
|
36
|
+
// ]
|
|
37
|
+
// })
|
|
38
|
+
|
|
39
|
+
// }
|
|
40
|
+
|
|
41
|
+
// async dan(e) {
|
|
42
|
+
// if (!cancanneed) {
|
|
43
|
+
// return false
|
|
44
|
+
// }
|
|
45
|
+
|
|
46
|
+
// if (await getBanGroup.get(e, 'dan')) {
|
|
47
|
+
// send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
|
|
48
|
+
// return false
|
|
49
|
+
// }
|
|
50
|
+
|
|
51
|
+
// let name = e.msg.replace(/[#/].*(dan|Dan)(\s*)/g, '')
|
|
52
|
+
// if (!name) {
|
|
53
|
+
// let dan = await getSave.getDan(e.user_id, true)
|
|
54
|
+
// if (dan[0]) {
|
|
55
|
+
// let resmsg = [`你的认证段位为`]
|
|
56
|
+
// for (let i in dan) {
|
|
57
|
+
// resmsg.push(`\n${dan[i].Dan.replace('/', ' ')} ${dan[i].EX ? 'EX' : ''}`)
|
|
58
|
+
// resmsg.push(segment.image(dan[i].img))
|
|
59
|
+
// }
|
|
60
|
+
// send.send_with_At(e, resmsg)
|
|
61
|
+
// } else {
|
|
62
|
+
// send.send_with_At(e, [`唔,本地没有你的认证记录哦!如果提交过审核的话,可以试试更新一下嗷!\n格式:/${Config.getUserCfg('config', 'cmdhead')} dan update`, word])
|
|
63
|
+
// }
|
|
64
|
+
|
|
65
|
+
// return true
|
|
66
|
+
|
|
67
|
+
// } else {
|
|
68
|
+
// try {
|
|
69
|
+
// let dan = await Vika.GetUserDanByName(name);
|
|
70
|
+
// if (!dan) {
|
|
71
|
+
// send.send_with_At(e, [`唔,暂时没有在审核通过列表里找到${name}哦!如果提交过审核的话,请耐心等待审核通过哦!`, word])
|
|
72
|
+
// return true
|
|
73
|
+
// }
|
|
74
|
+
// let resmsg = [`${name}的认证段位为`]
|
|
75
|
+
// for (let i in dan) {
|
|
76
|
+
// resmsg.push(`\n${dan[i].Dan.replace('/', ' ')} ${dan[i].EX ? 'EX' : ''}`)
|
|
77
|
+
// resmsg.push(segment.image(dan[i].img))
|
|
78
|
+
// }
|
|
79
|
+
// send.send_with_At(e, resmsg)
|
|
80
|
+
// return true
|
|
81
|
+
// } catch (err) {
|
|
82
|
+
// logger.info(err)
|
|
83
|
+
// send.send_with_At(e, `当前服务忙,请稍后重试QAQ!` + err)
|
|
84
|
+
// return true
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
// async danupdate(e) {
|
|
90
|
+
// if (!cancanneed) {
|
|
91
|
+
// return false
|
|
92
|
+
// }
|
|
93
|
+
|
|
94
|
+
// if (await getBanGroup.get(e, 'danupdate')) {
|
|
95
|
+
// send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
|
|
96
|
+
// return false
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
// /**检查是否绑定并提示 */
|
|
100
|
+
// let save = await send.getsave_result(e)
|
|
101
|
+
// if (!save) {
|
|
102
|
+
// return true
|
|
103
|
+
// }
|
|
104
|
+
// let dan = undefined
|
|
105
|
+
// try {
|
|
106
|
+
// dan = await Vika.GetUserDanBySstk(save.session);
|
|
107
|
+
// } catch (err) {
|
|
108
|
+
// logger.info(err)
|
|
109
|
+
// send.send_with_At(e, `当前服务忙,请稍后重试QAQ!` + err)
|
|
110
|
+
// return true
|
|
111
|
+
// }
|
|
112
|
+
|
|
113
|
+
// if (!dan) {
|
|
114
|
+
// send.send_with_At(e, [`唔,暂时没有在审核通过列表里找到你哦!如果提交过审核的话,请耐心等待审核通过哦!`, word])
|
|
115
|
+
// return true
|
|
116
|
+
// }
|
|
117
|
+
|
|
118
|
+
// history.dan = dan
|
|
119
|
+
|
|
120
|
+
// let resmsg = [`更新成功!你的认证段位为\n`]
|
|
121
|
+
// for (let i in dan) {
|
|
122
|
+
// resmsg.push(`${dan[i].Dan.replace('/', ' ')} ${dan[i].EX ? 'EX' : ''}`)
|
|
123
|
+
// resmsg.push(segment.image(dan[i].img))
|
|
124
|
+
// }
|
|
125
|
+
// send.send_with_At(e, resmsg)
|
|
126
|
+
// return true
|
|
127
|
+
// }
|
|
128
|
+
|
|
129
|
+
// }
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import Save from '../model/save/Save.js'
|
|
2
|
+
import fCompute from '../model/game/fCompute.js'
|
|
3
|
+
import getInfo from '../model/game/getInfo.js'
|
|
4
|
+
import getRksRank from '../model/game/getRksRank.js'
|
|
5
|
+
import getSave from '../model/save/getSave.js'
|
|
6
|
+
import send from '../model/render/send.js'
|
|
7
|
+
import picmodle from '../model/render/picmodle.js'
|
|
8
|
+
import Config from '../components/Config.js'
|
|
9
|
+
import getBanGroup from '../model/user/getBanGroup.js';
|
|
10
|
+
import makeRequest from '../model/api/makeRequest.js'
|
|
11
|
+
import saveHistory from '../model/save/saveHistory.js'
|
|
12
|
+
import phiPluginBase from '../components/baseClass.js'
|
|
13
|
+
import { canUseApi } from '../model/user/apiPermission.js';
|
|
14
|
+
import logger from '../components/Logger.js'
|
|
15
|
+
import platform from '../components/platform/index.js'
|
|
16
|
+
import { UserCredentials } from '../model/user/userCredentials.js'
|
|
17
|
+
|
|
18
|
+
/**@import {botEvent} from '../components/baseClass.js' */
|
|
19
|
+
|
|
20
|
+
export class phiRankList extends phiPluginBase {
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
super({
|
|
24
|
+
name: 'phi-rankList',
|
|
25
|
+
event: 'message',
|
|
26
|
+
priority: 1000,
|
|
27
|
+
dsc: 'phigros rks 排行榜',
|
|
28
|
+
rule: [
|
|
29
|
+
{
|
|
30
|
+
reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(排行榜|ranklist).*$`,
|
|
31
|
+
fnc: 'rankList'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(查询排名|rankfind).*$`,
|
|
35
|
+
fnc: 'rankfind'
|
|
36
|
+
}
|
|
37
|
+
// {
|
|
38
|
+
// reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(封神榜|godlist)$`,
|
|
39
|
+
// fnc: 'godList'
|
|
40
|
+
// }
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {botEvent} e
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
async rankList(e) {
|
|
52
|
+
|
|
53
|
+
if (await getBanGroup.get(e, 'rankList')) {
|
|
54
|
+
send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
|
|
55
|
+
return false
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if (await canUseApi(e)) {
|
|
61
|
+
const credentials = UserCredentials.fromEvent(e)
|
|
62
|
+
let data = {
|
|
63
|
+
Title: "RankingScore排行榜",
|
|
64
|
+
totDataNum: 0,
|
|
65
|
+
BotNick: platform.getBotNickname(e),
|
|
66
|
+
/** @type {rankingListObject[]} */
|
|
67
|
+
users: [],
|
|
68
|
+
me: {},
|
|
69
|
+
}
|
|
70
|
+
/**请求的排名 */
|
|
71
|
+
let msg = e.msg.match(/\d+/)
|
|
72
|
+
const api_ranklist = msg
|
|
73
|
+
? await makeRequest.getRanklistRank({ request_rank: Number(msg[0]) }, { event: e })
|
|
74
|
+
: await credentials.getRanklistUser()
|
|
75
|
+
if (api_ranklist) {
|
|
76
|
+
data.totDataNum = api_ranklist.totDataNum;
|
|
77
|
+
for (let item of api_ranklist.users) {
|
|
78
|
+
data.users.push({ ...await makeSmallLine(item), index: item.index, me: item.me })
|
|
79
|
+
}
|
|
80
|
+
data.me = await makeLargeLine(new Save(api_ranklist.me.save), new saveHistory(api_ranklist.me.history), e)
|
|
81
|
+
send.send_with_At(e, [await picmodle.common(e, 'rankingList', data), `总数据量:${data.totDataNum}\n`])
|
|
82
|
+
return true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
let data = {
|
|
86
|
+
Title: "RankingScore排行榜",
|
|
87
|
+
totDataNum: 0,
|
|
88
|
+
BotNick: platform.getBotNickname(e),
|
|
89
|
+
/** @type {rankingListObject[]} */
|
|
90
|
+
users: [],
|
|
91
|
+
me: {},
|
|
92
|
+
}
|
|
93
|
+
/**请求的排名 */
|
|
94
|
+
let msg = e.msg.match(/\d+/)
|
|
95
|
+
let rankNum = 0
|
|
96
|
+
data.totDataNum = await getRksRank.getAllRank()
|
|
97
|
+
|
|
98
|
+
if (msg) {
|
|
99
|
+
rankNum = Math.max(Math.min(Number(msg[0]), data.totDataNum), 1) - 1
|
|
100
|
+
} else {
|
|
101
|
+
let save = await send.getsave_result(e)
|
|
102
|
+
if (!save) {
|
|
103
|
+
return true
|
|
104
|
+
}
|
|
105
|
+
let sessionToken = save.getSessionToken()
|
|
106
|
+
rankNum = await getRksRank.getUserRank(sessionToken)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**展示的用户数据 */
|
|
110
|
+
let list = []
|
|
111
|
+
let myTk = ''
|
|
112
|
+
if (rankNum < 2) {
|
|
113
|
+
list = await getRksRank.getRankUser(0, 5)
|
|
114
|
+
myTk = list[rankNum]
|
|
115
|
+
} else {
|
|
116
|
+
list = await getRksRank.getRankUser(rankNum - 2, rankNum + 3)
|
|
117
|
+
myTk = list[2]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
for (let index = 0; index < Math.max(list.length, 5); index++) {
|
|
122
|
+
if (index >= list.length) {
|
|
123
|
+
data.users.push({ playerId: '无效用户', index: index + rankNum - 2 })
|
|
124
|
+
continue
|
|
125
|
+
}
|
|
126
|
+
let item = list[index]
|
|
127
|
+
let sessionToken = item
|
|
128
|
+
const save = await getSave.getSaveBySessionToken(sessionToken)
|
|
129
|
+
if (!save) {
|
|
130
|
+
data.users.push({ playerId: '无效用户', index: index + rankNum - 2 })
|
|
131
|
+
getRksRank.delUserRks(sessionToken)
|
|
132
|
+
} else {
|
|
133
|
+
data.users.push({ ...await makeSmallLine(save), index: Math.max(index + rankNum - 1, index + 1), me: myTk === save.getSessionToken() })
|
|
134
|
+
if (myTk === sessionToken) {
|
|
135
|
+
let history = await getSave.getHistoryBySessionToken(save.getSessionToken())
|
|
136
|
+
data.me = await makeLargeLine(save, history, e)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
send.send_with_At(e, [`总数据量:${data.totDataNum}\n`, await picmodle.common(e, 'rankingList', data)])
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @param {botEvent} e
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
async rankfind(e) {
|
|
150
|
+
if (await getBanGroup.get(e, 'rankList')) {
|
|
151
|
+
send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
|
|
152
|
+
return false
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
let rks = Number(e.msg.replace(/^[#/]?.*?rankfind/, '').match(/\d+(.\d+)?/)?.[0])
|
|
156
|
+
if (!rks) {
|
|
157
|
+
send.send_with_At(e, `请输入要查询的 rks!\n格式: /${Config.getUserCfg('config', 'cmdhead')} rankfind <rks>`)
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (await canUseApi(e, 'scoreStatistics')) {
|
|
162
|
+
const res = await makeRequest.getRanklistRks({ request_rks: rks }, { event: e })
|
|
163
|
+
if (res) {
|
|
164
|
+
send.send_with_At(e, `当前服务器记录中一共有 ${res.rksRank}/${res.totNum} 位玩家的 rks 大于 ${rks}!`)
|
|
165
|
+
return true
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
let totDataNum = await getRksRank.getAllRank()
|
|
170
|
+
|
|
171
|
+
let rank = await getRksRank.getRankByRks(rks)
|
|
172
|
+
|
|
173
|
+
send.send_with_At(e, `当前服务器记录中一共有 ${totDataNum - rank + 1}/${totDataNum} 位玩家的 rks 大于等于 ${rks}!`)
|
|
174
|
+
|
|
175
|
+
return true
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
// /**
|
|
180
|
+
// *
|
|
181
|
+
// * @param {botEvent} e
|
|
182
|
+
// * @returns
|
|
183
|
+
// */
|
|
184
|
+
// async godList(e) {
|
|
185
|
+
|
|
186
|
+
// if (await getBanGroup.get(e, 'godList')) {
|
|
187
|
+
// send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
|
|
188
|
+
// return false
|
|
189
|
+
// }
|
|
190
|
+
|
|
191
|
+
// let plugin_data = await getNotes.getPluginData(e.user_id)
|
|
192
|
+
// let data = {
|
|
193
|
+
// Title: "封神榜",
|
|
194
|
+
// totDataNum: 0,
|
|
195
|
+
// BotNick: Bot.nickname,
|
|
196
|
+
// users: [],
|
|
197
|
+
// background: getInfo.getill(getInfo.illlist[Number((Math.random() * (getInfo.illlist.length - 1)).toFixed(0))], 'blur'),
|
|
198
|
+
// theme: plugin_data?.plugin_data?.theme || 'star',
|
|
199
|
+
// }
|
|
200
|
+
|
|
201
|
+
// if (!list) {
|
|
202
|
+
// data.totDataNum = 0
|
|
203
|
+
// send.send_with_At(e, await picmodle.common(e, 'rankingList', data))
|
|
204
|
+
// return true
|
|
205
|
+
// }
|
|
206
|
+
|
|
207
|
+
// data.totDataNum = list.length
|
|
208
|
+
|
|
209
|
+
// for (let i = 0; i < list.length; i++) {
|
|
210
|
+
// try {
|
|
211
|
+
// let godRecord = new PhigrosUser(list[i].match(/[a-zA-Z0-9]{25}/)[0])
|
|
212
|
+
// await godRecord.buildRecord()
|
|
213
|
+
// let god = new Save(godRecord, true)
|
|
214
|
+
// await god.init()
|
|
215
|
+
// data.users.push(await makeLargeLine(god))
|
|
216
|
+
// data.users[data.users.length].index = i
|
|
217
|
+
// } catch (e) { }
|
|
218
|
+
// }
|
|
219
|
+
// send.send_with_At(e, await picmodle.common(e, 'rankingList', data))
|
|
220
|
+
// }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* 创建一个详细对象
|
|
225
|
+
* @param {Save} save
|
|
226
|
+
* @param {saveHistory} history
|
|
227
|
+
* @param {botEvent} e
|
|
228
|
+
*/
|
|
229
|
+
async function makeLargeLine(save, history, e) {
|
|
230
|
+
if (!save) {
|
|
231
|
+
return {
|
|
232
|
+
playerId: "无效用户"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
let lineData = history.getRksAndDataLine()
|
|
238
|
+
lineData.rks_date.forEach((item, index) => {
|
|
239
|
+
// @ts-ignore
|
|
240
|
+
item = fCompute.formatDateToNow(item)
|
|
241
|
+
lineData.rks_date[index] = item
|
|
242
|
+
});
|
|
243
|
+
/**
|
|
244
|
+
* @type {{ ChallengeMode: number; ChallengeModeRank: number; date: string; }[]}
|
|
245
|
+
*/
|
|
246
|
+
let clgHistory = []
|
|
247
|
+
history.challengeModeRank.forEach((item, index, array) => {
|
|
248
|
+
if (!index || item.value != array[index - 1].value) {
|
|
249
|
+
clgHistory.push({
|
|
250
|
+
ChallengeMode: Math.floor(item.value / 100),
|
|
251
|
+
ChallengeModeRank: item.value % 100,
|
|
252
|
+
date: fCompute.formatDateToNow(item.date)
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
let b30Data = await save.getB19(e, 33)
|
|
257
|
+
let b30list = {
|
|
258
|
+
P3: {
|
|
259
|
+
title: 'Perfect 3',
|
|
260
|
+
list: b30Data.phi
|
|
261
|
+
},
|
|
262
|
+
B3: {
|
|
263
|
+
title: 'Best 3',
|
|
264
|
+
list: b30Data.b19_list.slice(0, 3)
|
|
265
|
+
},
|
|
266
|
+
F3: {
|
|
267
|
+
title: 'Floor 3',
|
|
268
|
+
list: b30Data.b19_list.slice(24, 27)
|
|
269
|
+
},
|
|
270
|
+
L3: {
|
|
271
|
+
title: 'Overflow 3',
|
|
272
|
+
list: b30Data.b19_list.slice(27, 30)
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
backgroundurl: getInfo.getBackground(save?.gameuser?.background),
|
|
277
|
+
avatar: getInfo.idgetavatar(save.saveInfo.summary.avatar) || 'Introduction',
|
|
278
|
+
playerId: fCompute.convertRichText(save.saveInfo.PlayerId),
|
|
279
|
+
rks: save.saveInfo.summary.rankingScore || 0,
|
|
280
|
+
ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
|
|
281
|
+
ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
|
|
282
|
+
updated: fCompute.formatDate(save.saveInfo.modifiedAt.iso),
|
|
283
|
+
selfIntro: fCompute.convertRichText(save?.gameuser?.selfIntro),
|
|
284
|
+
rks_history: lineData.rks_history,
|
|
285
|
+
rks_range: lineData.rks_range,
|
|
286
|
+
rks_date: lineData.rks_date,
|
|
287
|
+
b30list: b30list,
|
|
288
|
+
clg_list: clgHistory,
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @typedef {Object} rankingListObject
|
|
294
|
+
* @property {string} playerId
|
|
295
|
+
* @property {string} [backgroundurl]
|
|
296
|
+
* @property {string} [avatar]
|
|
297
|
+
* @property {number} [rks]
|
|
298
|
+
* @property {number} [ChallengeMode]
|
|
299
|
+
* @property {number} [ChallengeModeRank]
|
|
300
|
+
* @property {boolean} [me]
|
|
301
|
+
* @property {number} index
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* 创建一个简略对象
|
|
306
|
+
* @param {Save | import('../model/api/makeRequest.js').UserItem} save
|
|
307
|
+
*/
|
|
308
|
+
async function makeSmallLine(save) {
|
|
309
|
+
if (!save) {
|
|
310
|
+
return {
|
|
311
|
+
playerId: "无效用户",
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
backgroundurl: getInfo.getBackground(save?.gameuser?.background),
|
|
316
|
+
avatar: getInfo.idgetavatar(save.saveInfo.summary.avatar || ''),
|
|
317
|
+
playerId: fCompute.convertRichText(save.saveInfo.PlayerId),
|
|
318
|
+
rks: save.saveInfo.summary.rankingScore,
|
|
319
|
+
ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
|
|
320
|
+
ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import Config from '../components/Config.js'
|
|
2
|
+
import phiPluginBase from '../components/baseClass.js'
|
|
3
|
+
import send from '../model/render/send.js'
|
|
4
|
+
import getInfo from '../model/game/getInfo.js'
|
|
5
|
+
import aliasProposalService from '../model/api/aliasProposalService.js'
|
|
6
|
+
import botSyncService from '../model/api/botSyncService.js'
|
|
7
|
+
|
|
8
|
+
/** @import {PlatformEvent} from '../components/platform/types.js' */
|
|
9
|
+
/** @import {AliasProposalRecord, AliasProposalStatus} from '../model/type/aliasProposal.js' */
|
|
10
|
+
|
|
11
|
+
const head = Config.getUserCfg('config', 'cmdhead')
|
|
12
|
+
const prefix = `^[#/](${head})(\\s*)(别名|alias)(\\s*)`
|
|
13
|
+
|
|
14
|
+
/** @returns {import('../components/platform/types.js').PlatformTask} */
|
|
15
|
+
export function createAliasProposalTask() {
|
|
16
|
+
return {
|
|
17
|
+
name: 'phi-Bot状态与正式别名同步',
|
|
18
|
+
fnc: async () => {
|
|
19
|
+
await botSyncService.scheduledTask()
|
|
20
|
+
await aliasProposalService.scheduledTask()
|
|
21
|
+
},
|
|
22
|
+
cron: '0 * * * * ?',
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @type {Record<AliasProposalStatus, string>} */
|
|
27
|
+
const statusName = {
|
|
28
|
+
submitted: '等待初审',
|
|
29
|
+
rejected_private: '私密拒绝',
|
|
30
|
+
public_review_requested: '已申请公审',
|
|
31
|
+
public_voting: '公开投票',
|
|
32
|
+
vote_passed: '投票通过待终审',
|
|
33
|
+
approved: '正式通过',
|
|
34
|
+
public_review_denied: '公审申请被拒',
|
|
35
|
+
rejected_final: '最终拒绝',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 按命令前缀和竖线分隔符解析用户输入。
|
|
40
|
+
* @param {string} message 原始消息文本
|
|
41
|
+
* @param {string} command 命令部分的正则表达式片段
|
|
42
|
+
* @returns {string[]} 去除首尾空白后的参数
|
|
43
|
+
*/
|
|
44
|
+
function splitArgs(message, command) {
|
|
45
|
+
return message
|
|
46
|
+
.replace(new RegExp(`${prefix}${command}\\s*`, 'i'), '')
|
|
47
|
+
.split('|')
|
|
48
|
+
.map(item => item.trim())
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 将提案列表格式化为适合 Bot 文本消息的紧凑内容。
|
|
53
|
+
* @param {AliasProposalRecord[]} items 提案列表
|
|
54
|
+
* @param {boolean} [includeVote=false] 是否展示票数和公开评审理由
|
|
55
|
+
* @returns {string} 可直接发送的消息文本
|
|
56
|
+
*/
|
|
57
|
+
function shortList(items, includeVote = false) {
|
|
58
|
+
if (!items.length) return '暂无相关别名提案。'
|
|
59
|
+
return items.slice(0, 15).map((item, index) => {
|
|
60
|
+
const vote = includeVote ? `|+${item.votesUp || 0}/-${item.votesDown || 0}` : ''
|
|
61
|
+
const reason = includeVote && item.publicReviewReason ? `\n理由:${item.publicReviewReason}` : ''
|
|
62
|
+
return `${index + 1}. ${item.alias} -> ${item.songId}\n${statusName[item.status] || item.status}${vote}${reason}\nID: ${item.id}`
|
|
63
|
+
}).join('\n\n')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class aliasProposal extends phiPluginBase {
|
|
67
|
+
/** 初始化命令规则、Bot心跳和正式别名同步任务。 */
|
|
68
|
+
constructor() {
|
|
69
|
+
super({
|
|
70
|
+
name: 'phi-别名提案',
|
|
71
|
+
dsc: 'Token 驱动的曲目别名提案与公投',
|
|
72
|
+
event: 'message',
|
|
73
|
+
priority: 1000,
|
|
74
|
+
task: createAliasProposalTask(),
|
|
75
|
+
rule: [
|
|
76
|
+
{ reg: `${prefix}(提案|submit)(\\s*).*$`, fnc: 'propose' },
|
|
77
|
+
{ reg: `${prefix}(我的|mine)$`, fnc: 'mine' },
|
|
78
|
+
{ reg: `${prefix}(公审|public)$`, fnc: 'publicList' },
|
|
79
|
+
{ reg: `${prefix}(申诉|appeal)(\\s*).*$`, fnc: 'appeal' },
|
|
80
|
+
{ reg: `${prefix}(投票|vote)(\\s*).*$`, fnc: 'vote' },
|
|
81
|
+
{ reg: `${prefix}(撤票|unvote)(\\s*).*$`, fnc: 'unvote' },
|
|
82
|
+
],
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 统一隐藏 API 错误细节,防止响应内容意外包含敏感信息。
|
|
88
|
+
* @template T
|
|
89
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
90
|
+
* @param {() => Promise<T>} operation 要执行的别名 API 操作
|
|
91
|
+
* @returns {Promise<T | null>} 成功结果;失败时已回复用户并返回 null
|
|
92
|
+
*/
|
|
93
|
+
async withFailureMessage(e, operation) {
|
|
94
|
+
try {
|
|
95
|
+
return await operation()
|
|
96
|
+
} catch (error) {
|
|
97
|
+
const message = error instanceof Error && error.message === '请先绑定 sessionToken。'
|
|
98
|
+
? error.message
|
|
99
|
+
: '别名服务暂时不可用,请稍后重试。'
|
|
100
|
+
send.send_with_At(e, message)
|
|
101
|
+
return null
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 私聊提交单曲别名提案。
|
|
107
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
108
|
+
* @returns {Promise<boolean>} 是否成功提交
|
|
109
|
+
*/
|
|
110
|
+
async propose(e) {
|
|
111
|
+
if (e.isGroup) {
|
|
112
|
+
send.send_with_At(e, '别名提案仅允许在私聊中提交。')
|
|
113
|
+
return false
|
|
114
|
+
}
|
|
115
|
+
const [songText, alias, note] = splitArgs(e.msg, '(提案|submit)')
|
|
116
|
+
if (!songText || !alias) {
|
|
117
|
+
send.send_with_At(e, `格式:/${head} alias submit 曲目 | 别名 | 私密备注(可选)`)
|
|
118
|
+
return false
|
|
119
|
+
}
|
|
120
|
+
if (alias.length > 64 || (note && note.length > 500)) {
|
|
121
|
+
send.send_with_At(e, '别名最多 64 字,备注最多 500 字。')
|
|
122
|
+
return false
|
|
123
|
+
}
|
|
124
|
+
const songIds = getInfo.fuzzysongsnick(songText, 0.85, true)
|
|
125
|
+
if (songIds.length !== 1) {
|
|
126
|
+
const candidates = songIds.slice(0, 8).map(id => `${getInfo.info(id, true)?.song || id} (${id})`).join('\n')
|
|
127
|
+
send.send_with_At(e, songIds.length ? `曲目不唯一,请使用更精确的名称:\n${candidates}` : '未找到对应曲目。')
|
|
128
|
+
return false
|
|
129
|
+
}
|
|
130
|
+
const proposal = await this.withFailureMessage(e, () => aliasProposalService.create(e, {
|
|
131
|
+
songId: songIds[0], alias, note,
|
|
132
|
+
}))
|
|
133
|
+
if (proposal) send.send_with_At(e, `提案已提交。\n${proposal.alias} -> ${proposal.songId}\nID: ${proposal.id}`)
|
|
134
|
+
return Boolean(proposal)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 查询当前 token 用户的提案。
|
|
139
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
140
|
+
* @returns {Promise<boolean>} 是否成功取得列表
|
|
141
|
+
*/
|
|
142
|
+
async mine(e) {
|
|
143
|
+
const items = await this.withFailureMessage(e, () => aliasProposalService.mine(e))
|
|
144
|
+
if (items) send.send_with_At(e, shortList(items))
|
|
145
|
+
return Boolean(items)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 查询正在公开投票的提案。
|
|
150
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
151
|
+
* @returns {Promise<boolean>} 是否成功取得列表
|
|
152
|
+
*/
|
|
153
|
+
async publicList(e) {
|
|
154
|
+
const items = await this.withFailureMessage(e, () => aliasProposalService.publicList(e))
|
|
155
|
+
if (items) send.send_with_At(e, shortList(items, true))
|
|
156
|
+
return Boolean(items)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 私聊为一次私密拒绝申请公开评审。
|
|
161
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
162
|
+
* @returns {Promise<boolean>} 是否成功提交申请
|
|
163
|
+
*/
|
|
164
|
+
async appeal(e) {
|
|
165
|
+
if (e.isGroup) {
|
|
166
|
+
send.send_with_At(e, '公审申请仅允许在私聊中提交。')
|
|
167
|
+
return false
|
|
168
|
+
}
|
|
169
|
+
const [proposalId, reason] = splitArgs(e.msg, '(申诉|appeal)')
|
|
170
|
+
if (!proposalId || !reason) {
|
|
171
|
+
send.send_with_At(e, `格式:/${head} alias appeal 提案ID | 10-500字理由`)
|
|
172
|
+
return false
|
|
173
|
+
}
|
|
174
|
+
if (reason.length < 10 || reason.length > 500) {
|
|
175
|
+
send.send_with_At(e, '公审理由必须为 10-500 字。')
|
|
176
|
+
return false
|
|
177
|
+
}
|
|
178
|
+
const proposal = await this.withFailureMessage(e, () => aliasProposalService.requestPublicReview(e, proposalId, reason))
|
|
179
|
+
if (proposal) send.send_with_At(e, `公审申请已提交。\nID: ${proposal.id}`)
|
|
180
|
+
return Boolean(proposal)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 设置或修改当前用户的公开投票。
|
|
185
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
186
|
+
* @returns {Promise<boolean>} 是否成功记录投票
|
|
187
|
+
*/
|
|
188
|
+
async vote(e) {
|
|
189
|
+
const args = e.msg.replace(new RegExp(`${prefix}(投票|vote)\\s*`, 'i'), '').trim().split(/\s+/)
|
|
190
|
+
const proposalId = args[0]
|
|
191
|
+
const choice = String(args[1] || '').toLowerCase()
|
|
192
|
+
/** @type {1 | -1 | null} */
|
|
193
|
+
const value = ['赞成', 'yes', '1', '+'].includes(choice) ? 1 : ['反对', 'no', '-1', '-'].includes(choice) ? -1 : null
|
|
194
|
+
if (!proposalId || value === null) {
|
|
195
|
+
send.send_with_At(e, `格式:/${head} alias vote 提案ID 赞成|反对`)
|
|
196
|
+
return false
|
|
197
|
+
}
|
|
198
|
+
const proposal = await this.withFailureMessage(e, () => aliasProposalService.vote(e, proposalId, value))
|
|
199
|
+
if (proposal) send.send_with_At(e, `投票已记录:${value === 1 ? '赞成' : '反对'}。`)
|
|
200
|
+
return Boolean(proposal)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 撤回当前用户对指定提案的投票。
|
|
205
|
+
* @param {PlatformEvent} e 当前消息事件
|
|
206
|
+
* @returns {Promise<boolean>} 是否成功撤票
|
|
207
|
+
*/
|
|
208
|
+
async unvote(e) {
|
|
209
|
+
const proposalId = e.msg.replace(new RegExp(`${prefix}(撤票|unvote)\\s*`, 'i'), '').trim()
|
|
210
|
+
if (!proposalId) {
|
|
211
|
+
send.send_with_At(e, `格式:/${head} alias unvote 提案ID`)
|
|
212
|
+
return false
|
|
213
|
+
}
|
|
214
|
+
const proposal = await this.withFailureMessage(e, () => aliasProposalService.vote(e, proposalId, 0))
|
|
215
|
+
if (proposal) send.send_with_At(e, '投票已撤回。')
|
|
216
|
+
return Boolean(proposal)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** @returns {Promise<void>} 完成一次通知轮询和到期快照同步 */
|
|
220
|
+
async aliasScheduledTask() {
|
|
221
|
+
await aliasProposalService.scheduledTask()
|
|
222
|
+
}
|
|
223
|
+
}
|