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
|
|
|
|
|
}
|
2023-04-21 13:51:59 +08:00
|
|
|
|
logger.mark(`[主人邀请加群]:${this.e.group_name}:${this.e.group_id}`)
|
2023-03-04 14:30:13 +08:00
|
|
|
|
this.e.approve(true)
|
2023-04-21 13:51:59 +08:00
|
|
|
|
this.e.bot.sendPrivateMsg(this.e.user_id, `已同意加群:${this.e.group_name}`).catch((err) => {
|
2023-03-04 14:30:13 +08:00
|
|
|
|
logger.error(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|