“Discord bot javascript” Réponses codées

Discord.js commence

const Discord = require('discord.js');
const client = new Discord.Client();
const token = 'TOLKEN'; // Add your token here

client.on('ready', () => {
  console.log('The client is ready!')
  })

client.login(token)
sydneyyy

Discord.js bot

//first you must install dicord.js by running the command: npm install discord.js
//once u do that copy and paste this into your main file
const Discord = require('discord.js');
const client = new Discord.Client();

client.on('ready', () =>{
	client.user.setStatus('your status')
	console.log('Connected!')
})
//rest of your code

//always remember to never share your token with anyone
client.login('your-token-here')
skittles

Discord bot javascript

const Discord = require('discord.js');

const DISCORD_SECRET = "put bot token here";

const client = new Discord.Client();

client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('pong');
  }
});

client.login(DISCORD_SECRET);
SunflowerToad

Réponses similaires à “Discord bot javascript”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code