#topgg-api

1 messages · Page 115 of 1

rain heart
#

with censoring the private stuff ofc

wanton saffron
#
public class Webhook {

    public static void main(String[] args) throws Exception {
        HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0); // create a Httpserver listening on port 8000
        server.createContext("/dblwebhook", new MyHandler());  // creates a handler for when a requests comes into https://yourserverip.com/dblwebhook
        server.setExecutor(null); // creates a default executor
        server.start(); // Starts your httpserver
    }

    static class MyHandler implements HttpHandler {
        @Override
        public void handle(HttpExchange t) throws IOException {
            String response = "This is the response";
            t.sendResponseHeaders(200, response.length());
            OutputStream os = t.getResponseBody();
            os.write(response.getBytes());
            os.close();
        }
    }

}
#
public class Reciever implements HttpHandler {

    @Override
    public void handle(HttpExchange t) throws IOException {
        String response = "Hello World"; // the response
        t.sendResponseHeaders(200, response.length()); // response.length being the length of response, needed in the header
        OutputStream os = t.getResponseBody(); // get the response outputstream
        os.write(response.getBytes()); // write and
        os.close(); // close
    }
}
#

These are both classes.

rain heart
#

you don't need the static class myHandler in your Webhook class

wanton saffron
#

ah im dumb yeah

rain heart
#

replace new MyHandler() in your Webhook class to new Receiver()

#

so that the requests get handled by your Receiver class

wanton saffron
#

If I do that it wants me to implement its methodes.

rain heart
#

yup that's correct

#

let it implement the methods

wanton saffron
#

gives me a bunch of errors

#
public class Webhook {

    public static void main(String[] args) throws Exception {
        HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0); // create a Httpserver listening on port 8000
        server.createContext("/dblwebhook", new Receiver() {
            @Override
            public void send(MidiMessage message, long timeStamp) {

            }

            @Override
            public void close() {

            }
        });  // creates a handler for when a requests comes into https://yourserverip.com/dblwebhook
        server.setExecutor(null); // creates a default executor
        server.start(); // Starts your httpserver
    }


}
#

both those overrides methodes.

rain heart
#

you're missing a ) afterwards

#

server.createContext("/dblwebhook", new Receiver());

#

or you accidentally imported the wrong class

#

make sure it's your class

wanton saffron
#

yeah wrong class.

#

okey

#

no more errors.

#

still not going into the main smh.

rain heart
#

what's the error?

wanton saffron
#

it's not printing anything

#

no error.

rain heart
#

add a debug line

wanton saffron
#

print?

#

or wdym with debug line?

rain heart
#

yup

#

just a println

wanton saffron
#

I did and it's not printing anything.

rain heart
#

are you running the correct class? remember that you have to start your webhook class

wanton saffron
#

...

#

yeah sorry.

#

now its printing.

rain heart
#

also, if you're running it on your local pc, you can also use localhost

wanton saffron
#

It's running on a server

rain heart
#

Oh then instead of localhost, your server ip

wanton saffron
#

wait

#

yeah

#

that worked.

#

"hello world"

rain heart
#

now you should just be able to get the inputStream from the httpexchange through t.getRequestBody

#

then parse the request json from that RequestBody and boom you got the webhook

wanton saffron
#

waitwaitwait

#

so

#

to get the query

#

I need to change the server.createContext("/dblwebhook", new Reciever()); to
server.createContext("/bot/:ID/vote", new Reciever());

rain heart
wanton saffron
#

ohh

#

so I insert that there aha

#

then everytime someone votes, it's sending data to that url

rain heart
#

yeah, you will have to parse that data in order to get all the things in the screenshot above

#

i suggest using org.json because that one is the easiest

wanton saffron
#

Can I first check if its sending data to that url?

rain heart
#

yeah ofc, print the data you're getting by using

StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, encoding);
String theString = writer.toString();
#

can be wrong though, lemme look for something better

wanton saffron
#

in my public void handle ? right

rain heart
#

yeah

#

before your os.close that is

#

you should be able to get the inputStream by using t.getRequestBody

wanton saffron
#

IOUtils.copy(inputStream, writer, encoding);it's not finding the copy , inputStream and encoding syntax

#

no libaries for that

#

I am using java 8

rain heart
#

oh give me a second then

wanton saffron
#

no worries! you're helping me so much!

#

nearly done

rain heart
#
StringBuilder responseStrBuilder = new StringBuilder();
while((line =  bR.readLine()) != null){

    responseStrBuilder.append(line);
}
inputStream.close();
``` should be able to parse your inputStream to StringBuilder, which you should be able to get with ``responseStrBuilder.toString()``
#

but parsing the json data has to be done by you alone

wanton saffron
#

😄 it's not finding line , bR and inputstream

rain heart
#

inputStream is t.getRequestBody, you'll have to define it yourself

#

There's a bunch of tutorials on how to parse the inputStream to an actual String

wanton saffron
#

alright I'll have a look

restive otter
#

Quick question, would I have to replace yourDBLTokenHere with my DBL token in ''?

rain heart
#

yes

restive otter
#

Ah okay, thanks.

wanton saffron
#

like use localhost there

#

to test

rain heart
#

localhost isn't going to work

#

you have to enter your servers ip

wanton saffron
#

ah

#

Alright yeah

#

It's recieving the webhook

#

just need to read from it

#

Thanks man you helped me so much! 🙂

rain heart
#

CatThumbsUp glad i could help

wanton saffron
#

Ahh I am so happy ❤️

sinful knoll
#

Wait, so if I get more then a thousand votes per month, I can't use the API and have to use webhooks?

rain heart
#

Yes

#

You will have to track the votes yourself

sinful knoll
#

Is it a hard limit? Like what'll happen if I go over?

rain heart
#

Well you won't be able to use the getvotes endpoint

sinful knoll
#

Thanks!

rain heart
#

You won't get over it. It will just not return any other votes that come in past the 1000 limit

sinful knoll
#

Awesome, thanks!

lyric nymph
#

Hi

severe viper
lyric nymph
#

I am here for api discussing buddy

severe viper
#

Don’t just say “hi” and wait almost a hour then.

lyric nymph
restive otter
#

anyone knows an api that gives random animals

dusk trail
#

this lib combines bunch of apis

#

hasn't been updated tho

dense basalt
#

This channel is for the top.gg api only

#

-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

foggy kelp
#

just send a request to the dbl api to check if a user has voted
@restive otter Is it in the link above?

restive otter
#

maybe

#

dbl.hasVoted for dblapi.js iirc

#

dunno for python

teal lava
#

You can also make the HTTP request yourself it aint that hard

dusk trail
#

Generally speaking, if I have a lots of commands that require voting, would DB be a better method?

teal lava
#

I don't think you need a db only for storing votes, because they reset every 12 hours

#

You can have an in-memory cache of people who have voted. When someone wants to run a command that requires voting, you first check if the user is in the cache, if they aren't, make an HTTP request to check if they have voted, if they have, you give them access and update the cache, if not, deny access. Reset the cache every 12 hours

#

If the command can be used only once per vote, then an in-memory cache isn't needed

rare socket
#

Hello

restive otter
#

-help

#

-ping

wild lanternBOT
#

dslWaddle I'm alive!!!

restive otter
#

Does the poststats api part need to be in a ```js
client.on("ready", () => {

})

