#topgg-api

1 messages · Page 98 of 1

latent narwhal
#

did

#
[READY] Black Sheep#5071 has been successfully booted up! Promise { <pending> }
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 19ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 15ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 50ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 17ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 18ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 17ms.
[WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 17ms.
#

everything it logs

vapid cape
#

what about now

#

did anything send in the channel?

latent narwhal
#

no

vapid cape
#

add a console.log in your vote event, before bot.uptime

latent narwhal
#

but noone will vote rn for testing

rapid kettle
#

test button

latent narwhal
#

add a console.log in your vote event, before bot.uptime
@vapid cape i did nothing logged

#

and i pressed test

#

nothing

vapid cape
#

what did you put?

#

console.log(vote)?

latent narwhal
#

console.log(vote)?
@vapid cape yes

latent narwhal
#
const bot = new Client({
  disableMentions: "everyone"
});


    const DBL = require("dblapi.js");
    const dbl = new DBL('SIKE', { webhookPort: process.env.PORT, webhookAuth: 'bruhboomer' }, bot);

    dbl.on('error', e => {
        console.log(`Oops! ${e}`);
    })
    dbl.webhook.on('ready', hook => {
        console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
    });
    dbl.webhook.on('vote', vote => {
      console.log(vote);
        if (bot.uptime) {
            bot.users.fetch(vote.user).then(user => {
                user.send("Thanks for voting :kittylove:. In the future, this will have benefits!")
                bot.channels.fetch('739081152807305308').then(channel => {
                    channel.send(`Thanks for voting ${user.tag} :kittylove:.\nIt is super apricated!`)
                })
            })
        }
    });``` @vapid cape this is my current code
#
Webhook running at http://0.0.0.0:3000/dblwebhook
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
    URL: wss://gateway.discord.gg
    Recommended Shards: 1
[WS => Manager] Session Limit Information
    Total: 1000
    Remaining: 984
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
    Gateway    : wss://gateway.discord.gg/
    Version    : 6
    Encoding   : json
    Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 63ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/1
[WS => Shard 0] [READY] Session 30b95111ab43d733bf91e8f1f0fc1b2c.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 842ms.
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
[READY] Black Sheep#5071 has been successfully booted up! Promise { <pending> }```
#

everything it logs

#

that is it

#

even if i test something

#

i mean press test

#

button nothing logs

#

Waiting weirdsip

#

Still

vapid cape
#

did you change your project name?

latent narwhal
#

did you change your project name?
@vapid cape yes

#

oh shit

#

i did

#

@vapid cape ```js
[WS => Shard 0] Heartbeat acknowledged, latency of 19ms.
{
bot: '716985864512864328',
user: '587663056046391302',
type: 'test',
query: [Object: null prototype] { test: 'data', notRandomNumber: '8' },
isWeekend: true
}
(node:8499) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
at Client.<anonymous> (/app/index.js:189:43)

#

error

vapid cape
#

looks like you got something

latent narwhal
#

ye

#

it worked

#

thanks

restive otter
#

np

latent narwhal
#

One thing

#

the bot does not gives role

#

and says cannot read property role la blah

#

error ```(node:9645) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'roles' of undefined

rapid kettle
#

just me or is webhook slow?

latent narwhal
#

just me or is webhook slow?
@rapid kettle idk

restive otter
#

webhook slow i think

dawn kernel
#

yo the snowflake type doesn't exist in json

#

is it a string or a number

#

@vital anvil pepeLaugh

willow spindle
#

just me or is webhook slow?
@rapid kettle works fine for me

restive otter
#

nice ping

rapid kettle
#

i know

#

it was an error on my side

willow spindle
#

@dawn kernel probably string

dawn kernel
#

k

#

Time to change code then crylaugh

willow spindle
#

¯_(ツ)_/¯

solar horizon
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
#

it does not remind me

#

when someone does vote

jaunty plank
solar horizon
#

my DBL token?

jaunty plank
#

No.
Webhooks require top.gg to push data to the url of your webhook server

#

Top.gg doesn't know this url unless you set it

#

On your bots edit page, at the bottom is a location to put it

solar horizon
#

But I do not have a bot site,

jaunty plank
#

The dblapi.js lib creates the site.
Thats what the webhook running at http stuff is

#

Which its not really a site

#

But a webhook

solar horizon
#

can you give me example??

#

@jaunty plank

jaunty plank
#

It should be logging an example on startup

#

But
http://ip:port/dblwebhook

solar horizon
#

I dont understand

jaunty plank
late spade
#

@little harbor I don't get it

little harbor
#

what language are you using

late spade
#

discord.js

little harbor
#

so look up "how to make a webhook in javascript" or "how to listen for post requests in javascript" and follow a tutorial, when you get a valid url set up for your webhook (you'll know when you get this), put it in the "URL" section of the "API options"

#

I can't give you a full tutorial since I don't use JS

#

but people here will be willing to help you to some extent

#

unfortunately, this is a somewhat complex topic and even if I gave you a step-by-step guide, it's a bit too much

late spade
#

okay

#

And what do you think about this bot? https://top.gg/bot/479688142908162059

little harbor
#

never used it before

#

but it might be worth trying!

late spade
#

okay

late spade
#

It worked!!

#

And it's super simple to do

#

I just entered the url and authorization that the bot gave me and that's it

true talon
#

imagine needing a bot to do vote rewards

muted axle
#

You need API for that

violet crown
#

webhook on the site not working, tried with postman and it words

#

idk if its me or not

median badger
#

They work

#

You have to receive the webhooks

#

Not send them lmao

violet crown
#

yes but i send a post req to my wb with postman to test it

eternal crown
#

yo jeremy , so i am confused what should i put as URL for webhook on top.gg

rapid kettle
#

where do you host

eternal crown
#

my vps

rapid kettle
#

ok, so vps has public ip right?

eternal crown
#

ye

rapid kettle
#

itd be http://vps.public.ip.here:port/dblwebhook

eternal crown
#

ok wait, i should put url to my file where i handle webhook right

rapid kettle
#

if you didn't change the path that is

eternal crown
#

k thx gonna try, let you know

violet crown
#

if i have a subdomain will it works ? like bot.domain.ovh/votes

#

or i need to put the base ip and port (that redirect to the sub)

eternal crown
#

also jeremy, for authorization i put something and that is webhookAuth ?

rapid kettle
#

base ip and port works more reliable

#

also jeremy, for authorization i put something and that is webhookAuth ?
@eternal crown yup

eternal crown
#

how do i start webhook? maybe its a dumb question but first time working with webhooks

rapid kettle
#

you don't

eternal crown
#

oh so now if i setup everything correctly

#

if i vote

#

i'll see it in my logs

#

right?

rapid kettle
#

dont vote

#

use the test button

eternal crown
#

ty

#

dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
}); so if i am running my bot with pm2, i doubt these logs that are from specific voting file will show there, but i am not sure where should i look for these logs, or how exactly to set it up

