#topgg-api

1 messages · Page 99 of 1

latent narwhal
#

because dbl.getVotes doesn't work above 1000
@rapid kettle
I won't get that much lmao

rapid kettle
#

plus it'd be better to getBot

#

because getVotes doesn't return a number afaik

latent narwhal
#

Ok

vapid brook
unborn canyon
#

do you have dblapi.js installed

#

looks like the error is that

woven coral
#

try installing dplapi.js

#

or put it on your package.json

wintry ember
#

my procfile is exactly named: Procfile

rapid kettle
wintry ember
#

no...

rapid kettle
mental adder
#

UFF

rapid kettle
#

lang?

jaunty plank
#

i wish we could link directly to the webhook section of jslib

#

you should still read the docs before coming here

#

the docs should be your main source of info

restive otter
#

its dead

#

here

#

lol

sullen nymph
#

-api

abstract mothBOT
opal carbon
#

hello, what are the dblapi.js constructor options

rapid kettle
#

wdym?

opal carbon
rapid kettle
#

for webhooks or autoPosting

opal carbon
#

for the constructor

#

new DBL()

rapid kettle
#

lang?

opal carbon
#

hello, what are the dblapi.js constructor options
@opal carbon

#

literally said it .js

rapid kettle
#

ohwaitimstubid

#

right in the docs

opal carbon
#

cheers

rapid kettle
#

aye thats fine

opal carbon
#

oh wait

#

does the constructor post my stats for me

rapid kettle
#

Yea.

opal carbon
#

all i have to do is do the constructor and then bam?

rapid kettle
#

If you provide ("token", client) yes

#

if you want voting webhook setup you'd have to use webhook stuff

opal carbon
#

Oh right, thanks

humble bison
#

what timezone defines a weekend vote

sullen nymph
#

UTC

humble bison
#

is that like +0 or something in GMT

rapid kettle
#

yes

#

gmt + 0000 afaik

sullen nymph
#

^

humble bison
#

so i can say this right
votes are considered a weekend vote if the day is Saturday or sunday, based off UTC (GMT+00:00)

rapid kettle
#

yes

sullen nymph
#

Friday is considered weekend

humble bison
#

so there's 3 days

#

ok

jaunty plank
#

Friday, my favorite weekend day

restive otter
#

hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

willow spindle
#

1 i is enough smh

