#topgg-api

1 messages · Page 106 of 1

stray hatch
#

me?

restive otter
#

naj

#

Can you guys update the javascript library page?

#

So it matches v12

oak sinew
sonic forum
#

Same issue

trail sigil
#

have u tried to regen ur token yet?

sonic forum
#

Just regenerated and still the same issue

#

@trail sigil

trail sigil
#

weird

#

and ur just posting ur server count?

#

or trying to at least?

rapid kettle
#

I remember having the same issue

#

can’t remember how I fixed it

#

I think it just went away

trail sigil
#

yeah ngl i think it will probably just go away after a bit

#

not entirely sure why this would be happening tho

rapid kettle
trail sigil
#

lmao

#

if more people start reporting the same issue or if it keeps happening in a couple hours then ill report it to the team

dreamy skiff
#

Im trying to link my webhook url and i keep getting
There was a problem saving the webhook :Thonk:
Im using an ip currently because i dont have domain and the path is
http://ip:port/dblwebhook

median badger
#

try logging out

#

and back in

dreamy skiff
#

still same error

frozen canyon
#

Pls balance

#

Hello

craggy grove
#

voting doesnt work for my bot anymore either, nothing has changed on my end

#

getting a similar issue as the ppl above

empty violet
#

keep trying to post server count to top.gg and getting errors

steady trail
#

Same here, tried regening token a couple times and it still returned a 403

restive otter
flat maple
#

same, can't check votes, and it gave me a 403 and some kinda captcha

empty violet
#

at the end of the error it said statustext: forbidden

narrow raft
#

Hi! So I wanted that when someone voted my bot on DBL, a message will be posted on a channel and then a role will be giving to that user 12h. All this automatic. I think I need to use the DBL api but not sure how to create this...

restive otter
#

@narrow raft The role part can be done without the API but the message logging requires webhooks

#

Just a heads-up, we're not talking about Discord Channel Webhooks

narrow raft
#

So like I want a bot message not a webhook

upper nebula
#

You have to use the DBL Webhook

oak sinew
#

Api now works! nice

mental echo
#

Hiya!

#

Anyone send me the dbl api npm page? ^^

restive otter
#
require('dotenv').config();
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(
    process.env.TOKEN,
    {
        webhookAuth: process.env.WEBHOOKAUTH,
        webhookServer: server,
    },
);

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

dbl.webhook.on("vote", vote => console.log(vote.user));

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

server.listen(1234, () => console.log("listening"));

This didn't console log the vote

jaunty plank
#

did you update the url on your bots page?

restive otter
#

I did what?

jaunty plank
#

also, im not sure it even works if your bots not approved yet

restive otter
#

im doing this with a friend

vapid cape
#

also, if you're going to use express and http only for dbl, might as well not use them

restive otter
#

his bot is approved

vapid cape
#

dbl doesnt need express nor http

jaunty plank
#

^ this url

restive otter
#

ok let me try what y'all told me

#

how do i make the webhook url

jaunty plank
#

the url is the
http://ip:port/path

#

that you set

restive otter
#

do i need to use my own ip?

jaunty plank
#

the ip of the server your webhook code is running on

restive otter
#

is that the hook.hostname?

#
require("dotenv").config();
const pack = require("dblapi.js");
const dbl = new pack(
    process.env.TOKEN,
    {
        webhookPort: process.env.WEBHOOKPORT,
        webhookAuth: process.env.WEBHOOKAUTH,
    },
);

dbl.webhook.on("ready", hook => console.log(hook));
dbl.webhook.on("vote", vote => console.log(vote));

right now we have this

vapid cape
#

looks correct

restive otter
#

how do I get the ip from this

#

so i can fill it in on the top.gg page

vapid cape
#

you dont get it from there

restive otter
#

oh

vapid cape
#

you get it from your hosting company

#

where is this being hosted?

restive otter
#

im just using my pc right now to test it

vapid cape
#

ah

#

then you can google "whats my ip"

#

however you will likely be blocked by your modem/router's firewall

#

its better to test it in the server

restive otter
#

ok!

dreamy skiff
#

it would show ur ip but the port forwarding would be messed up wouldnt it?

restive otter
#

and then use the ip of my vps?

dreamy skiff
#

yes

restive otter
#

ok

#

let me test it 😄

dreamy skiff
#

if it works can u show me how to do it cuz im having issues

jaunty plank
#

What issue are you having?

mental echo
#

Where can i have a token?

jaunty plank
restive otter
#

i started the file

#

on my vps

#

i got

#
{ hostname: '0.0.0.0', port: '5050', path: '/dblwebhook' }
dreamy skiff
#

0.0.0.0 is ur vps ip bascially

restive otter
#

but then i pressed the test button for the webhook and didnt get anything

#

it just outputted this

jaunty plank
#

0.0.0.0 is just whats default logged for everyone

#

also, if you have a firewall youll need to let that port past

restive otter
#

the url is the
http://ip:port/path
@jaunty plank i did this in the dbl settings

#

i dont think i have a firewall on myh vps

#

how do i check?

dreamy skiff
#

i would just add a index.html and then add a simple hello website

#

so when u type the ip adress and port it would show that

jaunty plank
#

or postman

dreamy skiff
#

but idrk

jaunty plank
#

or whatever its called

restive otter
#

huh

#

i dont understand what i need to do

jaunty plank
#

it lets you make requests to a server, in this case you could simulate a request to your webhook server to see what kind of error your getting back

restive otter
#

ok

#

dont i just need to change the hostname somehow

#

K

jaunty plank
#

make a post request, send it to the url you are using

#

with the auth header set to the password you chose

restive otter
#

so

jaunty plank
#

simulated request sent to my bots server

restive otter
#

the url is the
http://ip:port/path
@jaunty plank this

mental echo
#

How works the dbl webhooks

jaunty plank
#

the docs explain the webhooks

#

yeah, filled in with your info @restive otter

restive otter
#

i cant click send

jaunty plank
#

hmm

#

did you fill in the request url?

#

as a proper url

restive otter
#

yes

#

and then

#

in headers

#

the auth

#

just like you had on your screenshot

jaunty plank
#

I have no idea why send wouldnt work

#

🤔

restive otter
#

but it says that the agent is unavailable

#

do i need to install it?

jaunty plank
#

yeah, or you can use the app

restive otter
#

but than its using my pc

#

not the vps

jaunty plank
#

Postman is supposed to be run remotely from the thing your trying to access

restive otter
#

it errors

#

Could not get response

jaunty plank
#

Otherwise it will bypass the firewalls since its local

restive otter
#

😔

jaunty plank
#

Then more than likly you have a firewall if it couldn't get a response and the webhook was running

restive otter
#

CORS Error: The request has been blocked because of the CORS policy

jaunty plank
#

No idea how to solve that, ngl

restive otter
#
require("dotenv").config();
const pack = require("dblapi.js");
const dbl = new pack(
    process.env.DBLTOKEN,
    {
        webhookPort: process.env.WEBHOOKPORT,
        webhookAuth: process.env.WEBHOOKAUTH,
    },
);

dbl.webhook.on("ready", hook => console.log(hook));
dbl.webhook.on("vote", vote => console.log(vote));

with:
webhookURL:https://ip:port/path
authorization: "password"

jaunty plank
#

You are putting your ip port and path in those spots correct?

restive otter
#

yes

jaunty plank
#

Also http not https

restive otter
#

oh

#

if i test it

#

yeey that works

#

thanks woo 😄

jaunty plank
#

Np

narrow raft
#

Hi! So I wanted that when someone voted my bot on DBL, a message will be posted on a channel and then a role will be giving to that user 12h. All this automatic. I think I need to use the DBL api but not sure how to create this...
I am not sure how to do this and I have tried this but idk how to make it work... https://www.npmjs.com/package/dblapi.js/v/2.4.0

jaunty plank
#

You can also simulate the calls with postman, I found it more reliable than the websites webhook test @restive otter

#

Your looking for the webhook stuff

narrow raft
#

yeah i already know that

#

but It doesn´t work

jaunty plank
#

What's not working? Are you running on a server or at home?

narrow raft
#

it doesnt send a console.log of the up-vote

jaunty plank
#

Have you put the url for the webhook on the bots edit page?

narrow raft
#

what url

jaunty plank
#

A webhook server receives requests from the webhook client.
The bot has the server and the client(top.gg) needs to know the url that the webhook server is at.

#

The url would just be
http://ip:port/path

narrow raft
#

what ip and path?

jaunty plank
#

The public ip of the server your code is running on

#

And the path you set with the lib

#

Or the default one listed on the docs

#

0.0.0.0 is just a placeholder

narrow raft
#

that´s what ts sending back

jaunty plank
#

yeah

#

and its just a placeholder

#

0.0.0.0 means any ip

violet spoke
#

what do I set webhook_path to in self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='my auth here', webhook_port=5000)?

hard knoll
#

what is JavaScript (ES5+BD.js)?

jaunty plank
#

you can leave it default /dblwebhook or make it custom to anything you want. @violet spoke

#

its just the path the post requests go to

violet spoke
#

so where would I put /dblwebhook?

jaunty plank
#

in the example you gave you already are doing that

#

webhook_path='/dblwebhook'

violet spoke
#

ok

#

on the edit page, in the url spot, would I put my channel webhook url /dblwebhook?

jaunty plank
#

you need to put the entire url

#

http://ip:port/dblwebhook

#

obvs replacing port and ip

violet spoke
#

would port be 5000?

jaunty plank
#

yep

violet spoke
#

k

#

so how does it know where to send the message if it doesn't have the channel webhook url?

jaunty plank
#

channel webhook?

#

as in a discord webhook?

violet spoke
#

yeah

jaunty plank
#

top.gg webhooks dont work with discord webhooks

violet spoke
#

oh

#

so that's just to receive the info

jaunty plank
#

yeah

violet spoke
#
@commands.Cog.listener()
    async def on_dbl_test(self, data):
        print(f"Received a test upvote:\nData: {data[user]}")
``` @jaunty plank would `{data[user]}` work?
jaunty plank
#

im not a py user sorry

violet spoke
#

oh ok

narrow raft
#

yeah
@jaunty plank we have hosted the bot on heroku and the webhook returns this ip

jaunty plank
#

youll need to use your public heroku url iirc

narrow raft
#

huh?

#

how do I get the ip

jaunty plank
#

iirc, heroku gives a url thats public

#

heroku doesnt provide public IP's

#

since its not a standard server

narrow raft
#

i dont understand

jaunty plank
#

heroku doesnt provide IP's

narrow raft
#

so?

#

how do we solve this?

jaunty plank
#

so you need to use the url they give you

narrow raft
#

whre do I find that

jaunty plank
#

iirc

#

I am not a heroku user

narrow raft
#

whas that

jaunty plank
#

I wouldnt know

#

non standard platforms are hard to give help for

narrow raft
#

idk what I am exactly looking for

jaunty plank
#

the public url they provide with every project

narrow raft
#

aaahhh

#

what do we do with that url

#

@jaunty plank

jaunty plank
#

that would be the public url for your program, youd replace the ip with that

#

potentially the port to, not sure

#

heroku doesnt do things how other providers do it, so im not exactly sure

#

if you have to, contact heroku support.

narrow raft
#

so where do we put this url then?

jaunty plank
#

its effectivly the ip

#

http://url:port/path

#

or, http://url/path

stable cedar
#

help me how I got ping command for discord bot

jaunty plank
#

this is for top.gg api questions

stable cedar
#

thanks

tardy nimbus
#

hi i need api help hi

#

so when i post my total server count to the dbl api, its just wrong

#

its like half of what it actually is

lusty flare
#
from discord.ext import commands
import dbl


class TopGG(commands.Cog):
    """
    This example uses dblpy's webhook system.
    In order to run the webhook, at least webhook_port must be specified (number between 1024 and 49151).
    """

    def __init__(self, bot):
        self.bot = bot
        print(f'bot = {self.bot}')
        self.token = 'Token duhh'  # set this to your DBL token
        print(f'token = {self.token}')
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='http://00.00.00.0/dblwebhook', webhook_auth='password', webhook_port=1337)
        print(f'dblpy = {self.dblpy}')

    @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(f"Received an upvote:\n{data}")

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        """An event that is called whenever someone tests the webhook system for your bot on top.gg."""
        print(f"Received a test upvote:\n{data}")


def setup(bot):
    print('Top.gg loop started')
    bot.add_cog(TopGG(bot))
#

so im using the example for webhooks in python. and im failing to receive any votes

#

anyone got any pointers?

sullen nymph
#

Either the documentation is vague af or you people generally don't get it

lusty flare
#

it is

sullen nymph
#

Actually that does make sense so yeah, thanks for the feedback

lusty flare
#

im able to get by with most libraries by just reading the doc but im at a complete loss with dbl

sullen nymph
#

That one hurt xd

lusty flare
#

theres 3 of us on a call completely smashing our heads against a wall haha

#

XD

sullen nymph
#

Will work on the docs, got it

#

In any case, webhook_path isn't the URL. It's the thingy after the IP and port in the URL

lusty flare
#

awesome, good to know! 😄

sullen nymph
#

so if you want the URL to be ip:port/dblwebhook, you set webhook_path to /dblwebhook

#

but the default value is that by default so you can technically just scrap it

lusty flare
#

gotcha!

sullen nymph
#

Yeah, I assume you also took care of port forwarding GWahreeSure

lusty flare
#

and the format in the web panel should be http//ip:port/dblwebhook

sullen nymph
#

mhm

lusty flare
#

ok perfect, that narrows it down for us! thanks 😄

sullen nymph
lusty flare
#

@sullen nymph we've tried everything, we've tried testing open ports after forwarding. and still not receiving any requests. i feel we're missing something obvious haha

jaunty plank
#

I would recommend using postman to send requests.

sullen nymph
#

Try using reqbin to send POST requests to your webhook with the following JSON as request body:

{
    "user": "123456",
    "type": "test"
}```
violet spoke
#
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        channel = self.bot.get_channel(764951115262853120)
        user_id = int(data['user'])
        member = self.bot.get_user(user_id)
        #await channel.send(f"{member}")
        print(data)
        print(f"user:-: {data['user']}")
        embed = discord.Embed(
            colour=discord.Colour.dark_gold(),
            title=f"Tested Upvote | {member}",
            description=f"{member} tested an upvote.",
            )
        await channel.send(embed=embed)