rapid kettle
#

try node running it

eternal crown
#

the bot?

rapid kettle
#

yea

#

node index.js

#

then it should console.log it

eternal crown
#

hmm i tried with node , nothing shows when clicking test, just to double check, dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
}); this part isnt in index.js its in separate file?

rapid kettle
#

put it in index.js

eternal crown
#

and change my webhook url

#

to index.js?

rapid kettle
#

no

eternal crown
rapid kettle
#

no thats normal

eternal crown
#

but when i click test

#

nothing happens

rapid kettle
#

0.0.0.0 is hardcoded

#

is it the right ip?

eternal crown
#

i put this

#

as url in topgg website

#

and the ip is right yes

rapid kettle
#

yea

eternal crown
#

still doesnt work, i am not sure where am i making a mistake

#

ok works now

#

thanks for the help

rapid kettle
#

np

eternal crown
#

i regenerated token , i probably didnt copy the first one correctly

#

xD

restive otter
#

Alguien me ayuda?

willow spindle
#

english only pls

restive otter
#

Oky

#

I need help to make those who drop my bot send it to a channel who dropped it and thanking them

#

@willow spindle

kindred walrus
#

what

willow spindle
#

"drop your bot"?

kindred walrus
#

@restive otter say it in spanish, i can translate it

restive otter
#

Oky

#

Es que quiero hacer que los que boten por mi bot salga en un canal

#

@kindred walrus

kindred walrus
#

He wants to know how to send on a channel when someone votes for his bot

#

im pretty sure all that is in the documents

restive otter
#

yes

kindred walrus
#

@restive otter Which language? Javascript?

restive otter
#

si pero no encuentro como hacerlo

willow spindle
#

setup webhook

kindred walrus
#

@restive otter ^^

restive otter
#

ya veo a ver

#

pero tengo que hacer un proyecto en glicht?

#

@kindred walrus

kindred walrus
#

no, you dont have to use glitch

#

you just need a webhook, it can be locally hosted or in your VPS

restive otter
#

ok pero como lo creo?

#

me ayudas?

#

@kindred walrus

kindred walrus
#

You should wait for someone here to set webhooks, but the documentation shows how to

restive otter
#

y en que pagina es?

kindred walrus
#

in the top

#

Top of page

restive otter
#

yo es pero en que pagina la pego?

kindred walrus
#

what do you mean?

#

in your bot page

#

the token?

restive otter
#

es donde tengo el bot?

kindred walrus
restive otter
#

Ok yo se pero en donde configuro la webhooks

kindred walrus
#

in the same place you have your bot being hosted

restive otter
#

osea en el proyecto de mi bot?

kindred walrus
#

yes

restive otter
#

solo copio y pego y losto y arreglo eso?

kindred walrus
#

dont copy it, you need to change some things

#

but that example should work if you put your token

#

i think you need to have your port open too

restive otter
#

okay

#

cual puerto?

kindred walrus
#

and in top.gg you edit your bot and put the IP of where your port is

#

should be fine using 5000 unless you have something else using it

restive otter
#

@kindred walrus hay esta mi bot

kindred walrus
#

i cant do anything with that

#

you are the one coding KEKW

restive otter
#

yo se pero necesito ayuda para hacer eso

kindred walrus
#

but i CANT see the edit page

#

only owner of the bot can

restive otter
#

Gracias por si algo te menciono

kindred walrus
#

okay, but i'll be busy for a bit. I'll probably setup a vote for myself too

deep smelt
#

Bonjour,
Comment faire pour avoir un event quand quelqu'un à voter ?

kindred walrus
#

English here @deep smelt

deep smelt
#

No, french incluse

kindred walrus
#

#rules-and-info 6. Speak english. This way everyone can understand you. It is our lingua franca after all.

deep smelt
tawny lava
#

yo anyone got any idea what this is

#

its discord rewrite

#

and it happens when i invite it to a new server

sullen nymph
tawny lava
#

oh aight

#

u know the command for that?

sullen nymph
tawny lava
#

oh crap sorry i thought this was for specific apis

sullen nymph
tawny lava
#

again sorry and thanks

harsh peak
#

.

vast geyser
#

.d

#

:')

willow spindle
#

no

#

keep channel on topic pls

quartz fern
#

Hey, I moved my bot from a selfhost to a VPS today. I opened the port I'm using, and changed the IP on the top.gg page, and all the code is the same, but I am no longer receiving the webhook. Anyone know what went wrong here?

restive otter
#

How to get MEE6 IN SERVER

sharp atlas
#

@restive otter Invite from mee6's website

surreal hill
#

Hi

#

What is the best way to program a discord bot because in this case I use it by cell phone and the programs here are bad...

#

Plz Mark me

glass steeple
frozen mica
median badger
#

No

#

It literally says that you cant

