Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
How do I read the console log made in javascript in html?

I am making a Discord bot using Discord.js v13, and once I run the project it prints in the console.log:

Bot is on
Timestamp: [time I ran the bot]

My code to make it like that:

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')
})

Now I also have a simple host, shown in the discordjs guide

Code in 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}`));

Code in index.html:

<!DOCTYPE html>
<html>
<head>
    <title>My Discord OAuth2 App</title>
</head>
<body>
    <div id="info">
        Hoi!
    </div>
</body>
</html>

My question is, how do I make it show on the web server when my bot started, just like it showed in the console.log?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda