#topgg-api

1 messages ยท Page 131 of 1

deft violet
#

ah

#

ok

#

Error: listen EADDRINUSE: address already in use :::1500

#

uh oh

jaunty plank
#

you cannot use a port you already are using

#

seems like 1500 is already in use

deft violet
#

wait so my Webhook URL cant be the same as the port?

jaunty plank
#

the url is
http://youip:yourport/yourpath

#

the port needs to be the same between the url and the code

deft violet
#

ok

distant oak
deft violet
#

Error: listen EACCES: permission denied http://myip:1250/webhook

rapid kettle
#

just make it 3943 or something

deft violet
#

both dont work

#

._.

deft violet
#

wdym

deft violet
#

home

hot axle
#

you're posting stats every millisecond or so

#

that's way too many requests

rain heart
#

Congratz

#

you're banned for an hour now

#

Read the full docs before using the top.gg api

#

not just jump into it

simple rune
#

oh gosh I'm stupid

hoary brook
#

For some reason even tho my vote logger is correct it doesn't work

rain heart
#

did you add the webhook url to your webhook settings on your bot page?

hoary brook
#

Everything works except the vote thingy like my vote client doesn't log


dbl.webhook.on('vote', async vote => {
   console.log(vote)
   const userID = vote.user;
   if(channelForWebhooks) await channelForWebhooks.send(`User with ID \`${userID}\` just voted!`);
})
hoary brook
#

I replaced port and ip with the port and ip

rain heart
#

wrong

hoary brook
#

Then?

rain heart
#

http://ip:port/dblWebhook

#

replace ip with the ip and port with the port

hoary brook
#

Ok

rain heart
#

this is the proper usage

hoary brook
#

Omg works

#

@rain heart how do I make a webhook to post it like not my bot but a webhook poster it

#

Post*

rain heart
#

what?

#

can you elaborate?

hoary brook
#

@rain heart like I make a webhooke for a channel and using the webhook token when someone votes the webhook sends user has voted

#

Webhook*

rain heart
#

you can make a request to that webhook then

hoary brook
#

Ok

rain heart
#

if you're referring to a discord webhook

hoary brook
rain heart
#

you need to query the user's full name through the library you're using then

hoary brook
rain heart
hoary brook
#

@rain heart no no I mean I don't know how to refer to the webhook

rain heart
#

Can't really help with making that unfortunately, as i dont code in js

hoary brook
#

oh ok

hoary brook
#

So that instead of mention it comes as tag

rain heart
hoary brook
#

I don't understand

dire imp
#

The total votes that my bot is querying from the api is not accounting for double votes of weekends. (In top.gg it's 55 votes but when querying it's 40 only) is there a way to correctly count the weekend votes too?
(I'm using discord.py btw)

rain heart
#

it is accounting that

hoary brook
#

Not id

rain heart
#

You need to get the tag from the user through your bot library

#

through discordjs presumably

hoary brook
#

${message.author.tag}

rain heart
#

that's not how it works

#

you need to get it through your library

#

read the docs

restive otter
sullen nymph
#

Log in

restive otter
#

okat thx

sullen nymph
#

In browser yeah

rustic stirrup
#

Hi hi, I am completely lost on how to get a webhook for vote messages, I have to code I just need to know how to make a webhook lol

#

Node JS

willow spindle
rustic stirrup
#

lol tnx

frigid thunder
#

with the top.gg py api can u pull when a user votes?

green roost
#

Setup a webhook

restive otter
#

how do i setup a webhook?

#

please help?

#

@green roost

green roost
#

Library probably has support for this. Which language?

restive otter
#

python

green roost
#

HTTP requests were borked on 3.9 last I checked, but webserver stuff should work fine ig

restive otter
#

yeah i saw that, but still aint sure on how to setup a webhook

#

when you come to the site

green roost
#

Just set the webhook port, auth and path properly

#

And pass the URL as http://yourip:yourport/yourpath in the URL field on the website

thorny thicket
#

Hey, I am trying to setup webhook in node-sdk
Do I need to run webhook server separately?

restive otter
#

your path in the sense?

green roost
#

webhook path. It's /dblwebhook by default. Take a look at the docs.

restive otter
#

ok ok ok @green roost thanks let me give it a shot

thorny thicket
green roost
#

Sure you could do that

thorny thicket
#

How do you do this? combined in 1 file ?

green roost
#

I tread on dangerous ground and do this manually lol

#

It's unsupported tho, so don't do it unless you know what you're doing, I just don't like extra deps.

thorny thicket
#

If I use different files.. how do I handle "vote" event? ๐Ÿ˜‚

#

this is confusing

green roost
#

Have you set up the web app to listen for the webhook post?

#

There's a pretty complete example in the docs I sent

thorny thicket
#

I am thinking about that.. but how would I handle the vote event?
Like I want to send message in channel

green roost
#

This is also covered in the docs, except it logs to console. Just change that to redirect to a channel

thorny thicket
#

This is also covered in the docs
Where? Couldn't find it

green roost
#

The app.post part.

#

top.gg sends a POST request everytime there's a vote

rustic stirrup
#

I have the code to make the webhook running but whenever I try to connect I get "Cannot GET /dblwebhook" any ideas?

restive otter
#

you should do a post request

#

and not get request

serene veldt
#

^

rain heart
#

you can't make get requests to it

rustic stirrup
#

Click the test button?

rain heart
#

yes

#

make sure you pressed save first before testing

rustic stirrup
#

Oki, what is suppose to happen? lol

rain heart
#

your webhook should get a request then upon testing

rustic stirrup
#

How do I know if it did?

rain heart
#

again, if you received a request

#

if you didn't, it most likely didn't work or it is not working

rustic stirrup
#

Yep didn't work hmmm

rain heart
#

dm me the url

#

I can try it from a more controlled test

rustic stirrup
#

Dosn't it have my ip thoe...

rain heart
#

I won't do anything with it, don't worries KEKW though if you don't feel comfortable, just test it yourself using something like postman to make your own test-request

rustic stirrup
#
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook(Password is here) // add your top.gg webhook authorization (not bot token)
console.log("ONLINE");
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
    console.log("Connected");
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 221221226561929217
}) // attach the middleware

