Miao-Yunzai/apps/event/outNotice.ts

31 lines
790 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-11 21:03:42 +08:00
tips = '退群了'
constructor() {
/**
name: '退群通知',
dsc: 'xx退群了',
*/
2024-06-12 22:36:39 +08:00
super()
this.event = 'notice.group.decrease'
2024-06-11 21:03:42 +08:00
}
/**
*
* @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
}
if (name) {
msg = `${name}(${this.e.user_id}) ${this.tips}`
} else {
msg = `${this.e.user_id} ${this.tips}`
}
logger.mark(`[退出通知]${this.e.logText} ${msg}`)
await this.reply(msg)
}
}