```Does anyone know why `member` returns `None`?
sullen nymph
#

User's either not cached or can't be found

violet spoke
#

do you know how to make it return the user?

lusty flare
#

ok, i did a check with reqbin. its giving a 200 code. all seems good. nothing in console still

sullen nymph
#

Interesting

#

give it a few minutes I guess xd

violet spoke
#

User's either not cached or can't be found
@sullen nymph when I do print(data['user']), it gives me the ID. but why can't it fetch the user?

lusty flare
#

yeah still nothing coming through. i feel like the listener just isnt.. well.. listening

sullen nymph
#

Convert to int, print both the value and its type

violet spoke
#

ok

lusty flare
#

if we send a json structure that it shouldn't receive we get a 500, so its definitely parsing it

sullen nymph
violet spoke
#

are you talking to me?

sullen nymph
#

Nah, Cal

violet spoke
#

ok, I printed it. It returns 511943071655526411 - test

#
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        channel = self.bot.get_channel(764951115262853120)
        user_id = int(data['user'])
        print(f"{user_id} - {data['type']}")
sullen nymph
#

Oh, yeah, wrong type

lusty flare
#

one second

sullen nymph
#

I meant type(user_id) xd

violet spoke
#

oh

lusty flare
sullen nymph
#

So theoretically it should work... k3llyhmm

#

unless top.gg webhooks are borked

lusty flare
#

well.. this is the odd thing

sullen nymph
#

Toss me the Auth key and URL you entered on the bot's top.gg page

#

Actually, question

#

Are you testing DBL or DSL webhooks

lusty flare
#

DBL

#

we've had DBL send data to a bin and it works. so we're a bit confused

#

i have no idea what DSL is btw

violet spoke
#

its Discord Server List

lusty flare
#

ohh i gotcha, no we're using the DBL and using test votes and real votes

violet spoke
#

It returns <class 'int'>

#
    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        channel = self.bot.get_channel(764951115262853120)
        user_id = int(data['user'])
        print(f"{type(user_id)}")
sullen nymph
#

Alright, then...

#

Try doing user = self.bot.get_user(user_id) or await self.bot.fetch_user(user_id), I guess?

violet spoke
#

ok I’ll try that

narrow raft
#

Please if any developer here has experience with Heroku and the DBL api, I would appreciate a lot if you DM me. Thanks!

violet spoke
#

Thanks, Shivaco! It worked.

sullen nymph
#

eh well hopefully your ratelimits won't go brrr

restive otter
#

is it possible to transfer all code from vs code to glitch?

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

dusty wraith
hot apex
#

yo @jovial kiln

jovial kiln
#

How can you read dbl if it is defined after dbl.on

#

?

hot apex
#

Bro idfk i frank too much but you said put it bealow

#

below

jovial kiln
#

Wait where is your client.on(“ready”

hot apex
#

bekwio\

#

below

#

but the login in the ready?

#

put*

dusty wraith
#

put it before you define the client

hot apex
#

it is

jovial kiln
#

You need to have ready before hand

hot apex
#

bro wtf

#

can we call

jovial kiln
#

No

hot apex
#

i just share schrren

#

screen

#

ok

jovial kiln
#

const client = bla bla

client.on(“ready”

dbl events here

client.login

hot apex
#

okay one sec

dusty wraith
#

yea it has to be under
const client = new Discord.Client();

hot apex
#

this shit wlding

jovial kiln
#

send me a haste bin

#

Please

hot apex
#

wilding

jovial kiln
#

Of your code

hot apex
#

but you get mycode thne

jovial kiln
#

?

hot apex
#

is that ok if you get my code?

jovial kiln
#

Yes...?

#

Just don't have your token

#

Just remove it

#

I don't need the token I just need the code

dusty wraith
#

no one is gonna steal your code dude

hot apex
#

thats inconfig

jovial kiln
#

Ok

#

Good

dusty wraith
#

at least here

hot apex
#

nice ❤️

jovial kiln
hot apex
#

nvm

jovial kiln
#

press new top right

hot apex
#

dont steal it -_-

jovial kiln
#

Bruh I don't need your code lmao

hot apex
#

that is what you ased for

jovial kiln
#

No

#

I mean

#

Like

hot apex
jovial kiln
#

I don't need to steal it

#

zzZ

hot apex
#

bro im too drunk to understand you

jovial kiln
#

Just

#

Give me a seonc

hot apex
#

can we just help me 🙂

#

ok thanks xx

jovial kiln
#

Alright so

#

Delete that link

#

NOW

#

Because you have your DBL token

#

Like I told you not to have

hot apex
#

but

#

what will that do

jovial kiln
#

wait

hot apex
#

allow people to show their server count

dusty wraith
#

just regen it

hot apex
#

i will xx

jovial kiln
#

kk

dusty wraith
#

put the const dbl under the ready event

hot apex
#

i mean if mee6 wanna use it

jovial kiln
#

^

hot apex
#

it is

dusty wraith
#

like outside it

hot apex
#

oh

jovial kiln
#

Not in the same scope

hot apex
#

OYYYYYYYYYYYYYYYYY LADS

#

YOU SORTED IT

#

MY GUYS

jovial kiln
#

👍

hot apex
#

❤️

#

love you xx

#

no homo

#

im not ga

#

gay

#

please dont think im gay

#

but thanks 🙂

#

xx

jovial kiln
#

Dis dude drunk as hell

#

LMAO

dusty wraith
#

100%

hot apex
#

naaaaa :jkejw

#

do you like my ha;loween logo

#

pfpf

#

pfp

#

i made it myself

#

you know, im pissed because i got bot dev

#

then my bot got unverified

#

so i lost it

#

and idl whu

dusty wraith
#

how lol

#

interesting

hot apex
#

idek

#

they cukked me

#

i was like bitch why you remove me vevifed badge

#

then sent me that

#

like BRO

#

WHY

dusty wraith
#

My bot was verified a day after they removed the de SadChamp

hot apex
#

how does that

#

wpr;l

#

sork

#

work

dusty wraith
#

the dev badge

hot apex
#

oh

#

yeah

#

i hope i can get it again

#

but i made a new bot

dusty wraith
#

hopefully

hot apex
#

on terms of @gaunt steeple

#

becuase the bot team owner got abben

#

banned

#

i cant have ownership of bot

dusty wraith
#

how?

hot apex
#

cant reammber

#

think its racimg

#

racidm

#

FUCK

dusty wraith
#

ah

hot apex
#

Racism

#

yea

#

but yea. that was cool. then it lost it

#

so brain told me to make a new application

#

and bro it got 35 servers in 1 day from dbl

dusty wraith
#

yea my bot growing like crazy

#

35 servers today

hot apex
#

yea. trouble is my API limit

dusty wraith
#

and it was just verified

#

wdym

hot apex
#

its 10000 and its 2x per each song played, so you play a song, it used 1 to search and then 1 to play

#

but then some can use more

#

lemme check it atm

dusty wraith
#

what do you use?

hot apex
#

yoube ap

#

api

#

youyrbue

#

FUCK

#

Youtube

dusty wraith
#

use lavalink

hot apex
#

Idk how

dusty wraith
#

just read the docs

#

and get a good lavalink library lol

hot apex
#

b ut i gotta change all my code

#

fuck man

#

im so close

dusty wraith
#

change it

hot apex
#

once that 7 days hits max, it fucking stops working

dusty wraith
#

changing the code isn't hard right?

hot apex
#

change it to work for lavalink

#

yea

dusty wraith
hot apex
#

its all different code

restive otter
#

how to i send an message every time when a user vote for my bot via webhook

jaunty plank
restive otter
#

how do u get the API?

paper torrent
#

use it

restive otter
#

ok

sullen nymph
#

They probably meant the top.gg API

restive otter
#

yes

#

shivaco is right

sullen nymph
paper torrent
#

ooook

restive otter
#

yes i am there

#

where do i download tho

paper torrent
#

does any of u know how to add clear command??

sullen nymph
#

You don't "download" an API

#

You send requests to it

restive otter
#

@sullen nymph can we get a list of users who votes our bot in the past 12hr?

#

sorry for tag

sullen nymph
#

See the docs

restive otter
#

its individual user

#

where do i send requests to it?

sullen nymph
#

In your code via HTTP request libraries

#

ggashish, then it's not implemented

restive otter
#

how do i use the individual user this

#

https://top.gg/api/bots/botid/check

#

what all i have to add?

#

In your code via HTTP request libraries
@sullen nymph ok thx

sullen nymph
#

https://top.gg/api/bots/check?userId=<user's ID here>

#

Make sure to send your bot's top.gg token in the request headers

restive otter
#

yup

#

https://top.gg/api/botid/check?userId=694061528906727514

#

i have voted the bot

#

but still its showing me {"error":"Not Found"}

sullen nymph
#

/api/bots

#

not api/botid

restive otter
#

ah yeh

sharp hollow
#

Hello

white galleon
#

@sharp hollow your bot needs to be accepted first before you can test, as you need the token for auth

limber crystal
#

How can I make vote rewards for my bot?

restive otter
#

rate limit apply to this?

foggy kelp
#

Believe so, yes

restive otter
#

how to do a action to vote a bot

sullen nymph
#

Why did you mention two people and delete the messages

restive otter
#

Accidentally

kind atlas
#

anyone has meme api?

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

frosty basin
#
```Please correct if im wrong
restive otter
#