app.listen(3000) // your port``` This is code right?
rain heart
#

did you enter the authorization inside your top.gg bot page settings too?

rustic stirrup
#

Yes

thorny thicket
#

Hey, I want to test events on webhook on my local system.. how can I do that?
I mean what to enter in Webhook URL so that it'll send post req on my pc's webhook

rain heart
#

if your webhook is running on your pc, you need to portforward

thorny thicket
#

ah... can you explain please? ๐Ÿ˜…

rain heart
#

I cannot assist you with how to portforward, you will need to look up a few tutorials on how you can get started

rustic stirrup
#

Could you host the webhook of something like heroku?

rain heart
#

for the webhook

thorny thicket
deft violet
#

how do i set that up

rain heart
#

in the sense of if you connected it to another router

deft violet
#

is it tcp & udp?

rain heart
#

just use all protocol

thorny thicket
#

Basically no need to portforward on secondary router?

rain heart
#

No, portforwarding is not going to work if your secondary router is just connected to your main router

#

you need to open external ports

#

"outside" ports

rustic stirrup
rain heart
#

not sure

#

never used heroku

#

i always host on a vps

rustic stirrup
#

Wait there is a special section for them lol

thorny thicket
rain heart
#

for that particular internal ip (internal ip of the pc the webhook is running on)

thorny thicket
#

and I use my public ip for Webhook URL on top.gg?

rain heart
#

yes

thorny thicket
#

like : http://<ip>:8081/dblwebhook

#

thanks

rain heart
#

yup

#

if 8081 is the port you use

thorny thicket
#

There's a problem
my pc is connected to secondary router.. with ip : 192.168.1.1 and main router has ip 192.168.0.1
so it's not allowing port forwarding on my pc's ip address 192.168.1.103 cuz it's different network segment ๐Ÿ˜‚

rain heart
#

that is what i was referring to

#

portforwarding isn't going to do anything if the port is not opened on your main router

thorny thicket
#

F

#

now either I have to disable DHCP server on 2nd router and make some changes to make sure every system has ip from main router and all are on same network segment
or I test this on my laptop cuz code will run on VPS anyays ๐Ÿ˜‚

#

which one sounds good?

rain heart
#

test the webhook on your vps

thorny thicket
#

It'll work but I need multiple tests cuz I want role and message for upvote user on upvote

#

So I need to test those things.. I can't do it on VPS cuz it'll be tedious to modify code on VPS

#

I'll figure it out, thanks for the help :)

wanton cliff
#

I made voting required command to my bot. When I test the webhook. Everything worked correctly. But when I do the voting required command in my bot nothing happened and this error has found in the console.

    at IncomingMessage.<anonymous> (/home/runner/TopggWebhooks/node_modules/dblapi.js/src/index.js:118:25)
    at IncomingMessage.emit (events.js:327:22)
    at IncomingMessage.EventEmitter.emit (domain.js:483:12)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:270) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:270) [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.```

This is the message event code.

```javascript
client.on('message', message => {
        if(message.content.startsWith('!ping')){
         dbl.hasVoted(message.author.id).then(c => {
                if (c){
                        message.channel.send(`Pong ${client.ws.ping}ms`)
                } else {
                        message.channel.send(`You haven't voted me on top.gg!`)
                }
          })
        }
})```
Any help would be highly appreciated
rain heart
#

or wrong

#

or missing

hoary brook
#

@wanton cliff
Regen ur token and try

rain heart
#

as seen by the 401

hoary brook
#

Or ur missing authorisation

rain heart
#

though they're using the library, so probably not that

wanton cliff
#

I'll try regen. token

rustic stirrup
#

I can't find what the url is for the heroku serverLMAOPAINducky

wanton cliff
#

I'm still getting that error

#

When I test the webhook. It works good

#

When test the webhook 726481895961002065 has voted me!

wanton cliff
restive otter
#

ok

#

so i wanna confirm

#

will this be my webhook?

rain heart
#

replay myip with your server ip then, yeah

#

dblwebhook if you defined it dblwebhook

restive otter
#

im suuuuuuuuper confused lol

#

wait

#

@rain heart

#

i have this defined in my code

#

dblpy = dbl.DBLClient(client, gg_token, autopost=True, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)

rain heart
#

then that is your webhook

#

authorization would be password

restive otter
#

wait sorry again, what is my webhook?

#

really sorry, just new to this, would be nice if you could help me thru, really

rain heart
#

Authorization

#

the key that authorizes your webhook

#

the Authorization field

#

would be in your case password

restive otter
#

aha ok

#

and webhook url?

#

what do i input there?

rain heart
#

your webhook url

#

the one you just posted

#

just replace myip with the ip the webhook is hosted on, for example a vps

#

or where your bot is hosted on

restive otter
#

suppose self hosted will be my ip

#

correct?

rain heart
#

self hosted referring to what? hosted on your own pc?

wanton cliff
restive otter
#

yeah

wanton cliff
#

So

#

It's working when testing

#

But it's not working when doing a command

#

just that error

rustic stirrup
#

Has anyone managed to setup the top.gg webhook on a heroku appLMAOPAINducky okbyeWaddles

rain heart
#

because it is not authorized

#

again make sure the token is correct

#

let it print out etc

wanton cliff
#

It's working when testing. That means token is correct

rain heart
#

then where's the issue if testing it works?

#

i dont get it

wanton cliff
#

Ok. There's a option to test the webhook in the top.gg right?

rain heart
#

Ohhh

#

your webhook doesn't work?

wanton cliff
#

It's just that error

rain heart
#

thats not webhook related according to the error message

wanton cliff
#

Also when test top.gg send a webhook to my discord server channel. But it won't work when doing a command

wanton cliff
#

That's why I want to know what is that error and how can I fix that?

rain heart
#

wrong server still

#

what "robot" are you talking about

wanton cliff
#

I can send the sample code to the bot. I made a new code for testing.

#

token is stored in the config.json

#
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json')
const DBL = require('dblapi.js');
const dbl = new DBL(config.token, { webhookPort: 5000, webhookAuth: config.dblauth });

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.user} has voted me!`);
    const webhook = new Discord.WebhookClient('804254555314585641', '1B9V4yc-V9UgQeDHUa2i_RvApSCpZ_wlnCvJkrrRHIsEaxJnYSBY7smK6dPdoFdeGHDD');
    webhook.send(`${vote.user} has voted me!`)
});

