Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

discord js

const { Client, Intents } = require('discord.js');
const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});

client.once('ready', () => {
    console.log(`Logged in as ${client.user.tag}.`)
})

client.on('messageCreate', (message) => {
 if (message.content == "ping") {
        message.channel.send("pong")
    };
}

client.login('TOKEN');
 
PREVIOUS NEXT
Tagged: #discord #js
ADD COMMENT
Topic
Name
2+4 =