2023-05-11 16:03:18 +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 () {
|
2023-06-30 21:20:06 +08:00
|
|
|
|
if (!this.e.isMaster) {
|
2023-05-11 16:03:18 +08:00
|
|
|
|
logger.mark(`[邀请加群]:${this.e.group_name}:${this.e.group_id}`)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
logger.mark(`[主人邀请加群]:${this.e.group_name}:${this.e.group_id}`)
|
|
|
|
|
this.e.approve(true)
|
|
|
|
|
this.e.bot.pickFriend(this.e.user_id).sendMsg(`已同意加群:${this.e.group_name}`)
|
|
|
|
|
}
|
|
|
|
|
}
|