diff --git a/src/modules/tab_complete.js b/src/modules/tab_complete.js new file mode 100644 index 0000000..5cccda7 --- /dev/null +++ b/src/modules/tab_complete.js @@ -0,0 +1,18 @@ +module.exports = (bot) => { + // let aaa cook + bot.tab_complete = (str) => { + return new Promise((resolve) => { + bot._client.write('tab_complete', { + text: str, assumeCommand: false, sendBlockInSight: false + }) + + const tab_completeH = (packet) => { + bot._client.removeListener('tab_complete', tab_completeH) + + resolve(packet.matches) + } + + bot._client.once('tab_complete', tab_completeH) + }) + } +} \ No newline at end of file