Skip to content

Commit

Permalink
feat:新增视频类,继续优化正则
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhan258 committed Jul 4, 2023
1 parent 950cec6 commit f3c7a68
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 21 deletions.
6 changes: 3 additions & 3 deletions apps/diaotu.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export class diaotu extends plugin {
fnc: 'diaotu'
},
{
reg: '^#?原神(,|,)启动(!|!)',
reg: '^#?原神(,|,)启动(!|!)$',
fnc: 'ysqd'
},
{
reg: '^#?(坤坤|小黑子|鸡|cxk|鸡脚)',
reg: '^#?(坤坤|小黑子|鸡|cxk|鸡脚|鸽鸽|哥哥)$',
fnc: 'cxk'
},
{
reg: '^#?随机表情',
reg: '^#?随机表情$',
fnc: 'sjbq'
}
]
Expand Down
4 changes: 2 additions & 2 deletions apps/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export class help extends plugin {
rule: [
{
/** 命令正则匹配 */
reg: '#(nav|憨憨帮助)',
reg: '#?(nav|憨憨帮助)$',
/** 执行方法 */
fnc: 'hanhanHelp'
},
{
/** 命令正则匹配 */
reg: '^#搜一搜帮助$',
reg: '^#?搜一搜帮助$',
/** 执行方法 */
fnc: 'so_help'
}
Expand Down
2 changes: 1 addition & 1 deletion apps/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class manage extends plugin {
priority: 6,
rule: [
{
reg: '^#憨憨设置(Ping|ping)(Token|token)',
reg: '^#憨憨设置(Ping|ping)(Token|token)$',
fnc: 'setPingToken'
},
{
Expand Down
51 changes: 43 additions & 8 deletions apps/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,91 @@ export class text extends plugin {
},
{
/** 命令正则匹配 */
reg: '^#?今天是几号',
reg: '^#?今天是几号$',
/** 执行方法 */
fnc: 'today'
},
{
/** 命令正则匹配 */
reg: '^#?历史上的今天',
reg: '^#?历史上的今天$',
/** 执行方法 */
fnc: 'history'
},
{
/** 命令正则匹配 */
reg: '^#?人生倒计时',
reg: '^#?人生倒计时$',
/** 执行方法 */
fnc: 'rsdjs'
},
{
/** 命令正则匹配 */
reg: '^#?随机日记',
reg: '^#?随机日记$',
/** 执行方法 */
fnc: 'sjrj'
},
{
/** 命令正则匹配 */
reg: '^#?舔狗日记',
reg: '^#?舔狗日记$',
/** 执行方法 */
fnc: 'tgrj'
},
{
/** 命令正则匹配 */
reg: '^#?新春祝福',
reg: '^#?新春祝福$',
/** 执行方法 */
fnc: 'newyear'
},
{
/** 命令正则匹配 */
reg: '^#?(污污|污句子)',
reg: '^#?(污污|污句子)$',
/** 执行方法 */
fnc: 'wjz'
},
{
/** 命令正则匹配 */
reg: '^#?网易云热评',
reg: '^#?网易云热评$',
/** 执行方法 */
fnc: 'wyyrp'
},
{
/** 命令正则匹配 */
reg: '^#?油价',
/** 执行方法 */
fnc: 'yjcx'
}
]
})
}

// 油价查询
async yjcx (e) {
let sendmsg = []
let encode = e.msg.replace(/^#?/, '').trim()
let shengfen = ['北京', '上海', '江苏', '天津', '重庆', '江西', '辽宁', '安徽', '内蒙古', '福建',
'宁夏', '甘肃', '青海', '广东', '山东', '广西', '山西', '贵州', '陕西', '海南', '四川', '河北',
'西藏', '河南', '新疆', '黑龙江', '吉林', '云南', '湖北', '浙江', '湖南']
let result = shengfen.includes(encode)
if (!result) {
await this.reply('只支持省份查询哦')
return
}
console.log(encode)
let url = `https://api.qqsuu.cn/api/dm-oilprice?prov=${encode}`
let response = await axios.get(url) // 调用接口获取数据
if (response.data.code == 200) {
sendmsg.push('省份:', response.data.data.prov, '\n')
sendmsg.push('0号:', response.data.data.p0, '\n')
sendmsg.push('89号:', response.data.data.p89, '\n')
sendmsg.push('92号:', response.data.data.p92, '\n')
sendmsg.push('95号:', response.data.data.p95, '\n')
sendmsg.push('98号:', response.data.data.p98, '\n')
sendmsg.push(response.data.data.time)
await this.reply(sendmsg)
} else {
await this.reply('查询失败,可能接口失效力~,请联系憨憨捏~')
}
}

// 网易云热评
async wyyrp (e) {
let resp = await fetch('https://api.f4team.cn/API/wyrp/api.php?type=text')
Expand Down
2 changes: 1 addition & 1 deletion apps/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class Update extends plugin {
await this.reply(
msg +
`最新的大脑和现在的憨憨大脑打架啦~:\n${errMsg}\n` +
'你肯定是偷偷动了憨憨的大脑!请执行#强制更新,放弃本地修改'
'你肯定是偷偷动了憨憨的大脑!请执行#憨憨强制更新,放弃本地修改'
)
return
}
Expand Down
118 changes: 118 additions & 0 deletions apps/video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import plugin from '../../../lib/plugins/plugin.js'
import { segment } from 'oicq'
import fetch from 'node-fetch'

export class voice extends plugin {
constructor () {
super({
/** 功能名称 */
name: '憨憨视频类',
/** 功能描述 */
dsc: '憨憨视频类',
/** https://oicqjs.github.io/oicq/#events */
event: 'message',
/** 优先级,数字越小等级越高 */
priority: 6,
rule: [
{
/** 命令正则匹配 */
reg: '^#?抖音变装$',
/** 执行方法 */
fnc: 'dybz'
},
{
/** 命令正则匹配 */
reg: '^#?随机裙子$',
/** 执行方法 */
fnc: 'sjqz'
},
{
/** 命令正则匹配 */
reg: '^#?甜妹$',
/** 执行方法 */
fnc: 'tm'
},
{
/** 命令正则匹配 */
reg: '^#?随机小姐姐$',
/** 执行方法 */
fnc: 'sjxjj'
},
{
/** 命令正则匹配 */
reg: '^#?双倍快乐$',
/** 执行方法 */
fnc: 'sbkl'
},
{
/** 命令正则匹配 */
reg: '^#?(萝莉|loli)$',
/** 执行方法 */
fnc: 'loli'
},
{
/** 命令正则匹配 */
reg: '^#?玉足$',
/** 执行方法 */
fnc: 'yz'
}
]
})
}

// 抖音变装
async dybz (e) {
let urls = 'http://api.yujn.cn/api/bianzhuang.php'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 随机裙子
async sjqz (e) {
let urls = 'http://api.yujn.cn/api/jksp.php?type=video'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 甜妹
async tm (e) {
let urls = 'http://api.yujn.cn/api/tianmei.php?type=video'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 随机小姐姐
async sjxjj (e) {
let urls = 'http://api.yujn.cn/api/xjj.php?'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 双倍快乐
async sbkl (e) {
let urls = 'http://api.yujn.cn/api/sbkl.php?type=video'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 萝莉
async loli (e) {
let urls = 'http://api.yujn.cn/api/luoli.php?type=video'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}

// 玉足
async yz (e) {
let urls = 'http://api.yujn.cn/api/yuzu.php?type=video'
let resp = await fetch(urls)
console.log(resp.url)
await e.reply(segment.video(resp.url))
}
}
56 changes: 50 additions & 6 deletions resources/help/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ <h1 style="text-align: center; font-size: 36px; margin-top: 20px;">憨憨帮助<
历史上的今天
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
油价+省份
</div>
<div class="general-inner-block-title">
只支持省份查询
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
兽语加密+内容
Expand Down Expand Up @@ -180,12 +188,7 @@ <h1 style="text-align: center; font-size: 36px; margin-top: 20px;">憨憨帮助<
<div class="general-inner-block-value">
转两层二维码
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
随机acg
</div>
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
随机东方
Expand Down Expand Up @@ -270,6 +273,47 @@ <h1 style="text-align: center; font-size: 36px; margin-top: 20px;">憨憨帮助<
小姐姐
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
loli
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
甜妹
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
随机小姐姐
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
双倍快乐
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
随机acg
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
玉足
</div>
<div class="general-inner-block-title">
玉足、美腿
</div>
</div>
<div class="general-inner-block">
<div class="general-inner-block-value">
随机裙子
</div>
<div class="general-inner-block-title">
JK、洛丽塔
</div>
</div>
</div>
</div>
<div class="general">
Expand Down

0 comments on commit f3c7a68

Please sign in to comment.