title: How to return result of a promise as a string?
body: <p>I am trying to create a bot for the discord platform that will search a SQL database and return the objects to the chat for people to see.</p>
  <p>SQL uses promises and I have been unable to successfully turn the promise it is returning me into something I can return to the chat (a string or array).</p>
  <p>This code queries the database:</p>
  <pre><code>function spell(name) {
  var spellData = sql.get(&quot;SELECT * FROM spells WHERE LOWER(name) = '&quot;+ name.toLowerCase() + &quot;'&quot;);
  spellData.then( value =&gt; {
      console.log(spellData)
      return spellData;
    });
  
  }
  </code></pre>
  <p>The table:</p>
  <pre><code>CREATE TABLE spells (
      `name` VARCHAR(25),
      `casting_time` VARCHAR(95),
      `components` VARCHAR(215),
      `description` VARCHAR(3307),
      `duration` VARCHAR(52),
      `level` INT,
      `range` VARCHAR(28),
      `school` VARCHAR(13)
    );
  </code></pre>
  <p>I'm using node.js, sqlite, and discord.js.</p>