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

204
Vistas
How to send dm as bot after voted top.gg discord.js?
const Discord = require(discord.js);
const client = new Discord.Client();
const Topgg = require ("@top-gg/sdk");

So i dont know about next code Sorry im to early for studying in javascript

In here im using discord.js V12

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You're not yet requiring Discord properly. It should be require("discord.js"); otherwise you're trying to require a non-existent variable.

Upon scrolling through the Top.gg API Docs it looks like you can use the webhook class to get when a user votes.

const Discord = require("discord.js");
const Client = new Discord.Client();
// top.gg example
const Topgg = require("@top-gg/sdk");
// Webhook options can be found here if you wish to include them, currently the only one is an error callback: https://topgg.js.org/interfaces/webhookoptions
// You'll have to set up a webhook on top.gg in your bot's settings
const TopWebhook = new Topgg.Webhook("authorization");
const express = require("express");
const app = express();
app.listen(process.env.PORT || 8080);

// This example assumes you're using express
app.post("/webhook", async TopWebhook.listener(vote) => {
    let user = vote.user; // the User ID
    // get the user from their user id, then send a DM
});

Hopefully this helps note that this is untested so may require some tweaking, but definitely read the documentation.

about 4 years ago · Juan Pablo Isaza Denunciar
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