Open ELONISEVIL opened 1 month ago
node -v
npm -v
This should display the versions of Node.js and npm installed.
Create a New Application:
Get Your Bot Token:
Create a New Directory and Navigate to It:
mkdir my-discord-bot
cd my-discord-bot
Initialize a New Node.js Project:
npm init -y
Install Discord.js Library:
npm install discord.js
Create a New File named bot.js
:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] });
const token = 'YOUR_BOT_TOKEN_HERE'; // Replace with your bot's token
client.once('ready', () => {
console.log('Bot is online!');
});
client.on('messageCreate', (message) => {
if (message.content === '!ping') {
message.channel.send('Pong!');
}
});
client.login(token);
Run the Bot:
node bot.js
You should see the message "Bot is online!" in your terminal, indicating that your bot is running.
https://github.com/ELONISEVIL/amfora/issues/4