Answers for "how to import token from .env file discord bot"

0

how to import token from .env file discord bot

require('dotenv').config();

// process.env.NODE_ENV allows you to get the environment the node process is in
let ver = process.env.NODE_ENV;

client.on('ready', () => {

  if (ver === 'production') {
    client.user.setActivity('An Idiot\'s Guide', { type: 'STREAMING', url: 'https://twitch.tv/something' })
  } else {
    client.user.setActivity('in code land', { type: 'PLAYING' });
  }
});
Posted by: Guest on March-19-2021

Code answers related to "how to import token from .env file discord bot"

Browse Popular Code Answers by Language