client.once('ready', () => {
        console.log('Bot is online!')
});

client.on('message', message => {
        if(message.content.startsWith('!ping')){
         dbl.hasVoted(message.author.id).then(c => {
                if (c){
                        message.channel.send(`Pong! ${client.ws.ping}`)
                } else {
                        message.channel.send(`You haven't voted me on top.gg!`)
                }
          })
        }
})

client.login(config.token);```
This is the sample code
sullen nymph
#

@restive otter -api

#

...

#

-api

abstract mothBOT
#

TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs

rain heart
#

shiv needs to re-learn the commands headpats

restive otter
#

127.etc is local host right?

rain heart
#

yes

rustic stirrup
#

Is there a way to get who voted without webhook?

rain heart
#

yes, with the api

#

if you want to get vote events though

#

you need webhooks

rustic stirrup
#

I see

#

But will api do for now?

wanton cliff
#

Sample one

rain heart
#

if you want live updates, webhook

rustic stirrup
rain heart
wanton cliff
#

Any answer for my question?

civic beacon
#
  const Topgg = require('@top-gg/sdk')
  const api = new Topgg.Api('Your top.gg token')

  setInterval(() => {
    api.postStats({
      serverCount: client.guilds.cache.size,
    })
  }, 180000) // post every 30 minutes```
#

is not it right?

restive otter
#

it is right

rustic stirrup
rain heart
wanton cliff
#

Any hints?

civic beacon
#

:/

uncut lintel
#

Hi i am unsure on how to add the server count on top.gg

restive otter
#

ahhhh how do i find my vps's ip? ๐Ÿ˜‚

rustic stirrup
#

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["authorization"] Hmmm

#

Now it works ok...

restive otter
#

ok i have another question

#

how do i use this without cogs

#
@commands.Cog.listener()
    async def on_dbl_vote(self, data):
        """An event that is called whenever someone votes for the bot on top.gg."""
        print("Received an upvote:", "\n", data, sep="")
restive otter
#

use either event or listen deco

kindred swift
#

Sometimes the website shows that my bot is in 2 servers

#

This usually fixes after I restart my bot

#

This usually happens when it passes 100

#

Happened last time too

#

@vital anvil Broken?

import dbl
import discord
from discord.ext import commands


class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = ('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijc4OTkxMTYzMzMyMDM0NMCIsImJvdCI6dHJ1ZSwiaWF0IjoxNjA5Njk0MDg1fQ.ntaEtGOqIVSV6WkKLksZWhAjYV6bQa5m-fN7apNkGh0') # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes

    async def on_guild_post():
        print("Server count posted successfully")

def setup(bot):
    bot.add_cog(TopGG(bot))
```This is the cog I use.
#

Oh whoops

#

where do i do that whoops

#

thx

kindred swift
#

Well still the bug happens from time to time

deft violet
#

sorry was in online class, no :(

#

ok

#

leme see...

#

k im here

#

what should the internal and external ports be

#

waid

#

OOO

#

i was using the wrrong thing

#

sec

#

leme find my router

jaunty plank
deft violet
#

oki il @ you when ive done it

restive otter
#

(node:39) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 posted listeners added to [DJSPoster]. Use emitter.setMaxListeners() to increase limit

#

I got this error

hot axle
#

you're using too many event listeners

restive otter
#

Hello how we make a API ship

#

Wdym ship

#

The command ship

sullen nymph
#

-api

abstract mothBOT
#

TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs

hot axle
#

oh cool

#

-api

#

what

wintry oracle
#

lol saw it

twilit birch
#

-api

knotty lotus
#

Still a tad confused on how to set up a webhook to be notified of votes. Here's what i have:

const DBL = require('dblapi.js');
const dbl = new DBL(process.env.TOPGG_TOKEN, { webhookPort: 4000, webhookAuth: 'test' });
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!`);
});

However, the test button doesn't work at all (nothing comes out in console). What am I doing wrong?

#

(a ping with response would be great)

jaunty plank
#

also dblapi.js is deprecated

knotty lotus
#

what is the public ip

jaunty plank
#

where are you hosting your bot?

#

home/vps/repl/heroku etc

knotty lotus
#

repl

jaunty plank
#

you wont have one, youll need to use your repl url

knotty lotus
#

okay

jaunty plank
#

also repl expects you to use 8080 as your port. iirc

knotty lotus
#

so it should be the replurl + :8080?

jaunty plank
#

your code needs to be 8080 webhookPort: 4000 should be 8080

#

then your url will be
yourreplurl/dblwebhook

knotty lotus
#

oh okay

jaunty plank
#

its just hardcoded to say that

#

it has no way of knowing your using repl

knotty lotus
#

oh okay

#

oh nice it works now

#

ty

restive otter
#

is there a top.gg api wrapper ?

#

for python ?

jaunty plank
potent tusk
#

someone who speaks spanish ?, help me to use the API

rain heart
potent tusk
#

how do i get a weebhock? Password

rain heart
#

you create that yourself

potent tusk
#

Ok, I will try everything it says, any error I come to warn

potent tusk
#

How is it achieved? I want to make my bot notify when they vote for it

#

sorry if misunderstood, i'm using translator

#

How?

twin walrus
#

how to create webhook in mobile?

potent tusk
#

