Miao-Yunzai/apps/event/outNotice.ts

32 lines
709 B
TypeScript
Raw Normal View History

2024-06-12 10:47:19 +08:00
import { Plugin } from 'yunzai/core'
export class outNotice extends Plugin {
2024-06-17 22:52:15 +08:00
tips = '退群了'
constructor() {
/**
2024-06-11 21:03:42 +08:00
name: '退群通知',
dsc: 'xx退群了',
*/
2024-06-17 22:52:15 +08:00
super()
this.event = 'notice.group.decrease'
}
/**
*
* @returns
*/
async accept() {
if (this.e.user_id == this.e.bot.uin) return
let name = null,
msg = null
if (this.e.member) {
name = this.e.member.card || this.e.member.nickname
2024-06-11 21:03:42 +08:00
}
2024-06-17 22:52:15 +08:00
if (name) {
msg = `${name}(${this.e.user_id}) ${this.tips}`
} else {
msg = `${this.e.user_id} ${this.tips}`
2024-06-11 21:03:42 +08:00
}
2024-06-17 22:52:15 +08:00
logger.mark(`[退出通知]${this.e.logText} ${msg}`)
await this.reply(msg)
}
2024-06-11 21:03:42 +08:00
}