添加`跳过登录ICQQ`开关
This commit is contained in:
		
							parent
							
								
									4f3a92cb59
								
							
						
					
					
						commit
						bd26f09f55
					
				
							
								
								
									
										5
									
								
								app.js
								
								
								
								
							
							
						
						
									
										5
									
								
								app.js
								
								
								
								
							|  | @ -2,3 +2,8 @@ import Yunzai from './lib/bot.js' | ||||||
| 
 | 
 | ||||||
| /** 全局变量 bot */ | /** 全局变量 bot */ | ||||||
| global.Bot = await Yunzai.run() | global.Bot = await Yunzai.run() | ||||||
|  | 
 | ||||||
|  | if (Bot.uin == "88888") { | ||||||
|  |     /** 跳过登录后加载插件... */ | ||||||
|  |     await ((await import('./lib/plugins/loader.js')).default).load() | ||||||
|  | } | ||||||
|  | @ -24,6 +24,9 @@ online_msg: true | ||||||
| # 上线推送通知的冷却时间 | # 上线推送通知的冷却时间 | ||||||
| online_msg_exp: 86400 | online_msg_exp: 86400 | ||||||
| 
 | 
 | ||||||
|  | # 是否跳过登录ICQQ | ||||||
|  | skip_login: false | ||||||
|  | 
 | ||||||
| # 签名API地址(如:http://127.0.0.1:8080/sign?key=114514) | # 签名API地址(如:http://127.0.0.1:8080/sign?key=114514) | ||||||
| sign_api_addr: | sign_api_addr: | ||||||
| # 传入的QQ版本(如:8.9.63、8.9.68) | # 传入的QQ版本(如:8.9.63、8.9.68) | ||||||
|  |  | ||||||
|  | @ -14,8 +14,15 @@ export default class Yunzai extends Client { | ||||||
|     const bot = new Yunzai(cfg.bot) |     const bot = new Yunzai(cfg.bot) | ||||||
|     /** 加载icqq事件监听 */ |     /** 加载icqq事件监听 */ | ||||||
|     await ListenerLoader.load(bot) |     await ListenerLoader.load(bot) | ||||||
|  | 
 | ||||||
|  |     if (cfg.bot.skip_login) { | ||||||
|  |       /** 造个假~! */ | ||||||
|  |       bot.uin = "88888" | ||||||
|  |       return bot | ||||||
|  |     } else { | ||||||
|       await bot.login(cfg.qq, cfg.pwd) |       await bot.login(cfg.qq, cfg.pwd) | ||||||
|       bot[bot.uin] = bot |       bot[bot.uin] = bot | ||||||
|       return bot |       return bot | ||||||
|     } |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | @ -9,6 +9,8 @@ import chalk from 'chalk' | ||||||
|  * Git Bash 运行npm命令会无法选择列表 |  * Git Bash 运行npm命令会无法选择列表 | ||||||
|  */ |  */ | ||||||
| export default async function createQQ () { | export default async function createQQ () { | ||||||
|  |   /** 跳过登录ICQQ */ | ||||||
|  |   if(cfg.bot.skip_login) return | ||||||
|   if (cfg.qq && !process.argv.includes('login')) { |   if (cfg.qq && !process.argv.includes('login')) { | ||||||
|     return |     return | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue