#topgg-api

1 messages · Page 68 of 1

rotund dune
#

@runic compass Idk rly how to make this to work so on vote i get message in channel

runic compass
#

You would do something like

#
dbl.webhook.on('vote', vote => {
webhookname.send(`User with ID ${vote.user} just voted!`);
});
#

Sorry took me so long to type it.

rotund dune
#

but you dont get what i mean i want to use this

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

and i want this to work but webhook is not define

runic compass
#

That is what the const is for

#

if you say webhook rn, it has no idea what webhook to send to.

#

webhook is not even recognized.

rotund dune
runic compass
#

Welp; I dunno then

rotund dune
#

oh

restive otter
#

const webhookname = new Discord.WebhookClient('webhookID', 'webhookToken'); dbl.webhook.on('vote', vote => { webhookname.send(`User with ID ${vote.user} just voted!`); }); if I put thin in my main bot file so if someone vote the bot then it will send messages in the server

restive otter
#

!bal

drifting wren
old grotto
#

Hello

queen crystal
runic grove
#

post your stats - read docs

restive otter
runic grove
#

doesnt have anything to do with this channel, read the topic

rotund dune
#

can someone tell me how to get this code to work

dbl.webhook.on('vote', vote => {
  clinet.channels.get(`623592233861513256`).send(`<@${vote.user}> ${vote.user} just voted on ModBot!`);
});
eternal crypt
#

@rotund dune you spelt client wrong

rotund dune
#

oh

restive otter
restive otter
#

where i get the webhookID and webhookTOKEN

sullen nymph
#

@rose elk Closer attention to webhook_x args in DBLClient

#

Only webhook_port is required for the webhook to run but customized auth is strongly encouraged

#

You got it right

winter spade
#

The npm module is posting server count of the current and not total server count like it used to

spiral steeple
#

server count of the current?

#

current what

restive otter
#

how do I know my bot's top.gg token?

spiral steeple
restive otter
#

uhmmm, does it have to already be approved?

sullen nymph
#

Yes

spiral steeple
#

I believe so but I actually dont know

#

Oh I guess so

smoky stream
#

Is the vote webhook link good: http://<ip>:<port>/dblwebhook ?

#

Because I can not run the webhook for votes.

runic grove
#

wrong channel

heady cradle
#

it is the right one lol

sullen nymph
#

The message was deleted

heady cradle
#

what

sullen nymph
#

The original message isn't there anymore

heady cradle
#

what are you on about

sullen nymph
#

I'm replying to your initial message stating that "this is the right channel"

winter spade
#

The npm module is posting server count of the current shard and not total server count like it used to*

kind harness
#