Function
rain heart
#

Presumably yes

viral tinsel
#

How can I do this when a people vote then send it to a channel

slow fern
#

:ping

tender pasture
#

uhm

#

i need help

#

so im trying to add a role for when someone upvotes my server

#

and im not sure how

spring pebble
#

when they upvote your server?

tender pasture
#

yup

#

im trying to make it o that it automatically gives a role

#

for 24hours

spring pebble
#

alright

tender pasture
#

and then they have to upvote again

#

can i invite you to my server, give you admin and u do it?

spring pebble
#

so I don't know how to works with servers

#

no ;-;

tender pasture
#

??

#

ok

spring pebble
#

so basically

#

when the api returns a packet with "this user voted"

#

u give that user the role

tender pasture
#

???

spring pebble
#

and then set a timeout to remove it again

tender pasture
#

i have no idea what ur talking about lol

spring pebble
#

You're gonna have to make a bot to do it

tender pasture
#

oh

#

that needs scripting right?

spring pebble
#

coding yes

tender pasture
#

oof

tender pasture
spring pebble
#

yes

tender pasture
wintry sequoia
#
    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        id = int(data["user"])
        member = self.bot.fetch_user(id)
        result = self.config.find_one({"id": id})
        print(id)
        print(data)
        print(data['user'])
        if result is not None:
            try:
                print('A')
                await member.send(f"Thank you for voting for the bot you have recieved {self.coin}1500.")
            except:
                print('B')
                pass
            print('C')
            self.config.update_one({"id": id}, {
                "$inc": {"bank": 1500}})``` isnt printing anything on vote
sullen nymph
#

@wintry sequoia Try to use on_dbl_test and press Test in the webhooks section on the website

wintry sequoia
#

alright

#

didnt work

#

@sullen nymph sorry for ping but it didnt work

sullen nymph
#

Seems someone's firewall is blocking requests

wintry sequoia
#

hmm

#

my firewall?

sullen nymph
#

I'd assume so

wintry sequoia
#

the bots not ran on my pc

#

its on a vps

sullen nymph
#

Well, your VPS' firewall :p

wintry sequoia
#

@restive lintel

restive lintel
#

Hm?

wintry sequoia
#

look at what they said

#

btw bigpuppys the other bot dev

#

and vps owner

#

but it also doesnt run on my pc

restive lintel
#

Uhhh

wintry sequoia
#

big do you know anything about this

restive lintel
#

So- I get whats happening

#

I don't know how to fix it

#

How would I get all the votes, and the users who voted for a bot through the API?

wintry sequoia
restive lintel
#

DMs

wintry sequoia
#

how do we setup a webhook

sullen nymph
#

Using dblpy, you simply set webhook_port to a port (number) to run the webhook on. The rest (auth and path) has default values

wintry sequoia
#

@restive lintel

restive lintel
#

Thanks!

wintry sequoia
#

yes, thank you very much

#

we got it

restive otter
#

So how do I make a command so when I vote for the bot it sends a message?

#

In discord.js

#

or dbltoken?

#

oh wait nvm

wintry sequoia
placid peak
#

why r u sharing ur cf id

wintry sequoia
#

thats the js page

placid peak
#

that long thing is cloduflare thing

wintry sequoia
#

ok then

restive otter
#

Thx

restive lintel
#

on_dbl_test is not working, we've set the webhook auth and port, along with path.

#

We changed the details on the webhook page also.

#

Could be something wrong with my pterodactyl panel, but I setup the allocations.

wintry sequoia
#
self.dblpy = dbl.DBLClient(
            self.bot, self.token, autopost=True, webhook_auth="authcode", webhook_port=9677, webhook_path='/dblwebhook')```
#
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print('event')``` and its not printing "event"
restive lintel
#

(That is my pterodactyl panel, pretty much I setup an open port for the bot)

sullen nymph
#

@restive lintel @wintry sequoia whoever can, please send me the exact webhook URL you are entering on the website

#

DMs strongly advised

restive otter
#

what is the code for webhooks?

amber yacht
#

hi guys
i just wanted to say that it would be cool to include the time at which a user voted for a bot when checking votes

willow spindle
restive otter
#

oh

rapid kayak
#

So ..... uh how do you make your top.gg customized?

willow spindle
#

your bot's page?

rapid kayak
#

Ye

willow spindle
#

you can use html/css on long description

rapid kayak
#

You can?

#

Wow

#

Thanks

restive otter
#

just use markdown :p

rapid kayak
unreal loom
#

how do u do the api

#

HOW do u customize the page

vocal ledge
wary ember
#

Yes because you need to set up a webserver

#

You aren't passing in a hostname

vocal ledge
#

Oh how do you do that?

willow spindle
unreal loom
#

@willow spindle zlr

willow spindle
#

What

vocal ledge
wary ember
#

@vocal ledge express; I believe the top.gg API documentation states this

vocal ledge
#

Kk ill check it out

rain heart
#

Yes, all the way at the bottom it does

vocal ledge
#

Yh i see thxs

vocal ledge
rain heart
vocal ledge
unreal loom
#

i dont understand

rain heart
#

there's a webhook example for py too

unreal loom
#

@vocal ledge idk

#

idk how to do it

vocal ledge
#

It shows an example

#

Im on js so i cant really help

rain heart
#

What's your goal though @unreal loom

unreal loom
#

to get the server count and discord.py thing on it lo

rain heart
#

but you wont be able to set your servercount yet while your bot is not approved

unreal loom
#

bruh

#

@rain heart i could put a server count on my status lmfao

vocal ledge
#

U dont need the top.gg api to post ur bot server count in its status

rain heart
#

then you're in the wrong channel

#

because this is top.gg api help

vocal ledge
#

I setup a webserver and it still comes up as undefined @wary ember

crude elm
#

Help me on webhooks.

dbl.webhook.on('ready', hook => {

Cannot read the property 'on'

jaunty plank
#

make sure to add port and auth on your dbl constructor.

crude elm
#

Ya I added

jaunty plank
#

can i see where you did that? hide your token please.

crude elm
#

K

#

Here

jaunty plank
#

its ('token', options, client)

crude elm
#

Nvm I didn't paste my dbl toke. Oof

crude elm
#

How to get the dbl token ?

jaunty plank
#

they are the same thing, just dbl was the old name.

crude elm
#

Oh

#

K

jaunty plank
#

docs havent been updated in awhile, will be soon

crude elm
#

Oh k

#

Cool

#

Letme test again

#

Options is not defined . _.

#

Nvm I got it

restive otter
#

i want DBL api key

#

please give me

crude elm
#

Api key ?

#

I never heard of.. oof

#

But not api key

#

Sorry

jaunty plank
#

you get a token once you have an approved bot @restive otter

crude elm
#

Can I know how to votelock a command.. I'm asking this from a week

restive otter
#

if that commands will not work it will not be approved

jaunty plank
#

youd want to keep that info in a database, then check the database if the user has voted @crude elm

crude elm
crude elm
#

Or some database module

#

Oof

jaunty plank
#

quick.db has some prerequisites.

crude elm
#

Oh

restive otter
crude elm
#

I need python for it and my pc is bad right now

jaunty plank
crude elm
restive otter
crude elm
#

I have 32

restive otter
#

i have 64 bit

crude elm
#

Oh

#

I have 32 bit os and 64 bit hardware. Idk why

restive otter
crude elm
jaunty plank
#

hey, what do you need?

mellow plank
#

can a top.gg widget be put as an image in a discord embed? it's not showing up when i try it

jaunty plank
#

theres a trick you have to do iirc. lemme try and find it.

sharp hollow
#

How do i make a dbl webhook, I don't get the docs

jaunty plank
#

you make an http server that receives post requests @sharp hollow

#

or use one of the provided libs

sharp hollow
#

how can i make one, im not really faimilar

jaunty plank
#

depends, what programming language are you using?

sharp hollow
#

discord.js, NodeJS

jaunty plank
sharp hollow
#

Yeah I know but I am confusing in making a server

jaunty plank
#

the js lib does that for you in this case.

sharp hollow
#

Yeah

#

So i downloaded that

jaunty plank
#

@mellow plank what language are you using?

sharp hollow
#
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!`);
});

I have my port as 5000

mellow plank
#

discord.js lib

sharp hollow
#

Doesn't log anything when i restart my project

mellow plank
#

i've tried with .png as well, no luck

jaunty plank
#

not evaling, just was him showing an example

jaunty plank
sharp hollow
#

Ok

#
const dbl = new DBL('', { webhookPort: 5000, webhookAuth: 'my auth i saved on my bots webhook page' }, client);
#

@jaunty plank

jaunty plank
#

hmm. weird.

sharp hollow
#

Yeah

mellow plank
#

perfect @jaunty plank thanks!

sharp hollow
#

so I didn't create any other server just installed that and yeah, some people say to use like express

jaunty plank
#

express isnt mandatory, the library is mostly indepentant, other than discord.js or eris 🤔

sharp hollow
#

what will the webhook URL be in the section in top.gg page?

jaunty plank
#

your not getting any errors correct?

sharp hollow
#

Nope

jaunty plank
#

http://publicip:5000/dblwebhook

sharp hollow
#

Oh ok

jaunty plank
#

publicip = the public ip of the server

#

If this is hosted on a home network youll need to port forward.

sharp hollow
#

I tried sending it

jaunty plank
#

it should be logging the Webhook running at ... stuff on startup.

sharp hollow
#

No response yet

#

i will restart it

jaunty plank
#

make sure to save the file if you didnt, happens too much.

sharp hollow
#

Yeah

#

it worked

#

@jaunty plank

jaunty plank
#

ay

#

vote worked too?

sharp hollow
#
Webhook running at http://0.0.0.0:5000/dblwebhook
#

that's what it logged

jaunty plank
#

ay

sharp hollow
#

Yay

#

ok i'll try voting

jaunty plank
#

just a heads up, 0.0.0.0 isnt the proper ip its just a placeholder.

sharp hollow
#

hope this works

#

Ok

#

so will it work even if that's the ip

jaunty plank
#

if you mean in the console log, yeah. it always will log 0.0.0.0

rain heart
#

0.0.0.0 means "you can connect to it from anywhere: doesn't matter if localhost, internal or external"

sharp hollow
#

So @jaunty plank I voted, didn't log

jaunty plank
#

some things to check
if on a home network, youll need to port forward.
If you have a firewall, youll need to allow past the firewall.
Check your url fits this http://ip:port/path
If not using https, use http. if you are unsure, use http.

sharp hollow
#

port will be 5000 in my case, what about the path?

jaunty plank
#

path by default is dblwebhook

sharp hollow
#

ok

#

it says refused to connect

jaunty plank
#

just curious, wheres this hosted.

sharp hollow
#

So for now it's on a host called DanBot Hosting or something

#

@obsidian marten

jaunty plank
#

well, its kindof annoying danbots docs are down

sharp hollow
#

oh

jaunty plank
#

