Miao-Yunzai/plugins/system/friend.js

23 lines
541 B
JavaScript
Raw Normal View History

2023-03-04 14:30:13 +08:00
import cfg from '../../lib/config/config.js'
import common from '../../lib/common/common.js'
export class friend extends plugin {
constructor () {
super({
name: 'autoFriend',
dsc: '自动同意好友',
event: 'request.friend'
})
}
async accept () {
if (this.e.sub_type == 'add' || this.e.sub_type == 'single') {
if (cfg.other.autoFriend == 1) {
logger.mark(`[自动同意][添加好友] ${this.e.user_id}`)
await common.sleep(2000)
this.e.approve(true)
}
}
}
}