Hi. I want to make Webhook in my discord server but how i can get Authorization code? (sorry for my english but I'm from Poland 😛 )

sullen nymph
#

You set it yourself

neat sierra
#

is it possible to use ROBLOX web api in bots

worn quail
#

yes

neat sierra
#

oh cool

worn quail
neat sierra
#

follow in

worn quail
neat sierra
#

ik

worn quail
#

Then why tf did you ask

kind harness
#

How to make vote webhook with IFTTT?

runic grove
#

i dont think there is support for ifttt/dbl

kind harness
#

Ok

barren wren
#

Can you write an API call to dynamically update your server's "Photo" to include the active number of voice users

narrow zenith
#

#development for that stuff, api for dbl is in this channel @vivid dagger

vivid dagger
#

ah woops

narrow zenith
#

i do that sometimes too

late crater
#

How would one obtain the total number of upvotes for a bot?

#

Using python

native kestrel
#

Read the docs

topaz wyvern
#

wait

#

nvm

#

actually yeah

#

that works for bots under 1000 upvotes

late crater
#

Thanks, I guess I’d just use len() but that might become a problem in the future if my bot becomes popular

kind harness
#

I want to make discord notifications when someone voted for a bot, but I don't know how to do it :/

#

(Is there any tutorial for this? RageJoy )

heady cradle
#

the docs i guess

dusty roost
#

speaking of votes:
i sent an email, but haven't gotten a response in 4 days.
i wanted to add voting rewards to my bot, so i figured i'd start with the example on the api page. i copied and pasted exactly what it said on the website (save the example token slot) but it still won't work
(d.js btw)

runic grove
#

showing your code would be helpful

steep sluice
uneven hawk
#

Im having trouble trying to install the dblapi.js npm module, could someone help?

#

when i try to do npm install dblapi.js it deletes a ton of other modules

steep sluice
#

Wdym

uneven hawk
#

nvm, i think i got it working

merry spear
topaz wyvern
#

@uneven hawk you were probably using a different PM

#

ie yarn

#

I've had that issue before as well

kind harness
#

How to connect discord webhook with bot on top.gg?
I want information about when someone votes for a bot

sharp wigeon
blissful notch
#

Is the retry-after header (for rate limiting) done in seconds or milliseconds?

topaz wyvern
#

Milliseconds I would guess because that's pretty standard

#

cc @arctic arch

sullen nymph
#

Docs say type integer is returned

#

Sounds like seconds are returned

sharp wigeon
#

Nah

#

Integer is milliseconds too

blissful notch
#

Yes, but it's not specific enough. akarirage

sullen nymph
#

DBL expecting devs to be competent

sharp wigeon
#

An dusually everything internet runs on milliseconds

sullen nymph
#

One way to figure out :p

blissful notch
#

Not that way notlike

dense basalt
#

It is in milliseconds

sullen nymph
#

dblpy handles seconds and works with seconds without any converting

#

nvm

dense basalt
#

What library are we talking about then

#

js, java, py, c# or Go

sullen nymph
#

What the DBL API returns in retry-after field on 429

dense basalt
#

Right

blissful notch
#

I'm just sending the raw request with no library atm

sullen nymph
#

You could just get the field and wait exactly that amount of time

blissful notch
#

Yes, I'm allowing requests until this.isRatelimited is true. Then using setTimeout to eventually set it as false. If it ends up being milliseconds and I don't convert it, it'll be sending a useless request.

#

It's not even super important I catch it as I'll probably never hit it, but it's to just be safe

sullen nymph
#

Looks like it's float containing minutes and seconds

restive otter
#
const DBL = require("dblapi.js");
const dbl = new DBL(process.env.DBL_KEY, {
    webhookPort: 5000,webhookAuth: process.env.DBL_WEBHOOK_AUTH}, bot);
dbl.on('posted', () => {
  //bot.channels.get(botlogchannel).send('Server count posted!');
})
 
dbl.on('error', e => {
 bot.channels.get(boterrorchannel).send(`Oops! dbl error: ${e}`);
})

dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });
  dbl.webhook.on('vote', vote => {
    if (vote.type == "test") {
      console.log("Test successful!")
    } else {
      if (vote.type == "upvote") {
        bot.channels.get(botdblvotechannel).send(`${vote.user} just upvoted <@${vote.bot}>!`)
      }
    }
  });```

I want to put this in my utils folder
#

but then, I am not sure how to connect anything here....

#

I am using a localhost:27017 ( mongoose )

blissful notch
#

floating minutes and seconds, example? KarenWhat

restive otter
#

huh

#

I am completely new to this

#

my goal is to make a vote command and a command that lists up the votes

#

but I am not sure how to start off. D;

sullen nymph
#

@blissful notch 30.5
30 and a half seconds

#

etc

blissful notch
#

ah, thanks for the help

restive otter
#

I am completely new to this
my goal is to make a vote command and a command that lists up the votes
but I am not sure how to start off. D;

#

what do I require

#

start off

#

;-;

#

should I use the first example webhook ( small one ) or the newer one ( node ) ? in pins?

sullen nymph
#

The first one

#

The latest pinned message is for times when you want to manually handle the webhook setup

dusty roost
#
const DBL = require('dblapi.js');
const dbl = new DBL('my token here', { webhookPort: 5000, webhookAuth: 'password' });

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

it's literally what it said on the docs
yes i have the api installed
there are no error messages
(ping me if you respond please)

restive otter
#

@dusty roost host this in a vps or open the port 5000 in your box

#

😊

#

And modify your bot page

Url webhook: your_ip:5000

#

And je other case = password

dusty roost
#

thanks! how do i do that? (sorry for asking so many questions)

restive otter
#

Wait

#

You want To open à port in your box?

dusty roost
#

it seems like an easy enough solution, so yes

restive otter
#

Okay wait

#

Hum...

#

What's your operator?

dusty roost
#

what do you mean?

restive otter
#

Mmmh

#

Opens your box settings

dusty roost
#

my what

restive otter
#

Wait

cold ledge
#

You wouldn't need to open up a port it should work

restive otter
#

In linux yeah

cold ledge
#

Wait it's not hosted on Linux?

#

Wait that shouldn't matter anyway

dusty roost
#

oh a mod how lucky

cold ledge
#

"lucky"

restive otter
#

Lol

#

Modos talk almost every day x)

cold ledge
#

Anyway Danny do you get any sort of output when you receive a vote?

restive otter
#

Hum

#

This is his problem

#

👀

cold ledge
#

Oh oops

#

Looked at the wrong name

#

Anyway do you get any sort of output when you receive a vote? @dusty roost

restive otter
dusty roost
#

uh no i don't

#

@restive otter send me some files

restive otter
#

Bruh

#

Go dm

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

I think you forgot this @dusty roost

dusty roost
#

o

restive otter
#

@cold ledge no

#

It doesn't change anything....

cold ledge
#

I mean it's a means of seeing if the thing is actually listening to any requests on port 5000

#

If that doesn't do anything then the webhook isn't working

#

Also what are you using to host the bot @dusty roost

dusty roost
#

glitch

restive otter
#

Wait

dusty roost
#

i feel like that's a common enough answer

cold ledge
#

I think the fact that when you send a request to glitch it needs to "wake" the application

#

The vote might just be timing out before it can even wake the application

restive otter
dusty roost
#

the app is 24/7

restive otter
#

Yes with uptime robot

dusty roost
#

^

cold ledge
#

And again glitch is a bit weird with things at times

restive otter
cold ledge
#

If he's legit copying the code it should work

restive otter
#

Yes

cold ledge
#

If it's not working it's either he messed up the code or glitch just doesn't work with webhook votes

restive otter
#

Lol glitch work with this

#

I did it another time before I deleted my bot

cold ledge
#

Then it's his code

restive otter
#

Yes

cold ledge
#

Either way I can't help much more

dusty roost
#

where do i get the webhookurl from @restive otter ?

restive otter
#

Go to settings of the vote channel

#

And create a webhook

#

Copy the url

#

@dusty roost

#

Well, I'm switching to my phone.

dusty roost
#

ok

#

i'm still adding the stuff from the glitch you sent me to my bot

restive otter
#

Okay

#

Good luck buddy

dusty roost
#

no response from the test

restive otter
#

🤦‍♂️

#

I leave you in the hands of the other developers....

#

Good night..

dusty roost
#

damn

#

thanks for your time

restive otter
#

Np

cursive spruce
#

What is authorization on webhook?

sullen nymph
#

A text that will be sent in request headers for you to verify that the request comes from DBL

cursive spruce
#

Example?

sullen nymph
#

You set it to anything

#

You could set it to I love cookies LOL and then see if Authorization field value is exactly that

cursive spruce
#

How do I set it up?

#

The URL one

#

I can't get the one on the docs

dusty roost
kind harness
#

What is the link to "Post Bot's Stats"?

runic grove
#

or just read the docs

#

its a simple POST request

kind harness
#

Like that?

hollow talon
#

How to api request the votes?

#

And if a player has voted for today

#

So i can do votes with rewards

kind harness
hollow talon
#

Ty

latent ocean
#

I just voted for my bot to test the api but it still shows it as False?

dblVote = await dblclient.get_user_vote(author.id)
    print(dblVote) # False
covert meadow
#

possibility that it may just be delayed in updating the fact that you voted, or maybe that's probs why its best to use the api that @kind harness mentioned as i believe its more accurate (unless there is a limit to using it then maybe not a good idea)

latent ocean
#

quick question

#

about szo's method

#

it returns 1 if he voted and 0 if not?

covert meadow
#

correct

#

and it resets every 12 hours when the person can vote again i would guess

latent ocean
#

how would I manage the response from https://top.gg/api/bots/464601463440801792/check?userId=

covert meadow
#

its a json response so just parse that

#

or seeings there is no other numbers in there just have it check if the response contains a 0 or 1

latent ocean
#

dblVote = await requests.get(dblVoteEndpoint + author.id)["voted"] TypeError: 'Response' object is not subscriptable

covert meadow
#

ur coding in python yh

latent ocean
#

yh? and yes

covert meadow
#

dont think you would have to use await to execute a get request right?

#

also after sending the get request you can just do:

if '0' in dblVote:
// user hasnt voted

latent ocean
#

very right

#

thanks

covert meadow
#

welcome

latent ocean
#

actually

sullen nymph
#

What kinda difference does using another library make

latent ocean
#

I'm getting a 401 error

covert meadow
#

rip

latent ocean
#
response = requests.get(dblVoteEndpoint + author.id) # https://top.gg/api/bots/464601463440801792/check?userId=115269304705875969```
sullen nymph
latent ocean
#