Use Google

twin walrus
#

ok, I created.

#

i created a webhook, how to make the bot send "DynamicFighter#0001 has just Voted" in that channel?

potent tusk
#

Use the weebhock

#

I recommend you watch a video

#

How do I get the password for the weebhock? @slim storm

#

Srry for ping

dire imp
potent tusk
#

My discord account password?

#

That I remember I have not provided any password

#

Aaaa

#

xD

#

Password random?

#

A question

#

I saw a video on how to do the vote but he gets a panel, which panel is it?

#

Yes something like that

#

what you see in the photo

#

What kind of menu is it?

#

@slim storm

#

No

#

It's from a video xD

#

But how do you access that?

#

That does not appear to me as panel D:

#

I use a host not my PC

#

Not a VPS

#

Used glitch

#

But I reached the deadline xD

#

Okay

#

But my question is:

#

How do i get to pa

#

That appears in the photo

#

Yes

#

Okay

#

I just need the token and right?

#

The other is optional

#

Leave try, but I don't know how to know if it works xD

#

Orita all my friends are you asleep

#

xD orita

#

I use a translator

#

D:

#

Ok

#

pass me the weebhock part?

#

@slim storm

#

To send a message to a discord weebhock

#
dbl.weebhock //etc xD```
#

For me to send a

#

To send a message to the weebhock created in a channel

#

Yed

#

Yes*

#

Yes

#

I just need to make him send a message to the weebhock who creates in a channel

#

example: 588911640624496673 You voted for me

#

xd

#

I already have that :p

#

Wait

#

I think what I want to do is in the docs

#

does not say

#

What I'm looking for is to send a message to the webhook that I did

#

I don't know what the image is

#

It does not appear in my bot

#

I mean this

#

No me aparece asรญ

#

F translate

#

;-;

#

XD

#

Wait

#

Already

#

It doesn't appear like that to me

#

Nothing like that appears to me

#

:'(

#

Ok

#

:0

#

I did not know that the other things appeared

#

Leave try to see if it works

#

The moment of the truth

#

: '(

#

It does not work

#

he does not command or say anything

twin walrus
#

i need help

potent tusk
#

Yes

twin walrus
#

how to make the bot send "DynamicFighter#0001 has voted in top.gg" in my webhook created channel

potent tusk
#
const DBL = require('dblapi.js');
const dbl = new DBL(process.env.TOPGG_TOKEN, { webhookPort: 8080, webhookAuth: '********' });
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!`);
});```
#

โฌ†๏ธ โฌ†๏ธ โฌ†๏ธ โฌ†๏ธ โฌ†๏ธ

twin walrus
#

I'm new to webhooks :c

potent tusk
#

Yes

#

Says ay

#

Says there*

twin walrus
#

where to get top.gg token and password? awkwardflushed

potent tusk
#

The password is random, you can put whatever you want

#

Okay

twin walrus
potent tusk
#

I'll wait for you here xD

twin walrus
#

then how to log the votes of a bot in a channel?

potent tusk
twin walrus
#

ohh ok

potent tusk
#

Use that structure if you want

#

Okay

#

Sorry xD

twin walrus
potent tusk
#

AlexIsOK#0384 You tell me when you try it

sullen nymph
#

repl.ir URLs proxy to port 8080 internally

#

Allowed port for requests is 443 aka HTTPS

#

host webhook on port 8080, send requests to 443

potent tusk
#

When you help me fix it you tell me to MD plz

#

I'm sleepy

#

See you in a while

restive otter
sullen nymph
#

The URL needs to be with just the domain

restive otter
#

i tested rn and it works lol

sullen nymph
#

As you're probably aware, HTTPS is port 443. That's where you actually send the requests. So, just the repl.co domain without port is what you need

potent tusk
#

Do not worry

sullen nymph
#

BUT you HOST the webhook on port 8080

potent tusk
#
const DBL = require('dblapi.js');
const dbl = new DBL(process.env.TOPGG_TOKEN, { webhookPort: 8080, webhookAuth: '********' });
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 is that okay?

restive otter
#

dont use the old api

#

use the new one

potent tusk
#

Oh!

#

I don't know how D:

restive otter
#

pins

potent tusk
#

Ok

restive otter
#

idk

#

it will be updated soon tho

#

yeah

#

thats what i did lol

potent tusk
#

tomorrow I see all that, which is when I have the pc

#

@slim storm thanks for your help

#

I'm going to sleep

restive otter
#

1sec

#

port is 3000 for my webhook

#

and it still works

#

ยฏ\_(ใƒ„)_/ยฏ

#

yup

#

Im using the domain

#

yup

#

ok now im confusion KEKW

#

idk what you mean by protocol lol

sullen nymph
restive otter
#

o

sullen nymph
#

Port 8080

restive otter
#

i do

sullen nymph
#

https

restive otter
#

only https

dire imp
restive otter
#

Because you are doing an GET request @dire imp

#

yeh

dire imp
restive otter
#

Hello

sullen nymph
#

You could use dblpy

dire imp
#

yes i am using dblpy

#

i just removed the webhook part for now because i dont need on_dbl_vote func rn

#

i just need to post the top.gg votes to my statistics command

sullen nymph
#

Are you using get_bot_info?

ionic quiver
#

Anyone help with webhook bot

restive otter
#

?doc

#

@abstract moth

dire imp
#

@sullen nymph no I'm using get_bot_upvotes()

outer fractal
#

please any information about this err
(node:41) UnhandledPromiseRejectionWarning: Top.GG API Error: 502 Bad Gateway

#

This error appeared in the console to me without reason

#

anyone will answer please ping me