hasty mortar
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
``` what things do i need to fill in here?
#

whats the password?

jaunty plank
#

The auth is whatever you define

#

It doesnt matter what it is, as long as its secure

#

Its the password your webhook will check against before allowing it through.

hasty mortar
#

o

#

okie

prisma hearth
#

Hi

restive otter
#

@vapid cape I have fixed the typo issue, The port is all okay. Everything is perfect right now, But upon testing / voting, Still, nothing is happening however the server count is working.
Any update on it?

crimson gazelle
#

i get errors
@hasty mortar it says something’s already using that P O R T

hasty mortar
#

oh

#

i uh

#

dont really know

#

what that means

#

heh heh

jaunty plank
#

Your bots on glitch?

crimson gazelle
#

@jaunty plank looks like heroku

opaque jetty
#

yep, its defo heroku

restive otter
#

eloel

jolly escarp
#

Does my bot have to be in this server if I want to use the API?

trail sigil
#

it'll need to be approved

jolly escarp
#

Oh ok

ornate sinew
jaunty hamlet
#

Hey, I've recently updated my Schema for mongoose.

#

How can I update all existing files in the database.

rapid kettle
#

how is this related to top.gg api

jaunty hamlet
#

Oops.

#

Wrong channel.

restive otter
#

is the api having problems right now?

#

0|projectbump | 'x-content-type-options': 'nosniff', 0|projectbump | server: 'cloudflare', 0|projectbump | 'cf-ray': '5bf307b3dd3e0621-FRA' 0|projectbump | }, 0|projectbump | ok: false, 0|projectbump | statusText: 'Origin Connection Time-out'

trail sigil
#

there are currently issues with the website, so it is very likely to be a result of that

#

web admins have been notified, just have to wait for now

jolly escarp
#

I'm kind of confused because bots like dank memer are on top.gg but it isn't in this server and I thought it had to br

#

Be*

trail sigil
#

-api

abstract mothBOT
jolly escarp
#

Oh sorry

#

Also for the 'Detailed description of your bot' part, do I just write about what my bot will be doing?

#

In the application form for the API key

jaunty plank
#

this is more of a #support question
you can write about your commands, and what your bot does.
mentioning nsfw commands isnt allowed

rich parcel
#

Oh wow

frail meteor
dense basalt
#

Do you not receive the votes at all or do you receive after a long delay

frail meteor
#

I do receive the votes, it just never sends the webhook request with the upvote data

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

ok

dense basalt
dense basalt
#

@frail meteor has it always been like this or just recently

frail meteor
#

I have only just set this up

dense basalt
#

The site might be having some issues, could you try it again in +/- 30 minutes?

frail meteor
#

Sure, if I can find someone who will upvote xd

sullen nymph
#

DM me the bot link in 30 minutes

frail meteor
#

Aight

prime needle
#

dm me the link and ill upvote

#

@frail meteor

#

@soft linden just ask your question here

soft linden
#

Ok so I'm really confused on how to set the webhooks up. I'm just trying to get it to send a message to a discord channel when someone votes

trail sigil
#

have you setup the url of the webhook correctly?

#

i.e. http://ip:port/dblwebhook

soft linden
#

so you need a website

#

or similar

trail sigil
#

nah, that is the ip and port of your bot's server

soft linden
#

wdym by bot's server

trail sigil
#

the machine/computer that hosts your bot

soft linden
#

oh ok

trail sigil
#

you cannot set the webhook url to a discord webhook for a channel btw

soft linden
#

and then you just need to handle requests on that server

trail sigil
#

yep

soft linden
#

to send the message to a channel

#

ok ty

trail sigil
#

indeed

#

you may wanna check the docs too, if you haven't already

#

it has some guides on how to do it and what you should expect in the webhook message you receive

soft linden
#

alright thx

prime needle
#

wait so @trail sigil how do you do it with justs discords webhooks

trail sigil
#

you don't

prime needle
#

oh then i cant use api

#

welp

dense basalt
#

Are you using JavaScript/NodeJS

prime needle
#

yep

dense basalt
prime needle
#

oh ok

dense basalt
#

Standalone webserver to handle votes

mystic dune
#

someone have good 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

prime needle
#

@dense basalt what is the port meant to be

dense basalt
#

The port you want the server to run on

#

Uhm

#

You might want to hide your IP

prime needle
#

not mine

#

vps

dense basalt
#

You want to hide that as well

prime needle
#

well if someone types ping websitename they can get it

#

its nothing secret

spiral steeple
#

uh

#

no, proxies exist

prime needle
#

my website uses it

#

tru

#

tru tru

dense basalt
#

Just yeet it behind cloudflare

prime needle
#

ok

#

i do

#

but still;

#

whats the problem

#

Uncaught Promise Rejection FetchError: request to https://ip:5607/voteInfo?user_id=510810429828890624 failed, reason: connect ECONNREFUSED ip:5607

#

@dense basalt

dense basalt
#

if you go <yourip><yourport> in your browser

#

What do you see

prime needle
#

nothing

dense basalt
prime needle
#

ok

lament blaze
#

hey hey! i'm trying to implement api stuffs to my bot but, as it turns out, I can't get dblpy through pip for whatever reason.

#

do I have to get it from source or something?

median badger
#

Are you spelling it completely right

lament blaze
sullen nymph
#

@lament blaze you sure that's pip for python 3.5.3+?

lament blaze
#

Oh goodness, you're right

#

I was running pip, not pip3

#

My b!

sullen nymph
lament blaze
#

For whatever reason my Ubuntu install tends to default to Python 2.7 :/

vapid cape
#

linux package managers rely on their own repositories, which are updated only for major releases

modest shale
#

someone can see what is wrong?

#

still not working

#

real bot

sullen nymph
#

That's PyCharm from what I can tell

modest shale
#

yes its

#

@modest shale this is the name?
@restive otter this is the name of the bot

sullen nymph
#

apply the listener decorator to on_guild_post and rename commands(bot) to comandos(bot)

modest shale
#

english isn't my main language if I say something wrong sorry

#

lol sorry

#

Pycharm

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

modest shale
#

yes

candid ferry
#

_play Ese tu novio now huh? BB Nobre

sullen nymph
#

-botcommands @candid ferry

abstract mothBOT
#

@candid ferry

Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.

modest shale
#

I tried to add the server count but now my bot is broken

#

what is happening?

#

I already made backup but still not working

sullen nymph
#

Post full traceback

modest shale
sullen nymph
modest shale
#

even the code that is hosted stop working

#

stopped*

#

worked ty

#

thank you @sullen nymph worked the server count

sullen nymph
#

Ey nice

modest shale
#

I started program this year helped a lot

final rune
#

How do I get any API

#

From any site

spiral steeple
jaunty plank
#

You'd have to be more specific

blazing lava
#

How do I get any API
@final rune by making a get request

sturdy maple
#

ok kid we get it

restive otter
#

@signal hawk We have a child here

#

Who needs to be punished

#

<@&304313580025544704>

signal hawk
restive otter
gloomy fractal
#

-atmods @restive otter

abstract mothBOT
#

@restive otter

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
restive otter
topaz wyvern
#

tfw

errant stratus
#

A

sharp turtle
#

how do I make a command vote only

#

nvm

restive otter
true talon
#

your bot needs to be approved

latent narwhal
#

yhe

#

my question is

#

how can i get total number of votes

true talon
latent narwhal
#

i wanna get number of votes

#

ok

ember terrace
#

You have to record the number yourself. Use one of the dbl libraries and when a vote is received, you can save it somewhere so that the user can get a reward

lofty hemlock
#

Hello guys

latent narwhal
#

You have to record the number yourself. Use one of the dbl libraries and when a vote is received, you can save it somewhere so that the user can get a reward
@ember terrace
They already get a reward ;-;

ember terrace
#

?

rain heart
#

you'll need to count the votes like that nonetheless

latent narwhal
#

?
@ember terrace
I am saying I already have a reward for them if they vote

dusty roost
#

so i just updated to discord.js v12 and all of a sudden i'm not receiving votes

#

no errors or anything

#

just nothing

jaunty plank
#

the website is down iirc.

dusty roost
#

well it's up for me

#

guess i'll wait and see

jaunty plank
#

its been going up and down the past like 12 to 24 hours

dusty roost
#

got it, thanks

restive otter
#

Which api can be used to make Pokécord

jaunty plank
#

pokecord you will have to make yourself

restive otter
#

Yes I know

#

Which api can be used to do it

rapid kettle
#

May I ask you to read the channel topic

restive otter
#

Sorry for asking

unborn canyon
#

Kek how make pokeman with api

willow spindle
frail meteor
white forge
#

corona sy

trail sigil
#

-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

olive turtle
#

how can i make the webhooks with votes

jaunty plank
#

are you using one of the libraries?

ebon lotus
#

.

unborn canyon
valid tiger
#

Start by setting up your webhook URL in the edit form of your bot on this site, it can be found at https://top.gg/bot/:ID/edit once you have entered the URL you want the webhook to be sent to, you're all set! If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in our #topgg-api channel.

How to make it?

rapid kettle
#

you can’t yet

polar falcon
#

merci!

sudden spindle
#

how should i do a bot with a automated request/buy system?

jaunty plank
sudden spindle
#

ok sry

median badger
#

@trail sigil

#

@left egret as starman is afk

abstract mothBOT
#

🤐 Muted kyloRen#7491 (@deep pivot)

left egret
#

Thanks

median badger
#

Thanks eri

lavish elm
#

Hey! I'm using this code and my servercount is not being posted. I am not getting any error either. Any idea on how to fix the code?:

    const dblToken = 'botToken';
    const DBL = require('dblapi.js');
    const dbl2 = new DBL(dblToken, client);

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

    dbl2.on('error', e => {
        console.log(`Oops! ${e}`);
    })```