yeah

sullen nymph
#

Have you ever heard about blocking

latent ocean
#

Well, I've heard about it

sullen nymph
#

What made you think switching to another library would fix something that is an issue on the API's side

latent ocean
#

uh?

#

oh

#

from dblpy to that

#

oh uh idk

sullen nymph
#

10/10

#

It's best to use webhooks to work with upvotes in real-time instead of sending requests all the time and most likely getting ratelimited

latent ocean
#

whats my problem tho? @sullen nymph

sullen nymph
latent ocean
#

how fast is it?

covert meadow
sullen nymph
#

Yes

#

There's no set time when the vote will be processed

#

It can take up to 5 or more minutes from what I've heard

latent ocean
#

Tbh I never made a webhook myself

#

Like, I used discord ones, but eh

sullen nymph
#

dblpy provides one

latent ocean
#

huuh

sullen nymph
#

All you have to do is specify webhook_port and preferably webhook_auth in DBLClient kwargs

#

rtfd for more information™️

latent ocean
covert meadow
#

is it possible to explain how i work this whole webhook thing and how i could use it for this

#

if not its ok

sullen nymph
#

Have a webserver run somewhere, get its public IP, make sure you use an open port, put it all in an URL like http://ip:port/. You probably also want to use a separate endpoint for DBL (something like /dblwebhook)

#

@latent ocean aye fam, should be good

latent ocean
#

hmmmmmm

covert meadow
#

oh btw do you know how long it usually takes to update the amount of servers my bot is in after executing this

latent ocean
#

I believe close to instant, lemme see

sullen nymph
#

Yep

covert meadow
latent ocean
#

yup

sullen nymph
covert meadow
#

oh well

latent ocean
#

shouldnt it goes {shard_count: 1, server_count: 1} in the updateStats?

#

for the webhook url, can I send it directly to a /folder/file.php?
@sullen nymph

sullen nymph
#

Ehh

#

If your webhook will be ok with that and will process everything properly... sure?

latent ocean
#

i MEAN

#

caps

#

Isnt it just the same way... $_POST["whatever"]

sullen nymph
#

You'll need to have DBL send the request to an endpoint
On a request to that endpoint, if you have Authorization field set, headers.get('Authorization') and make sure it's DBL, then proceed to do whatever you want with the data

latent ocean
#

is there anything else in the header?

tame kindle
#

no just the token you set

thorn storm
#

A bot (fdci-bot#1462) just dm'd me a server invite. Can a mod kick it please?

sharp wigeon
#

ss pls

thorn storm
#

Already been deleted

sullen nymph
#

But why this channel out of all

thorn storm
#

Don't know the correct place to put it

sullen nymph
#

at least read the channels' topics next time, thanks

rancid tusk
#

How can i check if a user voted for the bot or not using node js

willow spindle
restive otter
runic grove
#

using node js

restive otter
#

Yes but je can use the requests for this

#

He *

runic grove
#

you copied the description of another bot

#

also wrong channel

chilly plover
#

i no have description pls helpp

willow spindle
#

wrong channel

chilly plover
#

what pls dm me

latent ocean
#

How would I get the data from the webhook in php?

hollow talon
#

anyone to help me with aihttp

#

await aioclient.get(url, headers=headers)

#

Is that the one?

restive otter
#

I have javascript client.on('ready', () => { setInterval(function() { dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total); }, 1800000); }); and I get the error [dblapi.js autopost] Failed to post stats: undefined. What am I doing wrong here?

#

client.shards.totalShards

restive otter
#

message.channel.send('hello everyone! jeah');

dense basalt
#

-api @restive otter

abstract mothBOT
#

@restive otter

THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs

latent ocean
#

How would I get the data passed in the webhook in php?

desert tinsel
#

Hi

#

Can anyone

#

Help

#

Me

#

To konw haw to fix bot

vital stirrup
#

how bot broke

dense basalt
#

-api @vital stirrup @desert tinsel

abstract mothBOT
#

@vital stirrup @desert tinsel

THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs

dense basalt
#

Anything related to development but not the top.gg API, move to #development and ask your questions there

amber prism
#

<@&264889767072628742> <@&304313580025544704> MY server wont show up under ym profile after i have added the discord server list bot

dense basalt
#

-atmods

abstract mothBOT
#

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.
amber dune
#

-atmods @amber prism

abstract mothBOT
#

@amber prism

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.
amber prism
#

my bad

left egret
#

sigh

dense basalt
#

Also going for both roles

amber prism
#

sorry guys

amber dune
#

@near sparrow @boreal bridge since you both resigned

#

oh twist hasnt left yet

craggy sentinel
#

-atmods @amber prism

abstract mothBOT
#

@amber prism

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.
amber dune
#

@near sparrow for good measure

left egret
#

lmao

near sparrow
#

wait twist resigned?

craggy sentinel
#

anyways i'm gonna go to bed

near sparrow
#

and haha 😛

left egret
#

same

dense basalt
#

nOt the ChaNnEl gUys

craggy sentinel
near sparrow
#

Honestly as a punishment tag me for every @ mod 🤣

left egret
#

@amber prism Your bot will be only displayed once it's approved.

amber prism
#

ok

left egret
#

in case "but how long is approval?"

#

-checkmybot

abstract mothBOT
#

Bots added to the site are ordered by a queue based on the time they submitted their bot. Website Moderators check bots according to the queue and cannot check your bot just because you requested it. In addition, queue length is confidential and we cannot tell you your position in queue, either.

As the FAQ: How long is Approval? states, your bot may take up to a week or more until it is checked. There is no set time how long bot approval will take; there is a queue and you're not the first nor are you the last.

Please be patient.

craggy sentinel
#

@left egret discord server list

left egret
#

oh its a server

#

i need sleep

#

gn

restive otter
#

How i made a clear command 😅

steep sluice
willow spindle
#

what do you mean @restive otter

restive otter
#

I want to code an clear command

steep sluice
#

to clear what haHAA

restive otter
#

Messages

#

z!clear 99

steep sluice
#

ah

restive otter
steep sluice
#

what language do you use

restive otter
#

node.js

#

Wait this is the wrong channel

tame kindle
#

yes

silk bluff
#

-checkmybot

#

-help

raw fulcrum
#

-checkmybot

tame kindle
restive otter
#

Only mods can use these commands

restive otter
#

-bot

dreamy ridge
#