outer fractal
#
(node:41) UnhandledPromiseRejectionWarning: Top.GG API Error: 502 Bad Gateway
at Api._request (/node_modules/@top-gg/sdk/dist/structs/Api.js:74:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Api.postStats (/node_modules/@top-gg/sdk/dist/structs/Api.js:94:9)
(node:41) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
#

this error

outer fractal
#

```
Message
```

Message
#

you are welcome

rain heart
hidden wave
#

There is a fork of dblapi.js named "top.gg" and it isnt archived, am I able to use it instead of @top-gg/sdk?

#

Am I able to use it instead of @top-gg/sdk?

restive otter
#

tias

hidden wave
#

What

restive otter
#

Try it and see

hidden wave
#

._.

jaunty plank
#

That lib you linked to is unofficial, you can try it just don't expect much useful support.

olive arrow
sullen nymph
#

It's officially unofficial

brisk hollow
hot axle
hidden wave
brisk hollow
#

i translate for turkish

#

but i cant understand this again

jaunty plank
#

just like you need to use a token for your bot, you need to use a token for top.gg api

brisk hollow
#

i have token

#

but i cant authorized

jaunty plank
#

it needs to be sent in the
Authorization header

brisk hollow
#

okey thanks for help

#

where will i send and how @jaunty plank

jaunty violet
jaunty plank
#

it needs to be sent in every api request in the Authorization header, or it needs to be in the initialization line of the library you use.

brisk hollow
#

okeyy ty

hidden wave
potent tusk
#

How to use the new api?

jaunty plank
#

theres a new api?

potent tusk
#

yes

#

pins

olive arrow
#

for autoposting, you could just set an interval

potent tusk
#

Can I get it to notify when someone votes for my bot?

willow spindle
#

yes

#

use webhooks

potent tusk
#

how?

willow spindle
#

what language

potent tusk
#

D.js

willow spindle
potent tusk
#

And to notify in a channel?

willow spindle
#

it is up to you

#

you can use send function of discord.js or just use discord's webhook

potent tusk
#

ok

#

Thank you

#

Do you know why he doesn't send the message?

#

@willow spindle

#
const webhook = new Discord.WebhookClient("**************", "*******************************")
  webhook.send(`El usuario con la ID ${req.vote.user} ha votado por mi :D`)```
willow spindle
#

is token and webhook id correct?

#

send full code

potent tusk
#

Yes

#

Hoo

jaunty plank
#

top.gg webhooks dont work with discord webhooks

potent tusk
#

Already served

potent tusk
#

Can you do a checkvote with @ top-gg / sdk?

spare creek
#

how do I get the servers where my bot is on the page to appear? Like the print below

#

??

rapid kettle
#

what language are you using?

oak orbit
#

I have the same question

#

and I'm using css

rapid kettle
#

why does that make a difference

oak orbit
#

I'm saying that I have the same question, how do I show the total servers on my topgg page

rapid kettle
#

what language are you using

oak orbit
#

css

#

I already said

rapid kettle
#

you cant make a bot in css?

wary ember
#

@oak orbit show code

#

ill try to help

oak orbit
#

ok wait a sec

cunning blade
#

Question: Is there a wait to check if my bot is blacklisted on the API?

wary ember
#

you'll get a non-200 http code

oak orbit
# wary ember <@!556314352073048085> show code
<style>
.entity-header__image {
    border-radius: 50% !important;
      animation: float 5s ease-in-out infinite;
}
  
@keyframes float {
  0% {
    box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
    -webkit-transform: translatey(0px);
            transform: translatey(0px);
  }
  50% {
    box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
    -webkit-transform: translatey(-15px);
            transform: translatey(-15px);
  }
  100% {
    box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
    -webkit-transform: translatey(0px);
            transform: translatey(0px);
  }
}

.entity-content__divider {
    display: none;
}
</style>
#

i just have that

#

and the description itself

cunning blade
#

Because we are trying to post stats and don't get a error but the stats don't get update with the JS package.

wary ember
#

how exactly is that code for your discord bot?

cunning blade
#

Is this normal that the stats are not updating?

oak orbit
wary ember
#

yeah

oak orbit
#

i though you are saying the code on topgg page

#

because is that what I wanted

wary ember
#

oh you're getting server count

#

you need to post the data to the top.gg api for that

oak orbit
#

ah nevermind that takes a lot of work

restive otter
#

what

#

is

#

this

oak orbit
#

thanks anyway

green mantle
#

Is it just me or have people got way lazier since i last talked here

wary ember
oak orbit
#

you code in js?

wary ember
#

yes

#

there's even a npm package for you

oak orbit
#

so can you say how do I share my data with the api?

green mantle
wary ember
hot axle
#

wait

#

that's deprecated

green mantle
#

You need to write code to send HTTP requests to the api

hot axle
green mantle
#

also yeah dice is incorrect*

hot axle
#

use @top-gg/sdk

wary ember
#

sad

oak orbit
#

i'll search thanks guys

oak orbit
#

if I put just that

const AutoPoster = require('topgg-autoposter')

const ap = AutoPoster('topggtoken', client)

it will start posting?

#

lmao

#

why did you delete your message?

plucky lichen
#

**<style>
.entity-header__image {
border-radius: 50% !important;
animation: float 5s ease-in-out infinite;
}

@keyframes float {
0% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
-webkit-transform: translatey(-15px);
transform: translatey(-15px);
}
100% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
}

.entity-content__divider {
display: none;
}
</style>**

#

||ooof||

deft violet
#

if you want to set up a on vote event, do you need to port forward?

rain heart
#

you need to use webhooks, thus port forwarding

deft violet
#

o

#

Error: listen EACCES: permission denied

kindred swift
#
import dbl
import discord
from discord.ext import commands


class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = ('Yeah I will not put it here lol') # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes

    async def on_guild_post():
        print("Server count posted successfully")

def setup(bot):
    bot.add_cog(TopGG(bot))
#

Sometimes my bot shows 2 servers

#

When I'm not in 2 servers.

#

bug?

kindred swift
#

Yeah

loud jewel
#

have u added the package?

kindred swift
loud jewel
#

try again

kindred swift
#

try again?

loud jewel
#

yeah

kindred swift
#

try what again

silent anvil
#

hi my bot got approved a few minutes ago so I decided to look at the API on the site and use webhooks but don't know exactly how to do it. It is written not to be afraid to write here, that's why I'm here :D

rain heart
silent anvil
#

I pasted the webhook link from discord on the page where it was indicated

rain heart
#

You cannot use discord webhooks for that

restive otter
#

{'error': 'Unauthorized'} on vote check

rain heart
#

Token invalid prob

restive otter
#

but browser works fine?

rain heart
#

You can check if someone voted through your browser?

restive otter
#

yes

cerulean hedge
#

How to check if a user has upvoted

restive otter
cerulean hedge
#

Thanks

#

And how do i get how many servers my bot is in on my page (Im guessing im going to need to setup a webhook)

silent anvil
#

How do top.gg webhooks work and what can they be used for?

#

is it possible to send notifications on discord from top.gg in the form of a webhook?

green roost
#

Webhooks are used to receive bite events mostly.

#

They're required once you pass like 1k monthly votes

#

And yes you can send notifs in discord webhooks with simple redirection.

#

Using a library of your choice, set up a web server on your computer to receive the webhook requests, and upon receiving the request, format and send via discord webhook.

cerulean hedge
#

How do i auth my bot with top.gg?

obtuse roost
#

How to get Authorization key for top.gg webhook ?

rain heart
obtuse roost
#

@rain heart Can't understand ๐Ÿ˜ฆ

rain heart
obtuse roost
#

didn't work.

rain heart
#

Then you're not ready to do this yet

rapid kettle
#

the webhook auth is set by you

obtuse roost
#

is there any blog post for this?

brave nest
#

Hi, I'm also trying to post my bot's server count (in python). This is the code for the cog I use: https://mystb.in/ApparentlyHouseholdsUniform.python
I load the cog with client.load_extension('cogs.top_gg') before I run the bot. the cog is in ./cogs/top_gg.py relative to the script where I run the bot.
I'm not getting any errors, but also no update. The top_gg token is correct, I have printed it in the cog to double check before.

#

This is pretty much the example code in the API documentation > pyton library

dire imp
#

you are saying you are not getting the update that the server count has been succesfully updated?

brave nest
#

The server count isn't updating

#

Maybe I'll try the manual approach

dire imp
#

yea manual approach worked for me

#

so id suggest you do it manually for now using a discord.ext.tasks

brave nest
#

yep, thanks, will try that

dire imp
#

wlcm.๐Ÿ‘

restive otter
#

the cog has to be TopGG in order to work?

rustic stirrup
#

How do I make sure a person's vote was in the last 12h? (Using api not webhook)

rapid kettle
#

you dont

#

iirc

sullen nymph
dire imp
#

Although the docs did made me wonder if it has to be like that LOL

restive otter
#
async def on_dbl_vote(self, data):
  search = self.db.search(self.query.user == data['user'])
  if not (search):
    self.db.insert({'user': data['user'], 'votes': 1})
  else:
    search = search[0]
    votes = search['votes']
    self.db.update({'votes': votes + 1}, self.query.user == data['user'])
  print(data)
``` I believe this doesn't work.
Should I, like, add Cog.listener decorator?
sullen nymph
#

Mhm

golden tinsel
#

I have the same sorta question, I have this code:

    @commands.Cog.listener()
    async def on_dbl_vote(data):
        print(data)
        print(data.isWeekend)
        print(data.bot)
        print(data.user)
        await db.query(
            f'''
                UPDATE users
                SET votecount = votecount + 1
                WHERE id = {data.user}
            ''')
        

But it did not fire when I voted (not even print(data)) I think I am forgetting to config something on top.gg but I don't know how/where to do it :/

brave nest
#

Unrelated but important: be careful using format strings like that as queries. Image what happens if data.user is "1; drop table users;"

golden tinsel
#

oah yeah

#

good point

#

thx

brave nest
#

instead, use substitution characters provided by the module you use (mysql = %s, postgres = ?)

#

look up the documentation how to execute queries with data

golden tinsel
#

ok thx

safe pebble
#

Is it possible to setup the webhook for when people vote for your bot on heroku? I know we need a webhook port and stuff, I've looked at the docs and everything but i cant seem to find anything on this.

restive otter
#

I mean, that's not how you work with dicts? F_ThinkDerp

restive otter
#

does it work only with a webhook?

#

Ye, how is top.gg supposed to notify you

#

Wait, how do I set up a webhook?

#

not sure if creating a webhook in my server will be enough

rustic stirrup
#

Is there a way to get the number of times someone has voted?

rain heart
#

No, only through tracking it yourself on webhooks

rustic stirrup
#

Damn so is there no way to make it so a user can only claim a vote reward if they have voted again without a webhook?

#

I guess I could go through the last 100 votes count that and match against a number

golden tinsel
#

@rustic stirrup I am trying to use a database, postgre and elephantSQL as the host, it works well for me

#

anyway I have a question: I have this code

from discord.ext import commands, tasks

import dbl
import libs.database as db

import os

KEY = os.getenv('TOPGG_TOKEN')
class TopGG(commands.Cog):
    """
    This example uses tasks provided by discord.ext to create a task that posts guild count to top.gg every 30 minutes.
    """

    def __init__(self, bot):
        self.bot = bot
        self.token = KEY  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
        self.update_stats.start()

    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=30)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        await self.bot.wait_until_ready()
        try:
            server_count = len(self.bot.guilds)
            await self.dblpy.post_guild_count(server_count)
            print('Posted server count ({})'.format(server_count))
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))


    @commands.Cog.listener()
    async def on_dbl_vote(self,data):
        print(data)
        print(data.isWeekend)
        print(data.bot)
        print(data.user)
        await db.query(
            f'''
                UPDATE users
                SET votecount = votecount + 1
                WHERE id = {data.user.id}
            ''')
    @commands.Cog.listener()
    async def on_dbl_test(self,data):
        print(data)
        
        