jaunty plank
#

client is the client you log in with correct?

lavish elm
#

Yes

soft linden
willow spindle
#

yes

soft linden
#

kk ty

latent narwhal
#

the api is not working

#

suddenly it stopped

#

working

#

i dind't changed anything

#

wtf

gusty citrus
#

Same it broke for me too

latent narwhal
#

yeh

gusty citrus
#

Gotta wait i guess

latent narwhal
#

should we ping a mod ?

#

to make them aware

gusty citrus
#

I'm quite sure it's already aware

latent narwhal
#

@gloomy fractal

#

oh

gusty citrus
gloomy fractal
#

Ya, we know. Telling admins

latent narwhal
#

kk

#

sry

restive otter
#

Me and Zoro have already reported

#

Don't steal my credit

#

¯\_(ツ)_/¯

#

is it just me or dbl’s vote webhooks are not working?

#

i never changed anything to my code and it just suddenly broke

#

Bro

#

It has been reported

#

And the third message above you literally said we are aware

#

oh ok thx i was just too lazy to scroll up just now lol

gloomy vortex
#

Hello I sent you 25 days to get me on the website but until now I have no answer for me do I have a problem please someone help me why didn't I get it until now I'm waiting for you.

dense basalt
#

This is the wrong channel for that, but approval takes up to 4 weeks but it can also take longer so please stay patient ^^

gloomy vortex
#

Thanks I’m I watting..

short edge
#

Anyone else not getting webhook data? Mine worked yesterday but today it doesn't send anything, not even the test. My IP is the same, and port still open

restive otter
#

@short edge ehm, I was just looking myself

#

my api settings got rolled back to what they were like 2 weeks ago

#

so go check your settings, as I too am no longer getting data, imma put it back to what it should be now and check if that works sip_sip

#

@dense basalt is top.gg aware of that or any idea as to why?

dense basalt
#

You mean the votes not going through webhooks?

#

Admins are aware of that yes

short edge
#

Oh ok!

restive otter
#

@dense basalt I mean my webhook got changed kekedR

dense basalt
#

What do you mean changed?

restive otter
#

i had 2999/topgg as I now handle it myself, but when looking at the settings it shows :2998/dblwebhook like im still using the dbl package, which im not

dense basalt
#

You mean on the webhook URL?

restive otter
#

yeah no im just misremembering I guess, runaway

#

it is still correct, I just assumed it wasn't given it looks weird and no webhooks are being sent out

#

anyway don't mind me, im a retard, time to change this to be /topgg in my code

dense basalt
#

Yeah we're having issue with votes not going through

coral rampart
#

thank god i checked here before tearing my bot apart trying to fix it

dense basalt
#

Lmao

misty wind
#

I get this error often.
The code to post server count, one of the examples from top.gg/api !
Ping me if anyone helps.

sullen nymph
#

Try regenerating your top.gg token

lavish elm
rapid kettle
#

thats a server error -- Unavailable server error response code indicates that the server is not ready to handle the request

lavish elm
#

So it is not my fault? Is API down?

#

In my response body I can read Checking your browser before accessing from cludflare

#

So I'm probably getting some kind of captcha, but not sure how to bypass that

arctic arch
#

your url is wrong

lavish elm
#

Oh is it api/bots?

#

I will check url thanks

oak sinew
rapid kettle
#

anything

#

as long as it matches the auth in your code

oak sinew
#

ok thx

jagged sky
#

was working fine for a month

#

now i am not getting any post request anymore

#

was the api updated

rapid kettle
#

the webhooks dont work crrently

jagged sky
#

so what should i do? is it under maintainance?

rapid kettle
#

the admins know

jagged sky
#

ah i see thanks

#

so they'll fix it hopefully

sullen nymph
#

unplanned maintenance, you could say

daring cove
#
@commands.Cog.listener()
    async def on_dbl_vote(self, data):
        ch = self.bot.get_channel(725860667772502016)
        await ch.send(data)
``` I don't get why this is not sending anything
sullen nymph
#

scroll a bit above

#

Do test votes work?

daring cove
#

# The decorator below will work only on discord.py 1.1.0+ this?

sullen nymph
#

Fuck

#

No, I meant the on_dbl_test event with Test button on your bot's Edit page

#

as for "scroll up", I meant this channel

daring cove
#

obh sorry, lemme check

#

sorry, I don't get what does it mean by "webhook" if it's not the discord one

sullen nymph
#

a webserver

#

A webhook is reverse API. You listen to requests instead of sending them

daring cove
#

so it's just a simple GET request?

jaunty plank
#

Post

daring cove
#

mhh

#

so if I don't have a webserver I can't check upvotes?

#

I could make a loop for all users anche check if they voted

sullen nymph
#

top.gg sends the data in request body, POST request

storm surge
#

i noticed that some bot support servers have a channel when it says that the bot was voted. is that relevant to this site? only cos i know top.gg has a vote system

sullen nymph
#

I assume so, because top.gg supports webhooks

jaunty plank
#

The top.gg api has a ratelimit of 60 requests a minute. Looping through all users in cache will very likly result in a ratelimit

daring cove
#

mhh right

daring cove
#

I tried doing a simple server using flask:

@app.route('/webhook', methods = ["GET", "POST"])
def webhook():

  if request.method == "POST":
    data = {"content": "New post request"}
    print(request.form)
    requests.post(url, data = json.dumps(data), headers={"Content-Type": "application/json"}) # this is a discord webhook

  else:
    return "nothing to see here"
``` but it still not working
sullen nymph
#

why are you sending a request

daring cove
#

it's a discord webhook

#

url is a discord webhook url

#

btw if I do a normal post request it works

green mantle
#

it should work as long as top.gg can POST to that url without getting a error code

jaunty plank
#

Afaik top.gg webhook posts don't work with discord webhooks

daring cove
#

not that

#

@jaunty plank when top.gg makes a post request to my server, my server will send a discord webhook

jaunty plank
#

Ah, forwarding webhooks, fun

rose yarrow
#

yay i finally manged to psot my server count

#

noww votes