-checkmybot

restive otter
#

Only mods can use these commands xz

#

X2*

neat sierra
#

hey

#

people

#

dbl.webheek.on is causing error

#

the .on cause error

#

`dbl.webhook.on('vote', vote => {
^

TypeError: Cannot read property 'on' of undefined`

hearty lintel
#

Make sure to supply valid webhook options so that it’ll generate the webhook property

olive cypress
#

hi i can't use the invitation link of my bot, can you help me

hearty lintel
#

I don’t believe this is API related. Correct me if I’m wrong.
If you’re talking about like adding a new bot ask in #general

abstract mothBOT
tame kindle
sullen nymph
#

Will any of you read this channel's topic

amber dune
#

no

#

its gotten to the point where I don't even care what channels people use as long as they arent breaking any rules

heady cradle
#

tell em to bring me my money

hollow talon
#

Why when i use my bot it the clien.run() returs future.resume() and an error

#

Dm me for help

#

as THIS server notifs are broken

raven pebble
#

-bots

abstract mothBOT
sullen nymph
#

I swear to fucking God

amber dune
#

@sullen nymph no one asks questions about our api anyway

#

just delete the channel

sullen nymph
amber dune
#

please

hollow talon
#

i do

#

How to resquest votes in python using aiohttp

#

Cause the docs doesnt speak about that

#

Now i understand why noone ask questions about API

hearty lintel
#

You can make just an http request to the api

hollow talon
#

And

#

It returns

#

Exceptions

#

yay

hearty lintel
#

Explain more than just “exceptions”

hollow talon
#

When i do

#

ClienSession.request(url,header)

#

it raises

hearty lintel
#

What’re you putting as the url

hollow talon
#

The request

hearty lintel
#

That’s not-

hollow talon
#

that says return {votes:0} or {votes:1}

#

In the website

hearty lintel
#

What is the actual url

hollow talon
#

Ehh

#

/api

#

/[botid]/check?[userid]

#

I forgot url but i made it correct

#

cause if i didnt it will raise uncorrect url

#

or error 404

hearty lintel
#

Uh

#

Ok well look at the docs

#

Under the Resources section is where you’ll find things regarding http requests

hollow talon
#

.

hearty lintel
#

Ah yes .

hollow talon
#

Docs has only return types

hearty lintel
#

what did I just say

#

Go to the resources section of the docs

hollow talon
#

ok well

#

thanks!

hearty lintel
hollow talon
#

🙂

hearty lintel
hollow talon
#

Thank you so much lol!

#

Sorry for waisting ur time bro!

hearty lintel
#

👍

hollow talon
sullen nymph
#

I really hope you meant an actual instance of ClientSession

hollow talon
#

ye

radiant oxide
restive otter
#

how to i use the API? I keep on getting a 401 error

#

nvm im just dumb lol

gaunt steeple
#

hit it?

snow surge
#

I have one question about API: When I check bot vote page, there is 12h cooldown, but in:

Individual User Id Voting Check for the past 24 hours.
Is this 24h? How to get information about last 12h?

amber dune
#

@snow surge its 12 hours but the docs haven't updated

#

sorry

#

¯_(ツ)_/¯

snow surge
#

ok, thanks

spiral steeple
#

It's been like that for a year btw

#

> knows issue
> doesn't fix
> now the mods need to answer redundant questions

restive otter
#

{ webhookPort: 5000, webhookAuth: 'password' }); what does this mean by password,? What password?

#

You have To choose a strong password

#

Yea i already did it all

#

And edit your bot page

#

On Authorization i put the same password, right?

#

Bruh

#

Idk

#

Yup

noble lagoon
#

Hey can any body tell me how to start a Html

limpid heath
#

Someone know a NSFW API who works good ? (Tag me if you know)

restive otter
#

@limpid heath DiscordBotList(top.gg) doesn't support this, sorry i can't help you

#

And this channel le only for top.gg api

willow spindle
restive otter
#

can anybody tell me how to set my server count, please define in detail

sullen nymph
#

Which library

restive otter
#

Other

sullen nymph
#

Your actual library that you use for your bot

restive otter
#

DBM

sullen nymph
restive otter
#

I'm pretty sure, yes

#

99% of bots made on DBM are advertised on top.gg

amber dune
#

@restive otter we do not support dbm

#

and where the hell did you get that statistic

restive otter
#

because I'm friends with tons of bot creators who have their bots on top.gg / made on dbm

amber dune
#

erm, ok

#

but yea we dont support it

#

¯_(ツ)_/¯

restive otter
#

dang

#

do you support discord.js

amber dune
#

yes

#

you can figure out how to integrate our library with dbm

#

but we cant help you here

restive otter
#

okay

#

ty

nocturne fjord
#

Hey i dont understand this whit the webhook to vote. Where i become the url. Its not the Channel webhook