def setup(bot):
    bot.add_cog(TopGG(bot))

I dont really know what the issue is, I think I am not filling out self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000) correctly but idk how to fix it, what config do I need to do on https://top.gg/bot/798634937606864937/webhooks

golden tinsel
#

@versed storm its been quite a while, If there is someone/role I am supposed to ping I am sry

#

ping me when someone sees this

restive otter
#

Can someone help me link my bot to a webhook so it can display how many servers it is in?

kindred shuttle
#

Hey, I have my bot on 2 servers and when I for example write command or click emoji on one i want to give myself a role on another. How can I do this with discord.py?

#

i have like

member = ctx.author
role = discord.utils.get(a.roles, name='role')
await discord.Member.add_roles(member, role)

and i want instead of adding role to myself on this server i want to add it on another one

jovial kiln
restive otter
#

So I have got my bot on Top.gg and have installed the package with cmd prompt. Where would I put this code in order to make it work?

const Discord = require("discord.js");
const client = new Discord.Client();
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}`);
})```
Ping me when you have an answer.
willow spindle
#

dblapi.js is deprecated

restive otter
willow spindle
#

huh?

restive otter
#

Like, once you install it.

#

What is the folder called?

willow spindle
#

in node_modules?

restive otter
#

Oh crap.

willow spindle
#

