Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda