const chalk = require("chalk"); const {startPrompt} = require("../lib/prompt"); const {updatePresence} = require("../lib/presence"); function sendMode() { if (!comcord.state.currentChannel) { console.log(""); return; } startPrompt( chalk.bold.cyan(`[${comcord.client.user.username}]`) + " ".repeat( comcord.state.nameLength - (comcord.client.user.username.length + 2) ) + chalk.reset(" "), async function (input) { if (input == "") { console.log(""); } else { try { process.stdout.write("\n"); await comcord.client.createMessage(comcord.state.currentChannel, { content: input, }); if (comcord.state.afk == true) { comcord.state.afk = false; comcord.client.editStatus("online"); comcord.client.editAFK(false); console.log(""); updatePresence(); } } catch (err) { console.log(""); } } } ); } module.exports = {sendMode};