Miao-Yunzai/apps/outNotice.ts

32 lines
797 B
TypeScript
Raw Normal View History

2024-06-11 21:03:42 +08:00
import { plugin } from '#miao/core'
export class outNotice extends plugin {
tips = '退群了'
constructor() {
/**
name: '退群通知',
dsc: 'xx退群了',
*/
super({
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
}
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)
}
}