update: 修改
This commit is contained in:
parent
56f6d5a180
commit
2a66b09158
44
apps/add.ts
44
apps/add.ts
|
@ -12,22 +12,9 @@ import { makeForwardMsg } from 'yunzai/core'
|
|||
const textArr = {}
|
||||
|
||||
export class add extends Plugin {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
path = './data/textJson/'
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
facePath = './data/face/'
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
isGlobal = false
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -36,14 +23,8 @@ export class add extends Plugin {
|
|||
name: '添加表情',
|
||||
dsc: '添加表情,文字等',
|
||||
*/
|
||||
super({
|
||||
event: 'message',
|
||||
priority: 50000,
|
||||
});
|
||||
|
||||
/**
|
||||
* rule
|
||||
*/
|
||||
super();
|
||||
this.priority = 50000
|
||||
this.rule = [
|
||||
{
|
||||
reg: '^#(全局)?添加(.*)',
|
||||
|
@ -70,6 +51,17 @@ export class add extends Plugin {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async accept() {
|
||||
/** 处理消息 */
|
||||
if (this.e.atBot && this.e.msg && this.e?.msg.includes('添加') && !this.e?.msg.includes('#')) {
|
||||
this.e.msg = '#' + this.e.msg
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -82,16 +74,6 @@ export class add extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async accept() {
|
||||
/** 处理消息 */
|
||||
if (this.e.atBot && this.e.msg && this.e?.msg.includes('添加') && !this.e?.msg.includes('#')) {
|
||||
this.e.msg = '#' + this.e.msg
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
|
||||
import { ConfigController as cfg } from 'yunzai/config'
|
||||
import { Plugin } from 'yunzai/core'
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class disFriPoke extends Plugin {
|
||||
constructor() {
|
||||
/**
|
||||
name: '禁止私聊',
|
||||
dsc: '对私聊禁用做处理当开启私聊禁用时只接收cookie以及抽卡链接',
|
||||
*/
|
||||
super({
|
||||
event: 'notice.friend.poke'
|
||||
})
|
||||
super()
|
||||
this.event = 'notice.friend.poke'
|
||||
this.priority = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* default
|
||||
* @returns
|
||||
*/
|
||||
async accept() {
|
||||
if (!cfg.other?.disablePrivate) return
|
||||
|
||||
if (this.e.isMaster) return
|
||||
|
||||
this.e.reply(cfg.other.disableMsg)
|
||||
return 'return'
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,12 +13,8 @@ export class disPri extends Plugin {
|
|||
name: '禁止私聊',
|
||||
dsc: '对私聊禁用做处理当开启私聊禁用时只接收cookie以及抽卡链接',
|
||||
*/
|
||||
super({
|
||||
event: 'message.private'
|
||||
})
|
||||
/**
|
||||
*
|
||||
*/
|
||||
super()
|
||||
this.event = 'message.private'
|
||||
this.priority = 0
|
||||
}
|
||||
|
||||
|
|
|
@ -8,16 +8,14 @@ export class example2 extends Plugin {
|
|||
name: '复读',
|
||||
dsc: '复读用户发送的内容,然后撤回',
|
||||
*/
|
||||
super({
|
||||
event: 'message',
|
||||
priority: 5000,
|
||||
rule: [
|
||||
{
|
||||
reg: '^#复读$',
|
||||
fnc: 'repeat'
|
||||
}
|
||||
]
|
||||
})
|
||||
super()
|
||||
this.priority = 5000
|
||||
this.rule = [
|
||||
{
|
||||
reg: '^#复读$',
|
||||
fnc: this.repeat.name
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -15,9 +15,8 @@ export class friend extends Plugin {
|
|||
name: 'autoFriend',
|
||||
dsc: '自动同意好友',
|
||||
*/
|
||||
super({
|
||||
event: 'request.friend'
|
||||
})
|
||||
super()
|
||||
this.event = 'request.friend'
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -14,9 +14,8 @@ export class invite extends Plugin {
|
|||
name: 'invite',
|
||||
dsc: '主人邀请自动进群',
|
||||
*/
|
||||
super({
|
||||
event: 'request.group.invite'
|
||||
})
|
||||
super()
|
||||
this.event = 'request.group.invite'
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -11,10 +11,9 @@ export class newcomer extends Plugin {
|
|||
name: '欢迎新人',
|
||||
dsc: '新人入群欢迎',
|
||||
*/
|
||||
super({
|
||||
event: 'notice.group.increase',
|
||||
priority: 5000,
|
||||
})
|
||||
super()
|
||||
this.event = 'notice.group.increase'
|
||||
this.priority = 5000
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,9 +6,8 @@ export class outNotice extends Plugin {
|
|||
name: '退群通知',
|
||||
dsc: 'xx退群了',
|
||||
*/
|
||||
super({
|
||||
event: 'notice.group.decrease'
|
||||
})
|
||||
super()
|
||||
this.event = 'notice.group.decrease'
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -12,9 +12,8 @@ export class quit extends Plugin {
|
|||
name: 'notice',
|
||||
dsc: '自动退群',
|
||||
*/
|
||||
super({
|
||||
event: 'notice.group.increase'
|
||||
})
|
||||
super()
|
||||
this.event = 'notice.group.increase'
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -34,21 +34,20 @@ export class Restart extends Plugin {
|
|||
name: '重启',
|
||||
dsc: '#重启',
|
||||
*/
|
||||
super({
|
||||
event: 'message',
|
||||
priority: 10,
|
||||
rule: [{
|
||||
super()
|
||||
this.priority = 10
|
||||
this.rule = [
|
||||
{
|
||||
reg: '^#重启$',
|
||||
fnc: 'restart',
|
||||
fnc: this.restart.name,
|
||||
permission: 'master'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
reg: '^#(停机|关机)$',
|
||||
fnc: 'stop',
|
||||
fnc: this.stop.name,
|
||||
permission: 'master'
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async init() {
|
||||
|
|
|
@ -16,18 +16,15 @@ export class sendLog extends Plugin {
|
|||
/**
|
||||
name: "发送日志",
|
||||
dsc: "发送最近100条运行日志",
|
||||
*
|
||||
*/
|
||||
super({
|
||||
event: "message",
|
||||
rule: [
|
||||
{
|
||||
reg: "^#(运行|错误)*日志[0-9]*(.*)",
|
||||
fnc: "sendLog",
|
||||
permission: "master"
|
||||
}
|
||||
]
|
||||
})
|
||||
super()
|
||||
this.rule = [
|
||||
{
|
||||
reg: "^#(运行|错误)*日志[0-9]*(.*)",
|
||||
fnc: this.sendLog.name,
|
||||
permission: "master"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,15 +11,13 @@ export class status extends Plugin {
|
|||
dsc: '#状态',
|
||||
*/
|
||||
constructor() {
|
||||
super({
|
||||
event: 'message',
|
||||
rule: [
|
||||
{
|
||||
reg: '^#状态$',
|
||||
fnc: 'status'
|
||||
}
|
||||
]
|
||||
})
|
||||
super()
|
||||
this.rule = [
|
||||
{
|
||||
reg: '^#状态$',
|
||||
fnc: this.status.name
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,7 +67,7 @@ export class status extends Plugin {
|
|||
await this.reply(msg)
|
||||
}
|
||||
|
||||
async getCount(groupId = '') {
|
||||
async getCount(groupId:number | string = '') {
|
||||
this.date = moment().format('MMDD')
|
||||
this.month = Number(moment().month()) + 1
|
||||
|
||||
|
|
|
@ -12,32 +12,28 @@ let uping = false
|
|||
export class update extends Plugin {
|
||||
typeName = BOT_NAME
|
||||
messages = []
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
name: '更新',
|
||||
dsc: '#更新 #强制更新',
|
||||
*/
|
||||
super({
|
||||
event: 'message',
|
||||
priority: 4000,
|
||||
rule: [
|
||||
{
|
||||
reg: '^#更新日志',
|
||||
fnc: 'updateLog'
|
||||
},
|
||||
{
|
||||
reg: '^#(强制)?更新',
|
||||
fnc: 'update'
|
||||
},
|
||||
{
|
||||
reg: '^#(静默)?全部(强制)?更新$',
|
||||
fnc: 'updateAll',
|
||||
permission: 'master'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
super()
|
||||
this.priority = 4000
|
||||
this.rule = [
|
||||
{
|
||||
reg: '^#更新日志',
|
||||
fnc: this.updateLog.name
|
||||
},
|
||||
{
|
||||
reg: '^#(强制)?更新',
|
||||
fnc: this.update.name
|
||||
},
|
||||
{
|
||||
reg: '^#(静默)?全部(强制)?更新$',
|
||||
fnc: this.updateAll.name,
|
||||
permission: 'master'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async update() {
|
||||
|
|
Loading…
Reference in New Issue