So, I was trying to get vote updates from https://discordbots.org/ using webhooks so my code was trying with this
const app = express();
app.get("/", (request, response) => {
console.log("Ping received!");
response.sendStatus(200);
});
// listen for requests :)
const listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
const DBL = require('dblapi.js');
const http = require('http');
const server = http.createServer(app);
const dbl = new DBL(process.env.DBLTOKEN, { webhookAuth: process.env.DBLAUTH, webhookServer: server });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
server.listen(5000, () => {
console.log('Listening');
});```