#

but i suck at webhook

green mantle
#

top.gg webhooks are already broken af

#

so i wouldnt bother testing them rn

rose yarrow
#

hmm

golden adder
#

Anyone know if the api is back?

median badger
#

No

#

They are broken

craggy anchor
#

got 1 vote through so

#

might be working sometime soon

haughty barn
#

I'm running the dblapi.js on a different repository than the bot. Do I need to install anything other than that dependency, or do I need some server handler like express and set up endpoints for the webhook?

rapid kettle
#

nah just a webhook and a bot client afaik

haughty barn
#

@rapid kettle This is how the webhook looks like right now, it's basically the same as the examples except the database call on line 15. The Discord dependency is not included because it's not used in the api examples. I deployed this to heroku, but the test-button doesn't give me any response in the logs. Is there an obvious mistake I'm doing?

rapid kettle
#

Not afaik

#

Webhooks are recovering from somethin so

#

might take a while

haughty barn
#

Ok, thank you

golden adder
#

Just got voting confirmations for users who voted 6 hours ago 😂

velvet pond
#

Hey, I'm having some trouble with vote webhooks. It's not logging anything when I vote or use the test button, but works just fine when I send it in postman.

app.post('/vote', async (req, res) => {
    res.header('Access-Control-Allow-Origin', '*'); // allow cross-domain requests
    res.header('Access-Control-Allow-Headers', 'X-Requested-With'); // allow cross-domain requests
    const auth = req.get('Authorization'); // get auth header
    console.log(auth); // for debug
    if (!auth || auth !== keys.dblWebhook) return res.status(401).send(); // check auth headre matches
    const {user} = req.body; // user id
    new Vote({
        user,
        time: new Date()
    }).save(); //log in db
    res.status(200).send();
});

any help?

#

again, works just fine when I send it in postman to the same url with the same auth header.

spiral steeple
#

scroll up

velvet pond
#

@spiral steeple to what?

spiral steeple
velvet pond
#

ah, it's offline?

#

can someone pin that message to help future people asking?

#

and is there any eta?

jaunty plank
#

no one reads pins pandasad

#

no eta, wouldnt expect it to take too long

green mantle
#

they're slowly rolling out

#

but stability is still eek

spiral steeple
#

Yeah lmao I didnt even know I had a pin in this channel

jaunty plank
#

saw that earlier

arctic arch
#

<@&412346069675147264> Hey, the DiscordBotList org has been renamed to top-gg. You should update your git configs and any links to the repos 🙂

sullen nymph
#

will do in a bit

green mantle
#

@sullen nymph How you gonna label the import 🤣 topggpy

sullen nymph
#

pip install top.gg gang

green mantle
#

Couldnt of waited till d.py v2

jaunty plank
#

does that mean everyone needs to update their library installs?

green mantle
#

probably not

sullen nymph
#

Functionality doesn't change so

green mantle
#

if tonkku is gonna force them to change it then might aswell redo the lib to make it more oop ey shiv 👀

sullen nymph
#

I haven't changed shit because no one has really complained

green mantle
#

i mean theres no point really

#

not until v2 comes out

#

that would be the time to change it

sullen nymph
jagged sky
#

dont change it

dense lance
#

Hi, I closed dm from all servers because I am busy and after my bot is approved, I do not get notification from Luca bot that my bot has been approved

#

The problem is I don't get the DBL api or the token 🙂

sullen nymph
dense lance
#

thank you

restive otter
#

if its return 0 means the user didn't voted me ?

jaunty plank
#

yeah

restive otter
#

idk why but i voted

#

but the resquest still said i didn't voted

jaunty plank
#

im not sure if the api is completely working yet.

restive otter
#

this is my webhook

jaunty plank
#

the api has been having pretty significant issues all day

restive otter
#

show up i voted for today

#

oh really

bronze ginkgo
#

Hello

jaunty plank
#

hey

bronze ginkgo
#

What time My bot verified

jaunty plank
#

3+ weeks from submission

bronze ginkgo
#

3 week?

restive otter
#

mine is 4+

hasty mortar
#
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}`);
})
``` how often does this update? this example is on the api page for dbl
jaunty plank
#

30 minutes

hasty mortar
#

ah

#

thx

pure prairie
#

npm install top.gg --thebest

whole night
#
activeServers = bot.guilds
print(activeServers)
summ=0
for s in activeServers:
    summ += len(s.members)
print(summ)

whats wrong here? the output is

0
restive otter
#

i did const guild = server

trim stone
#

um do we have to put something in our code to show something in site?

#

because i m new to this

remote slate
#

if you have the top.gg API library (for node.js or python)

#

then it's auto, just check the docs to set it up

#

if not you will have to deal with API requests yourself

#

@whole night your bot is not instantly conneted to the Discord gateway

#

put that in your on_ready function

trim stone
#

uhhh api requests i m not advanced but i'll try once its approved

remote slate
#

use top.gg library for python then

#

it's easier

whole night
#

@whole night your bot is not instantly conneted to the Discord gateway
@remote slate
Yeah it's done

remote slate
#

@whole night that works now?

tame pier
#

How to add my own bot on top.gg? Am i at the right place to ask this?

opaque jetty
sullen nymph
#

Is default webhookPath in dblapi.js planned to be changed to something like /topgg in the future?

remote slate
#

This server name is still Discord Bot List, I guess it will remain /dblwebhook

#

it would break so many bots to change it btw

rapid kettle
#

Yea, its practically the standard for now.

arctic arch
#

no plan rn

sullen nymph
#

got it

arctic arch
#

also im thinking dblapi.js will stay specific to bots with the integrations

#

with a different module for generic top.gg or new modules for specific integrations

sullen nymph
#

I see where you're getting at

vital anvil
#

Hey <@&412346069675147264>, another small change while we are reworking the way we work with GitHub internally. To help smoothen out permissions and billing on our side, you'll be converted to an outside collaborator with the same permissions you have right now on your repositories.

fading river
#

when creating a webhook to dbl what's the password for webhookAuth supposed to be

placid citrus
#

Whatever you set under edit on your bot on topgg