green tapir
#
2020-08-02T11:38:03.917689+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized
2020-08-02T11:38:03.917690+00:00 app[worker.1]:     at IncomingMessage.res.on (/app/node_modules/dblapi.js/src/index.js:118:25)
2020-08-02T11:38:03.917691+00:00 app[worker.1]:     at IncomingMessage.emit (events.js:203:15)
2020-08-02T11:38:03.917692+00:00 app[worker.1]:     at endReadableNT (_stream_readable.js:1145:12)
2020-08-02T11:38:03.917693+00:00 app[worker.1]:     at process._tickCallback (internal/process/next_tick.js:63:19)
2020-08-02T11:38:03.917772+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-08-02T11:38:03.917836+00:00 app[worker.1]: (node:4) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
``` Help
sullen nymph
#

are you sending your top.gg token

green tapir
#
const DBL = require("dblapi.js");
const dbl = new DBL('wdbuiwgfoiagyfouagwf87w4gfo (my token)');
sullen nymph
#

Try to regenerate it

green tapir
#

kk

pliant vortex
#

I don't understand how to use webhooks, can someone explain to me ?

jaunty plank
pliant vortex
#

where is it explained ? I've already read the doc but i didn't understand, it doesn't seem clear

#

For example, we have to write a webhook url on the bot's page but how can i get such an url ?

vapid cape
#

a webhook is like a reverse request

#

instead of you sending a request to a website or a server, they send a request to you directly

#

so you have to provide an address to where they will send this request to

#

this url is typically a webserver that you run, either inside your bot or as a separate process

#

to receive these requests

pliant vortex
#

ok i see

pseudo otter
#

My webhook url was something like http://amazingurl:port/api/webhooks/incoming and it didn't work until I changed it to http://amazingurl:port/topggwebhook any idea why?

#

my vps didn't receive anything at all with the test button

frozen mica
#

can i use heroku to make webhook?

#

because im using heroku to host my bot too

jaunty plank
#

Does heroku provide a static ip/url for things on their platform?

ancient hazel
#

You get a subdomain yeah

gray vigil
#

put this in my code, but it doesn't display the server count on top.gg, am I doing something wrong? (yes I put my bot's top.gg API token)

#

please ping with reply

restive otter
#

You gotta Actually show us your code, not the top.gg one that shows an example

#

@gray vigil

gray vigil
#

um

#

but it will leak token

#

API token

restive otter
#

Just blur it out or replace with just API TOKEN

spiral steeple
wooden pewter
#

how can i set my webhook url?

willow spindle
#

click Edit button and scroll down

wooden pewter
#

yea but what have i put inside xd

#

so how can i create my own url

rapid kettle
#

http://vps.public.ip.address:port/dblwebhook

willow spindle
#

http://server IP:port/dblwebhook

wooden pewter
#

so i need a website?

willow spindle
#

no

rapid kettle
#

why would you?

wooden pewter
#

where do i have to get the server ip and port lol

rapid kettle
#

from your server lmao

#

where do you host

wooden pewter
#

bot host?

#

heroku

willow spindle
#

yes

wooden pewter
#

ahh

#

okey well

willow spindle
#

then it is heroku project url/dblwebhook

wooden pewter
#

guess i got it

rapid kettle
wooden pewter
#

dont need port?

rapid kettle
#

no

#

heroku doesn't have more than one port afaik

wooden pewter
#

ah

willow spindle
#

heroku using 3000 iirc

wooden pewter
#

key lemme try

wooden pewter
#

what does this mean Error: listen EADDRINUSE: address already in use :::3000 2020-08-02T19:50:46.835972+00:00 app[Worker.1]: at Server.setupListenHandle [as _listen2] (net.js:1309:16) 2020-08-02T19:50:46.835973+00:00 app[Worker.1]: at listenInCluster (net.js:1357:12) 2020-08-02T19:50:46.835973+00:00 app[Worker.1]: at Server.listen (net.js:1445:7) 2020-08-02T19:50:46.835982+00:00 app[Worker.1]: at DBLWebhook._startWebhook (/app/node_modules/dblapi.js/src/webhook.js:45:18) 2020-08-02T19:50:46.835987+00:00 app[Worker.1]: at new DBLWebhook (/app/node_modules/dblapi.js/src/webhook.js:27:12) 2020-08-02T19:50:46.835987+00:00 app[Worker.1]: at new DBLAPI (/app/node_modules/dblapi.js/src/index.js:69:22) 2020-08-02T19:50:46.835988+00:00 app[Worker.1]: at Client.<anonymous> (/app/main.js:1501:18) 2020-08-02T19:50:46.835988+00:00 app[Worker.1]: at Client.emit (events.js:321:20) 2020-08-02T19:50:46.835992+00:00 app[Worker.1]: at MessageCreateAction.handle (/app/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14) 2020-08-02T19:50:46.835997+00:00 app[Worker.1]: at Object.module.exports [as MESSAGE_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32) 2020-08-02T19:50:46.835998+00:00 app[Worker.1]: Emitted 'error' event on Server instance at: 2020-08-02T19:50:46.835998+00:00 app[Worker.1]: at emitErrorNT (net.js:1336:8) 2020-08-02T19:50:46.835999+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:84:21) { 2020-08-02T19:50:46.835999+00:00 app[Worker.1]: code: 'EADDRINUSE', 2020-08-02T19:50:46.835999+00:00 app[Worker.1]: errno: -98, 2020-08-02T19:50:46.836000+00:00 app[Worker.1]: syscall: 'listen', 2020-08-02T19:50:46.836000+00:00 app[Worker.1]: address: '::', 2020-08-02T19:50:46.836000+00:00 app[Worker.1]: port: 3000 2020-08-02T19:50:46.836001+00:00 app[Worker.1]: }

#

guess something wrong with the port

sullen nymph
#

port is already in use

restive otter
#

So i've been trying to setup a webhook to get the user who voted it doesn't log anything
Webhook:

http://<My host ip>:<host port>/dblwebhook``` and this is the event to get the votes but it doesn't work...
```js
dbl.webhook.on('vote', vote => {
		console.log(`User with the tag: ${vote.user.tag} has voted!`);
		})```
sullen nymph
#

http

restive otter
#

Huh, lemme check if i did that correctly

#

It's http

#

As i set my set my host ip
At the ready event it shows
running at http://0.0.0.0:<port>/dblwebhook instead of the actual ip

#

This is Suspicious

sullen nymph
#

try posting to your webhook with reqbin

restive otter
#

K

violet crown
#

