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": "听到账爽一下" }] }, {