does danbot provide you with a public ip and a port?

sharp hollow
#

Yeah

#

It has it on the console

#

so

#

im guessing that's the ip now?

jaunty plank
#

yeah, and I am unsure how danbot hosting works, they may restrict what port you can use.

#

saddly with the docs down its impossible to find out.

sharp hollow
#

what docs are you talking about?

jaunty plank
#

yeah

#

more < docs

sharp hollow
#

So do i change the port to what they have?

jaunty plank
#

if they restrict it, yes.

sharp hollow
#

Ok

jaunty plank
#

for now, make sure the ip is theirs. if they give you a port, try changing to it.

sharp hollow
#

Ok

#

so it connected once again.

#

Nope doesn't work

jaunty plank
#

might just have to wait for their docs to be up then.

sharp hollow
#

@jaunty plank Do i need to specify the webhook path in the options

jaunty plank
#

the default one is fine.

sharp hollow
#

i specified it as /dblwebhook

rain heart
#

try manually making a request to it, through a request maker for example

sharp hollow
#

@jaunty plank hey, i got the request! It says User ID with myid just voted!

jaunty plank
#

oh, good!

sharp hollow
#

@jaunty plank thank you so much for helping me Smile

jaunty plank
#

no problem 🙂

tropic yoke
#

``cool`

sharp hollow
#

Hey, can i put a

const user = client.users.fetch(...)
user.send(...)

in the dbl.webhook.on function because im getting the bot to send messages when someone votes.

restive otter
#

where i can get a soundcloud api
pls ping me when u answer me

sullen nymph
#

@restive otter see channel topic

restive kiln
#

dadada

#

a

restive otter
#

oo

#

i thoht some help of geting diffrent api

sharp hollow
#
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
    try {
    const guy = client.users.fetch("742972160158728283")
    guy.send("hello")
        
    } catch {
        console.log("An error!")
    }
});

I've got this but it seems to encounter an error when sending the message to me

humble ledge
#
    const guy = client.users.fetch("742972160158728283")

shouldn't this be :

    const guy = client.users.fetch(vote.user)
``` instead ?
rain heart
#

wrong channel

#

ohh, vote.user

#

yeah vote.user is the user id

restive otter
#

I'm having an error for

client.shard.Id and client.shard.total

I'm just tryna post stats for my bot aka also dogos bot minercord

#

Also is it possible to use this api using dbd.js

willow spindle
#

show error

restive otter
#

I have the same question

sullen nymph
#

http://ip:port/YOUR_WEBHOOK_PATH_HERE

restive otter
#

thank you

#

port 80 is default, right?

sullen nymph
#

There's no default that dblpy uses. You're pretty much forced to set your own port

restive otter
#

and if I'm using a root server?

sullen nymph
#

I use port 80 only for my production stuff and 5000 for anything related to top.gg stuff ¯_(ツ)_/¯

#

(Unless I cram both into one webserver and let chaos begin)

restive otter
#

but there is a part sepicial for webhook_port

sullen nymph
#

Yeah, that's a port that dblpy will attempt to use (if it's not already in use by some other process)

restive otter
#

this is for it, right?

sullen nymph
#

The URL, yeah

restive otter
#

and auth?

sullen nymph
#

It's essentially a password you come up with yourself to confirm that top.gg is, indeed, sending requests

restive otter
#

and I only have to enter this password in the source code or on top.gg too?

sullen nymph
#

both

restive otter
pure junco
#

So is there any reason at all that Python could not find dblpy

sullen nymph
#

The Authorization field

sullen nymph
pure junco
#

Nope... I just acceditly did dbl.

sullen nymph
#

Eh well

winged widget
#

Like how to use the data that i get from dbl.on_bot_vote in python?

#

Do i need webhooks to do it?

sullen nymph
#

Note to self: write guide how to host webhooks with dblpy in next update

winged widget
#

Lol

#

What to do?

#

I was just approved
Idk anything
What am i doing with my life lol🤣

#

Shivako do i need webhook url?

jaunty plank
#

yes

winged widget
#

Ok

#

Should be created by bot? Or me xD?🤣

restive otter
#

How can I get the bot to send notifications when someone votes for the bot?

#

i'm new

winged widget
#

Same

#

Wgich language do you use?

restive otter
#

djs

winged widget
#

Check pins

lunar helm
#

Can i user my Ipv4 for the webhook url?

restive otter
#

can i use no-ip url [since im port forwarding] for the webhook?

jaunty plank
jaunty plank
restive otter
#

is the path required doe?

jaunty plank
#

path is determined by the http server(or library)

#

I dont see why noip would affect that.

oblique kestrel
#

does anyone know, how I can add a CSS file to my detailed descption?

I use a html Code, and want to make a CSS files, but I don't know how

willow spindle
#

<style> tag

restive otter
#

actually ill find out my self

#

wut

#

server Count is wrong

spark parcel
#

My server count is wrong, any ideas

#

I'm using the provided python library

sharp vigil
#