fading river
#

what do you mean

#

actually nvm

#

thanks

#

but what does it mean webhook url?

#

like do i have to create one?

median badger
#

its the server ip:port

#

so by default

#

ip:port/dblwebhook

fading river
#

which server?

#

the one i host my bot on?

placid citrus
#

Yes

fading river
#

ok thanks

restive otter
#

My port keeps changing everytime

#

So

#

Can i just do ip/dblwebhook

#

Or do i still need to put the port

sullen nymph
#

There must always be a port

restive otter
#

frik

#

but

#

when someone visits my bot ip there is no port needed

#

so

#

I use expressjs

spiral steeple
#

Do you have a webserver set up to listen on that port and redirect ports 80/443 to it?

restive otter
#

Umm

#

Maybe

#

This is my site:
over 30 character long URL that looks really weird

#

I run my bot and my smol bot website in the same file

#

Do you have a webserver set up to listen on that port and redirect ports 80/443 to it?
@spiral steeple it works for 80 but not for 443

#

lmfao

#

i accidentally used http instead of https that's why

spiral steeple
#

well if it's not https, it wouldnt

sullen nymph
#

Isn't 80 http and 443 https

spiral steeple
#

doesnt need to use https

restive otter
#

lemme try

#

https

#

Works

#

443 port:
||https://codeco-discord-bot.code913.repl.co:443||

restive otter
#

Lack of pretty CSS on that site hurts

trail sigil
#

-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

restive otter
#

How can i get usersize api

remote slate
#

@restive otter What do you mean?

restive otter
#

i mean

#

i want to share total user count on my website

#

and server count

#

@remote slate

remote slate
restive otter
#

website

remote slate
#

On Top.gg they're librairies that can do that automatically for you

restive otter
#

i know

remote slate
wary ember
#

If I have nginx set up, do I need to proxy pass anything for webhooks?

remote slate
#

Yes, you have to add the Connection, Upgrade headers

#

and probably the http proxy pass version

#

you should search on the internet

narrow scarab
#

Pls use wi

remote slate
#

other computers' files?

#

what?

winter drum
#

i tried using the bot widget and it worked fine until today

winter drum
#

anyone?

spark raven
#

Hello ppl

pine flax
#

heyy does anyone know the code for top.gg bots sever counting

modest plume
willow spindle
#

it is outdated

median badger
rapid kettle
#

@sullen nymph shiv there is ads

sullen nymph
#

ffs I'm restarting my client

rapid kettle
#

the ads

jaunty plank
#

lol

#

@dense basalt

rapid kettle
#

bruh (banhammer)

jaunty plank
#

imagine ads in a channel no one looks at

sullen nymph
#

Keep this channel on topic yo

rotund apex
#

Does the votes ever reset?

trail sigil
#

at the beginning of every month

rapid kettle
#

Yes, once at the start of each month

rotund apex
#

Ok, thanks!

restive otter
#

How i setup a vote webhook?

rapid kettle
#

Do you have an approved bot?

restive otter
#

No, but i want to know it

jaunty plank
rapid kettle
hollow crane
#

-help

tawny elbow
unborn canyon
#

???

teal bay
#

Why does top.gg keep breaking, it keeps saying i only have 2 Serves with my bot, even though thats incorrect

#

but if i stop the stop for 1 min

#

restart it, the website says the correct count

#

And once again

#

it has again gone back to 2

restive otter
#

@teal bay make a setInterval function to update the server count every minute

#

naybe it'll fix it

teal bay
#

how would i add that though?

#
const DBL = require("dblapi.js");
const dbl = new DBL('<removed>', client);

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

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

bruh

teal bay
#

I litterly copy and pasted

restive otter
#

then

#

maybe the copy paste was wrong

#

also do you know how to do setInterval functions

teal bay
#

Yh, but were would i attach it in this case bec i got no clue

restive otter
#
setInterval(function(){
//code
},60000);
teal bay
restive otter
#

The 60000 means it will run every minute

teal bay
#

It claims to manage this automatically

restive otter
#

Put your code inside it

teal bay
#

Ah wait there is a manual post

#

dbl.postStats

#

yh i can use setInterval now thanks

#

Ive done that but now it keeps changing one second its the correct number then its specifically 2 again

#

Its not my browser cache as ive used multiple browsers and cleared my cache

trail sigil
#

might just be server caching?

teal bay
#

Mine?

trail sigil
#

nah the server caches things too

teal bay
#

Thats what i thought

#

but it keeps switching

trail sigil
#

could be that

teal bay
#

it says 2 then correct 2 then correct :/

trail sigil
#

yeah, that's what happens when you have multiple cache servers

teal bay
#

Ah ok

#

yh that would make sense

#

ill give it an hour or so

trail sigil
#

yeah

subtle shard
#

will the topgg's api work when my bot hasn't been verified yet?

signal hawk
#

no, you only get your key once approved

subtle shard
#

no problem. thanks

restive otter
#

@ornate sinew do you need help with anything

ornate sinew
#

what

#

?

restive otter
#

do you need help with the api

signal hawk
#

-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

frozen mica
#

hmmm my bot catch this error Error: 503 Backend fetch failed what is it?

jaunty plank
#

503 means service unavailable

visual thistle
#

The .NET API documentation doesn't appear to cover webhooks in any way. Does anyone have any experience with this, as i'd like to be notified when someone votes for my bot

jaunty plank
#

Youd have to make your own webhook server which handles the requests.

stiff cedar
#

-add

jaunty plank
lofty dagger
#

Hi @restive otter

restive otter
#

Yo

#

What was the error and code that you used

lofty dagger
#

I've been posting to the API every 5 minutes, and it was only this once that the API returned error 522.

restive otter
#

hmmm

#

connection time oit

#

the api is going shenanigans recently

lofty dagger
#

xD

#

Shall I just ignore it?

restive otter
#

Yes

wet wing
#

ahoy i asked here ages ago about my server posting- i took the advice about the cog listener but it still doesnt work oop



    def __init__(self, bot):
        self.bot = bot
        self.token = get my token
        self.dblpy = dbl.DBLClient(self.bot, self.token,
                                   autopost=True)  

        @commands.Cog.listener()
        async def on_guild_post(self):
            print("Server count posted successfully")

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