restive otter
#
const dbl = new DBL('bla bla bla', client);```
#

How Can I get api token?

restive otter
#

@restive otter your bot is in verification, you can't get this for now

tame kindle
#

@oak shuttle wrong channel.
also you need to have an approved bot

fiery nimbus
#

4

pearl coral
#

Hey guys

#

I;m using python and I keep getting error "Module 'dbl' has no attribute 'Client'

#

any ideas?

sullen nymph
#

dbl.DBLClient

pearl coral
#

Thanks so much! @sullen nymph

fiery tree
#

why isn't it like that on the official website?

tame kindle
#

documentation for the libs haven't been updated in a year or so sipEyes

sullen nymph
fiery tree
#

is the server count accurate?

sullen nymph
#

Usually DBL libraries depend on <Client>.guilds so unless your caching system is drunk, it should be ok

fiery tree
#

oh, then how do i undrunk my caching system, idk if i have one

tame kindle
#

u can't

fiery tree
#

its says 43 servers, but i doubt its that many

tame kindle
#

it depends on the library

fiery tree
tame kindle
#

yea

sullen nymph
#

Have you played with client.guilds

fiery tree
#

i havent really touched client.guilds

#

i just copy pasted the provided cog with minor changes to it

#

the bot in question does not do many poweruser commands to have me include client.guilds

sullen nymph
fiery tree
#

so this will update on its own if its put in activity or in every bot launch is set as a list and thats it

#

will i have to make a loop for this ? or is it on its own?

sullen nymph
#

Your client.guilds should be okay, so just use the example code

fiery tree
#

yeah but if i want to pass it to activity, should i make a second loop?

quick trellis
#
    var dbl = new DBL("my token",{ webhookPort: 5000, webhookAuth: "my password" });
    
    /* DBL */
    dbl.webhook.on('ready', hook => {
      console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
    });
    dbl.webhook.on('vote', vote => {
      console.log(`User with ID ${vote.user} just voted!`);
    });

it logs (http://0.0.0.0:5000/dblwebhook) but when i try to test it it wont give me anything

#

how do i make this work?

heady cradle
#

i honestly dont know

quick trellis
quick trellis
#

oh well rip me waffleSad

gilded dawn
#

lul

#

just make a express endpoint

#

*post request

quick trellis
#

hmmm

gilded dawn
#

Simple af

quick trellis
#

idk how i would do that

#

XD

gilded dawn
#

Learn express

#

And nodejs

runic grove
#

as if thats the only way

gilded dawn
#

A suggestion 😉 I mean if you like you could use any language whatever suits or even librarys like kola I think feathers

#

And some others

runic grove
#

my only guess is that the auths dont match

quick trellis
#

i guess i have to :/

runic grove
#

are you trying to test this locally? if so, you need to have a port forwarded iirc

quick trellis
#

does having symoles like ? + or = effect it

#

i test it on my server

#

with the port open

runic grove
#

it shouldnt

quick trellis
#

it shouldn't?

#

do i close the port?

#

ah nvm im stupid

#

hmm what can it be then

#

will none us letters matter?

#

like Ø

wraith flax
#

on the other hand

#

maybe xid isnt good to share LULW

muted ferry
#

Im confused as to how to set up the webhook for votes

spiral steeple
#

What are you confused about, the lib does all of it for you

restive otter
#

I know it's not allowed to send server count to DBL if it's fake. What if I'm testing it? Is it allowed to display a lower number?

harsh stream
#

If you test it with a low number and then you start using the real server number and it's a lot, moderators might think the real number is fake

dense basalt
#

-api @elder lantern @tiny glade @spark dawn @obtuse owl @late crater @wheat geode

abstract mothBOT
#

@wheat geode @elder lantern @tiny glade @spark dawn @late crater @obtuse owl

THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs

dense basalt
daring cove
sullen nymph
#

Reset token

daring cove
#

ok

#

it worked

meager summit
#

ineed help

dense basalt
#

ask away

buoyant sandal
#

When trying to post server count I get this:
Error: Forbidden (status code: 403)

I resetted dbl token and it still does not work
Using: discord.py

#
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>```
this is the first few lines of the response so it might have to do something with cloudflare blocking bot traffic or something, idk.
arctic arch
#

what does it say under the title

buoyant sandal
#

it seems to work now, and I no longer have access to the response.

restive otter
#

Why is the api not working
async postStats(serverCount, shardId, shardCount) {
^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/storage/emulated/0/bot/zeusbot/node_modules/dblapi.js/index.js👍80)
2019-11-29 21:50:27 : pid 13651 exited
with code : 1 / signal : 0

arctic arch
#

you want to await postStats

#

async is for creating an async function, await is for using an async function

restive otter
#

?

arctic arch
#

wait nvm it seems you are making an async function?

#

ooh it's from the module I see

#

what is your node version

restive otter
#

Idk wait

#

3.10.10

arctic arch
#

you need to update your node

restive otter
#

. _.

arctic arch
#

to version 8 at least I think

#

but I recommend using at least 12 right now

restive otter
#

How idk how i install specific node version

arctic arch
#

how did you install your current node version

restive otter
#

I use totime an android app d/node.js

#

I can install termux

#

Its an terminal emulator

arctic arch
#

you're coding on android?

restive otter
#

Yep

#

And it works fine...

arctic arch
#

but it seems whatever you are using has a really outdated node so you should look at something else

restive otter
#

Np i install termux

#

There i can install every node version

#

How i install specific node version?

arctic arch
#

just install the latest

restive otter
#

Then comes an error from npm

#

v10 isn't supported

craggy grove
#

how do i post how many servers my bot is in while sharding? when i do postStats(180) it literally posts 180 servers as the count instead of automatically updating

tame kindle
#

maybe because you're posting as 180

sullen nymph
#

.postStats(serverCount, [shardId], [shardCount])

craggy grove
#

hmm thats weird. someone told me a while back i could do postStats(180) and it would give the accurate server count, and it did for the longest time until i began sharding lol

#

thanks tho!

sullen nymph
#

Not sure why they said that Thonk

green mantle
#

FaKInG SErVeR cOuNT

#

Jk

craggy grove
#

Lmao I still can’t get it to work right so my server count says 1k as of now

arctic arch
#

I have no idea how postStats(180) ever gave you accurate stats, but what library are you using?

placid peak
#

Why this wont work? js const dbl = require('dblapi.js'); dbl.getVotes().then(votes => { if (votes.find(vote => vote.id == message.author.id)) message.channel.send('You have been voten!'); else message.channel.send('What? You have not voted me today, pleas evote here: https://top.gg/bot/.'); });error: TypeError: dbl.getVotes is not a function

green mantle
#

is it Votes or votes

#

.getVotes()

#

no capital for V

placid peak
#

it is

#

on the dbl source the function is this js async getVotes() { const response = await this._request('get', 'bots/votes', undefined, true); return response.body; }

green mantle
#

in your code its a captial letter V

#