Authentication?

frosty basin
#

Authentication???

restive otter
#

Authentication header

frosty basin
#

how

#

where am I going to put header?

#

{headers: {Authorization :"token here"}, server_count: "clientguildscachesize"}

#

???

#

dealing with JSON is hard...

#

ah

#

Why is it error 401???

#
{
  "headers": {
    "Authorization": "token here"
  },
  "server_count": "client.guilds.cache.size"
}
#

did this,,,, error 401

rapid kettle
#

Headers need to be closed

frosty basin
#

???

#

and this is why I don't do POST

#

i think i got it

#

so I splitted the header from the content

#

and .toString()

#

it all works perfectly

#
axios.post('https://top.gg/api/bots/744405785714491503/stats', {"server_count": client.guilds.cache.size.toString()}, {"headers": {"Authorization": process.env.TOPGG}})
#

So what will happen if I place in inaccurate data??? keklaugh

rapid kettle
#

You get a warning from a mod

#

do it again and you’re banned

frosty basin
#

Then... How will the mods know if the data is inaccurate?? keklaugh

sullen nymph
#

Magic!

rapid kettle
#

Then... How will the mods know if the data is inaccurate?? :keklaugh:
@frosty basin the appropriate amount on the bots invite link

frosty basin
#

ooh. Thats cool