@top-gg/sdk

restive otter
#

Yes.

#

Then?

#

What do I do there?

willow spindle
#

what do you mean

restive otter
#

Like, what do I put in there?

#

How do I setup the servercount?

willow spindle
#

read the docs of this package

restive otter
#

Ok.

#
const client = Discord.Client() // Your discord.js client

const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
    shardId: client.shard.ids[0], // if you're sharding
    shardCount: client.options.shardCount
  })
}, 1800000) // post every 30 minutes```
#

Is it this one?

#

Or the other code?

#

@willow spindle

willow spindle
#

yes

#

you have to use middleware for vote webhooks

restive otter
#

But where do I put this code?

willow spindle
#

do you actually know how to code

restive otter
#

Not this type of coding.

#

I've never seen this before.

#

Can you please just tell me where I should put it?

#

I'm sorry if I'm stupid.

versed storm
#

And/or ask again.

golden tinsel
#

ok, ima work on it later,I have more important stuff to do

versed storm
#

Ironically, so did I which is why it took hours for me to even respond Kek

golden tinsel
#

lol

surreal kernel
#

Ok, I'm using python to develop a bot that receives a vote. However, the docs just cover bot voting. And the webhook for on_dbl_vote returns bot_id and user_id... but not server_id..

My bot is to get dbl votes on servers not bots so how would I do this?

#

@sullen nymphi was told you'd be able to help me

#

can you please let me know ASAP? I want to finish this before top.gg reset votes

#

oh my nick sad

#

lol

#

also, is it possible to get all the votes of a certian user?

restive otter
dense grail
restive otter
#

I'm trying to get the API to work.

#

I can't.

dense grail
#

what's your error?

surreal kernel
restive otter
#

My bot crashes.

#

Hold on.

dense grail
restive otter
#

If I was to remove the shards one, what would the code look like?

#

Iawa.

dense grail
surreal kernel
restive otter
#

Only that line?

dense grail
#

oh and shardCount

restive otter
#

Oh.

#

Ok.

#

I did that.

#

But.

#

Let me try it again.

#

Maybe I forgot to install the package.

#

To my hosting service.

dense grail
#

So if you have a token for that server it's assumed that you know the server ID of the server you have the token of

#

or more so, recieve webhook events from

surreal kernel
#

hm

#

ok

#

but

dense grail
#

but?

surreal kernel
dense grail
#

That's completely irrelevant to server ID

surreal kernel
#

also, is it possible to get all the votes of a certian user voting for a server

dense grail
#

that's to make sure that the request is from topgg

surreal kernel
#

what's the webhook data for server requests then

dense grail
#

O H

#

ohhh

#

sorry lmao

#

lul

restive otter
#

I'm testing the bot again.

dense grail
#

was confused on your question

surreal kernel
#

no it's fine... i'm confused so it affects my questions too

restive otter
#
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
/home/container/bot.js:17
const client = Discord.Client() // Your discord.js client
               ^

ReferenceError: Discord is not defined
    at Object.<anonymous> (/home/container/bot.js:17:16)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
container@pterodactyl~ Server marked as offline...

[Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon]: Exit code: 1
[Pterodactyl Daemon]: Out of memory: false
[Pterodactyl Daemon]: Aborting automatic restart, last crash occurred less than 60 seconds ago.```
#

@dense grail

#

This is what I get.

dense grail
#

that's not related to the api

restive otter
dense grail
#

you defined discord js as DiscordJs

restive otter
#

But it works whenever I remove the code.

#

Where?

dense grail
restive otter
#

Please.

#

I'm so dumb.

dense grail
#

You defined discord js as DiscordJS

restive otter
#

Oh.

#

Wait.

#

Is there a space.

#

In between?

dense grail
#

@surreal kernel i think it's guild, user, type, isWeekend

#

but I honestly don't know, I haven't tested the webhooks

surreal kernel
#

but you get it from the event on_dbl_vote?

dense grail
#

@restive otter No, here you decided to define the lib as DiscordJS, so you have to use that.

Please go to #development. Your question is not related to the API.

#

when the webhook fires ye

surreal kernel
#

ok

#

hopefully it works

#

how do i test with a testing server

dense grail
#

you should be able to fire a fake webhook test in the um

#

in the server edit page

surreal kernel
#

ok

#

my bot isn't in the actual server yet so how would i get a token

#

?

dense grail
#

it's on your server's page

surreal kernel
#

i have to add the bot to the server that's on topgg but i haven't yet

#

can i still make a fake webhook or do i have to add server first

dense grail
#

you shouldn't have to add a bot to a server thats on top.gg?

#

it's just a webhook

#

bots aren't related to server votes ??

#

what

surreal kernel
#

not topgg bot voting...

#

but i'm extremely confused so

dense grail
#

you have to add the bot "DSL" to a server that's listed on top.gg

#

then you should be able to mess around with webhooks

#

remember to open your ports

surreal kernel
#

webhooks including fake webhooks?

#

and what ports

#

sorry but i'm just really confused as to how this all works

dense grail
#

Yes, you can test webhooks via the server edit page on top.gg

#

in order for a webhook event to fire, your program application must have a port open that you're listening to for the top.gg webhook to like, send a post req to you

surreal kernel
#

what's a port

#

but thx

surreal kernel
#

@dense grail what port should i open? and what type of url should I use for webhook?

surreal kernel
#

I also voted on the server but nothing happened... no errors or anything through webhook

#

@dense grail

#

ping me please since i have to sleep now

brittle spoke
#

You didnt need to mention them 4 times zoomeyes

rain heart
#

your dbl token is wrong

hoary nexus
#

Is there a way to store all my bot reviews and send then on my server channel?

rain heart
#

I suggest using webhooks for that

hoary nexus
#

How?

rain heart
#

Read the docs

wraith skiff
#

does anyone know how to get the code from my command. For ex I have a command ping and want to get it's code and send it?

restive otter
#

@wraith skiff if you're using Node.js then use child_process and execute the bash command cat <path to command>
also this channel is for top.gg api help, not for bot coding help

wraith skiff
#

oh ok

#

I use python anyway

restive otter
#

Or view file contents

#

In Node.js it's child_process, in Python I don't know though

wraith skiff
#

ok thanks

green mantle
#

or for discord bots with async asyncio's subprocess system

wraith skiff
#

oh thats complex

green mantle
#

I mean if you just wanna ping an ip

wraith skiff
#

no

#

forget it, its off topic

green mantle
wraith skiff
#

no ones answering there

green mantle
#

patienceโ„ข๏ธ

#

also your question isnt worded massively helpfully

bronze axle
#

how can I make an onVote() java?

#

So when someone votes, an action is taken

rain heart
#

Are you using the java-sdk?

bronze axle
#

yh

rain heart
bronze axle
#

ok

restive otter
#

i am asking if a member votes my server can @wild lantern (webhook) send a message like {user} just voted the server!

sinful token
#

you need a webhook for that like xiuh said

restive otter
#

ok i got it now what next?

sinful token
#

next is make a webhook by yourself ๐Ÿ˜ธ

restive otter
#

i did it

sinful token
#

wait! i think you cant do it

sullen nymph
#

Not a Discord webhook

restive otter
#

then?

sullen nymph
#

You need a physical machine that listens to HTTP requests

sinful token
#

bc you dont have the acces to the site

sullen nymph
#

Not with the servers part

restive otter
sullen nymph
#

try this

sinful token
restive otter
sullen nymph
#

Well, how do you plan on handling votes without a machine that runs 24/7?

restive otter
#

uhm. api?

#

well, fair enough

rain heart
#

webhook is part of the api kinda

restive otter
#

i mean, isn't listening to api with some async magic enough?

rain heart
#

no, webhooks is the easiest way

hot axle
#

yea, it's just a basic server with a route for the webhook

restive otter
#

k, are there any guides?

hot axle
#

there are some examples on the docs

#

the js docs use dblapi.js, which is deprecated tho

jaunty plank
#

the current js lib is pinned.

restive otter
green mantle
#

why not just use either a webserver or dblpy for this

rain heart
#

a webhook is a webserver

rapid kettle
sullen nymph
#

yes I do too

surreal kernel
#

Not my local machine

fallen seal
#

Do u pay to put ur server on top.gg

rapid kettle
#

no

restive otter
#

Hey i have voting credit how can i transfer them to my account

dapper copper
#

You can redeem them on the first of Feb (tomorrow)

surreal kernel
#

Idk, it's weirdly confusing for me, but until then I have a new approach that should work

surreal kernel
#

I'm using replit

void warren
#

im trying to use the top.gg api and when i try to use dbl.webhook.on it just says TypeError: Cannot read property 'on' of undefined

#

note: i have dbl and DBL both setup

jaunty plank
#

so for that lib you need to initialize with the webhook data
const dbl = new DBL(yourDBLTokenHere, { webhookPort: yourport, webhookAuth: 'yourpassword' });

void warren
#

i did

jaunty plank
#

it includes webhook port and auth?

void warren
#

well on mine it's just client

#

i dont think it's supposed to be that

jaunty plank
#

right, so that doesn't initialize the webhook at all

void warren
#

lol ok

#

how do i get the port and password

jaunty plank
#

port can be any available port, password you make.

void warren
#

so

#

5000?

jaunty plank
#

5000 is fine

void warren
#

and password is anything?

jaunty plank
#

yeah, any string

void warren
#

kk

#

lol my password is so long

jaunty plank
#

i typically just smash on the keyboard for a bit

#

dsajIND9AD9uasjdoijAD9pas43jADPsad

#

ez

void warren
#

PERFECT

#

that can be the end of it

jaunty plank
#

haha

void warren
#

finished

#

worked!

#

thanks!

jaunty plank
#

@main kayak what programming language is your bot in

#

npnp

main kayak
#

oh hi

#

javascript

jaunty plank
#

you can use the autoposter

main kayak
#

thats it?

jaunty plank
#

yep, the new lib handles everything for posting server counts.

main kayak
#

i just have to put it in my index.js file, ok...thanks!

jaunty plank
#

yeah, just make sure its after client is initialized.

main kayak
#

yes

#

it will show the change on the website immediately or after some time?

#

so that i can check if i did it correctly or not

void warren
#

it works but now doesnt detect votes at all

#

not even a message in console

#
dbl.webhook.on('vote', vote => {
//my code
});
jaunty plank
void warren
#

well it starts up

#

Webhook running at http://0.0.0.0:5000/dblwebhook

jaunty plank
#

so did you fill in the url and auth on your bots edit page on the webhook section?

void warren
#

f

#

LOL