this is my code 😳
sullen nymph
#

un-nest your on_guild_post event

wet wing
#

aha

#

i will do that

#

hm there doesnt seem to be any changes?

sullen nymph
#

Try waiting 30 minutes

wet wing
#

it’s been 30 minutes and it’s not updating :,(

restive otter
unborn canyon
#

@signal hawk

signal hawk
#

-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

fiery osprey
#

Open music

balmy sphinx
#

support what's api

#

??

restive otter
restive otter
#

-api

main cedar
#

hey guys can anyone tell me what does relationships.read scope do in oauth2 in discord developers portal

arctic arch
main cedar
#

come on they say to go to api and you say go to development

arctic arch
#

the people who told you to come here are wrong
tell them that tonkku said they're wrong and should be ashamed

cinder gate
#

@arctic arch sir how i verify my bot

#

@arctic arch i add my bot on bot list website but after add there i see a notice verify bot now who verify my bot

trail sigil
#

@cinder gate firstly, this is the wrong channel to ask, secondly please don't ping tonkku for something like that and thirdly, check #502193464054644737 and pins in #support, it'll tell you all about getting your bot added and approved on top.gg

runic pond
#

Im trying to add the yugioh bot i found on top.gg but it wont let me invite it to my server what do i do

jaunty plank
#

is there an error?

runic pond
#

It says unavailable on mobile launch from web instead but when i click to launch from my browser it just takes me back to the homepage

#

Its that bot

jaunty plank
#

thats actually an issue with discord not top.gg.
its been going on for a long time.

the fix i was told was to run your phones browser in desktop mode

runic pond
#

How do i put it in desktop mode?

#

Sorry, im dumb

wet wing
#

how can i set up webhooks for getting votes? im a little confused aha

rapid kettle
#

What lang are you using @wet wing

wet wing
#

py!

rapid kettle
#

Ooh, I don't know about py, sorry

wet wing
#

thats fine, thank you anyway!

restive otter
#

dbl.on is not a function

#

help?

#

i have it like: ```client.on("ready", async () => {
console.log("ready");

setInterval(() => {
    dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);

// Start auto posting
let initalPost = await statcord.autopost();

// If there is an error, console.error and exit
if (initalPost) {
    console.error(initalPost);
    process.exit();
}

});

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

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

sullen nymph
#

What's dbl

restive otter
#

should it be: ```client.on("ready", async () => {
console.log("ready");

setInterval(() => {
    dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);

// Start auto posting
let initalPost = await statcord.autopost();

// If there is an error, console.error and exit
if (initalPost) {
    console.error(initalPost);
    process.exit();
}

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

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

#

the

#

thing

#

What did you defined as dbl ?

#

const dbl = new DBL('my token', client); ofc with the token

#

@restive otter

#

I see

#

I still don't get it, lol

#

oh

#

I fixed it now

#

Code: setInterval(() => { dbl.postStats(client.guilds.cache.size); }, 1800000); Error: [dblapi.js autopost] Failed to post stats: {"error":"Required parameter server_count or shards missing"}

#

Help?

#

nvm

#

i do it tmr

fringe whale
#

can somebody help me with showing servers with api (lib is bdfd)

rapid kettle
#

I don't think you can do POST requests with bdfd

fringe whale
#

my friend have it

rapid kettle
#

Then he probably uses other languages?

fringe whale
rapid kettle
#

It's DiscordGo

#

not bdfd?

fringe whale
#

yes but its actually bdfd

#

im in project

#

so how he made it?

rapid kettle
#

I don't know then, try asking him.

fringe whale
#

he didnt responded

#

@signal hawk and you can help me here?

signal hawk
#

I dont know the answer, so i cannot.

fringe whale
#

:/

little harbor
#

bdfd doesn't have a support server?

#

if they do, the answer is probably there

fringe whale
#

uuh

little harbor
#

most people here don't use bdfd though so most of us won't be very helpful

fringe whale
#

okay

#

i learned on bdfd im coding now js 🙂

unborn canyon
#

bdfd

fringe whale
#

im in

#

nop

past flame
#

@fringe whale Its easy, but honestly learn js

fringe whale
#

i do js rn

#

this is older bot

past flame
#

Tell your friend to learn

fringe whale
#

hm he didnt respond

#

offline guy

sharp vigil
#

hey so im trying the topgg api

#

and i get the error No module named 'dbl'

#

even tho i have imported it and have downloaded it with wthat they said

spiral steeple
#

How did you install it?

sharp vigil
#

install from source

spiral steeple
#

So you didn't use pip? (I assume you're using python)

sharp vigil
#

i also did that one yeah

#

am indeed using python yeah sorry

spiral steeple
#

You did it in the right directory?

sharp vigil
#

and then just copy pasted the example with manual server count and webhook

#

i suppose so

#

i did what it said

#

tried it agian and everything was satisfied

spiral steeple
#

Weird, I don't actually use python, but if you tried pip and from source and neither worked you'll have to get someone more experienced in it than I am, sorry.

#

Which translates to you'll have to wait for someone else.

sharp vigil
#

understood

#

hey man thanks for the effort anyway!

#

hey so im trying the topgg api
and i get the error No module named 'dbl'
even tho i have imported it and have downloaded it with wthat they said

sharp vigil
#

python

restive otter
#

Nvm read that wrong

harsh peak
#

.

signal hawk
#

-dotpost @harsh peak

abstract mothBOT
#

@harsh peak

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

worn vault
#

help, i try to get the votes of my bot with the dblapi.js package and the getVotes() function and if i put votes it says [object Object]

#

then i tried to put votes()

#

and it just didn't send

#

nvm im just dumb it's to find people that voted ur bot

sudden palm
#

hey i wanted to know what this topgg api does

rapid kettle
sudden palm
#

thank you

prisma hearth
#

Hello

#

I need a little help

#

Is some there

rapid kettle
#

Yes

prisma hearth
#

Hi matt

rapid kettle
#

hello

restive otter
#

Specify what youre trying to do

rapid kettle
#

yes, please do

prisma hearth
#

I am developing a bot using python but the only problem that I am facing is that when I runs the code for connecting to server it fails

rapid kettle
unborn canyon
#

heck you Matt typing faster than me

prisma hearth
#

Sorry matt

sullen nymph
#

@sharp vigil are you sure you used pip for the same python interpreter that you use to run your bot?

jagged sky
#

how often does the bots info refresh ?

#

like once in an hour?

#

the bots guild info isnt updating on website

#

oh nvm. it updated

median badger
#

if you use the djs module

#

it posts on the ready event

#

then every 30 min

sharp vigil
#

@sullen nymph i think i so Maybe git? Ill try In like an hour when i get back

restive otter
#

@mighty shuttle ahem

mighty shuttle
grim torrent
#

sa

#

TURKİSH🇹🇷

trail sigil
#

-api @grim torrent

abstract mothBOT
#

@grim torrent

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

grim torrent
#

ne yazdın amk

trail sigil
#

-notr @grim torrent

abstract mothBOT
#

@grim torrent

İngilizceden başka dillerde sohbet etmek için #memes-and-media kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.

grim torrent
#

ok

sharp vigil
#

@sullen nymph i did pip install dblpy and in my code it says import dbl ... i changed it to dblpy but still didnt work
I followed the topgg instructions

sullen nymph
#

What's the command you use to run the bot?

sharp vigil
#

i use a bat file to run it

sullen nymph
#

What does the bat file execute?

sharp vigil
#

the command path and then the python file

#

with the code in it

scarlet cobalt
#

One message removed from a suspended account.

sullen nymph
#

Paste it here please

sharp vigil
#

pushd %~dp0
"C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38-32\python.exe" webhooklistener.py
pause

#

oh nvm

#

my friend changed it i see

#

now its this

pushd %~dp0
"C:\Users\Gebruiker\AppData\Local\Programs\Python\Python38-32\python.exe" topgg.py
pause

#

and this is the error

sullen nymph
#

why not just put Python in PATH and simply type python

#

Anyhow, append -m pip install -u dblpy to the path with Python executable

sharp vigil
#

idk why my friend set this part up am trying to make it work agian ;/

#

eum this might sound dumb

#

but how?

#

cuz i tried the cd path and then do it but -m is not recognized as an internal or external command,
operable program or batch file

#

then tried to the path with the topgg file

#

and without anythin

sullen nymph
#

Add Python to path, python -m pip

sharp vigil
#

ooooh

#

okay

sullen nymph
#

-U

#

sorry

sharp vigil
#

oh

#

okii

#

why capital U if i may ask?

sullen nymph
#

Shortly for --update

sharp vigil
#

o alright understandable

sullen nymph
#

Try running your bot with python webhooklistener.py

sharp vigil
#

that worked

#

only idk what flask is O-o

sullen nymph
#

Question

tulip hatch
#

it’s a web deployment lib

sullen nymph
#

why do you have Flask as a requirement in your project lol

sharp vigil
#

i have no idea XD my friend made the bot about a year ago and im reviving it / learning with it

sullen nymph
#

If it's not used anywhere in your code, why not remove it?

sharp vigil
#

ill send the code

#
import asyncio
import random
import os, re, aiohttp
from cogs.rpgutils.db import db
from cogs.rpgutils.defaults import serverdata, userdata
from discord.ext import commands
from random import choice as randchoice
from cogs.utils.dataIO import fileIO
import time
import dbl
import sys
from flask import Flask, request, abort
import flask
import json

app = Flask(__name__)

@app.route('/', methods=['POST','GET'])
def webhook():
    if request.method == 'GET':
        print("Solyx GET request?!")
        return '<h1>This is for top.gg only, what are you doing here?!</h1>'

    elif request.method == 'POST':
        data = request.json
        print("SOLYX VOTE: {}".format(request.json["user"]))

        userinfo = db.users.find_one({"_id": data['user']})
        # Account check
        if userinfo["class"] == "None" and userinfo["race"] == "None":
            return
        if request.json["isWeekend"] == "True":
            userinfo["voted"] = "weekend"
        else:
            userinfo["voted"] = "True"
        db.users.replace_one({"_id": data['user']}, userinfo, upsert=True)

        return '', 200

    else:
        abort(400)

if __name__ == "__main__":
    app.run(host='my ip', port=my port, threaded=True, debug=True) # will listen on port

sullen nymph
#

Half the shit there isn't even used

#

It's a Flask webhook ran separately, huh

sharp vigil
#

i suppose so

#

im legit trying everythin atm

sullen nymph
#

Well, there's no need for dblpy in that file

sharp vigil
#

the plan is that if a user uses the command -vote they get the link and then they vote and try the command again -vote and the get rewards

#

and in this code ( vote cog) i saw the webhooklistenere thing and i went to try that out maybe that works

#

becuase rn i only get the link and not not the actual voted stuff

#

the code itself worked fine btw just the voting not

sullen nymph
#

... yeah, you can scrap that file

Optimally, I would create a DBLClient with dblpy's built-in webhook in my main file and then attach it to my d.py bot object. While you will be at it, set on_dbL_vote and on_dbl_test events.

Voting doesn't work because apparently you don't connect the database used in the Flask script properly to your bot

sharp vigil
#

scrapt the webhooklistener? or the vote file?

sullen nymph
#

The webhooklistener

sharp vigil
#

aight done

sullen nymph
#

Since it's ran separately without any direct connection to your bot

#

Now, onto slapping dblpy into your bot's main file :p

sharp vigil
#

it has to be main file?

#

in the topgg file

sullen nymph
#

Not really, you could use a cog for it (which is what dblpy examples happen to be)

#

Also on_dbl_test to easily test the votes with the Test button

sharp vigil
#

whats that?

sullen nymph
#

An event used by dblpy

sharp vigil
#

ooh i finnaly found something about dblpy

restive otter
#

I have loaded the dblapi.js module, but the console gives MODULE_NOT_FOUND error.

rapid kettle
#

what is the full error?

restive otter
rapid kettle
#

that is heroku yes?

restive otter
#

yes

rapid kettle
#

ok

#

is it in the package.json file?

restive otter
#

yes

rapid kettle
#

has the package been installed?

restive otter
#

yes

rapid kettle
#

How do you know

restive otter
restive otter
#

hey do you know why it doesn't work ?

    const DBL = require('dblapi.js');
    const express = require('express');
    const http = require('http');
    const app = express();
    const server = http.createServer(app);

    const stats = new DBL("token de api", bot);

setInterval(() => {
    stats.postStats(bot.guilds.size);
}, 1800000);

const dbl = new DBL("token api", { webhookAuth: 'password', webhookServer: server });

dbl.webhook.on("vote", vote => {
    console.log(`User with ID ${vote.user} just voted!`);
  })

when someone vote nothing appear in the console

rapid kettle
#

I should in theory work

#

Why not try using the built in DBL webhook?

#

here is my init line

#

const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'auth' }, client);

restive otter
#

Oh okay i will try

rapid kettle
#

ah

#

try a new port

restive otter
#

You don't understand, the bot run the same port twice, so its working for shard 1 but not shard 2

#

😅

#

it's why the error is
Error: listen EADDRINUSE: address already in use :::5000

rapid kettle
#

Ahhh

#

No idea sorry.

restive otter
#

oh okay, no problems

jaunty plank
#

code?

kindred walrus
#

My time to ask for a bit of help

#

gg definetly fowarded to that ip

#

and i can ping it outside too(checking if ports are indeed properly opened). @ me for answer pls

icy hazel
#

OH no

#

man

sudden salmon
#

? Bot

jaunty plank
#

30 minutes is normal.

rigid laurel
#

Which bot is best or welcome

#

Anyone tell me plz

median badger
#

wrong channell

#

and just go search for one

olive cave
#

is it normal that it takes about 2 minutes for dbl to recognize that the user has voted?

jaunty plank
#

Yeah, top.gg has slow webhook times sometimes.

#

It seems instant right now for me tho

#

Just did a test vote

willow spindle
#

works fine for me

spark flower
#

Because that doesn't seems to works, maybe this is another url ?

#

(404, not found)

dapper copper
spark flower
#

oohh, /api x)