rapid kettle
#

less is fine, more is not

#

well slightly more is I’d hope

frosty basin
#

Maybe I should update it every bot join/leave so it can be accurate af

#

nahh.. That is API abooz

#

hmmm think

rapid kettle
#

I update it every 30 minutes

restive otter
#

ils il y des helpeurs fr ?

#

PLS PET

merry zodiac
#

So it says in the API docs that

type String The type of the vote (should always be "upvote" except when using the test button it's "test")
Where is the "test button" so that I can push a test vote?

agile token
#

--HTTP Request --DBL server

jaunty plank
#

@merry zodiac your bots edit page on the webhook tab

merry zodiac
narrow raft
#

Please if any developer here has experience with Heroku and the DBL api, I would appreciate a lot if you DM me. Thanks!

jaunty plank
#

Yeah @merry zodiac, you do need the webhook info entered and webhook setup to use it.

merry zodiac
#

How would you add the webhook integeration with the dblpy wrapper

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

    def __init__(self, bot):
        self.bot = bot
        self.token = os.getenv("TOPGGtoken")  # 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

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

This is what I'm doing right now but when I hit the test button it doesnt print data

sullen nymph
#

ReAD thE DoCS

merry zodiac
#

im using the example from the docs

jaunty plank
#

The docs below show the webhook stuff too

merry zodiac
#
import dbl
import discord
from discord.ext import commands, tasks

import asyncio
import logging


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

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

    # The decorator below will work only on discord.py 1.1.0+
    # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())

    @tasks.loop(minutes=30.0)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""
        logger.info('Attempting to post server count')
        try:
            await self.dblpy.post_guild_count()
            logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
        except Exception as e:
            logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

        # if you are not using the tasks extension, put the line below

        await asyncio.sleep(1800)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        logger.info('Received an upvote')
        print(data)

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(TopGG(bot))
#

this is what the docs r doing

sullen nymph
#

pqpowieeuurhrhnsmslpaow

#

Refer to the docs on GitHub

mortal onyx
#

pqpowieeuurhrhnsmslpaow
?

jaunty plank
peak lodge
#

were are the docs for JS

#

for the upvote webhook stuff

jaunty plank
restive otter
#

where i can get the token of dbl? DerkyKEKW

peak lodge
#

thanks

jaunty plank
restive otter
#

thanks

peak lodge
#

hey

#

so

#

how do i setup a vote webhook

restive otter
jaunty plank
#

its the password you set between top.gg and your webhook

restive otter
#

how i see the password ZICK_xd?

jaunty plank
#

the vote webhook is in the second example on the docs @peak lodge

#

you set it

#

its not given to you

restive otter
#

oh

#

how i set the password? cryIgnore

jaunty plank
#

change 'password' to what you want it to be

restive otter
#

oh

jaunty plank
#

then on your bots edit page, in the webhook section put the authorization to the exact same thing

restive otter
#

thanks

jaunty plank
#

np

peak lodge
#

do i need my bot approved

#

before i set this up

jaunty plank
#

yeah

#

you can put it in your code and test it with postman to make sure it works

#

but theres not a lot of point imo

restive otter
#

I’m using an iOS app to code

jaunty plank
#

gl

restive otter
#

?

#

?

#

?

#

the second example on the docs dont work ZICK_xd

jaunty plank
#

Its what I am using

#

Did you fill in the url and auth on the top.gg site?

#

With the proper ip, port, and path.

restive otter
#
const DBL = require("dblapi.js");
const dbl = new DBL('your api key here', client);
exports.run = (client, message) => {
    dbl.hasVoted(message.author.id).then(voted => {
        if (!voted) {
            message.reply("Bu komutu kullanabilmek için DBL üzerinden oy vermen gerekiyor. (Eğer oy verdiyseniz bi kaç dakika bekleyin .s) \nTo vote: https://discordbots.org/bot") /type your bot's dbl vote link

        } else {
            message.channel.send("Destekçi rolün verildi."); //Gives a member a special role when you vote if you want
            message.member.addRole("632469420220088325")//role ID to add during voting

        }
    })
}```
#

Example for DBL Vote

#

I don't see an error, It works clean for me too

#

but I want when a user vote the bot send a message

#

1 min

#
const DBL = require('dblapi.js');
const dbl = new DBL('DBLTOKEN', { webhookPort: 5000, webhookAuth: 'DBLWEBHOOKPASSWORD' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook: http://${hook.hostname}:${hook.port}${hook.path}`);
})
dbl.webhook.on('vote', vote => {
      client.channels.get('CHANNELID').createWebhook(vote.user.username)
    .then(webhook => webhook.edit(vote.user.username)
        .then(wb => {
            const hook = new Discord.WebhookClient('DBLTOKEN', wb.id, wb.token);
  
  hook.send(`\`${vote.user}\` Voted!`);
  hook.delete()
}))
          });```
#

@restive otter

agile token
#

HTTP Request -->DBL server

restive otter
#

@restive otter i need to set the password?

#

yea

#
      webhookID = '',
      webhookToken = '';//

const express = require('express'), // 
      app = express(), // 
      bodyParser = require('body-parser'), // 
      morgan = require('morgan'), //
      { RichEmbed } = require('discord.js'), // 
      { WebhookClient } = require('discord.js'), // 
      hook = new WebhookClient(webhookID, webhookToken); 

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(morgan('combined'));

app.post('/vote', (req, res) => {
    var authorization = req.headers.authorization;
      
    var bot = req.body.bot;
    var user = req.body.user;
    var type = req.body.type;

    if (!bot || !user || !type || !authorization) {
        res.setHeader('Content-Type', 'text/plain'); 
        res.statusCode = 403;
        return res.end('MISSING_PARAMS'); 
    };
      
    if (authorization != authorizationKey) {
        res.setHeader('Content-Type', 'text/plain'); 
        res.statusCode = 403;
        return res.end('WRONG_SECRET'); 
    };

    if (type === 'upvote') {
        var embed = new RichEmbed({
            color: 3447003,
            title: `A new vote has been received!`,
            description: `<@${user}> bot gave a vote on DBL!`,
            timestamp: new Date()
        });
        
        hook.send({ embeds: [embed] });

        res.statusCode = 200; 
        return res.end('OK');

    } else if (type === 'test') {
        var embed = new RichEmbed({
            color: 3447003,
            title: `Successful!`,
            description: `DBL test successful Votehook is working properly!`,
            timestamp: new Date()
        });
        
        hook.send({ embeds: [embed] });

        res.statusCode = 200; 
        return res.end('OK');

    }

})```
#

