Estoy creando un bot de Discord usando Discord.js v13, y una vez que ejecuto el proyecto, se imprime en el archivo console.log:
Bot is on Timestamp: [time I ran the bot]Mi código para hacerlo así:
const Event = require("../Structures/Event.js"); const Discord = require('discord.js') var today = new Date(); var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate()+' `'+today.getHours()+':'+today.getMinutes()+':'+today.getSeconds()+'`'; var hms = today.getHours()+':'+today.getMinutes()+':'+today.getSeconds(); module.exports = new Event("ready", client => { console.log(`Bot is on\nTimestamp: ${hms} `) client.channels.fetch("928241814639632404") .then(channel => { channel.send(`Started on ${date}`).then(sentMessage => { setTimeout(() => { sentMessage.delete() }, 1000); }) }) client.user.setActivity({ name: 'The World Failing', type: "WATCHING" }) client.user.setStatus('dnd') })Ahora también tengo un host simple, que se muestra en la guía de discordjs
Código en index.js:
const express = require('express') const app = express(); app.get('/', (request, response) => { return response.sendFile('index.html', { root: '.' }); }); app.listen(port, () => console.log(`App listening at http://localhost:${port}`));Código en index.html:
<!DOCTYPE html> <html> <head> <title>My Discord OAuth2 App</title> </head> <body> <div id="info"> Hoi! </div> </body> </html>Mi pregunta es, ¿cómo hago para que se muestre en el servidor web cuando se inició mi bot, tal como se muestra en el archivo console.log?