#

Ty dude ^^

restive otter
#

How can I log in to my bot?

spark flower
#
import requests 
import json


s = requests.Session()
r=s.get('https://top.gg/api/bots/your_bot_id/votes', headers={'Authorization': "your token"})
data=r.text

#

(in python)

#

You can get your api token here @restive otter

jaunty plank
#

he doesnt have an api token

#

only approved bots have tokens

serene shuttle
#

how do I trigger the on_dbl_test? want to test how it works ofc

rapid kettle
#

The test button

#

under edit on your bot page

serene shuttle
#

Im actually blind, tysm

spark flower
#

Oh okay, sorry @jaunty plank

serene shuttle
#

getting no result from it, is something wrong with my code here?

    """Handles interactions with the top.gg API"""

    def __init__(self, bot):        
        self.bot = bot
        self.token = 'tok' # my token is here
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', 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')

setup(bot)
bot.add_cog(TopGG(bot))```

this is my code except token stripped.
#

no errors or anything, just nothing printed so guessing the listeners arent being triggered

kindred walrus
#

having a similar deal

#

waiting for that too

#

ports opened, webserver definetly listening on that path, yet no incoming traffic

serene shuttle
#

wait do I need to edit stuff in the API options like the url and authorization? It just says come here if you're stuck

median badger
#

Yes

#

If you're receiving votes

#

Your will want to set an authorisation

serene shuttle
#

right, and do I have to edit any of the values in the Cog for it to trigger the event?

#

like webhook_path='/dblwebhook', webhook_auth='password',, these two, do they need to be edited?

sullen nymph
#

webhook_auth - yes, if you entered anything in the Authorization field on top.gg

#

webhook_path is just the stuff after the URL (ip.address.here.aaa:port<webhooK_path>)

serene shuttle
#

ah yeah got the webhook auth, uh how do I find that url?

#

sorry never used webhooks before

rapid kettle
#

@serene shuttle Where are you hosting?

serene shuttle
#

hosting the bot? Im running it on a vps

rapid kettle
#

Ah, nice

serene shuttle
#

oh ic so I have the ip.address.here.aa bit and ik the port

#

but webhook path?

rapid kettle
#

So, to run the webhook it's generally http://your.vps.ip.here:port/dblwebhook

#

wait what is the new DBL line?

serene shuttle
#

oh ic, so I just use /dblwebhook?

rapid kettle
#

do you have a path set in code?

#

if not thats the default afaik

serene shuttle
#

webhook_path='/dblwebhook'

rapid kettle
#

yea

#

should work

serene shuttle
#

oh not default I did overwrite

#

alright let me test again ty for help

sullen nymph
#

if not thats the default afaik
@rapid kettle correct, /dblwebhook is the default value for webhook_path

serene shuttle
#

Im still just getting no output

#

I dont need to edit the webhook url in api options do I?

sullen nymph
#

What do you have it set to?

serene shuttle
#

its empty

sullen nymph
#

So, to run the webhook it's generally http://your.vps.ip.here:port/dblwebhook
the thing in codeblock is the URL "example" you would use

serene shuttle
#

my bad ty, I think my brain is melting I dont know why Im struggling to grasp basic things here lmao

sullen nymph
#

Realizing it is one step closer to improving 🙂

kindred walrus
#

still couldnt figure out even after tinkering with it a bit more

sullen nymph
#

Tried sending manual requests?

kindred walrus
#

with the test function or manually connecting?

sullen nymph
#

Manual

kindred walrus
#

had a test server making sure it was working

sullen nymph
#

Try to set up a webserver listening to POST requests

kindred walrus
#

lets see

#

@sullen nymph definetly listening to posts

sullen nymph
#

Try sending a remote request with reqbin

serene shuttle
#

still cant get it to work

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

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

and then the url in API options is set to https://my.ip.is.here:5000/dblwebhook