wtf

#

there is something like this i use

#

i need this? xd

#

😄

#

?

#

Don't you want something like that? xd

jaunty plank
#

ah v11

#

im scared

restive otter
#

why ?

#

i want when the user vote the bot send a message

potent basalt
jaunty plank
#

did you put your webhook url and auth on your bots edit page?

potent basalt
jaunty plank
#

in the webhook section

#

http, dont think it supports https

potent basalt
#

so i changed it to http?

jaunty plank
#

should be

restive otter
#

https eyess

jaunty plank
#

ay, guess it does support https now?

#

still will need ssl setup in your code

potent basalt
#

@jaunty plank But when i clicked "Test" 4 times i get the ping received in console

jaunty plank
#

you need to use the proper path then, default is /dblwebhook

#

also, channelforWebhooks seems to be null

potent basalt
#

Line 93

steady garden
#

p!help

jaunty plank
#

only other thing then is to add the proper path to the url on the bots page

potent basalt
#

i changed it to /dblwebhook and i spammed Test and i get the "Ping received" is this mean it worked when someone vote the bot?

hard knoll
#

how to do the server counts pls help me

jaunty plank
#

you need a verified bot first

hard knoll
#

i don't think so

jaunty plank
#

afaik, the webhook event is still supposed to happen. when using a seperate http server app.
not sure why yours isnt going off @potent basalt

#

you dont get an api token until your bot is approved @hard knoll

hard knoll
#

my bot is approved

jaunty plank
#

is your bot under a different account?

hard knoll
#

yeah

jaunty plank
#

why do you have two discord accounts here?

hard knoll
#

idk

jaunty plank
#

ok

#

well what lib is your bot in?

hard knoll
#

wait let me login with my real acc

orchid siren
#

well what lib is your bot in?
@jaunty plank BD script

jaunty plank
#

like discord bot designer?

orchid siren
#

yeah

jaunty plank
#

honestly, zero idea how you post server count with that

orchid siren
#

😢

#

honestly, zero idea how you post server count with that
@jaunty plank i really need help

jaunty plank
#

shiv might know

rapid kettle
#

You can’t post with that

jaunty plank
#

yeah i didnt think so

storm surge
#

when it says get your DBL token, does it mean your profile or the bot token in the edit page?

#

on the auto guild count

sullen nymph
storm surge
#

i think i did it. i guess just wait and see