dbl.getVotes().then(votes => {

placid peak
#

yes? and on that function its async getVotes (btw its js not py)

green mantle
#

im looking at the docs for js and your right, for me it looks like a lower case :/

placid peak
#

k

placid peak
#

someone?????

sullen nymph
#

Have you looked at the dblapi.js example

arctic arch
#

@placid peak you're not creating an instance of dbl

placid peak
#

didnt notice it, thanks!

craggy grove
#

tonkku im using djs

arctic arch
#

@craggy grove stable or master

craggy grove
#

stable

#

`const DBL = require("dblapi.js");
const dbl = new DBL(DBL_TOKEN, { webhookPort: myPort, webhookAuth: myWebhookAuth }, bot);

dbl.postStats(180);`

arctic arch
#

you've included your bot in the new DBL part so the library automatically posts stats

craggy grove
#

oh gotcha

#

thanks

arctic arch
#

so whats been happening is that whenever you start you bot the server count is set to 180, but after some time the library has posted the correct stats for you

craggy grove
#

ahh ok

#

makes sense

#

im doing the same thing now where i include my bot, but it doesnt automatically post stats. do i have to do something different because im sharding?

#

im not doing poststats 180 lol

arctic arch
#

are there any errors

craggy grove
#

no errors are being thrown, ill post my code in a sec

arctic arch
craggy grove
#

actually is this against the rules

#

to post my link

#

to my bot's page

#

just want to show how the server count only displays the count of a single shard

arctic arch
#

you're not doing it to advertise so its fine

craggy grove
#

it is in 2k+ servers, ill post code in a sec
_ _

#

`const bot = new DiscordJS.Client({
token: TOKEN,
autorun: true
});

const manager = new DiscordJS.ShardingManager('./dio.js', { token: TOKEN });
manager.spawn(2, 0).then(complete => {

    const DBL = require("dblapi.js");
    const dbl = new DBL(DBL_TOKEN, { webhookPort: myPort, webhookAuth: myWebhookAuth }, bot);`
#

do i need to do bot.login() for it to automatically post stats?

arctic arch
#

so you're creating that client there just for dblapi.js?

craggy grove
#

yes, should i be doing something else?

arctic arch
#

you should supply the client of the actual shards

#

or you can remove it and calculate the stats manually and use postStats

craggy grove
#

yea i was originally calculating it manually with a bcEval and grabbed server count, except the code in the .then(complete => { }) runs after one shard as spawned

#

which makes me wonder if there is a way to detect when all shards have spawned, like an event or smomething

arctic arch
#

I believe the bot you have in there right now is just not doing anything because it never starts

unless d.js starts up the first shard which will then get posted

craggy grove
#

oh bruh, the bot is optional

#

i just re read the docs

#

omg lmfao

sudden depot
#

top.gg will add the Server Count togheter for you when you post with shardId

stray acorn
#

I need a dbl_apikey

tame kindle
restive otter
#

@sudden depot can I just send 999999999 instead of my guild count

tame kindle
#

@restive otter that's faking server count and can cause your bot to be deleted

restive otter
#

So that's a no

amber dune
#

very much a no

verbal vigil
#

hey help for vote api

#

help please

tame kindle
#

just say what you need help with

heady cradle
#

for vote api

hollow iron
#

I am a bit confused about the webhook.
As I've never used webhooks in the past, I don't know what I am supposed to use in order to set up the webhook.
So, what am I supposed to get? And where am I supposed to get it?

sullen nymph
#

There's libraries that help you with creating a webhook

hollow iron
#

I've just been reading those. I didn't get it. It said "password" though, I don't know what it means by that.

sullen nymph
#

A webhook is just a server running in background waiting for requests
Password? You mean the auth/authorization part?

hollow iron
#

Pretty much, yeah.

sullen nymph
#

On DBL you choose the password

hollow iron
#

Where? I searched all around the site, I couldn't find it.

sullen nymph
#

Are you using any DBL library?

hollow iron
#

JavaScript Library

#

dblapi.js

sullen nymph
#

Did you see the webhookAuth thing in DBL constructor

hollow iron
sullen nymph
#

Yeah, that's the thing you get to choose for yourself. It just has to match the text on your bot's Edit page (Webhook section at the very bottom)

hollow iron
#

Oh... I actually didn't scroll that far somehow. My scroll wheel stopped at submit and preview. I have no idea why, though it made me think there was nothing there. And then after you said it, and I went to check, it finally worked for some reason. I don't know what's wrong with my mouse, but uh, thank you for the help.

sullen nymph
#

02lul you're welcome

hollow iron
#

How can I test the webhook for votes, without voting for the bot?

gaunt steeple
#

why not vote for the bot to test it?

#

vote for your own bot, and take the vote away and then retest as needed

#

iirc theres no test system

hollow iron
#

Wait, I can take away votes from my bot?

gaunt steeple
#

yes i think so?

#

or am i getting confuzzled.

#

wait, no you cant.

#

but you can do this:

#

put code in your bot to capture the entire POST and dump it to a file

#

vote once, capture the vote

#

then replay that POST with a simple script

#

you can replay that post using curl or such

hollow iron
#

Well, that sounds a bit too much of work for what I am trying to do. I am pretty sure it should work, though I have 3 different outputs on the votes. One for each scenario where the bot finds the user. And I would like to get all of them tested without cheating(in a way) the vote system.

gaunt steeple
#

im sure its acceptable to register discord users for such purposes

#

i mean without a proper test system, how else can you do it 😛

hollow iron
#

It's going to send a thanks message in development server, where if the user is in the server, it will mention them, if not in the server, it will show the tag, and then when the user is not in any server with the bot, it will send the ID.

hollow iron
#

Ok so, another thing.
I just got this error popping up, saying I was rate limited

(node:2496) UnhandledPromiseRejectionWarning: Error: 429 Too Many Requests
    at IncomingMessage.res.on (/rbd/pnpm-volume/5e67cf9e-ab38-4576-ac99-0726c5933577/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/index.js:118:25)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
(node:2496) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 32)

Could that be because I have this inside inside of a message event?

dbl.isWeekend().then(weekend => {
        if (dbl.hasVoted(message.author.id) && !weekend) giveXP = giveXP * 1.15;
      else if (dbl.hasVoted(message.author.id) && weekend) giveXP = giveXP * 1.30;
      });
arctic arch
#

possibly

#

but also

#

dbl.hasVoted also returns a promise and you're not waiting for it to resolve

#

so everyone is going to get the xp

hollow iron
#

Oh,

hollow iron
#

Ok so, my first attempt to set up the voting messages failed. It didn't even give an error.
Though, I do get this log Webhook running! http://0.0.0.0:5000/dblwebhook from

const DBL = require('dblapi.js');
const dbl = new DBL(process.env.TOPGGAPI, { webhookPort: 5000, webhookAuth: process.env.VOTEAUTH }, client);

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

As I've said earlier, I haven't worked with webhooks before, so I don't exactly know what to do.

harsh stream
#

The hook hostname needs to be the address of your bot

#

I can't give you more info, I also never worked with it

hollow iron
#

Uh, I am unsure of how to make it that, and I am unsure if that means, the host or some other server.

sullen nymph
#

The host machine's IPv4 address

#

(Not sure about IPv6 honestly)

hollow iron
#

Any idea how I can get that from Glitch?

#

Or actually, I think I have an idea

#

Uh, nevermind, they're not showing me the IP in the logs.

sullen nymph
hollow iron
#

Oh, alright.

#

Also, I can use multiple accounts to vote for it to test it, right?

sullen nymph
#

You can just send a test request

hollow iron
#

But like, I need to test to vote for a account that is in the development server.

sullen nymph
#

Well nothing prevents you from voting with multiple accounts

hollow iron
#

Well, I am wondering if it's allowed, and stuff.

sullen nymph
#

I just think it's more convenient to fake a vote through testing instead of voting every 12 hours with different accounts

#

meh I haven't seen punishment being handed out for that

hollow iron
#

Alright.

sullen nymph
#

Neither is it honestly stated anywhere

hollow iron
#

I changed the url to the project url, still just 0.0.0.0

sullen nymph
#

Edit the actual URL

#

The console.log part will always output 0.0.0.0

#

see it as a placeholder

hollow iron
#

Oh, so then, do I put that in as a option?

sullen nymph
#

The zeros should be replaced with your actual IP/Glitch domain I sent earlier

#

and with that you get your actual server URL you'll need

hollow iron
#

Wait, I am confused, how do I replace the zeros again? Like, in the code.

sullen nymph
#

You don't replace them in youd code

#

You replace them when entering the webhook URL on top.gg

hollow iron
#

Uh, I did put in the project there.

sullen nymph
#

Save and try it

hollow iron
#

Oh wait, I just realized I forgot keepalive... Let's see if it works now I guess.

#

Nope, still zeros

sullen nymph
#

Is yoour webhookPath set to 'keepalive'

hollow iron
#

No, it's set to dblapi

#

wait no

#

dblwebhook

#

Great, now I just got the rate limit again.

sullen nymph
#

Put that in instead of keepalive

#

Hlw are you managing to hit 429s like thay

hollow iron
#

I have this to give people a little boost for 24 hours when they've voted

let voted = dbl.hasVoted(AuthorID);
      let Voted = Promise.resolve(voted)
      if (Voted) {
        dbl.isWeekend().then(weekend => {
        if (!weekend) giveXP = Math.round(giveXP * 1.15);
      else if (weekend) giveXP = Math.round(giveXP * 1.30);
      });
#

It's inside a message event.

sullen nymph
#

Uhhhhhhhh

#

That'd explain it

#

You sent too many requests because you send a request per message your bot gets

hollow iron
#

Yeah, but like, it's for the leveling system, so that way, if they've voted, they get slightly boosted xp for 24 hours.

#

Well uh, how can I make it still work, but not get rate limited?

sullen nymph
#

I honestly suggest you remove that for now

hollow iron
#

Alright, I've commented it.

green mantle
#

cant u just store if a user has voted and let it tick along like that

#

without having to ping the system every single time a message gets sent

sullen nymph
#

The overall system would go like this:
User votes -> Their ID is saved in database for 12 hours (or store timestamps as well to compare against later) -> on bot startup, fetch database, add users to cache -> when their vote is expired, remove them from cache

hollow iron
#

Uh, perhaps what I could do, is to store the time it expire, and if it was during a weekend or not, and their id, and then I use check their id up to the database?

#

Wouldn't be too hard, would just need the vote event to work, and it should go smoothly.

sullen nymph
#

Glitch only allows port 3000 btw

hollow iron
#

Oh

#

Error

#
Webhook running! http://0.0.0.0:3000/dblwebhook
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: listen EADDRINUSE :::3000
    at Server.setupListenHandle [as _listen2] (net.js:1360:14)
    at listenInCluster (net.js:1401:12)
    at Server.listen (net.js:1485:7)
    at Function.listen (/rbd/pnpm-volume/5e67cf9e-ab38-4576-ac99-0726c5933577/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/application.js:618:24)
    at exports (/rbd/pnpm-volume/5e67cf9e-ab38-4576-ac99-0726c5933577/node_modules/.registry.npmjs.org/node-keepalive/0.0.1/node_modules/node-keepalive/main.js:20:26)
    at Object.<anonymous> (/app/main.js:7:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
sullen nymph
#

Oh look something is using the port already

hollow iron
#

Yes, uptimerobot

#

Is using keepalive

#

To stay up 24/7

sullen nymph
#

egh

green mantle
#

what happens when you use glitch 🤷‍♂️

hollow iron
#

Once I changed it to 3000, I got that, and then I put it back to 5000, and the errors went away.

#

Webhooks are just so confusing to me.

sullen nymph
#

I don't think Glitch has any port other than 3000 open

#

So really only viable option I see here is free your port 3000

hollow iron
#

But then, what am I gonna do with uptimerobot and the uptime?

green mantle
#

get a vps = problem soved

sullen nymph
#

That's a problem I never had and don't know s solution to

#

Does uptimerobot require an open port that desperately

green mantle
#

i mean u could do a rather complicated requests handler to redirect multiple requests on the same port

hollow iron
sullen nymph
hollow iron
#

Neither of them are working.

#

Ok so, I've fixed so that it doesn't give errors on port 3000, but the uptimerobot is messed up, and they are still just zeros

sullen nymph
#

Which part of your code outputs zeros

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

Webhook running! http://0.0.0.0:3000/dblwebhook

sullen nymph
#

It'll always be like that

hollow iron
#

And now the errors are back

#

Oh wait nevermind

#

Old logs

#

Ok, finally the vote event works.

#

But now I have that issue with uptimerobot

sullen nymph
#

I'm not familiar with it so I can't really help

hollow iron
#

It just pings a http to prevent it from going offline.

restive otter
#

Yo

#

Docs need to be updated

#

Or website

#

Website python example still says dbl.Client and docs say dbl.DBLclient

sullen nymph
spiral steeple
#

The docs have been out of date for over a year now, and it's known you'd think they'd fucking updated it so this doesn't happen

#

3 characters too.

#

(And timings of votes)

late crater
#

   @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print("PERSON VOTED PERSON VOTED PERSON VOTED ==============")
        userID = data["user"]
        global inventories
        if str(userID) not in inventories:
            inventories[str(userID)] = 0
        inventories[str(userID)] = inventories[str(userID)] + 32
        """channel = self.bot.get_channel(642446655022432267)
        channel.send("UPDOOT RECIEVED!!!!!")"""
        user = self.bot.get_user(userID)
        if user.dm_channel == None:
            await user.create_dm()
        await user.dm_channel.send(embed=discord.Embed(color=discord.Color.green(), description=choice(["You have been awarded 32 emeralds for voting for Villager Bot!"]))
#

So my bot isn’t detecting votes on dblpy

#

I have tried: resetting api key, restarting bot, restarting bot host (an rpi).

#

Sorry for weird indentation, it messed up when I copied it via vnc

late crater
#

Anyone wanna help?

#

Please........

spiral steeple
#

If I knew python

late crater
#

F

#

I could probably figure it out by messing around with it like I usually do but I can because one can only vote every 12 hrs and I’m pretty sure making alts to vote, regardless of purpose, is against the tos

spiral steeple
#

Use test

#

You can send test votes

#

It's in your edit when you set the webhook info

late crater
#

Why am I stupid

#

Here’s my poor man reddit gold 🏅

haughty tundra
#

Heyo, webhook auth's aren't being send with the webhook.

late crater
#

What

#

Speak to me in idiot

#

Do I have to specify the webhook info when I make a new dblpy client?

haughty tundra
#

What?

late crater
#

Were you talking to me?

haughty tundra
#

No xD
But ur using python so lemme take a look

#

:))

plush crescent
#

What is API?

late crater
#

lol

plush crescent
#

...

haughty tundra
#

application programming interface

plush crescent
#

Ok

#

Thanks

haughty tundra
#

np

#

@late crater I don't really use the dblpy lib for that.

#

@arctic arch when trying to add a authorization to the webhook it doesn't add the auth in the json POST. 😦

spiral steeple
#

It should.

haughty tundra
#

Whait?

spiral steeple
#

I mean when I made my api wrapper I check the headers

#

It's an auth header

haughty tundra
#

Ooh

#

really?

spiral steeple
#

The post info is just the user stuff

haughty tundra
#

I'm sorry for the ping then Thonkun tought api was broken

#

xo

spiral steeple
haughty tundra
#

ty Steven

spiral steeple
#

Ye

late crater
#

How does one send a test vote?

#

I looked through the docs (maybe I am blind) but there was no function to send a test vote, I also looked in the dev portal and on top.gg/api/docs

haughty tundra
#

I'm using webhooks, I don't think you can send a test vote any other way.

late crater
#

then what is on_dbl_test

haughty tundra
#

dblpy its libary vote systm

#

IDK if it uses a webhook.

late crater
#

@spiral steeple how does one send test votes?

#

(Sorry for the ping)

spiral steeple
#

Go to the edit page of your bot

#

Scroll all the way down

late crater
spiral steeple
late crater
#

K thanks

spiral steeple
#

Unless they changed it

haughty tundra
#

Whats the max char count for the auth?

late crater
#

idk

runic grove
#

i dont think there is a limit

#

just dont be insane about it

late crater
#

Alright, so I think I have webhooks set up properly, but I’m still not getting anything

#

I set the port to 5000, and port forwarded it

#

And I typed in my ip (not 192.168.1.x, I’m not that dumb) along with the correct path and port

#

Like http://69.69.69.69/dblwebhook:5000

#

Pretty sure I’m messing up the url

#

But idk the correct way

runic grove
#

ip:port/dblwebhook

late crater
#

Alr thx

#

I’m really new to the top.gg api and webhooks, thanks a lot!

fiery tree
#

hey im getting a server count of 128 from the api but the fetch_guilds() gives me 100, is my cache broken?

#

i tried inv it into a server but only the api refreshes properly

rigid lichen
#

Hey

#

When I use the package, it doesn't do a fetchClientValues() so the server count sent is the one of the current shard

#

how can I do it?

tame kindle
#

what

rigid lichen
#

here are the stats displayed on top.gg

#

My shard #3 has 129 servers

#

but it doesn't post the global server count

#

I use dblapi.js

#

Nvm, found.

dusty roost
late crater
#

If you're using discord.py, put your global ip in along with the specified path and port

dusty roost
#

well i'm using d.js

late crater
#

ok

dusty roost
#

probably should have mentioned it but i didn't know it was relavant

late crater
dusty roost
#

they weren't

#

neither of them gave the information to the question i asked

sullen nymph
#

Are you using Glitch

dusty roost
#

yeah

#

@sullen nymph

sullen nymph
#

projectname being your Glitch project's name and <webhookPath, well...

dusty roost
#

well...?

sullen nymph
#

Reading the docs will tell ye what your webhookPath will be :^)

dusty roost
#

/dblwebhook?

sullen nymph
#

By default, yup

dusty roost
#

alright cool

#

thanks a lot

#

much appreciated 👍

#

now to see if it will actually work

#

how do i utilise the "test" feature?

#

oh nevermind

#

thanks shivaco for the help

digital linden
#

also glitcj only has 1 port

heady cradle
#

3000

#

which i bet 99% that its in use for you

plucky hedge
#

Can i join our group pleaseeee 😦

willow spindle
#

@dense compass ^^

dense compass
#

@plucky hedge I'm not entirely sure what you mean but if you're asking for people to join some kind of group this isn't the place for it. Please take a look at #rules-and-info. (Also non api related talk goes in #memes-and-media or #general )

fallow lava
#

Hello

tepid zodiac
#

pls beg

willow spindle
#

@craggy sentinel ^

sullen nymph
#

Is there much need to ping mods for that

restive otter
#

no ^

sharp wigeon
#

@willow spindle There is no "group" and stop pinging mods, please

runic grove
#

they werent talking about that

sharp wigeon
runic grove
fiery tree
#

Hey im getting this error, can someone explain to me what happened?```bash

RuntimeWarning: coroutine 'DBLClient.post_guild_count' was never awaited
status = discord.Activity(type=discord.ActivityType.watching, name=f'for &help | Rolling for {dblpy.post_guild_count()} servers')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f891821d790>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f891b7b1600>, 13772.246144971)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f891821d990>```

#
@tasks.loop(seconds=1800)
async def change_presence():
    dbtoken = 'token'  # set this to your DBL token
    dblpy = dbl.DBLClient(client, dbtoken)
    await dblpy.post_guild_count()
    status = discord.Activity(type=discord.ActivityType.watching, name=f'for &help | Rolling for {dblpy.post_guild_count()} servers')
    await client.change_presence(activity=status)```
#

this is the code

late crater
#

Read the error!

fiery tree
#

i have a await for post guild count

#

so what?

#

post guild count was awaited

runic grove
#

okay first of all

#

since change_presence runs on a loop, dont redeclare dbtoken and dblpy

#

second

#

you dont await it when youre setting the status, and you shouldnt either

#

as in

#

dont post your server count after you posted it and yeet its response into the status

#

instead fetch how many servers your bot is in

#

and put that in the status

fiery tree
#

get_guilds gives me a out of date number

#

thats why im trying to use dbl

#

get_guilds is stuck at 100 for some reason

#

and i have confirmed that is does not work properly, i asked the discord.py discord server , they told me "meh idk"

#

so yeah, is it not possible like so?

#

or im stuck with get_guilds?

runic grove
#

len(<Client>.guilds) maybe?

late crater
#

That’s what I do

fiery tree
#

yeah that was the previous iteration of what i did

#

but it kept giving me 100

#

even if i inv the bot to a server, leave it for a day

#

still stays at 100

#

even if i later kick it its at 100