title: How can I deploy a discord.js bot to Cloud Functions?
body: <p>I want to deploy a Discord bot running on discord.js to Firebase Cloud Functions but I can't get the bot to run in Firebase. If I use nodemon it runs perfectly but if I use firebase deploy it will not start the bot. </p>
  
  <p>Here is my current code:</p>
  
  <pre class="lang-js prettyprint-override"><code>const functions = require('firebase-functions');
  
  require('dotenv').config();
  const token = process.env.TOKEN
  
  const Discord = require('discord.js')
  const Client = new Discord.Client();
  
  Client.on('ready', () =&gt; {
      Client.channels.find(x =&gt; x.name === 'main-cannel').send('bot is deployed')
      Client.user.setGame(`The Cult | ${Client.guilds.size} servers`)
      Console.log('test')
  });
  
  Client.login(token);
  
  //is is not working but de basic
  //export.App = functions.... {Client}
  exports.app = functions.https.onRequest((request, response) =&gt; {
      response.send("Test");
  });
  </code></pre>