radiant peak
#
^CUnclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fe6ea8cbf10>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fe6dbf8d0d0>
Task exception was never retrieved
future: <Task finished name='Task-1510' coro=<DBLClient.webhook() done, defined at /usr/local/lib/python3.8/dist-packages/dbl/client.py:417> exception=OSError(98, "error while attempting to bind on address ('0.0.0.0', 5000): address already in use")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/dbl/client.py", line 436, in webhook
    await self._webserver.start()
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/web_runner.py", line 100, in start
    self._server = await loop.create_server(  # type: ignore
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
    raise OSError(err.errno, 'error while attempting '
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 5000): address already in use
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fe6dbeadd30>
Task exception was never retrieved
future: <Task finished name='Task-1922' coro=<DBLClient.webhook() done, defined at /usr/local/lib/python3.8/dist-packages/dbl/client.py:417> exception=OSError(98, "error while attempting to bind on address ('0.0.0.0', 5000): address already in use")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/dbl/client.py", line 436, in webhook
    await self._webserver.start()
  File "/usr/local/lib/python3.8/dist-packages/aiohttp/web_runner.py", line 100, in start
    self._server = await loop.create_server(  # type: ignore
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
    raise OSError(err.errno, 'error while attempting '
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 5000): address already in use```
#

so I sometimes get this error when I stop my bot with ctrl + c

#

its in python

#

so this are my settings ob top.gg

west flax
#

Idk if you want to share your IP but your IP is in there

radiant peak
#

oh

west flax
#

Anyways, my knowledge of Python is zero to none but there seems to be a DBLClient.close() function which you can call

#

to close the WebServer that's being used for the webhooks

radiant peak
#

okay, ill use it in future

#

and another question

#

my webhook just stopped working

#

i changed nothing

#
import asyncio
import random
import traceback
from datetime import datetime

import dbl
import discord
from discord.ext import commands, tasks
from discord.ext.commands.cooldowns import BucketType

import info
import sql


class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = 'my_token'
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=1556)

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print("Vote Test!")

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

so this is my code

opaque jetty
#

@radiant peak where are you hosting

radiant peak
#

contabo

#

its in germany

#

but it worked until now perfectly

hollow forum
#

0.0.0.0

Idk if you want to share your IP but your IP is in there
@west flax is not an ip

#

Also, @radiant peak this just means something is already using that ip

dreamy brook
#

that looks like an ip

jaunty plank
#

0.0.0.0 is kinda like saying 192.168.1.1

#

its not anything important

#

every computer has 0.0.0.0, as it has localhost

hollow forum
#

^

#

What you get by 192.168.x.x is your machine IP.
No one will ever be able to access to it unless he's on the same network (local network).
Using this to make external ppl to access to it won't work

#

This is how it works when u forward ports on your router. You define the ports you want to open and the destination (Your local PC ip, if you're hosting a webserver on it, per exemple) so people will be able to get access to it from your public ip to the destination PC

radiant peak
#

@hollow forum okay ty

#

I get it to work actually

#

idk what was wrong

hollow forum
#

When an application runs twice on your ip per exemple, the second one wont work @radiant peak

radiant peak
#

so what does that mean?

#

I reloaded the cog

hollow forum
#

If u get no error then its okay

radiant peak
#

is it then running twice?

#

k

#

ty

grim anchor
#

How could i make a vote command in python?

snow phoenix
#

No entiedo

scenic mica
#

Hello

west flax
#

@hollow forum he removed if after I said it

snow phoenix
#

Hello

#

I speak Spanish and that's why I don't understand

crimson night
somber wadi
#

@crimson night

crimson night
#

how?

#

u can show me?

sullen nymph
#

Did you read the docs

crimson night
#

oh

#

oki

#

Did you read the docs
@sullen nymph sorry for the ping but i don't know how to find it-

#

where i can find?

somber wadi
#

what's your bot language?

crimson night
#

is made with dbd-

sullen nymph
#

Yeah, no. Ain't posting server count with that

crimson night
#

oh-

sullen nymph
#

Unless there's some feature somehow that does it, which I highly doubt

crimson night
#

ok-

#

Sorry for disorder

hollow forum
#

@hollow forum he removed if after I said it
@west flax ?

opaque rampart
#

is there a way to know whenever a user votes for a server? not a BOT

restive otter
#

is there a way to know whenever a user votes for a server? not a BOT
@opaque rampart yes using webhooks

opaque rampart
#

is there a tutorial for this?

#

im new to dbl api tho.

restive otter
#

we don't have docs for DSL yet

#

read pins for now

#

the setup is mostly the same as DBL webhooks

#

only difference is the request body contains different stuff

rapid kettle
#

It’s just a POST request

#

you can find the auth in the Authorization header

#

and the body looks a tad like this: json { "user":"USER ID", "guild":"GUILD ID", "type":"upvote or test" "query":"?a=5&b=6" }

#

@opaque rampart ^

#

What you could do is set up a repl on https://repl.it to listen for your votes

#

The easiest way is using express

#

you do need to add the json parser though.

#

I’ll give you a baseplate

#
const express = require('express');
const app = express();
app.use(express.json());

app.post(”/", (req, res) => {
  /*req.body gives you the body I discussed above, and req.header("Authorization") gives you the auth so you can check the validity*/
});

app.get("/", (req, res) => {
  res.send("I’m alive!");
)};
#

You might want to put this on to uptime robot

stuck loom
#

uhh

rapid kettle
#

need help?

stuck loom
#

yes

#

i dont know how these webhooks work

#

on the docs

rapid kettle
#

It just sends a POST request

stuck loom
#

ik

#

but then

#

how do i use the authorization thing

rapid kettle
#

express?

stuck loom
#

Authorization
You can use this value to verify the requests are coming from us.

#

but how

#

like

rapid kettle
#

what web server are you using to receive the POST

stuck loom
rapid kettle
#

what?

stuck loom
#

for the webhook

rapid kettle
#

no?

sullen nymph
#

You got the wrong idea

stuck loom
#

like that

#

idk

sullen nymph
#

That's widgets, yeah

rapid kettle
#

that’s not webhook

#

that’s widgets

sullen nymph
#

basically displaying a bot's info

stuck loom
#

oH

#

sorry

sullen nymph
#

Webhooks are reverse APIs, used for easier storage and receiving of votes

stuck loom
#

i'm a little new at this stuff

sullen nymph
#

It's all good nekohappy

rapid kettle
#

we all were at some point

stuck loom
#

another question

rapid kettle
#

aye

stuck loom
#

how do i use it to display on the bots thing

rapid kettle
#

how do you use what

stuck loom
#

the widget

sullen nymph
#

You mean show the widget on your bot's top.gg page?

stuck loom
#

yes

#

qwq

rapid kettle
#

you only get access to that once your bot gets approved

stuck loom
#

oh-

sullen nymph
#

Use the img HTML tag and set the widget link as src attribute

stuck loom
#

huh

#

how u do dat

sullen nymph
#

Well, you can still set it up, it just won't work until your bot is approved KEKW

stuck loom
#

aH-

rapid kettle
#

<img src="https://top.gg/api/widget/botID.png">

#

NICE WORK DISCORD

sullen nymph
#

use codeblock for once KEKW

stuck loom
#

huh-

#

I-

#

what if i have it like this

#

do i just take the widget part

rapid kettle
#

that works

sullen nymph
#

Yeah, that's Markdown, which is supported

stuck loom
#

or the whole thing-

rapid kettle
#

That’s the markdown equivalent basically

stuck loom
#

uH-

rapid kettle
#

you take the whole thing

stuck loom
#

do i still need the <img thingy

rapid kettle
#

no

stuck loom
#

oki

#

now i waiteth

#

tankies for the help you two

rapid kettle
junior perch
distant oak
#

Hi ! The test button for webhooks work ?

#

Bc im receving anything

frigid thunder
#

hey is there a python thing that works with this?

distant oak
vital drum
#

ok

frigid thunder
#

oh ok

#

is there github?

#

oh

#

i found it

spice grove
#

Hi, I'm new, I have a problem with nekotina my bot does not react to my commands and is offline is Nekotina

jaunty plank
#

this is a support server for top.gg not nekotina

serene shuttle
#

I don't get how to set up the cog, Im not getting any result from on_dbl_test, what do I pass to DBLClient?

#

is there an example somewhere?

#

using Python btw

jaunty plank
#

the docs

primal pecan
#

Hi, I would like to know: as @Lyss#0001 told me, the incorrect number of shards and servers on top.gg site is coming from my side, so please can someone tell me what's wrong with my request ?
My discord bot has 36 shards for 36,800 servers but on the top.gg web page we can see only 24 shards for 26,400 servers (https://top.gg/bot/318312854816161792).
I have checked and all my requests are sent by the bot and the send interval is 3600000 (1 hour) to be sure to not overload the top.gg services.
Here the code i use to send my shards stats:

const fetch = require('node-fetch');

Client.setInterval(() => {
    fetch(`https://top.gg/api/bots/${Client.user.id}/stats`, {
        method: 'post',
        body: JSON.stringify({
            server_count: Client.guilds.cache.size,
            shard_id: Client.shard.ids[0],
            shard_count: Client.shard.count,
        }),
        headers: {
            'Authorization': process.env.topgg_token,
            'Content-Type': 'application/json',
        },
    });
}, 3600000);```
serene shuttle
#

I cant find anything to set it up for tracking voting though?

#

or I could have the webhook url wrong

#

what do I pass to this? in analytics

distant oak
#

DraftMan#0042 Use the npm dbl package (salut sinon)

serene shuttle
#

anyone able to help?

sullen nymph
#

show your code

serene shuttle
#

oops

#
import dbl
import asyncio
import logging

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

    def __init__(self, bot):        
        self.bot = bot
        self.token = 'mytok'
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_auth='mypass', webhook_port=5000)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print('abc')
        logger.info('Received an upvote')
        print(data)

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

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
sullen nymph
#

Make sure your port is open and properly forwarded

serene shuttle
#

I dont know how to port forward

#

how do I do that?

#

it is open and listening

jaunty plank
#

is your code on a server or home network?

serene shuttle
#

server

jaunty plank
#

then you wont need to port forward

#

if you have a firewall on your server youll need to let it past

serene shuttle
#

yeah I checked all the firewalls and theyre all open for it

#

well checked iptables and another one, I've never set one up myself

#

nothing blocking it

#

do I need to pass anything differently into self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_auth='mypass', webhook_port=5000)?

sullen nymph
#

Try sending manual request with reqbin

#

No, that's fine

serene shuttle
#

I dont even know how to do that

sullen nymph
#

I believe in you and your common sense

serene shuttle
#

I dont lol

sullen nymph
#

It's relatively simple

serene shuttle
#

I'm just getting operation timeout, unless I'm doing something wrong

#

I just put in https://ip.my.address.here:5000/dblwebhook and hit post?

jaunty plank
#

I'm still not sure if https:// will even work
someone said it does, someone said it didnt 🤷‍♂️

#

the lib uses HTTPClient

serene shuttle
#

after removing https:// I got Status: 401 (Unauthorized) Time: 139 ms Size: 0.00 kb

jaunty plank
#

did you put in your auth?

#

pretty sure everythings working if you got an unauthorized warning

serene shuttle
#

oh shit I got something through

#

it errored but I got something

#

ty

#

Im getting Status: 500 (Internal Server Error) Time: 141 ms Size: 0.05 kb

jaunty plank
#

use http:// not https://

serene shuttle
#

yeah same deal

#

doesnt work at all on https, on http or on nothing specified it gives internal server error

jaunty plank
#

and the unauth error went away when you put the correct auth in?

serene shuttle
#

omg it worked

#

yeah it did

#

it was working just got the internal server error as it didnt know how to handle whatever reqbin was pushing it

#

but works now from dbl

jaunty plank
#

ah

serene shuttle
#

tysm for the help guys, really appreciate it

jaunty plank
#

what changed Thonk

serene shuttle
#

http > https mostly

jaunty plank
#

ah your url on page i see

serene shuttle
#

yup

rapid kettle
#

read the channel topic

restive otter
alpine lichen
#

every since adding the dblapi.js library my bot randomly crashes without error

#

actually

#
Error: 503 Backend fetch failed
    at IncomingMessage.<anonymous> (/home/pi/Essentials/node_modules/dblapi.js/src/index.js:118:25)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) 

jaunty plank
#

that happens any time the api is down

#

you should be checking for those errors

rapid kettle
#

.catch() is genuinely your best friend most cases

jaunty plank
#

rip nitro boost

restive otter
#

@jaunty plank i don't think so.

jaunty plank
#

dont think what 🤔

restive otter
#

rip nitro boost

jaunty plank
#

matt lost his boost

#

he got it back though

rapid kettle
#

aye

night geyser
#

I ned nitro

#

frik

scarlet cobalt
#

One message removed from a suspended account.

night geyser
#

were

scarlet cobalt
#

One message removed from a suspended account.

hoary flame
restive otter
#

Hello I need help

#

I am using python

#

and I want to chech if a person votes a server

#

but the docs only shows bots

#

channel ded

#

Why is this channel ded

#

I

restive otter
#

Why is this api channel so empty-

#

ah

#

this channel is so dead man

mild flume
#

Because people are scared to chat here. If you want to chat, please go #general or #general-int for the sake of being muted-ness.

#

Thank you,

  • BabyGOAT
restive otter
#

Please help me

#

Please

mild flume
#

May I ask with what?

restive otter
#

How to make the bot run a command when the server is voted @mild flume

mild flume
#

I have not done that yet, but I do know who does, join the Prism Official server and ask the Bot Dev how to. He has taught me many things and you can learn from him.

(He entered the part of cod you were talking about. With the voting.)

#

How to make the bot run a command when the server is voted @mild flume
@restive otter

restive otter
#

alirght

#

server is locked

mild flume
#

DM mods

restive otter
#

m

#

do u know any mod cuz i see none there

#

why api is like this withot servers but bots?

sullen nymph
#

DSL is in reworks but an API is possibly or most likely planned to be implemented

restive otter
#

so its possible to do ths i have seen many bots do that\

sullen nymph
#

Use webhooks for ddoingdomething when someone votes

restive otter
#

mk

#

@sullen nymph i have created the webhook

sullen nymph
#

Discord webhook?

restive otter
#

ye

sullen nymph
#

Not that webhook

#

A webserver on your VPS

restive otter
#

ahh

#

so much work

#

i will just leave it

sullen nymph
restive otter
#

why is this api like this

sullen nymph
#

Webhooks aren't that hard to set up

restive otter
#

ik but its confusing discord and other webhooks

#

and i ahave never create a "top.gg" type webhook. or maybe i have never created a webhook

sullen nymph
#

There are official libraries that can help you

restive otter
#

also a discord webhook or a discord_bot webhook?

sullen nymph
#

a uh

#

a webserver

#

A separate program that listens to HTTP requests

restive otter
#

OH

#

so you mean http requent thingy

#

this one

restive otter
#

but if i create a webhook

#

i cant run my other commands with it

#

.

dull mirage
#

where is the application page to create a bot?

restive otter
#

i am done with this bad api

#

am amgery

willow spindle
#

@dull mirage this is not related with top.gg API

dull mirage
#

sorry

regal fjord
#

@restive otter on the top.gg website, you can create a webhook (like an endpoint). So when someone votes on your bot, top.gg sends your webhook some information about who voted, etc.