Hello, i have configured a webhook listener on my webserver but there are no response when i test it with the test button, but when i send a post request with postman it works, here is my code ```js
const express = require(express),
router = express.Router(),
Discord = require(discord.js);

router.post(/, async (req, res) => {
if(req.headers.authorization === req.client.config.topggWebhookToken){
const user = await req.client.users.fetch(req.body.user);
await req.client.votesHook.send(new Discord.MessageEmbed()
.setTitle(Vote by clicking here)
.setURL(https://discordbots.org/bot/${req.client.user.id}/vote)
.setDescription(:arrow_up: **${user.tag}** (\${user.id}`) voted for ${req.client.user.username} on top.gg, thank you!)); res.status(200).send({ message: Thank you =)`
});
}
});

module.exports = router;```

#

in my app.js

topggRouter = require(`./Routes/topggvote`);
app.use(`/topggvote`, topggRouter)```
restive otter
#

just use the dbl's

vapid cape
#

if it works with postman then it should work

#

did you save the config on top.gg before pressing the test button?

restive otter
#

@sullen nymph
1- Raw: 403 forbidden
2- With Authorization: 400 bad request

violet crown
#

yeah but it isn't lol thats why im asking here

#

yes i saved

vapid cape
#

can you also test with reqbin?

sullen nymph
#

are you sure you are logging in with the right bot under the top.gg token @restive otter

violet crown
#

hmm yes i can

restive otter
#

@sullen nymph Of course

vapid cape
#

if you get bad request, the authorization is correct

sullen nymph
#

Do you use dblapi.js' autopost?

#

wait I got them mixed in my head

restive otter
#

autopost?

vapid cape
#

there is no vote.user.tag btw

#

vote.user is an id

sullen nymph
#

providing your d.js client to dblapi.js to post server count automatically

restive otter
#

Yea auto posting server count

#

@vapid cape well in overall it doesn't even emit the event... Meaning it's not working

#

Or else it should have at least logged something

violet crown
#

if you get bad request, the authorization is correct
@vapid cape it returns a 404

jaunty plank
#

Was your request a get?

violet crown
#

no a post

vapid cape
#

@restive otter test with reqbin, with something like {"user":"test123"} in the body

#

and with authorization

restive otter
#

K

#

Wait where am i gonna put {"user":"test123"}

vapid cape
#

in reqbin in the body field

sullen nymph
#

request body

vapid cape
#

@violet crown 404 means url not found

violet crown
#

yeah ik i fixed i got an error but now the real error is a timeout

vapid cape
#

a timeout means firewall is blocking it

#

where is it hosted?

violet crown
#

ovh

#

wait no

#

oneprovider

restive otter
#

200: Wehook successfully received

vapid cape
#

windows or linux?

violet crown
#

linux debian10

vapid cape
#

check if they require ports to be opened somewhere in the admin panel

#

@restive otter and nothing in the logs?

violet crown
#

okay, so im not blocked bc i send the post loccaly with the same ip as im connecting to the server

restive otter
#

hmm lemme check

#

@vapid cape wait logs?

vapid cape
#

this console.log(User with the tag: ${vote.user.tag} has voted!);

restive otter
#

Oh i received this
User with the tag: undefined has voted!

vapid cape
#

then its working

restive otter
#

Hmm so what to do now, my Friend voted and I didn't receive anything

violet crown
#

i suppose you to fetch the id and then send the message

restive otter
#

I know

vapid cape
#

there is no vote.user.tag

#

vote.user is an id

violet crown
#

and tim thanks i notify you when my network admin answers me bc idk anything about firewall lol

restive otter
#

I know, i mean Should have at least logged

User with the tag: undefined has voted!``` when he voted?
vapid cape
#

it probably should, but if it logs correctly with reqbin it should work

#

test again with the test button

restive otter
#

Says Webhook tested! This may take a few seconds

#

This happened too before i made a request

#

with reqbin

vapid cape
#

and nothing?

#

is the url and auth exactly the same?

#

did you save before testing?

restive otter
#

Yea

vapid cape
#

did you remove the .tag just to make sure?

restive otter
#

Lemme remove and test again

wooden pewter
#

i dont get it with the port

vapid cape
#

the port is already in use

#

you cannot use the port twice

#

do you have something else using the port? like an express server?

wooden pewter
#

how can i solve /remove the first process

vapid cape
#

search your code for all instances of "process.env.PORT" or "3000"

wooden pewter
#

nah the port is always going higher lol

#

checked full code

surreal hill
#

but is the bot automatically checked or do I have to tell you to check? plz help

rapid kettle
#

its in queue

#

also pls read channel topic ty

jaunty plank
#

They check when they reach submitted bots in the queue

surreal hill
#

resume plz

restive otter
azure plover
#

i keep getting that error

#

when connecting to the DBL API

sullen nymph
#

Return the non-parsed response body

azure plover
#

Oh

#

It gets that after the bot runs for a while

#

I hit that api on every message create event

#

Could that be why?

blissful notch
#

maybe you got rate limited

azure plover
#

Yeah that’s what I’m thinking

jaunty plank
#

Thats a lot of api requests

azure plover
#

But I’ve been doing that ever since I put out the bot a couple months ago and I only got that error today

#

I should probably set it up to receive webhooks and cache those results / get that endpoint when it’s not in the cache

#

I’m just waiting for it to throw the error again

ruby ivy
#

how i can do when someone vote its sent in any channel

rapid kettle
blissful notch
#

use webhooks and listen when a user has voted or manually check if they've voted. It's in the documentation

junior lintel
#

should i use http or https?

#

My webhook settings on top.gg ^

rapid kettle
#

http

#

for ip

#

https for url

junior lintel
#

Ok, thank you.

jaunty plank
#

🤔

finite hare
#

how would you use the dblapi.js module correctly on a sharding bot?

jaunty plank
#

Dblapi.js handles shards by itself iirc?
You might have to manually post each shards server count

finite hare
#

i mean like

#

how do i use its functions on each shard?

#

it's not useable by any

#

like, DBL#hasVoted() doesn't work within any of the shards

#

and you can't branch them via a master class either

#

due to it just attempting to reuse the same address, causing you to get the EADDRINUSE error

jaunty plank
#

Don't use the webhook on anything other than your main shard

finite hare
#

the main shard, that's the first one, right?

jaunty plank
#

Yeah

finite hare
#

sure but

#

still can't use the library on other shards

jaunty plank
#

I'm not sure why?
Only the webhook uses a port

finite hare
#

mhm

#

if you add a webhook

#

and then create another instance without a webhook

#

that still causes an EADDRINUSE error

jaunty plank
#

Maybe someone else knows better than me

wooden pewter
#

so i fixed the port issue on my project and got this console.log but i dont get the console.log for new votes

#

also tried to test it on the edit page on top.gg but nothing happend :/

jaunty plank
#

Is that the url your using? Or you just edited it to hide it?

wooden pewter
#

iam using this

rapid kettle
#

herokuurl isn't your actual heroku url is it ?

wooden pewter
#

ehm xd it is

rapid kettle
#

no it isnt

jaunty plank
#

No .com? .net or anything?

#

🤔

wooden pewter
#

someone told me that its the url from heroku

jaunty plank
#

Thats where you are supposed to put your heroku url

rapid kettle
#

yea it is

wooden pewter
#

Thats where you are supposed to put your heroku url
@jaunty plank i did

#

on the code its just on the console

jaunty plank
#

So the actual url your using is something like
http://someSubdomain.herokuapp.com/dblwebhook

wooden pewter
#

where is the subdomain?

jaunty plank
#

If I understand correctly, the subdomain is your heroku projects name

#

Its above where that link takes you

wooden pewter
#

ah

jaunty plank
wooden pewter
#

okey thanks got it

#

🙂

restive otter
#

how to use here

jaunty plank
#

Your webhook url depends on your settings and hosting location

median badger
#

Hello, I sent you 15 days until now you have no answer.
@gloomy vortex do you not understand

jaunty plank
#

The docs give some examples

median badger
#

You've been told in multiple channels

#

Ask your question

restive otter
#

how can i make live server,member count on my site with php

jaunty plank
olive turtle
#

Your webhook url depends on your settings and hosting location
@jaunty plank which hosting location

jaunty plank
#

Vps/self hosted/glitch/heroku

olive turtle
#

and how i get this?

#

@jaunty plank

jaunty plank
#

How do you get what?

#

How do you know where your bot is hosted?

olive turtle
#

yes

#

Idk

#

wait

#

I have a vServer

jaunty plank
#

Like a virtual server? Vps?

olive turtle
#

yes

jaunty plank
#

Then the url would typically be
http://yourvpsip:port/dblwebhook

#

Port and dblwebhook you can define in your code.
Dblwebhook is default

olive turtle
#

huuuuuuuuh?

jaunty plank
olive turtle
#

yes?

willow spindle
#

we need a guide for webhooks

restive otter
#

help pls

olive turtle
#

i help two @restive otter

restive otter
#

what should i do now

olive turtle
#

idk

restive otter
#

what

olive turtle
#

i need help two

restive otter
#

lol

willow spindle
#

write webhook url and authorization key

#

then setup webhook server

olive turtle
#

whick authorization key

jaunty plank
#

You set auth

willow spindle
#

it is your choice

jaunty plank
#

It can be anything you want

olive turtle
#

anything?

willow spindle
#

anything

jaunty plank
#

Obviously something secure

olive turtle
#

can i check this again

restive otter
#

where can i create url and authorization

jaunty plank
#

The url is the url to your webhook server

#

Auth you set in your code

#

If you are using a lib it makes it pretty easy

olive turtle
#

What should I exchange for dlwebhook

#

Then the url would typically be
http://yourvpsip:port/dblwebhook
@jaunty plank

jaunty plank
#

The path you set in your code.
If your using the dblapi.js webhook, and are not setting something custom you can just use dblwebhook

olive turtle
#

must i host anything?

jaunty plank
#

The webhook server

olive turtle
#

how

jaunty plank
#

Depends on your lib

#

And Language

olive turtle
#

python

jaunty plank
#

Has examples and everything

olive turtle
#

omg

#

This may be complicated

restive otter
#

can somebody show me how can i do api options

jaunty plank
#

Api options?

restive otter
olive turtle
#

idk how i do that

restive otter
#

this is for server count for my bot page right ?

olive turtle
#

no

jaunty plank
#

No, webhooks are for getting vote events

olive turtle
#

@jaunty plank idk hoe this works

restive otter
#

i need this

olive turtle
#

@restive otter which langue

restive otter
#

Turkish,English

jaunty plank
olive turtle
#

i mean java or python

jaunty plank
#

Bingo

restive otter
#

java

olive turtle
#

@jaunty plank can i write you per dm

jaunty plank
#

I dont really check dms, this channel is for api related questions.

knotty radish
#

!help

restive otter
#

Whene a bot in 75 serveur how many time to discord send you a message in dm

jaunty plank
#

I think they typically send it at 76 servers.
But you can send your request at 75 on your bots page.

restive otter
#

Ah

#

@jaunty plank bot page ?

#

Omg

#

@jaunty plank thank so mush

olive turtle
#

@restive otter hgw

#

Can anyone help me with webhook votes

restive otter
#

@restive otter gg mec pour tes 75 serveurs look_uraniumcommunity

finite hare
#

does anyone know how to use dblapi.js on a sharded bot?

#

this is killing me

restive otter
#

@restive otter tnx

#

Its on 102 server

#

Gg

#

Me only 11 pepecry

cobalt hollow
#

where can i find the token 'Your top.gg token'

willow spindle
cobalt hollow
#

thx

frozen mica
#

is there a function to get the user vote cooldown?

dapper copper
#

Literally

#

get the time they voted

#
  • 12 hours
#

AND BOOM

#

You have the cooldown

frozen mica
#

hmm is there have a function to get the time they voted?

#

i cant find that 02think

shy vortex
#

@frozen mica just store the times when the users voted somewhere

frozen mica
#

yes ty

restive otter
#

Am I allowed to use SFW endpoints on nekos.life?

shy vortex
#

@restive otter

sfw !== nsfw
#

(yes you can since its not nsfw)

restive otter
#

Okay, thank you

trail sigil
#

-api

abstract mothBOT
latent narwhal
#

umm

#

one error is happening

#

the dbl api sends vote event even if someone didn't voted

#

like i pressed vote button

#

and top.gg said that i already voted in last 12 hrs

#

but still my bot sent me a message saying thanks for voting

#

which is under vote event

vapid cape
#

you're setting up a webhookServer

#

so the server's port is used

junior lintel
#

Which port do you recommend using? Preference?

vapid cape
#

pretty much

junior lintel
#

Let's say I do 80, then I still get the same error.

vapid cape
#

ports < 1024 are restricted to root/admin

junior lintel
#

I'm on an ubuntu VPS, so all my ports are open by default.

#

All the ports I've tested so far has given me the same error, even < 1024.

vapid cape
#

if you want to use ports < 1024, you have to run the node process as root

#

which is not recommended

#

but other ports should work, just make sure you're testing the correct one

#

if you use webhookServer:server, and server.listen(7000) then you should curl 7000, not 8080

#

webhookPort is ignored if webhookServer is pesent

junior lintel
#

I forgot switching the port whilst trying other ports lol.

#

Thank you for the help mate 😉

static pond
#

Whats the best way to debug with the api using a testing bot (aka not production)

#

as far as i can see, it blocks connections using a different bot

vapid cape
#

what do you want to debug?

#

the rest api or webhooks?

static pond
#

api

#

using dblpy

#

im guessing i could make a new bot listing for my testing bot

#

running the production bot on my wifi is hard

sullen nymph
#

There's the option of scrapping dblpy

static pond
#

scrapping?

sullen nymph
#

you can run dblpy on your prod bot account separately also

#

aka not using dblpy and doing manual requests instead

static pond
#

ah yeah thats a option.

#

i think ill just suck it up and run production locally

vapid cape
#

you dont need to run the entire bot

static pond
#

i dun wanna make a whole new thing rn :p

vapid cape
#

you can make a simple script with only dbl.py and nothing else

sullen nymph
#

ps please don't name your files/folders dbl

vapid cape
#

pythonk

sullen nymph
#

pain

static pond
#

lmao

#

dont worry i use topgg where possible

sullen nymph
#

noice

latent narwhal
#

you're setting up a webhookServer
@vapid cape
How to make it sure

static pond
#

thanks for the help and i hope the head guys enjoy my money

latent narwhal
#

That vote is completed

vapid cape
#

wdym

latent narwhal
#

You said me this

vapid cape
#

i was responding to Krybskytten

#

he deleted his code for some reason

latent narwhal
#

Oh

#

Makes sense

vapid cape
#

@latent narwhal

i pressed vote button
and top.gg said that i already voted in last 12 hrs
but still my bot sent me a message saying thanks for voting
if this is really happening then there's something wrong with top.gg, nothing you can do about it

latent narwhal
#

Ok

arctic arch
#

does that happen every time or only every 12 hours

latent narwhal
#

does that happen every time or only every 12 hours
@arctic arch
Everytime
Like u voted for my bot and u got a thanks message
Then few mins later once u press the vote button
Top.gg will say you already voted but will send info through API and my bot will send u msg saying thanks for voting again

full walrus
#

If I post stats manually (dblapi.js) for servercount do I specify the servercount for current shard or servercount across all shards?

vapid cape
#

if you define shard information, it will be for those shards

#

if you only pass the count, without any sharding information, it will be for everything

full walrus
#

Ok thanks

vapid cape
#

if you use the autoposter, it will detect shards for you

slate tapir
#

Bruh, whats an API?

median badger
#

...

slate tapir
#

In Indonesia Api means Fire 😂

#

Thats why im confused

sullen nymph
compact creek
#

Must i change anything on this line of code from the dblapi.py?

self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
jaunty plank
#

Probably want to change the auth to something more secure.
And if port 5000 is unavailable a diffrent port(it only isn't available on some platforms like glitch or heroku, or some other program is using it)

compact creek
#

okay

#

@jaunty plank On the website what must i put in the webhook url option

jaunty plank
#

For webhooks yes

#

and auth in the auth section

compact creek
#

so what is the url

#

is it my server ip or port?

jaunty plank
#

http://ip:port/dblwebhook

compact creek
#

okay

restive otter
#

I’ve entered the token in for the API (getting server count etc)

#

How long does it take to appear

jaunty plank
#

Typically instantly.

timber mason
#

^

restive otter
#

Probably a stupid question on my part but its been like this for ages now, why does my bots presence on its top.gg page appear as • ??? instead of a green dot saying its online

trail sigil
#

your bot is likely not in this server @restive otter

#

-api

abstract mothBOT
trail sigil
#

wrong channel to ask tho

restive otter
#

ahh alright my apologies

young yoke
#

?

teal plaza
#

Anyone know anything about voting detection with sharded bots? Mine broke as soon as I sharded. Do I have to use webhooks?

median badger
#

well you have to use webhooks

jaunty plank
#

i was helping someone else with this earlier.
but from what i understand, having the webhook on its own process not on bot, or only on your main shard(the first shard) is how to do it

rapid kettle
cyan stump
#

@rapid kettle Idk why I said api I thought it did

#

My bad

slate crown
#

a

jaunty iron
#

Hello! How to put like the bot DMs you when you vote for the bot on top.gg?

jaunty plank
#

webhooks

haughty barn
#

How can I test my webhook without having to wait for 12 hours with voting?

sullen nymph
#

test button on your bot's Edit page

haughty barn
#

That's very helpful! Thank you

sullen nymph
cursive geode
#

I don't know my webhook doesn't work

#

but api posts server count

#

https://0.0.0.0:5000/dblwebhook

#

is this a valid url ^ ?

jaunty plank
#

0.0.0.0 means any ip that the server has access to

#

youd need to put your own public ip

cursive geode
#

it still doesn't work

jaunty plank
#

typically its also http:// not https://

olive turtle
#

can anyone help me

median badger
#

Maybe ask the question

olive turtle
#

Do I need to host anything for the webhooks?

willow spindle
#

you have to create a webserver for receiving requests which coming from top.gg

olive turtle
#

how?

jaunty plank
lavish elm
#
        const DBL = require('dblapi.js');
        const dbl = new DBL(dblToken, { webhookPort: 8080, webhookAuth: 'pass' }, client);


        dbl.webhook.on('ready', hook => {
            console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
        });```

My server count is not being posted
#

Any idea why? (Token is right)

#

Also, webhook for votes is working good

jaunty plank
#

Id add the posted and error events just incase its not erroring and attempting to post

dbl.on('posted', () => { console.log('Server count posted!'); }) dbl.on('error', e => { console.log(`Oops! ${e}`); })

https://top.gg/api/docs#jslib

#

Bad copy pasta pandasad

lavish elm
#

Sounds good!

#

Will ping you with an update

restive otter
#

-api

jaunty plank
#

It was an api related question

restive otter
#

-api

#

!help

prime warren
#

!p blank space

upper acorn
#

Hey my bot isn't posting any stats

opaque jetty
#

it doesn't do it automatically

#

are you posting them using a lib or something?

upper acorn
#

I have the autoposter set up through a webhook

#

But it's not updating

opaque jetty
#

wha

#

a webhook handles traffic from dbl -----> your bot

#

you need to send traffic from your bot ------> dbl

#

if you're using js do ```const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);

// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})

dbl.on('error', e => {
console.log(Oops! ${e});
})```

#

@upper acorn

upper acorn
#

aight ty

olive arrow
#

Or you can write your own script to do it for you

#

Without needing modules

lean harbor
#

How Can I Get DBL Api Key

median badger
#

you need to have an approved bot

livid matrix
#

How do I use webhooks to post votes? Because I put the webhook there and nothing happened.

rapid kettle
#

you don't post votes

livid matrix
#

Public what?

azure plover
#

Webhooks are for receiving "notifications" when someone upvotes your bot. Similar to how you make a request to an API to retrieve info, DBL will make a request to your "API" when someone upvotes, and you can do stuff with that data. @livid matrix

#

You can log it in a Discord channel, you can give them perks within your bot, etc

#

Posting your bot's server count to DBL is done by a POST /bots/:id/stats

#

You can either use one of their client libraries or just make a regular post request according to their docs: https://top.gg/api/docs#bots... example:

curl https://top.gg/api/bots/:id/stats \
   -H "Authorization: $TOKEN" \
   -d '{ server_count: 1 }'
livid matrix
#

a

young haven
#

help

ready.js:17
                        dbl.postStats(client.guilds.cache.size, client.shards.Id, client.shards.total);
                                                                              ^

TypeError: Cannot read property 'Id' of undefined
    at Timeout._onTimeout (C:\give16do07\events\ready.js:17:58)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)```
rapid kettle
#

client.shard?

#

and isn't it id and not Id

young haven
#

this is the example that is on the api site of top.gg

young haven
#

and isn't it id and not Id
@rapid kettle even making this change, the error remains the same

rapid kettle
#

no idea

young haven
#

I'm using this example

client.on('ready', () => {
    setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);
});```
jaunty plank
#

The example on the dbl website for manual posting is for djs 11 iirc

#

Its just outdated, and isn't copy paste.

spiral steeple
#

The method is still the same

#

The lib handles 11 and 12

jaunty plank
spiral steeple
#

Oh, not sharding lmao

#

Idk if you can even get the current shard id

#

Without using a guild

jaunty plank
#

Iirc, that's how it worked in 11 right?

spiral steeple
#

Something like that, the only way I know is on v12 is <Guild>.shardID

glass steeple
#

typically its also http:// not https://
If the service doesn't serve via SSL

jaunty plank
#

99% of users are not going to setup ssl for their webhook.

glass steeple
#

All you need is a cert 🙂

jaunty plank
#

And a domain, unless you self sign

#

Let's encrypt requires a domain

glass steeple
#

Does that work with no-ip.org? I feel like I've used this before, and if that's the case, I was def using no-ip

jaunty plank
glass steeple
#

provides what, the cert?

jaunty plank
#

Yeah

glass steeple
#

I was more concerned about it being a subdomain

#

x.y.etc

jaunty plank
#

Iirc, you cant cert a subdomain unless you own the domain

glass steeple
#

That's my concern as well

jaunty plank
#

Yeah

glass steeple
#

🤷‍♂️

jaunty plank
#

So I think noip would provide a cert, or you cant

#

You could self sign a cert, but browsers would reject it

placid peak
#

just do cert with following stuff *.domain.(your domains end, like com) www.*.domain.--/-- domain.--/-- www.domain.--/--

#

thats messy ik

tall jolt
#

hello

jaunty plank
#

Doesn't letsencypt try and send requests to domain.--/-- which he wouldn't be able to get certs for?

#

Since he wouldn't have acess to it

frozen mica
#

how can i know when the bans time is over? nvm the bans time is over

haughty barn
#

If I'm running the bot from a local server the host of the dbl says it's http://0.0.0.0:5000/dblwebhook . I tried to type both that and my public IP into the edit page url form but I get no response when trying to test. Is there an obvious mistake I'm not seing?

rapid kettle
#

did you port forward?

#

plus you're right with the public IP.

haughty barn
#

Ok. No I didn't port forward, I will try that. Thank you.

jaunty plank
#

If your bot is on a system with a firewall, you also need to let the port through the firewall

inland falcon
#

=help

haughty barn
#

I wrote the dbl webhooks inside the app of my bot and deployed it to heroku. The syslogs says it's running on 0.0.0.0:port/dblwebhook.
How can I communicate with that ip?

jaunty plank
#

0.0.0.0 just means any ip that the server has access to

latent narwhal
#

Umm

#

My bot is in 418 servers

#

From 417

jaunty plank
#

did it just get to 418?

#

has your program done a postStats since the change?

restive otter
#

i have problem

rapid kettle
#

read channel topic.

restive otter
#

what is it

rapid kettle
restive otter
#

sorry

willow spindle
#

what

restive otter
#

what

unborn canyon
#

he's a genius

junior cedar
#

;-;

restive otter
#

@restive otter

It's off topic, but you should check the guilds your bot is in and check how much guilds are from the same discord-user,
if someone's using your bot more than for example 2 times, you should kick your bot out of one guild.

#

oh okay

#

If you got any questions please DM me, the Discord Bot List isn't responsible for any discord-bot verification...

#

oh okay
@restive otter 👌

latent narwhal
#

has your program done a postStats since the change?
@jaunty plank
What do you mean by that

#

My bot is in now 422 servers

#

But it still

#

Says 417

short glen
#

can you help me with the vote system?

#

im using discord.js and heroku

severe quiver
#

Right so I want to manage stats posting from each of my shards and the webhook from the manager - how do I stop the manager from trying to post stats?

arctic arch
#

don't add the client in the constructor @severe quiver

severe quiver
#

Wew it's the real tonkku

#

Thank you very much

restive otter
#

hii

#

i need help regarding webhooks

rapid kettle
#

@restive otter what do you need

restive otter
#

i want create a webhook regarding youtube

rapid kettle
#

not youtube api

restive otter
#

it will work or not

rapid kettle
restive otter
#

oh ok sorry

severe quiver
#

Right I have another question about the right API lol

rapid kettle
#

ok

severe quiver
#

It appears that my webhook is not starting at all - nothing logs, not even an error

#

My token is there, the config is there

#

(and I checked whether dblapi.js is installed and it is)

#

So my question is help?

#

(pls)

#

n e v e r m i n d I fixed it

ionic ocean
#

Does the Java library have webhooks?

jaunty plank
#

It doesnt seem to.
You'd have to make it yourself

ionic ocean
#

What about the .js library?

median badger
#

Mhm

ionic ocean
#

Time to learn some basic .js then.

mellow sun
#

@dim halo

dim halo
#

?

mellow sun
#

Mg pv?

dim halo
#

yes

mellow sun
#

Zaproś do znaj

dim halo
#

for what?

mellow sun
#

Bo nie mg pisać do ciebie

dim halo
#

you have question of my bot?

#

ps: why you typing on api channel? XD

mellow sun
#

Idk XD

#

It's about the server what had 2000 raise

dim halo
#

2k what?

#

wait I opening my dm

mellow sun
#

Plz pisz po polsku xD bo mój angielski słaby

#

Pv

dim halo
#

ok, opened

mellow sun
#

Send a friend request

dim halo
#

no, this is english servsr

#

no, my dm is opened

median badger
scarlet cobalt
#

One message removed from a suspended account.

latent narwhal
#

ok

tawny pelican
#

my bot doesnt have a api and if it has idk where

jaunty plank
#

You must make a webhook server on your bot. You can use the libs or make your own

tawny pelican
#

Ok but how?

#

I can't understand docs as i said

latent narwhal
#

@tawny pelican do u use glitch?

tawny pelican
#

Yes but host on a vps

latent narwhal
#

;-;

#

wym

#

anyways

#

for glitch

#

it would be

#

@tawny pelican

#

https://web.hook/your-glitc-project-name.glitch.me/dblwebhook

tawny pelican
#

Yes

latent narwhal
#

this

tawny pelican
#

ok

#

and what bout dbl webhook?

#

whats that and where

latent narwhal
#

huhu

tawny pelican
#

Ok

#

lol

latent narwhal
#

that's what i am telling u

jaunty plank
#

Thats the path you define in your code

latent narwhal
#

rn

#

^^^^^^

tawny pelican
#

its that only

latent narwhal
#

and u can see pins

tawny pelican
#

i rhink

latent narwhal
#

for exapmples

#

examples

tawny pelican
#

Ok

#

And what if i request api for bot from my host

jaunty plank
#

Thats not really a proper url

latent narwhal
#

^^^

tawny pelican
#

Ok

#

what the proper url

#

I got api

#

for my bo

#

bot

jaunty plank
#

What do you mean by that

tawny pelican
#

how does api look likes

jaunty plank
#

Requesting from the api, is a bit diffrent than webhooks

raven quiver
#

Hi

jaunty hamlet
#

Hi, so I'm confused onto how to make a voting system.

#

Well, voting notifications.

#
const dbl = new DBL(client.config.tokens.tokenDBL, { webhookPort: '3000', webhookPath: '/newVote', webhookAuth: 'Auth' }, '717034854012813404');
willow spindle
#

the 3rd parameter should be a your client

#

not a client id

jaunty hamlet
#

ok

#

@willow spindle, does the rest look fine?

#

My console is telling me the webhook is hosted at 0.0.0.0:port/newVote

#

I'm not sure of that's how it's supposed to be.

arctic arch
#

the 3rd parameter has nothing to do with the webhooks

jaunty hamlet
#

Well.

arctic arch
#

replace 0.0.0.0 with your server's public ip

jaunty hamlet
#

Yeah, I figured.

arctic arch
#

dont forget the http

jaunty hamlet
#

{ webhookServer: 'http://ip', webhookPort: '5000', webhookPath: '/newVote', webhookAuth: 'auth' }

#

correct?

arctic arch
#

no don't set webhookServer

jaunty hamlet
#

ok

arctic arch
#

have you filled out the webhook details on the website

jaunty hamlet
#

I'll check.

#

Yes.

#

I have,

#

For the URL

#

http://ip:port/path

#

right?

arctic arch
#

yeah

#

and the auth part matches?

jaunty hamlet
#

yes

#

http://ip:5000/newVote

arctic arch
#

is the port open on your firewall

#

(if self hosting, the router)

jaunty hamlet
#

It's on a VPS.

#

So I'll need to check.

#

It probably is though.

#

http://0.0.0.0:5000/newVote

#

ok

#

I'll try now.

#

I've opened it on the firewall.

#

Alright, thanks Tonkku. It works now!

polar falcon
maiden sail
#

@polar falcon "lol"

#

Nice

#

I wasted 1 minute

bold lake
#

Do u have tutorial for make webhook topgg ?

jaunty hamlet
#

@bold lake I don't think there's one.

#

I can guide you if you want.

true talon
#

im trying to post my bot's stats to dbl using dbl.postStats bc the automatin version doesnt seem to work, but it doesnt seem to post anything. any idea why

jaunty plank
#

Do you have the error event in your code?

true talon
#

il using discord.js-light

#

yes i have it

#

not it shows nothing

jaunty plank
#

And the posted event?

#

Does the posted event ever happen if so?

true talon
#

apparently no

#

maybe bc im using webhooks idk

jaunty plank
#

Webhooks are seperate entirely

dusty crater
#

The dank meme

#

Wut is the API for tat?

jaunty plank
#

This channel is for top.gg api related questions

#

Whats your code look like @true talon

true talon
#

nothing is logged

#

at all

jaunty plank
#

Wait, not even your setup line?

#

The console log isn't logging?

true talon
#

the setup line is logged obviously

jaunty plank
#

It seems to just take that data and just send a request

true talon
#

hm

chrome elk
#

:okeh:

latent narwhal
#

How can I

#

Get number of votes

#

Like my bot has 62 upvotes

#

I want my bot to tell current number of votes as well

rapid kettle
#

i'd imagine you could use dbl.getBot

latent narwhal
#

Huh

rapid kettle
#

scroll down

latent narwhal
#

ok

#

It's .getVotes

#

But in this event?

i'd imagine you could use dbl.getBot
@rapid kettle

#

What about event I am using

rapid kettle
#

afaik dbl.getBot provides votes too

latent narwhal
#

ok

#

what is afaik

rapid kettle
#

because dbl.getVotes doesn't work above 1000

latent narwhal
#

As far as I know ?

rapid kettle
#

yes