添加一个设置用来禁用频道消息 (#5)
This commit is contained in:
parent
9502bd3ddc
commit
c30f0dac9b
|
@ -5,6 +5,8 @@ autoQuit: 50
|
|||
# 主人QQ号
|
||||
masterQQ:
|
||||
|
||||
# 禁用频道功能 true: 不接受频道消息,flase:接受频道消息
|
||||
disableGuildMsg: true
|
||||
# 禁用私聊功能 true:私聊只接受ck以及抽卡链接(Bot主人不受限制),false:私聊可以触发全部指令,默认false
|
||||
disablePrivate: false
|
||||
# 禁用私聊Bot提示内容
|
||||
|
|
|
@ -33,7 +33,7 @@ await checkInit()
|
|||
async function checkInit () {
|
||||
/** 检查node_modules */
|
||||
if (!fs.existsSync('./node_modules') || !fs.existsSync('./node_modules/icqq')) {
|
||||
console.log('请先npm install安装')
|
||||
console.log('请先运行命令:pnpm install 安装依赖')
|
||||
process.exit()
|
||||
}
|
||||
|
||||
|
|
|
@ -159,6 +159,8 @@ class PluginsLoader {
|
|||
* @param e icqq Events
|
||||
*/
|
||||
async deal (e) {
|
||||
/** 检查频道消息 */
|
||||
if (this.checkGuildMsg(e)) return
|
||||
/** 检查黑白名单 */
|
||||
if (!this.checkBlack(e)) return
|
||||
/** 冷却 */
|
||||
|
@ -659,6 +661,11 @@ class PluginsLoader {
|
|||
return false
|
||||
}
|
||||
|
||||
/** 判断频道消息 */
|
||||
checkGuildMsg (e) {
|
||||
return cfg.getOther().disableGuildMsg && e.detail_type == 'guild'
|
||||
}
|
||||
|
||||
/** 判断黑白名单 */
|
||||
checkBlack (e) {
|
||||
let other = cfg.getOther()
|
||||
|
|
Loading…
Reference in New Issue