refactor(informer): ♻️ reorder config loading
This commit is contained in:
		| @@ -1,9 +1,19 @@ | ||||
| let cfg | ||||
| let bot | ||||
| let mcData | ||||
| let quiet | ||||
| // import v from 'vec3' | ||||
| const v = require('vec3') | ||||
|  | ||||
| let cfg = { | ||||
|     info: { | ||||
|         quiet: quiet, | ||||
|         recentCommand: null, | ||||
|     }, | ||||
|     // to satisfy typescript | ||||
|     quiet: null, | ||||
|     bot: bot | ||||
| } | ||||
| function block(pos) { | ||||
|     const block = pos ? bot.blockAt(v(pos)) : bot.blockAtCursor() | ||||
|     console.log(block, block && block.getProperties()) | ||||
| @@ -133,12 +143,9 @@ function command(message_parts, player) { | ||||
| } | ||||
|  | ||||
| const load = (config) => { | ||||
|     config.info = cfg.info | ||||
|     cfg = config | ||||
|     bot = cfg.bot | ||||
|     cfg.info = { | ||||
|         quiet: cfg.quiet, | ||||
|         recentCommand: null, | ||||
|     } | ||||
|     mcData = bot.mcData || (bot.mcData = require('minecraft-data')(bot.version)) | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user