Miao-Yunzai/plugins/system/invite.js

24 lines
665 B
JavaScript
Raw Normal View History

2023-03-04 14:30:13 +08:00
import cfg from '../../lib/config/config.js'
export class invite extends plugin {
constructor () {
super({
name: 'invite',
dsc: '主人邀请自动进群',
event: 'request.group.invite'
})
}
async accept () {
if (!cfg.masterQQ || !cfg.masterQQ.includes(Number(this.e.user_id))) {
logger.mark(`[邀请加群]${this.e.group_name}${this.e.group_id}`)
return
}
Bot.logger.mark(`[主人邀请加群]${this.e.group_name}${this.e.group_id}`)
this.e.approve(true)
Bot.sendPrivateMsg(this.e.user_id, `已同意加群:${this.e.group_name}`).catch((err) => {
logger.error(err)
})
}
}