From 34fc10543f0d00feeedf42b8809010793d2c2bf1 Mon Sep 17 00:00:00 2001 From: yeyang <746659424@qq.com> Date: Mon, 10 Oct 2022 13:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sing.js | 23 ++++++++++++++++++++--- config/system/help_system.js | 4 ++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/sing.js b/apps/sing.js index db2ada4..42d5c9f 100644 --- a/apps/sing.js +++ b/apps/sing.js @@ -6,9 +6,9 @@ export class example extends plugin { constructor() { super({ /** 功能名称 */ - name: '随机唱鸭', + name: '娱乐功能', /** 功能描述 */ - dsc: '随机唱鸭', + dsc: '娱乐', /** https://oicqjs.github.io/oicq/#events */ event: 'message', /** 优先级,数字越小等级越高 */ @@ -16,9 +16,15 @@ export class example extends plugin { rule: [ { /** 命令正则匹配 */ - reg: '^#?唱歌$', + reg: '^#唱歌$', /** 执行方法 */ fnc: 'Sing' + }, + { + /** 命令正则匹配 */ + reg: '^#支付宝到账.*$', + /** 执行方法 */ + fnc: 'ZFB' } ] }) @@ -48,4 +54,15 @@ export class example extends plugin { await e.reply(lyric) return true; } + + async ZFB(e) { + let amount = e.msg.replace(/#|支付宝到账/g, "").trim() + + if (!/^\d+(\.\d{1,2})?$/.test(amount)) return e.reply("你觉得这河里吗!!", true); + + if (!(0.01 <= amount && amount <= 999999999999.99)) { + return e.reply("数字大小超出限制,支持范围为0.01~999999999999.99") + } + e.reply([segment.record(`https://mm.cqu.cc/share/zhifubaodaozhang/mp3/${amount}.mp3`)]); + } } diff --git a/config/system/help_system.js b/config/system/help_system.js index b4e2d3d..1399f80 100644 --- a/config/system/help_system.js +++ b/config/system/help_system.js @@ -157,6 +157,10 @@ export const helpList = [{ "icon": 9, "title": "#收益曲线帮助", "desc": "=-=" + }, { + "icon": 15, + "title": "#支付宝到账<数字>", + "desc": "听到账爽一下" }] }, {