how would i post the shard amount? i have this

    @tasks.loop(minutes=30)
    async def update_stats(self, ctx):
        """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))

I dont know what to add Ehehe

restive otter
spark parcel
restive otter
#

probably not the problem but idk

#

make sure you're inserting the right number

#

try to insert it manually to make sure if it was your problem

restive otter
#
class votes(commands.Cog):
    def init(self, bot):
        self.bot = bot
        self.token = "I put my dbl token here"
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='http://myserverIP/test', webhook_auth='1234', webhook_port=22)
#

But it doesn't work

sullen nymph
#

My friend

restive otter
#

I'm sorry

sullen nymph
#

Replace webhook_path and the URL with each other

#

and keep it /test

restive otter
#
class votes(commands.Cog):
    def init(self, bot):
        self.bot = bot
        self.token = "I put my dbl token here"
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='/test', webhook_auth='1234', webhook_port=22)```
#

Now?

sullen nymph
#

Yeah, looks good

restive otter
#

Nope, nothing

sullen nymph
#

Ah

#

Imagine making it init and not __init__

restive otter
#

Nope, nothing

#

Is it my port? 22 is usually for ssh

sullen nymph
#

Did you specify it in the URL

#

22 is SSH, top.gg is doing HTTP requests

#

So it's not 22 but 80 for HTTP and 443 for HTTPS

lyric bay
#

for the webhook, can i just use a discord channel or do i need a website? I just want to log when someone votes

sullen nymph
#

You need a webserver

lyric bay
#

😐

#

is there a way to get vote notifications without that?

restive otter
sullen nymph
restive otter
#

port 80 is open

#

so i try

#

No didn't worked

sullen nymph
#

Well fuck

restive otter
#

hmm

cursive finch
#

How to use api

willow spindle
cursive finch
#

thanks

restive otter
#

hey, i'm pretty new to the api and need a bit of help.
I'm trying to use the on_dbl_vote listener but whenever someone votes I'm not receiving anything, I'm using the example in the docs just to make sure I'm doing everything correctly.

I'm using the python library.

cursive finch
#

i want to know that too

#

dm me if solved

lyric bay
#

so i got an application that forwards things from a url to a localhost but nothing happens when i test vote

const DBL = require("dblapi.js");
const express = require('express');
const http = require('http');

const app = express();
const server = http.createServer(app);
const dbl = new DBL(config.top_ggToken, { webhookAuth: 'password', webhookServer: server, webhookPath: 'localhost:5055' }, client);

dbl.webhook.on('ready', hook => {
    console.log(`Webhook running with path http://${hook.path}`);
});
dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
});

app.get('/', (req, res) => {
    console.log("gotit");
    console.log(res.user);
    console.log(req.user);
});

app.post('/', (req, res) => {
    console.log("gotem");
    console.log(res.user);
    console.log(req.user);
});

server.listen(5055, () => {
    console.log('Listening');
});```

and on top.gg i have the url set and when i test vote, the console.log is working but user is undefined. Am i missing something?
rain heart
#

Your webhook path is set to localhost, that's the issue

#

Top.gg cannot send webhooks to your localhost

lyric bay
#

i dont have it set to localhost on the website tho i have something forwarding everything to localhost

#

does the url on the website and there have to match?

rain heart
#

I'd just say test it with a request client, like Postman

lyric bay
#

im getting all of these requests tho

#

like when i test the webhook, i do in fact get stuff

rain heart
#

Then you're most likely parsing the user wrong, let it print out the whole request data in your console.log

lyric bay
#

i dont see why dbl.webhook isnt working tho

#

and the api docs are incomplete on if i need to pipe the request or anything

#

ima give up on it because i wont go through the troubles of getting my own server when im 90% sure that exposing localhost to the internet should be a valid substitute

rapid kettle
#

the path is the after the / bot

#

try sending a request to /localhost:5055

lyric bay
#

im super duper angry

#

heres the fix:

#
app.use(express.urlencoded());
app.use(express.json());```
hearty lintel
#

@willow sphinx is the npm package for dblapi.js still like updated?

#

cuz i see the github is updated but the package is deprecated

willow sphinx
#

I haven't had time to push updates to it lately but the npm deprecation is just tonkku being a cunt

#

since it's still under his name

#

would've probably disappeared if it wasn't for npm protecting packages

hearty lintel
#

right, are there any plans to like move the package name or somethin idk

#

can u transfer npm packages?

willow sphinx
#

not sure, I'd like to migrate the package to typescript and give it a new name but I really don't have time to maintain open source stuff while doing all this other stuff

hearty lintel
#

berry for lib dev when 😔🖐️

#

would it be a good idea to put "use the github version" on the docs or something?

willow sphinx
#

no, it's fine the way it is for now

#

I'd like to talk to veld to appoint someone who has time to maintain topgg open source, maybe one of the mods if possible

hearty lintel
#

ik i joke about it but if you are interested i do know the ins of the package and typescript so if you can't find someone else i'm here

willow sphinx
#

will keep in mind

hearty lintel
willow sphinx
#

im a simp for open source it's just that all the other stuff take up so much time

#

I have another package I'm working on that I'd like to open source but ya know

hearty lintel
#

right i feel you

restive otter
#

Um

#

I still didnt get help with my error

#

I'm having an error for

client.shard.Id and client.shard.total

I'm just tryna post stats for my bot aka also dogos bot minercord

Also is it possible to use this api using dbd.js

plucky lance
#

Keep in mind posting the shards is optional not required. Posting the guild size is almost enough if you don’t use sharding anyways.

restive otter
#

Crap forgot to turn ping off

restive otter
#

Still getting the same thing

lyric bay
#

if your bot is small or you dont know what sharding is, then just omit them

tropic yoke
#

google api pls!

jovial kiln
#

webhooks

lavish spruce
#

With which Bot

lyric bay
#

im getting upset over this api system because the built in stuff isnt doing the trick and something with js and vsc means I cant just ctrl click and see what is going on because of some stupid typescript. My issue is that I create a local host knowing full well that this isnt on the internet. So, I got this handy dandy tool that forwards all traffic from a website to my localhost so that i dont need to do anything with getting my own website. However, when I follow the api examples, the built in dbl.webhook.on("ready") gives an empty webhook (hook.hostname is always 0.0.0.0) no matter how much i specify. So my question is why is my manual vote listener better than the one with a library? I would like to use the library one so that it is cleaner but frankly its so much pain for zero gain, but that leaves me confused as to why it just isnt removed or is what im doing just not supported?

sharp hollow
#

@lyric bay the hook.hostname will always be 0.0.0.0 in the console

lyric bay
#

why is that?

sharp hollow
#

I don't know but it's always that, but the ip will be the same just that in the console.

lyric bay
#

okay so how do i set the ip?

sharp hollow
#

What is your host?

lyric bay
#

localhost

sharp hollow
#

I mean the bot host

lyric bay
#

ngrok

#

so 127.0.0.1:4040 is my second guess

sharp hollow
#

Ok you have to read their docs or smn to get the server ip

#

Ok

#

so go onto your bot's top.gg page and go to the webhook part

lyric bay
#

wait no i has a link and its set but i didnt bother to do the /dblwebhook

#

the ip is where i can look at the stats in the web interface

sharp hollow
#

You have to do that

#

the path is required

lyric bay
#

alr back to testing ig

sharp hollow
#

ok

lyric bay
#

😑 ofc it works

sharp hollow
#

It does?

lyric bay
#

mhm

sharp hollow
#

Ok then

lyric bay
#

either way it was fun learning about the internet

sharp hollow
#

Ok, glad to help.

lyric bay
#

tysm

sharp hollow
#

No problem.

winged widget
#

can anyone tell me about webhook

#

i dont know anything bout webhooks

rain heart
#

@winged widget

winged widget
#

saw

#

but what webhook link should i put?

#

from my server?

rain heart
#

Yes

#

Read the example

winged widget
#

should i put it in code or in dbl website?

rain heart
#

Read the documentation please

winged widget
#

wheres the example?

#

checked but idk what im doing with wehooks

#

please help

#

whats authorization.... ....

restive otter
#

for the webhook or the authorization header you're talking about?

winged widget
#

yeah

restive otter
winged widget
restive otter
#

You only need to put the port in the code and password, rest of it goes in the website.

winged widget
#

Ohk

tropic cairn
#

NASA's API is really helpful is anyone wanna use. Wondered that I should share it.
https://api.nasa.gov

restive otter
#

out of topic sir

winged widget
#

@restive otter so i need to add only ip:port in website and code?

#

And in authorization, add a password?

restive otter
#

@winged widget

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

As an example, This API code of Top GG does only takes the PORT and the authorization.

Whereas, In the website settings:
You fill this up followed by the things mentioned in it. http://web_server_ip/:port/dblwebhook

The port should be same as you filled in the Code.
The password (authorisation) should be same you filled in the Code.
Make sure the Port you select is open in the webserver, More of it can be searched in the settings of your VPS.

winged widget
#

Whats the webserverip?

#

Is it the ip of vps?

rain heart
#

yes

restive otter
#

yes

winged widget
#

Ok

#

I c now

winged widget
#

When i do like, add on_dbl_test...
And use test in website? Shouldnt it run the function?

sullen nymph
#

Correct

winged widget
#

I havent got anything

#

Shivaco can you explain me more

#

😅

#

Like this?

rain heart
#

that's not how urls work

#

this would be correct

winged widget
#

Ohh i c

#

Whoops then

#

And ip should be a number yeah?

#

Seperated with .

sullen nymph
#

Yes

winged widget
#

Yeah😅 finally that worked

#

Thank you for tolerating me🤣😅

sullen nymph
#

Somewhere that's not here

restive otter
#

i dm you

restive otter
#

lol

#

webhook

rain heart
#

pretty much, yeah

restive otter
#

you will have to setup a server to receive their post requests if you're using a home network you will have to port forward noip can help you

after doing all of that you will have to put this in the webhook url thing

http://serverip:port/path

(you will receive if it if you used an on connection function or something like that)
then parse the body and you'll get these

user:Id
query:
bot:
etc
(you will receive them as json)

#

you might want to add a key too

#

if you're using a vps you can skip the port forwarding part and create a server and it should work

#

you can create a server depending on the library you use (they're different ofc)

#

yw

solar quartz
#

How do I put the top.gg API to know the votes of the bot?

cloud sky
#

Hi

restive otter
#

make sure to have an Authorization header in your request or it will give you (forbidden)

young dirge
#
const dbl = new DBL([.env - redacted], client, { webhookPort: 5000, webhookAuth: '[redacted]' })
dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
willow spindle
#

it is new DBL(token, options, client)

restive otter
#

there must be a issue with the API as i check my total votes for this month in the analytics page and it is going down, and i have no clue what is going on. any staff able to look into this happy to show photos if pinged or privately messaged

#

like it looks like my bots data has been lost as also the invites and views have also gone down completely

livid iris
#

TE buzi

jaunty plank
#

@restive otter if xet hasn't gotten back with you on that one, submitting a github issue is the best way to submit an issue.

https://github.com/top-gg/issues

restive otter
#

👍

pine heart
#

heyy guys does someone knows how to make a webhook service server myself?

#

like not buy one somewhere

#

pls ping me if someone has an answer thx <3

#

well I need it for the top.gg webhook thingy that's why I ask here...

golden adder
#

@pine heart server votes?

pine heart
#

yeah

golden adder
#

You want them to post to a Discord channel webhook?

pine heart
#

nah

#

"Instead of requesting our API to see the users who have voted for your bot, we now have webhooks! Webhooks will send a post request to a URL of your choice when your bot has been voted for."

#

this

golden adder
#

I think you just replace bot with server

pine heart
#

uh

#

okay let me check pins ;)

pine heart
#

well but I have to get a url somehow

#

that's the thing

tacit drift
#

Are review webhooks possible?

pine heart
#

what do you mean?

tacit drift
#

like can I get a webhook sent on review

pine heart
#

uh idk

#

actually I'm also kinda lost xD

jaunty plank
pine heart
#

hellu

jaunty plank
#

@pine heart what library are you using

pine heart
#

discord.js

#

all I need is that url thing

jaunty plank
#

are you using the offical dblapi.js lib?

#

oh

pine heart
#

I think...

jaunty plank
#

http://ip:port/path

pine heart
#

yeah but how to get that

jaunty plank
#

ip is just the public ip of your server

pine heart
#

I read that like 100 times I'm feeling so stupid honestly

jaunty plank
#

port and path will be defined in your code

pine heart
#

oh so I have to set up a server right?

jaunty plank
#

yeah

pine heart
#

goooooooood

#

thx

jaunty plank
#

the easiest way is the js lib

golden adder
pine heart
#

that's what I wanted to know

jaunty plank
pine heart
#

uh okay I'll read that

#

if I dont get it I'll ping you

#

:)

jaunty plank
#

the webhooks are not available until you have an approved bot anyway, so a webhook on review would be hard for devs to implement.

pine heart
#

I've already installed the js lib and did this, but the url of the webhook is that with the many 0. So I still have to get an url somehow right? I guess I can do so by renting a server somewhere...?

#

@jaunty plank apologizes for ping <3

jaunty plank
#

0.0.0.0 just means any ip

#

so youll want to use the public ip.

pine heart
#

ok

#

so 0.0.0.0 is fine or not?

jaunty plank
#

its fine its logging it(it always will)

#

but in your url on the webhook section you need to put the real public ip.

pine heart
#

ah

#

okay

#

and how to get that ip

#

that's my main problem

jaunty plank
#

where are you hosting?

pine heart
#

that's where I'm stuck

#

on a friend's server

#

:)

jaunty plank
#

wheres that friends server hosted?

#

a hosting company/home etc.

pine heart
#

at his home

jaunty plank
#

youll have to use his public home ip

pine heart
#

uhhhh

jaunty plank
#

youll also have to ask him to port forward.

pine heart
#

ok

#

give me a sec I'm actually in a call with him rn xD

jaunty plank
#

if his server has any firewalls the port will have to be opened aswell.

pine heart
#

alright

#

so basically I have to put the ip of the server I'm hosting my bot on...

jaunty plank
#

yes

#

http://ip:5000/dblwebhook

pine heart
#

okayyy

#

let me try that hang on

jaunty plank
#

again, he will have to port forward and open the port through any firewalls.

pine heart
#

okay

#

omfg it worked thx so much you are the best

#

@jaunty plank loveheart loveheart loveheart

jaunty plank
#

npnp pogey

pine heart
restive otter
#

tranquil fulcrum
#

A

#

Acaba benim botumu ne zaman onaylicaklar

jaunty plank
tranquil fulcrum
#

Onaylansinda yeter@jaunty plank

dark oasis
#

sa

calm nymph
#

As hg

wide elbow
#

as

willow spindle
hot apex
#

hi

#

so

rapid kettle
#

yep

upper nebula
#

You have to send the data to the API yourself, its not automatic.

rapid kettle
#

they are sending it

hot apex
upper nebula
#

Yea thats what I was trying to get lol

rapid kettle
#

can I see the new DBL constructor

hot apex
upper nebula
#
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}`);
})```
^ From the docs directly.
#
new DBL(token, [options], [client])```
hot apex
#

yes

#

thats why i dont know why its broke

upper nebula
#
.postStats(serverCount, [shardId], [shardCount])```
#

Do you have that in your event?

rapid kettle
#

Try posting manually

#

use a setTimeout and .postStats

hot apex
#

no it does it automatically every 30 mins

#

look let me get logs

#

@rapid kettle how do i use SetTimeout to rn it every 30 mins, not just once

rapid kettle
#

setTimeout(func, [time in ms])

hot apex
#

that will run indefently

rapid kettle
#

yes

hot apex
#

i fucking did somthing

#

i broke it

shut wharf
turbid meadow
#

@hot apex

#

allegro this is polish website

#

very popular for shopping

#

and 100% safe because it has a customer protection system

#

haha

shut wharf
plucky lance
#

By editing your bot on the top.gg website

#

(approved bot)

shut wharf
shut wharf
hot apex
#

hence the music bot

shut wharf
jaunty plank
#

Hey! Servers don't get tokens.

#

Since the api is mainly for bots.

shut wharf
#

Ok, thx

stuck loom
winged widget
#

Can I edit the info (description) in top.gg in a loop in code?

rain heart
#

loop?

#

elaborate

winged widget
#

Like can i edit my bot description in top.gg every 12 hrs or upto rate limit if there is any?

rapid kettle
#

You can’t do that in code

restive otter
#

How to link top.gg webhook to heroku

#

Mine not working

tepid walrus
#

how to add url in webhook and what type is it

rain heart
restive otter
#

using a webhook you'll instantly know when someone votes for your bot which is op(better in most cases)

#

if a user was voted it the json object will be {voted: 1}

#

you're using a home internet to host your bot?

#

^

#

because if so you'd have to portforward to make a webhook

#

you'd still have to create a server btw

#

did you read what the message link lead to though? thonkku

tulip abyss
#

using the python api I can easily fake the number of servers. Thonk

restive otter
#

ofc you can

#

all you have to do is sending a post request to their endpoint that contains a servers count number body what did you expect

even if it wasn't possible to do with the api you could just make your own post request which is easy

hearty crystal
#

hello my bot seems ofline on the site but in reality its online how can i fix this

restive otter
#

#support
also try to edit anything in your bot's topgg page

#

oh yeah is there a mutual server between your bot and dbl bot?

hearty crystal
#

yes

#

this server

restive otter
#

try to put both of them in a single server and then edit anything in your bot's page if it didnt work then you'll have to check #support

glossy mantle
#

Hello,
Even if they voted for my bot, true value does not appear on the API. Some users have this problem.

willow spindle
#

afaik it takes 1-2 mins to confirm. You can setup the vote webhooks and store vote data in your db

glossy mantle
#

15 minutes have passed

rain heart
#

yeah best is to just track the votes with a webhook yourself

#

instead of relying on the api

restive otter
#

or it will give you something like this
{"error":"Forbidden"}

#

sometimes it can take time for the api to check if that person has voted for the bot [probably fixed]

eternal moth
#

as soon as the person votes I receive the POST in .json format

#

like 2-3 sec. at max.

craggy anchor
#

if you're running multiple instances of the bot, do you use the dbl webhook for each instance to get the correct server total count? I'm not good with webhooks at all, was just wondering if you could have multiple as they would all be connecting to the same port

willow spindle
#

I told you

eternal moth
# glossy mantle how ?

@glossy mantle create an account in pipedream > create a source > use the endpoint link > create an event listener in your code > voi là

pine heart
craggy anchor
#

All good! Ty for letting me know, if you or anyone else knows the answer to my problem just ping me

pine heart
#

👍

#

I found something about TCPs though...

#

but idk if that applies to webhooks lol

restive otter
#

please ping me with answer

sullen nymph
pine heart
#

ah

sullen nymph
craggy anchor
#

Yeah w sharding as I need more than 1 process

sullen nymph
#

Oh bismillah, sharding

pine heart
midnight void
#

Hi

sullen nymph
#

You can try to receive guild counts from multipme shards in your main shard (shard 0) and post array of guild counts there

#

I'm not exactly sure if posting to a specific shard ID works nowadays

pine heart
#

shivaco maybe this is a dumb question and it's obvious to everyone else but what library are you a dev of?

sullen nymph
#

dblpy

pine heart
#

ahh

#

nice

sullen nymph
#

And eh, it's only obvious if you're actually familiar with development of dblpy and have seen the GitHub commits

pine heart
#

which I haven'tpika_lurk_uwu

sullen nymph
#

KEKW which is understandable

pine heart
summer tinsel
#

how do I get my bot ID for the ```html
<dbl-stat bot-id="bot-dank-memer" stat="upvotes">Loading...</dbl-stat>

#

The bots user id doesnt work

pine heart
#

weird

#

usually the bot ID is the bot's user ID

tired moat
#

Where can I find the docs for DSL webhook for server votes? I can only find for bot vote's webhook one in top.gg/api/docs

rain heart
#

they're on the same page

tired moat
rain heart
#

scroll all the way down

#

"Webhook events"

tired moat
#

It's for bot votes not server votes

hearty lichen
sullen nymph
#

@tired moat the docs don't explain those yet, refer to pins in this channel instead

restive otter
#

i got this error when setting up server count

rain heart
#

Your token isn't valid thrn

#

Then

restive otter
#

thats odd

#

its my bot token

#

lol

#

oh api token

#

im stupid headf

craggy anchor
#

@sullen nymph sorry do you mind clarifying? Right now I just have 1 instance of the bot connecting to top.gg webhook, where exactly does the webhook read off the bot how many guilds its in

sullen nymph
#

A

#

U

#

Ok

#

I'm not experienced with sharding so yee haw

#

The way I'd go about it is have some process/shard collect the guild counts of all shards and post them as an array

solar drum
#

How can I get my bot page to show how many shards?

civic beacon
#

hello, this person has that many votes in total. how can I do it?

#

sample: ${total.vote.user}

#

??

keen matrix
#

maybe have a database which each time they vote it adds one

#

or something like that

civic beacon
#

i can't, i don't know

bleak fog
#

how do i make a api

versed storm
mint knot
#

can i have the top.gg api docs?

restive otter
#

Check the channel description

agile quail
#

nvm i used nuget gallery instead

red cove
#

Can someone help me with getting data from DSL? So I got a simple webhook server but I’m confused how exactly I need to go about getting this to work. I’m using Python by the way

agile quail
#

so apparently ISelfBot isnt found, is that something i change to my own value or is that supposed to be in the package, d.net btw

agile quail
#

Anyone?

restive otter
#

Guys, Everything is setup correct but unfortunately, The webhooks are not working. I am using AWS hosting and already port forwarded the PORT.
Upon clicking on the LINK: http://#####:5000/dblwebhook , 405: Method Not Allowed Which states, It's going fine. However, On testing the webhook or voting manually, Nothing is happening.

#

any idea?

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

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print(data)
#

Also, The server count is not working.

sullen nymph
#

@restive otter is Authorization field the same as webhook_auth

sullen nymph
#

God help us all

#

Try to send requests manually via reqbin or Postman

subtle hare
#

DBLWEBHOOKŞIFRE nasıl alıcam

rain heart
#

under webhooks

lethal lion
#

raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host top.gg:443 ssl:default [Network is unreachable] sience yesterday

restive otter
#

Hi i need help with the voting system

rain heart
restive otter
#

Hey how's it going?
It makes sense that my bot got a V but it couldn't get into more than 100 guilds?

sullen nymph
umbral hatch
rain heart
#

you can't yet

#

you need to get your bot approved

restive otter
paper torrent
#

my bot is approved wht to do now?

#

@restive otter

restive otter
paper torrent
#

ook

restive otter
#

hi how i can make uptime shower to my music bot

grizzled sundial
#

Does anyone know how to get webhook url from pythonanywhere?

lethal lion
loud jewel
#

How do u make the server count appear?

rain heart
restive otter
rain heart
#

yup to you

#

up*

restive otter
#

ah im confused

#

forgot it

lunar helm
#
const webhook = new DBL(process.env.DBL, { webhookPort: 5000, webhookAuth: 'xxxx' });

I got this error:

Error: listen EADDRINUSE: address already in use :::5000
rain heart
#

use another address

#

you're probably using 5000 already

lunar helm
#

ok

robust storm
#

Please test this bot

rain heart
#

@left egret

left egret
#

-b @robust storm

abstract mothBOT
#

dblMod Banned THEFIGHTER999#6901 (@robust storm)

left egret
#

oh their bot was added in queue...

rain heart
#

That's just my quick reaction when someone posts their bot link, sorry peek

restive otter
#

🤭

restive otter
#
HTTP/1.1 405 Method Not Allowed
Content-Type: text/plain; charset=utf-8
Allow: POST
Content-Length: 23
Date: Fri, 27 Nov 2020 12:48:02 GMT
Server: Python/3.7 aiohttp/3.6.3

405: Method Not Allowed```
vocal ledge
#

http://0.0.0.0:5000/dblwebhook i get this in my log,

#

do i just paste it in with the password!

#

i port forwarded already

sullen nymph
#

nice

#

I knew you could do it sure

sullen nymph
restive otter
#

Can i ask? the get_user_vote() at python library gives u bool if user voted in past 12 hours or what?

#

at docs it says: vote status – Info about the user’s upvote.
so its for last 12 hours or how

rain heart
#

Yes

restive otter
#

ty

slow dove
#

Hey! I am trying to figure out how to make voting rewards. This is what I have so far:

const DBL = require('dblapi.js');
const dbl = new DBL(process.env.DBL_TOKEN, { 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!`);
});
#

process.env.DBL_TOKEN is the thing labeled "API Key" that I got from the "My Bots" section.

#

Not even sure if that's right, though, because I also see something labeled "Authentication" in the "Reference" section

sullen nymph
#

Authentication is exactly what explains that

#

So you pretty much got it

slow dove
#

then why didnt it log it

#

when i voted for my bot

#

(yes the cringe, voting for your own bot, i was testing it KEKW)

#

@sullen nymph is it webhookAuth then?

#

where i put the auth token

sullen nymph
#

aiya