Answer the question
In order to leave comments, you need to log in
How to run a simple discord bot Electron Node js?
The simplest html code. It is necessary to start the Discord bot on page load.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Main Page</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:[email protected];400;500&display=swap" rel="stylesheet">
</head>
<body>
<button id="butn" class="sendButton">Send Embed</button>
</body>
<script src="script.js"></script>
</html>
window.addEventListener('load', function() {
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question