text: const mysql = require("mysql2/promise");
  const vbu = require("../utils/botUtils.js");
  
  
  exports.log = async(userstate, message, channel) => {
      try {
          const sqld = await vbu.returnSQLDetails();
          const conn = await mysql.createConnection({
              host: `${sqld.host}`,
              user: sqld.user,
              password: sqld.pass,
              database: channel.replace("#", "")
          });
          await conn.query(`INSERT INTO logs (time, username, userid, message) VALUES (CURRENT_TIMESTAMP(), "${userstate["username"]}", "${userstate["user-id"]}", "${mysql.escape(message).slice(1, -1)}")`);
          await conn.end();
      }
      catch(ex) {
          console.log("Error logging to database: " + ex);
      }
  }