Created
September 21, 2021 17:05
-
-
Save wylie39/babbf086205d96bb95c62be654a9c687 to your computer and use it in GitHub Desktop.
Discord.js example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client, Intents } = require('discord.js') | |
const client = new Client({ | |
intents: [ | |
Intents.FLAGS.GUILDS, | |
Intents.FLAGS.GUILD_MESSAGES | |
], | |
partials: ['CHANNEL', 'MESSAGE'], | |
}) | |
client.on('ready', () => { | |
console.log(`Logged in as ${client.user.tag}!`) | |
}) | |
client.on('messageCreate', (message) => { | |
if (message.content.startsWith('ping')) { | |
message.channel.send('Pong') | |
} | |
}) | |
client.login('token') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment