#topgg-api

1 messages ยท Page 22 of 1

urban lynx
#

......

#

Fucking hell

#

Server is absolutely dead

#

where tf do i need to get help bruh

signal harness
urban lynx
#

;-;

#

Bro

urban lynx
#

Am i doin something wrong or the links are broken ๐Ÿ˜ญ

icy aurora
mint vault
urban lynx
icy aurora
#

you left it as id not your bot id

#

@signal harness heads up use botid not just id

mint vault
#

I doubt your bot's ID is ID

icy aurora
manic axle
#

Hey why send test not work

icy aurora
icy aurora
manic axle
icy aurora
#

no

icy aurora
manic axle
#

Thx

icy aurora
#

@untold sparrow I need a favor

untold sparrow
#

busy

icy aurora
#

fuck

#

@signal harness favor?

signal harness
proven bay
signal harness
#

im seeing what he wants

#

its probs something stupid

icy aurora
# signal harness say it

i made my webhook public for users and i got working for users whos not in the server im asking if can you join my support server and vote so i can see if voter role is working

signal harness
#

bro wants a free vote

#

sure send in dms

icy aurora
signal harness
#

just checking out this armory then ill be over

icy aurora
#

alr

signal harness
#

voted

icy aurora
#

something went wrong with the vote sad

signal harness
#

no it worked second time

fiery phoenix
#

@void estuary can u check? idk my bot is in review or not :3

#

sry for the ping

fiery phoenix
void estuary
fiery phoenix
#

no one on review?

void estuary
#

i can see you deleted mogger bot 35 minutes ago tho?

fiery phoenix
#

but lol

void estuary
fiery phoenix
#

omg

#

im so

#

OMG

#

im so sorry

#

holy

void estuary
#

it's ok lol, tho if u deleted the bot it'll have to be reviewed again

fiery phoenix
#

it was approved but i tought its buggy

fiery phoenix
#

i waited so long ๐Ÿ™

void estuary
fiery phoenix
#

review

void estuary
#

i'm not sure if the bot's info is saved after being deleted

fiery phoenix
#

after apply

#

i make it new fast

void estuary
#

it'll be added to the queue, tho it might be closer to the front since it's a resubmission

#

not entirely sure on that one sorry

fiery phoenix
#

oh damn

fiery phoenix
#

but thanks alot

#

a lot

urban lynx
#

Uh guys

#

Can anyone help me

#

Setup a webhook?

brazen cloak
# urban lynx Setup a webhook?

Hop on PC > go into edit channel (where u want the webhook) > Integration > Create Webhook > add a pic and change name if u want > copy it's link > paste it into whatever you wanna use it with

tidal idol
#

i think they mean a top.gg webhook

#

easiest way is https://webhook-topgg.com but it depends if they just want vote logs or if they want to integrate it into their bot to give people rewards etc

Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.

fiery phoenix
runic creek
#

It should be available under the Integrations & API tab

signal harness
#

yes the documentation needs changed, I can see if I can open a PR for that to get updated.

sage wadi
regal citrus
sage wadi
#

Integrations & API

sage wadi
#

@icy aurora

safe spindle
#

How to refresh my bot's server count

terse pendant
#

where to find top gg api doc?

old gate
#

should i use the v1 endpoint or stick with old one?

#

for check vote status

icy aurora
#

im using old one

runic creek
#

The only thing that can happen is that the old endpoint may be deleted and then you will have to move to the new one so it is better to use the new endpoint right away

gleaming wadi
#

Hi. I'm somewhat new to top.gg and I wanted to know how I get my API token?

runic creek
#

Don't click that

runic creek
gleaming wadi
runic creek
#

Dude, stop

#

You are not scamming anyone

runic creek
gleaming wadi
#

Tyvm

icy aurora
elfin marlin
#

Anyone else getting 500 status codes?

#

Nvm must be a blip

vital anvil
#

Hey y'all <@&1471335335605571837> (new ping), new API endpoint was added AG_Pray You can use this in the event of any votes that you missed due to an outage, or if your desired platform does not support webhooks.

https://docs.top.gg/docs/API/v1/projects#get-votes

Here's some example usecases:

Scenario 1:

Your service went down, and in the meantime users kept voting. The webhooks failed to deliver therefore you manually fetch the votes, and process them.

GET /api/v1/projects/@me/votes?startDate=2026-02-12T01:58:55Z

Scenario 2:

You run a minecraft server and cannot publish a web http port on your server. You can run a fetch call which reads any new votes by taking the latest cursor from your response.

GET /api/v1/projects/@me/votes?cursor=a234edf9cca...

Hope this helps!

API resource for a projects such as bots or servers submitted on Top.gg

robust star
#

That's something I never considered and am going to add! thanks

vital anvil
robust star
#

...Ideas! I love the new integration. ATM it's theoretical until I can get the bot through review and get the key but that's solid.

With my old bot one of the main issues was the voting container dying or whatever and people losing the vote rewards and it never occured to me to do something like this,

vital anvil
#

Probably because it wasn't possible yet! Now it is :)

robust star
#

So on boot it calls the api and then has some sort of checkpoint system to see if it needs to backfill

#

Thats sweet

vital anvil
#

Oh smart! May need to store the vote ids processed then

robust star
#

Cool I will do something whilst I wait for the review - thanks for the awesome usecase and idea for another voting bot ๐Ÿ‘€

opal solar
#

@woven coral I wanna make a library for the api-types of top.gg (like "topgg-api-types") - could we add that to the community github?
-# Why? Some people want to do their own integration and not use the whole sdk

woven coral
#

cc @vital anvil

opal solar
#

ah, I asked you because you did the node sdk ^^

woven coral
opal solar
#

ah ๐Ÿ‘Œ

vital anvil
#

Feel free to open one on your own GitHub @opal solar

#

I think itโ€™s a good idea, but i also think that moving everything to the top gg community was a bad move long past. People who wrote the code should own it fully.

#

Let the ecosystem grow with freedom

woven coral
vital anvil
#

I just don't want to add more stuff to it

woven coral
vital anvil
#

It would only make the whole sdk lifecycle worse imo, and I don't have time to monitor/review even more repos :)

#

Though if you'd prefer to maintain an sdk under your own ownership. you definitely could

woven coral
#

i just wanted to help because most of the sdks are heavily outdated haha ๐Ÿ˜„

#

frankly I don't mind needing a review from someone on the sdks I maintain, but if you feel too pressured by them, I understand

vital anvil
#

No worries at all! I appreciate you updating them, I wouldn't have any time to do it so it's appreciated!

opal solar
#

I thought of doing the schemas with zod or zod/mini and infer the types then.
So people can easily use the provided Schemas to validate payload and have a valid type on it.

Update: v1 types now done I think, except a few things
https://github.com/The-LukeZ/topgg-api-types

I also added some comments to it so I and others can understand it better.

vital anvil
#

starred it :D

opal solar
#

^^ thx, I appreciate it.
I also added the v0 stuff now, I will jsut go to bed now and continue tomorrow/later.

If you got the time, could you review the TODOs, mainly in the v0 types, please? I got several questions about some fields and their values there ๐Ÿ˜…

icy aurora
snow bloom
#

Curious as to the data.weight aspect of the new update

opal solar
opal solar
#

wait, those endpoints will still be available. I still need some clarification on some fields ๐Ÿ˜…

woven coral
#

or fixed (if there's any bugs)

#

subsequent updates will be for v1

opal solar
#

Yeah I figured ^^
But I'm talking about those:

#

These are things where I had to assume stuff which were not really clear to me.

woven coral
woven coral
opal solar
woven coral
#

you do you

#

Veld advised us to do this for the sdks

opal solar
#

because I assume those endpoints will be migrated to the v1 api and then the old endpoints will be removed. However until that happens it might be months or a year

snow bloom
opal solar
#

yes

opal solar
#

indeed, that is why I was waiting for a response

minor sandal
#

api token

robust star
#

edit > integrations & API

minor sandal
runic creek
#

Is your bot approved on the site?

minor sandal
signal granite
frail stone
#

Hi

#

Anyone help

signal granite
#

any ideas why the "send test " button would be returning a "The destination URL rejected the request"
whyyyyy
cos its being skipped already from cloudflare, and requests arent reaching my origin to begin with akward and there are no blocks from cloudflare

icy aurora
signal granite
icy aurora
#

yea but thatโ€™s curl not topgg

#

itโ€™s whole new setup

signal granite
#

sighs let me try akward (trying with fastapi soo yhh)

#

finally it works

#

had to delete and re-add

#

(same code still)

runic ginkgo
amber owl
#

I need help with having my botghost bot detect when my server is voted for

opaque breach
#

Can anyone help?

icy aurora
opaque breach
#

@icy aurora

icy aurora
opaque breach
robust star
#

He's saying to do it yourself but in an odd cryptic way

opaque breach
robust star
#

I haven't had a play with this yet as I am awaiting approval but have you looked at the code example they offered?

regal citrus
#

i sure do hope i configured mine ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜…

by all accounts when in test mode

logged to my dashboadd hit vote got my 12h premium and a message wss posted

opaque breach
robust star
#

I have the framework set up to add a counting save token on vote + backfill missed votes but waiting on ye old stamp of approval.

#

Look at this

opaque breach
runic creek
opaque breach
heavy bolt
#

I thought that I would keep one webhook that sends events to the test version of my website then uncheck all events when I don't need to test anything (so I don't have to edit the webhook secret each time, and for Top.gg to not send events to the offline test website), but is it possible to edit the webhook events after creation ?

opaque breach
#

Does anyone know how to get the total number of votes from the bot?

icy aurora
#

hey @signal harness ^

minor sandal
#

Can I use the API to get the remaining time before I can vote again on Top.gg?

runic creek
#

Check documentation

strange palm
#

Trying to post my bot's commands gives me a "The JSON value could not be converted to System.Collections.Generic.IReadOnlyList'1[Topgg.Data.Entities.Commands.MinimalApplicationCreatePacket]. Path: $" and "The createPackets field is required." error. The hell is this? It's not mentioned anywhere in the docs.

strange palm
strange palm
#

oh I just had a brain fart there

#

that isn't my payload

#

this is```js
[
{
options: [ [Object], [Object], [Object], [Object] ],
contexts: [ 0 ],
defaultMemberPermissions: '0',
name: 'watch',
description: '(admins only) Follow a gameโ€™s news feed or price changes (maximum 25 of each per server)',
},
{
options: [],
contexts: [ 0 ],
name: 'watched',
description: 'See what games are being watched in this server.',
},
// etc
]

#

stringified of course

#

Oh and I'm using api._request from the official SQK

vital anvil
#

๐Ÿค” I don't think the official SDK supports the v1 api yet on this

#

@woven coral would know better tho

strange palm
#

I mean, looking at the code, all it does is add the authorization and content-type headers and prefix the API path

woven coral
#

a new update with the new v1 features is still yet to be published, sorry!

strange palm
#
const api = new Api("Bearer foobar");
api._request("POST", "/v1/projects/@me/commands", JSON.stringify(topggCommands))
```should work, no?
woven coral
#

the Node SDK pull request is very close to completion though

strange palm
#

ooooh wait I misread the code

#

_request does call JSON.stringify

#

so I shouldn't use it

woven coral
#

yes

strange palm
#

yep it works now
my bad

#

still, that's a weird error

vital anvil
#

It should have a better error

strange palm
#

Hey, webhooks don't include the user's language anymore? I used to get it with vote.query.lang (although that I'm not certain this was ever valid)
It's not in the headers either.
It would be nice if is was added to the user data in the body, or as an accept-language header. My bot does have the vote reward message localized, it's a shame I have to default to English.

#

-# (I promise this is the last of my questions, upgrading the webhooks was the last step of my upgrading to the new API)

icy aurora
strange palm
#

I am using the new webhooks, yes

vital anvil
#

I need to re-add queries yes

icy aurora
strange palm
#

Ah, I knew I wasn't crazy

hasty sparrow
#

Buna ziua aveศ›i emisiunea jumฤƒtatea mea stie kanal d 2013 toate episoadele

#

Dacฤƒ aveศ›i link

#

รŽn romana spune

runic creek
#

Wild question for this channel

hasty sparrow
#

รŽn romana spune

rain heart
#

bless you

strange palm
#

I wonder what goes through the mind of someone barging in a server, speaking a completely different language, and expecting people to understand

#

This seems completely unrelated to Top.gg as well, let alone the API

shut sorrel
#

@signal harness give me url

signal harness
shut sorrel
signal harness
#

What do you mean

shut sorrel
signal harness
#

Iโ€™m clicking on it

#

Itโ€™s not

#

Not sure why

shut sorrel
signal harness
#

Just go here

#

And then click API -> V1 -> Introduction

#

Or V0 has more endpoints

shut sorrel
signal harness
shut sorrel
stuck kite
#

So what exactly is the point of the new API standard for secrets if it's just using symmetric keys? I get that they can't be intercepted and becomes a way to validate it, but still. Asymmetrical seems more appropriate so that we can't ever get the key, meaning no adversary could either, thus raising the bar for security all around.

mint vault
#

Without encrypting or signing the request at least

#

Would then slap an encryption layer over an existing one for everything and other services, which isn't what an API token/key is supposed to do

neat remnant
#

Can someone help me?

mint vault
steel quartz
#

do i need to compute hmac

stuck kite
#

I mean the hash is essentially already doing that, but it's symmetrical. Idk just seems backwards IMO. Realistically they could use one asymmetrical key set for all API calls and have the validity with less risk of exposure.

earnest nexus
#

How can I update the guild size on top.gg? I don't see any docs about that on the api

mystic helm
#

Hello,

I'm a bit confused about the top.gg API and the procedures for accessing it.
I contacted support and they told me to go to their documentation (the URL doesn't work and I've searched but haven't found it) and they require a bot approved by their site.
What do they mean by that? Because I have one that's on their site, so I assume I can use it?

earnest nexus
#
void topgg_post_stats(dpp::cluster &bot) {
    std::string topgg_token = palette::services::get_env_value("TOPGG_TOKEN");

    std::string body =
        "{\"server_count\":" + std::to_string(dpp::get_guild_count()) + "}";

    std::multimap<std::string, std::string> headers = {
        {"Authorization", topgg_token}, {"Accept", "application/json"}};

    std::string bot_id = bot.me.id.str();

    bot.request(
        "https://top.gg/api/bots/1470481920100925683/stats", dpp::m_post,
        [](const dpp::http_request_completion_t &r) {
            std::cout << "Status: " << r.status << "\n";
        },
        body, "application/json", headers);
}

Why am I getting 400 here?

earnest nexus
sturdy zephyr
#

any source or code for the rewards vote and how it should work?

icy aurora
#

nvm

#

idfk python

runic creek
#

That's C++, not python

#

At least it looks like C++

icy aurora
#

i canโ€™t tell since im on my phone with 1 bar of LTE

earnest nexus
barren nexus
#

hey is there a bug on topggs Integrations & API tab? I setup my webhook here and still receive events, but now the page says 0 out of 3 webhooks used ? looks like they updated it with some new stuff recently, but can't really find what i need

barren nexus
#

Ah I see, interesting that the legacy stuff isn't visible even though its still functioning it seems

icy aurora
barren nexus
#

cool, appreciate the heads up!

dapper copper
#

Its gonna stay in maintenance mode until a time its ready to be discontinued

dapper copper
#

Right at the bottom called Legacy Webhooks

barren nexus
#

I gotta get my bot up on your site, looks neat ๐Ÿ˜›

wintry cape
#

Hi all, I have recently made a C++ library that uses D++ to listen to HTTP requests from top.gg. Essentially, a top.gg webhook library. You can use it to verify both bot and guild votes and it parses top.gg's JSONs to present them in a struct with every value ready to be used. The API version it uses is v1. As far as I can tell, there's no other C++ library that does this.
Here's the lib's GitHub link:
https://github.com/Henonicks/DPPTGG
Let me know your thoughts!

GitHub

A D++ program that listens to requests and handles them if they're from top.gg, to compliment my D++ bot Guiding Light - Henonicks/DPPTGG

vital anvil
#

awesome :)

wintry cape
#

Thank you!

jaunty plank
gaunt steeple
#

its at the bottom in bot.request()

jaunty plank
#

Weird syntax ๐Ÿ‘€

Good to know, thanks.

icy aurora
#

rip

#

woo isnโ€™t staff anymore

runic creek
#

A lot of poeple left lately mans_sad

signal granite
icy aurora
wintry cape
mint vault
#

Not a JSON param or body

wintry cape
#

Are query params the things after domain/path??

mint vault
#

A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a web browser or other client application, for example as part of an HTML document, choosing the appearance of a page, or jumping to positions in multimedia content.

A web serve...

#

Not sure what you mean with that. but the parameters are the key-value after a ? separated by &

wintry cape
#

I see, thanks, I completely forgot about those

mint vault
#

sending some body on a GET request usually fails or gets ignored because it simply shouldn't be done

wintry cape
#

makes sense

wintry cape
#

Is there a page with all the errors JSONs I might get? I'm reading the /v1/ docs and there's an object that doesn't match the JSONs I've gotten from different endpoints

wintry cape
stuck kite
#

It's literally right there so I'm not sure how you missed that lol

wintry cape
#

If "pagination cursor" is a universal term then I didn't know that

#

I don't even know why I asked what a cursor is

hollow prairie
#

How do I get/set the "authorization" value for webhooks? I have a created a working webhook, but I don't know what authorization value the webhook is looking for.

icy aurora
#

btw that token will not work cuz its been deleted and it only can be used on that project

hollow prairie
icy aurora
hollow prairie
#

ok thanks

icy aurora
vital anvil
#

so you should treat it as a string

wintry cape
vital anvil
vital anvil
wintry cape
wintry cape
vital anvil
#

It gives you a safeguard to a single point of failure

wintry cape
#

What I'm making is just an API, people can store the vote ID if they like, I'm just letting them have it

vital anvil
#

makes sense

wintry cape
#

I still have that question, what do I expect in an error when a request to top.gg fails? The docs only show something that doesn't match reality

tidal plover
#

ever since switching to new webhooks small percentage of votes get delayed by ~5-10 minutes
im not 100% sure it isnt on my side, but it didnt happen before the switch, nor do i think anything in my code can delay it that much
i can send user ids and rough timestamps

#

some people also claimed it didnt go through at all

signal granite
vital anvil
#

๐Ÿค” all of em should appear at minimum, but sometimes there seems to be a delay indeed

#

@tidal plover i checked your project's logs for you.

tl;dr
100% success rate, max latency is 25 seconds, avg latency is 460ms

#

data is from the last 1000 processed votes

tidal plover
vital anvil
#

hmmmmm

vital anvil
#

prolly has an error message underneath

tidal plover
#

times are in gmt and arent super accurate
1295500443371442250 march 3rd 11:21 am
885044386130440233 march 2nd 2:34 pm
553093932012011520 march 3rd 6:23 am
552599390498455574 march 2nd 11:48 am
1308141070017626193 march 3rd 11:25 am
344637751208968192 march 2nd 8:30 pm

#

ok i have 5 different confirmations that error was seen when it happened

vital anvil
#

lemme see

#

are these discord user ids?

tidal plover
#

yes

#

a few more
1029133865027121202 march 3nd 1:55 am
885044386130440233 march 2nd 2:30 pm
614098831113584640 march 3rd 12:50 pm

vital anvil
#

lemme see

#

885044386130440233 last voted utc 2:36am

#

is that a vote u missed from webhook? AG_Think

#

@tidal plover

tidal plover
#

what do you mean by that

vital anvil
#

885044386130440233 march 2nd 2:30 pm

#

2:36am is 12 hours later

#

or do you mean thats when they are supposed to be able to vote again?

#

would mean they can vote again in ~7 minutes

tidal plover
#

i asked people to dm me of the time they got the bug and thats the time they gave me picardia_shrug

vital anvil
#

actually, let me just add a timer on the vote page KEK

#

gotcha

#

can u ask them otherwise to join here and reach out to me?

#

I'm happy to help them out HappyWow

#

Could be good learning for the top.gg voting experience too

wintry cape
winter raft
#

Do you have to use the old api to post server count to top.gg?

runic creek
#

There is no other way yet afaik

pallid wyvern
#

Where is the documentation for the server count API?

wintry cape
#

/v1/ doesn't have it

#

Look in /v0/bots/

hollow prairie
#

scroll down to "Post Stats" subtitle

wintry cape
#

Hey, I tried implementing the "Last 1000 Votes" request and whether the ID I provide is the ID of my own bot (the one whose token I'm using) or not, I get a 200 status and a response that's simply []. "Search Bots" works fine with my setup. My bot only got 86 votes this month. Is this a server-side issue?

runic creek
#

Last 1000 votes endpoint still doesn't work afaik

wintry cape
#

Oh, alright, I don't really need that as this is for a library but I was just wondering if I was doing something wrong

wintry cape
#

Now I'm POSTing this JSON to /api/bots/<bot_id>/stats json {"server_count":64,"shard_count":1,"shard_id":0,"shards":[]}

But even though the API returns 200, when I get the stats for the same bot, I get this in return: json {"server_count":0,"shards":[],"shard_count":0}

Am I doing something wrong this time?

wintry cape
#

I have no idea how this works but it seems that if I send anything but {"server_count":num} then the server count will be 0

#

I have read this chat's history and found out you don't support that anymore

#

Man I hate these docs

modern geyser
#

Where do i find the webhook secret that i will use for voting ?

signal harness
modern geyser
signal harness
#

You just pass the webhook URL

modern geyser
#

i mean i can use the legacy thing right?

signal harness
#

Yes

wintry cape
signal harness
#

Where would that be? I donโ€™t use one

wintry cape
#

There's a new section specifically for /v1/ though

signal harness
#

Ya thatโ€™s to enter it there is no secret

wintry cape
#

It shows the secret once and then you have to create another webhook if you want to get a secret

signal harness
#

Your right I didnโ€™t see that when I made mine thanks for helping

#

once you create a webhook you will see the secret @modern geyser

modern geyser
#

okay !

wintry cape
#

You don't necessarily need it but then keep in mind that if somebody sends an HTTP request to that endpoint (or the server, if you don't check the endpoint) and formats it the same way top.gg would a vote request, you wouldn't have a way to verify whether it really is top.gg or not

signal harness
#

I must change mine XD

wintry cape
#

I don't actually know how the v0 webhooks worked 'cause I used a third-party service for those but recently they went down for a reason unknown to me so I had to work with top.gg's v1 api

signal harness
#

It was the same

wintry cape
#

๐Ÿ‘

signal harness
#

You passed a webhook and secret and it tracked votes really no difference between the two but v0 is no longer supported as in terms of bug fixes from my understanding

wintry cape
#

Right

#

I see

#

Well, that's why I switched to v1 in the process

wintry cape
#

Right, so apparently, the v0 "Individual User Vote" GET endpoint only gets the vote for the owner of the token, regardless of the bot ID provided?

#

and POST/GET server count work the same way

#

the :bot_id in the URI seems pointless then

#

I replaced every :bot_id with 0 and the ID of a random bot on top.gg and it works the same way as if I used the token owner bot's ID

wintry cape
#

Continuing on with my adventure, I have now added support for the v0 endpoints (all of those that actually work):
https://github.com/Henonicks/DPPTGG/pull/7
I had mostly no clue whatsoever about what I was doing since the docs are so outdated and some fields just refused to work for me but this finally exists

unique hill
#

401 error

#

I got the token from integrations and api

#

Used it

runic creek
#

There are 2 types of tokens afaik (v0 and v1 tokens). v0 tokens doesn't work for v1 endpoint but v1 tokens should work for v0 endpoints

unique hill
wintry cape
#

Which endpoint?

#

/v1/ endpoints require you to append "Bearer " in front of your token:
Bearer to.k.en

#

According to my experience, the v1 token is fine for the v0 endpoints

#

The Bearer part only depends on the endpoint you're making the request to, not where you got the token from

unique hill
wintry cape
#

Nice

unique hill
#

I used legacy api token

mossy mist
#

Hmmm. Any issue with shard count in the stats api? Site is only showing the last shard that submitted a count (and not showing a shard count either) and the api GET is still returning the old shard count

wintry cape
#

Only the guild ID is supported

mossy mist
#

this one i mean

wintry cape
wintry cape
mossy mist
#

alright so gotta do my own server count aggregation then...

wintry cape
#

Oh, are you using an outdated library?

mossy mist
#

i'm posting from each shard individually

#

that worked fine before..

#

server_count: number of servers on current shard, shard_id: current shard, shard_count: total shards

wintry cape
#

those were probably some good times

mossy mist
#

yea seems to be broken for a while already it seems

wintry cape
#

as well as three /v0/ endpoints

round stirrup
#

Sorry I'm a bit confused, it mentions that v1 doesn't have stat posting, am I suppose to use v0 for that then, or should I just not include it for now?!

wintry cape
#

You have to use v0 for that right now

round stirrup
#

Okay thank you, and I assume I have to wait for approval before I can get a token?

wintry cape
#

Well, if your bot is on top.gg already, you can simply click the button

round stirrup
icy aurora
#

your bot is still in queue

round stirrup
#

Ok that's what I originally thought thank you

boreal flower
#

ount

wintry folio
median spindle
#

a

carmine sinew
#

b

civic summit
old kernel
#

c

shut fog
#

d

fast rover
#

e

frank arch
#

f

mint vault
#

@signal harness kinda annoying

icy aurora
#

@signal harness

signal granite
#

@chrome pier

chrome pier
#

thanks

rapid hollow
#

So there is an api that I can use for an accurate vote timer?

rapid hollow
worldly nacelle
#
import express from 'express';
import { Webhook } from '@top-gg/sdk';
import { TOPGG_API_KEY, TOPGG_PORT } from 'core/variables';
import { redis } from 'utils/redis';

const app = express();

const webhook = new Webhook(TOPGG_API_KEY);

app.post(
  '/webhook/topgg',
  webhook.listener(async (vote) => {
    try {
      console.log('Vote received:', vote);

      const userId = String(vote.user);
      const votedAt = new Date().toISOString();

      await redis.incr(`topgg:votes:user:${userId}`);
      await redis.sAdd('topgg:votes:users', userId);
      await redis.set(`topgg:votes:last:${userId}`, votedAt);

      const totalVotes = await redis.get(`topgg:votes:user:${userId}`);
      console.log(`User ${userId} total votes: ${totalVotes}`);
    } catch (err) {
      console.error('Webhook error:', err);
      throw err;
    }
  }),
);

app.use(express.json());

app.listen(TOPGG_PORT, () => {
  console.log(`Top.gg is listening on port ${TOPGG_PORT}`);
});``` did i do sum wrong? its not logging anything
#

the website returns The destination URL rejected the request

worldly nacelle
autumn valley
icy aurora
#

this isnt going be thing anymore

icy aurora
autumn valley
#

Thonk oh yeah new api

icy aurora
#

that why is getting rejected

worldly nacelle
#

my bad chat

icy aurora
#

its alright

#

use new v2 webhook and i gave you example for it

worldly nacelle
#

tthanks

icy aurora
#

plus VELD needs start working on somethin

shut fog
#

Oh

#
router.post("/webhook/topgg", async (req, res) => {
    try {
      console.log("Received Top.gg webhook request");

      const signatureHeader = req.headers["x-topgg-signature"];
      if (!signatureHeader || !req.rawBody) {
        console.warn("Missing signature header or raw body");
        return res.sendStatus(401);
      }

      const parts = Object.fromEntries(signatureHeader.split(",").map((p) => p.split("=")));

      const timestamp = parts.t;
      const receivedSignature = parts.v1;

      if (!timestamp || !receivedSignature) {
        console.warn("Invalid signature format");
        return res.sendStatus(401);
      }

      if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) {
        console.warn("Webhook timestamp outside allowed window");
        return res.sendStatus(401);
      }

      const message = `${timestamp}.${req.rawBody}`;
      const expectedSignature = crypto
        .createHmac("sha256", process.env.TOPGG_WEBHOOK_AUTH)
        .update(message)
        .digest("hex");

      if (receivedSignature.length !== expectedSignature.length) {
        return res.sendStatus(401);
      }

      const valid = crypto.timingSafeEqual(
        Buffer.from(receivedSignature, "hex"),
        Buffer.from(expectedSignature, "hex")
      );

      if (!valid) {
        console.warn("Invalid Top.gg signature");
        return res.sendStatus(401);
      }

      const payload = req.body;
      console.log("Parsed payload:", payload);

      if (payload.type === "webhook.test") {
        console.log("Top.gg webhook test received");
        return res.status(200).json({ ok: true });
      }

      if (payload.type !== "vote.create") {
        return res.status(200).json({ ignored: true });
      }

      const userId = payload.data?.user?.platform_id;
      const username = payload.data?.user?.name;
      if (!userId) {
        return res.status(400).json({ error: "Invalid vote payload" });
      }```
#
const app = express();
    const port = 48433;
    app.use(
      express.json({
        verify: (req, res, buf) => {
          if (req.originalUrl === "/api/webhook/topgg") {
            req.rawBody = buf;
          }
        }
      })
    );
#

this would work

lament dove
#

In res.status(200).json({ ignored: true });

lament dove
amber orbit
#

i

#

cli .

shut fog
#

Soo they donโ€™t send it again

#

Otherwise until you send 200 server will send you request until 3 times

shut fog
#

๐Ÿงธ

#

I just add up extra checks

#

And yes this snippet is working perfectly

icy aurora
icy aurora
shut fog
#

is working

#

and yes it's same

#

if u even know basic of js you would understand

icy aurora
#

ill read that code on my pc after work

shut fog
#

lmao

#

i just didnt split the request in multiple parts and handled it in one

icy aurora
#

this small as phone aint helping

shut fog
#

becuase i have 20 other routes

icy aurora
autumn valley
icy aurora
#

idgaf if the code is a mess or not

#

if it works it works

shut fog
#

its not amess

autumn valley
#

Making routes is more fun in sveltekit imo

icy aurora
shut fog
#

i am so tired making this

icy aurora
#

i just love itโ€™s looks like heโ€™s breaking 4th wall

shut fog
icy aurora
exotic karma
#

do i need to delete the legacy webhook to get the new webhook to work with votes?

wintry cape
stoic shadow
#

is there an api to get stats from bots with the topgg api?

icy aurora
stoic shadow
#

...

#

Man this Platform sucks

icy aurora
#

might not work i

icy aurora
stoic shadow
#

Hmm

stoic shadow
wintry cape
#

The endpoints that pretend to support other bot IDs don't according to my experience

#

afaik you can't even get a bot because the endpoint for getting info on a singular bot is down

#

Or at least it was

#

bots is really unreliable for this, obviously

stoic shadow
#

hmm :/

runic hound
#

Hello,
I updated my bot today and the server count on discord isn't getting updated the autoposter doesn't work anymore?

icy aurora
#

it takes little longer to the page to update but if you request the stats by api you can see itโ€™s been updated

twin vector
#

anyone pulling/scrapign review #'s?

twilit olive
#

what tho API do on this?

twin vector
wintry cape
#

The v1 project struct contains the amount of reviews and the review score

#

I don't think you can get project info of someone else though

meager briar
#

SLAM ALIKOM

twin vector
#

yeah wow was in the open my eyes section

#

thanks for that appreciate it dunno how i missed it

elfin marlin
#

For the โ€œnewโ€ webhooks, am I right with saying that sometimes the avatar url isnโ€™t sent? When is this the case?

elfin marlin
#

@vital anvil hey do you mind answering this?

vital anvil
#

it should always send the pfp that we have

#

keep in mind this is not the discord pfp, this is a top.gg pfp.

#

if you want the discord profile pic, you need to fetch the discord object

elfin marlin
#

Do people always have one?

#

Guessing no?

vital anvil
#

yes

#

afaik they do

elfin marlin
#

Yes as in they always do, ok

#

Which is either their discord one or one they uploaded to top?

vital anvil
#

yes, right now its either a discord cdn or top.gg cdn link

#

in the future it would only be top.gg cdn links

elfin marlin
#

Maybe Iโ€™m doing something wrong in my code but it seems sometimes I donโ€™t get a pfp, but I can look into it just havenโ€™t had the time lately

#

Thanks

vital anvil
#

hmm ok

#

I can take a look for you

hushed elk
#

@boreal flower can u tell me how

#

And how do I get the api

hushed elk
#

ok

cerulean cypress
#

may I please know why its NOT accepting my token. And it does have read and write permissions

401 Unauthorized (You need a token for this endpoint)
vital anvil
twilit olive
strange palm
#

I know it's a bit of a common joke that no one knows how to use HTTP methods properly... But PUT for creating a new announcement, really?.. Yet POST for metrics and commands, even though these do override the existing data? Who did this?

wintry cape
#

Not to mention the fact that v0 has been the only way to post stats for years and still is

strange palm
#

No no, they did recently add the /metrics endpoint in v1. It should be using PUT and not POST, but it's there.

wintry cape
#

no way

#

when was this added?

strange palm
#

Few days ago?

wintry cape
#

Oh my days this was three days ago

#

I've been waiting for this the whole two months or so

#

Okay my bad

strange palm
#

But the real head-scratcher is the /commands endpoint. They (kindly) designed it so you can use the exact same payload as when bulk-overwriting command to Discord. And that action on Discord's side... uses PUT.

wintry cape
#

lmao

#

can't wait for a change to happen to make the endpoint documentation outdated for at least three years

vital anvil
#

pepe yeah my bad

#

we use POST for add or update and PUT for add-only

strange palm
#

If my network professor was here he would be very upset

#

That's a failed assignment right there

wintry cape
#

"bro" I am NOT your brother

vital anvil
#

i'd rather fail an assignment than fail running a business

#

but ya

#

we'll see what we can do

strange palm
#

I understand it's low priority but like
it's triggering my autism

vital anvil
#

good for you someone in the team is also annoyed by it so it's pushed upwards because they will do it

strange palm
elfin marlin
#

@vital anvil Hey, for the metrics endpoints it accepts the shard count but I can't see where this is displayed on the site? What is it used for exactly? Also, there's a batch endpoiint for metrics also. What's the use case for this? As surely only the most up to date server count for example matters. OH is this for like server count tracking?

#

also, "required" for response fields just feels wrong... these aren't required responses these are just not optional?

vital anvil
#

Weโ€™re working on a new โ€œinsightsโ€ page thatโ€™s going to be your new social proof home

wintry cape
#

@signal harness clankers at the gate

viscid vine
viscid vine
#

<@&817055174613794826>

signal hawk
raven karma
#

@signal hawk sirr can you tell me how I can make thing like when someone vote my bot on top.gg it send voting message in support server

strange palm
#

those noobs, eh?

#

A link to the docs was literally just posted, but no, gotta ping two staff members.

raven karma
strange palm
#

yes, this

raven karma
#

K

strange palm
#

It has a big "webhooks" button that will lead you to a step-by-step tutorial with a code example

#

It's actually quite simple, assuming you're not completely new to programming...

robust yacht
#
{'type': 'webhook.test', 'data': {'user': {'id': '265.', 'platform_id': '9187.', 'name': 'annomy9257', 'avatar_url': 'https://cdn.discordapp.com/avatars/91877/8f9d2.png'}, 'project': {'id': '5.', 'type': 'bot', 'platform': 'discord', 'platform_id': '10190'}}} None```
why is authorization None?
strange palm
#

What do you mean, "authorization"?

robust yacht
#

oh alright

pallid wyvern
#

What solution do you guys use for updating guilds?

I feel like there is 2 options having it automatic push everytime a guild joins or leaves

Or having it just push the number every x hours?

runic creek
#

Every x hours is fine, nobody cares about guild count anyways

hearty lintel
runic creek
#

Huh

elfin marlin
# vital anvil I can take a look for you

Hey so I finally got around to adding some logs for avatars. I got a response where the avatar_url gives a 404 response back. The user definitely has an avatar though

vital anvil
#

gotcha - if they are discord cdn avatars, you can't really rely on us having the latest data

#

use the cached discord ones you have

elfin marlin
#

They are yes. Guessing these will change some time?

vital anvil
#

yeah we are working hard on the changes to move things to our CDN

elfin marlin
#

No worries i can just fetch the user for now

rare moth
#

\\

#

ุทูƒุธ

#

<"ูƒุฒูƒุฒ

#

ุท<|\\\\\\\\

sacred patrol
#

Does anyone know why it takes so long to verify when claiming rewards? It usually takes around 10 - 20 seconds

#

nvm i figure it out

#

thanks me

stuck steeple
#

Hey, can anyone help me out how to know if page_content update actually worked?

vital anvil
torn kestrel
#

I recently implemented voting. However, the votes are stuck and don't go up. Infact it has gone down from 41 to 35 since the last week and is stuck at 35. Is it common? I don't understand how this works

stark laurel
#

Was the query field removed from responses in the new webhooks? I didn't see anything about it in the docs (besides the fact that it's missing) - is there no way to receive the query params anymore?

strange palm
#

yep
I used to use to to give a localized notification, but alas

vital anvil
stark laurel
#

That'd be awesome! Thanks!

runic ginkgo
#

I just noticed are query strings no longer supported with webhooks v1?

#

This is pretty fatal I use them to bind a vote to a guild

icy aurora
runic ginkgo
untold sparrow
runic ginkgo
wary zinc
#

number

left thunder
#

question for the new topgg webhook system, what are the valid Types? Webhook.test and what? How do ik a user votes for the bot to log it?

icy aurora
left thunder
signal oyster
#

whw to fix top.gg api time out error

#

Top.gg API error (allowing by default): timeout of 2000ms exceeded
Top.gg API error (allowing by default): timeout of 2000ms exceeded

chrome crown
daring slate
#

@meager acorn What error do you get from the api call itself?

meager acorn
#

just throws this

daring slate
#

How have you implemented this on the code side?

meager acorn
#

wait

meager acorn
# daring slate How have you implemented this on the code side?
// Top.gg vote webhook verification middleware
function verifyTopggWebhook(req, res, next) {
  const secret = process.env.AUTHORIZATION; // Set in Top.gg dashboard as "Webhook Authorization"

  if (!secret) {
    return res.status(503).json({ error: 'Webhook authentication not configured' });
  }

  const auth = req.headers['authorization'];

  // timingSafeEqual prevents timing attacks
  try {
    const authBuf   = Buffer.from(auth || '');
    const secretBuf = Buffer.from(secret);
    if (!auth || authBuf.length !== secretBuf.length || !crypto.timingSafeEqual(authBuf, secretBuf)) {
      return res.status(401).json({ error: 'Unauthorized' });
    }
  } catch {
    return res.status(401).json({ error: 'Unauthorized' });
  }

  next();
}

// Route
app.post('/webhook/topgg/vote', verifyTopggWebhook, async (req, res) => {
  return await processVote(req, res);
});

Webhook verification

async function _processVoteInternal(req, res, user, type, isWeekend) {
  const db = require('../database/database');

  let wizard = await db.getWizard(user);
  if (!wizard) wizard = await db.createWizard(user);

  // Base rewards
  let crystalReward = 75, coinReward = 5000, expReward = 40, couponReward = 1;

  // Weekend double rewards
  if (isWeekend) {
    crystalReward *= 2; coinReward *= 2;
    expReward *= 2;     couponReward *= 2;
  }

  // Streak tracking
  const now = Date.now();
  const timeSinceLastVote = now - (wizard.voting?.lastVote || 0);
  wizard.voting.currentStreak = timeSinceLastVote < 86400000
    ? (wizard.voting.currentStreak || 0) + 1
    : 1;
  wizard.voting.totalVotes = (wizard.voting.totalVotes || 0) + 1;
  wizard.voting.lastVote   = now;

  // Streak multiplier (up to 2x)
  const mult = 1 + Math.min(wizard.voting.currentStreak * 0.1, 1);
  crystalReward = Math.floor(crystalReward * mult);
  expReward     = Math.floor(expReward * mult);

  // Milestone bonuses (10, 25, 50, 100 votes)
  // ... milestone logic ...

  // Save rewards
  await db.addExperience(user, expReward, 'vote');
  const fresh = await db.getWizard(user);
  fresh.voting   = wizard.voting;
  fresh.crystals = (fresh.crystals || 0) + crystalReward;
  fresh.coins    = (fresh.coins    || 0) + coinReward;
  fresh.premiumCoupons = (fresh.premiumCoupons || 0) + couponReward;
  await db.updateWizard(user, fresh);

  // Send DM notification to voter
  sendVoteNotifications(user, fresh, { crystalReward, coinReward, expReward, couponReward, ... });

  res.json({ success: true, rewards: { crystals: crystalReward, coins: coinReward } });
}

Vote processing

const { Api } = require('@top-gg/sdk');
const topggApi = process.env.TOPGG_TOKEN ? new Api(process.env.TOPGG_TOKEN) : null;

// Post server count every hour
if (topggApi) {
  setInterval(async () => {
    const serverCount = client.guilds.cache.size;
    await topggApi.postStats({ serverCount, shardCount: client.shard?.count || 1 });
  }, 60 * 60 * 1000);
}

Stats posting

// 3-tier cache: memory (5min) โ†’ DB (lastVote within 12h) โ†’ Top.gg API
async function checkVote(userId, botId, forceRefresh = false) {
  // 1. Memory cache
  const mem = _voteCache.get(userId);
  if (!forceRefresh && mem && Date.now() - mem.checkedAt < 300_000)
    return { voted: mem.voted, source: 'memory' };

  // 2. DB cache (wizard.voting.lastVote)
  if (!forceRefresh) {
    const wizard = await db.getWizard(userId);
    const lastVote = wizard?.voting?.lastVote || 0;
    if (Date.now() - lastVote < 43200000)
      return { voted: true, source: 'db' };
  }

  // 3. Top.gg API (rate-limited, max 50 calls/min)
  const res = await fetch(
    `https://top.gg/api/bots/${BOT_ID}/check?userId=${userId}`,
    { headers: { Authorization: process.env.TOPGG_TOKEN } }
  );
  const data = await res.json();
  return { voted: data.voted === 1, source: 'api' };
}

Vote check for gated commands

runic creek
#

Try without posting shardCount

meager acorn
meager acorn
runic creek
#

Maybe

meager acorn
#

okay

meager acorn
runic creek
#

It doesn't say anything

meager acorn
#

yes

signal oyster
elfin marlin
atomic shardBOT
vital anvil
# atomic shard

@golden adder since you requested this a while back ๐Ÿ™

vital anvil
#

I can take a look for you

elfin marlin
#

I should've deleted this, I was being an idiot. Thanks anyway and sorry to bother

atomic shardBOT
uncut crystal
#

first

cyan ruin
#

second

ember cloak
#

THIRD

uncut crystal
#

:^)

cyan ruin
#

there we go

#

kek

ember cloak
#

cheeky cunt aetheryx

cyan ruin
#

i like discord.js it fast

normal sleet
#

hi

uncut crystal
#

okay let's not I'm not sure if this is supposed to be unlocked

ember cloak
normal sleet
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

sudden rampart
#

the java library has only blocking requests please fix kthx

inner venture
#

@sudden rampart blobtriumph

golden wind
#

aio

normal sleet
#

~ ( . - . ) ~

tardy crater
#

Quit chatting in here like it's general.

strange jasper
#

Chill or ban please be nice in here, dont chat too much โค

uncut crystal
#

Read the channel description

light crag
#

nice api

sudden rampart
#

None of the libraries respect ratelimits

restive otter
#

Suggestion: for the widget demo, use one of the user's own bot ids or luca if they dont have any. so less bias ig

dreamy rain
#

seriously, get out of here if you aren't actually discussing the API

restive otter
cobalt ruin
normal sleet
#

For the dblapi.js, what do we put for the token/key in const dbl = new DBL('token/key thing', client);?

uncut crystal
#

Your bots' API token

sudden rampart
#

go to your bot's edit page

normal sleet
#

mk

sudden rampart
#

and scroll down

normal sleet
#

thank you

small kindle
#

do i need to change to the new library for the api (i'd be using the js one), or is what I was using before still going to work?

sudden rampart
#

old one should work

small kindle
#

thanks, i'll get arround to updating eventualy

restive otter
#

/bot/:ID/vote doesnโ€™t seem to work for me

sudden rampart
#

replace :ID with the bot's ID

restive otter
#

i did

sudden rampart
#

/bots/

restive otter
#

oh lemme try that

dawn jay
#

hey admins thanks for the docs

#

really helpful

#

actually it's kinda funny because I was looking at the docs this morning and couldn't really figure out how to use widget

restive otter
#

the hell it still isnโ€™t working

dawn jay
#

@cobalt ruin is there any documentation for the https://discordbots.org/api/widget/status/:ID widget?

uncut crystal
#

.

shy vessel
#

oboy

#

@dawn jay don't ping website admins, mods or community managers at all just ask or ping one mod

#

kthx

dawn jay
#

oh

#

sorry

#

maybe disable mentions on that role?

uncut crystal
#

has been suggested

sudden rampart
arctic arch
#

any fields, contains case insensitive

sudden rampart
#

okay thanks

calm torrent
halcyon kernel
#

I can

calm torrent
#

and imo the client should be made in init with bot.loop

blazing egret
#

what the oof is this

#

heccing oof

restive otter
#

Wow that py example

#

Imports messy af

#

Creating a session and doesn't use it

#

bot = bot wtf

#

Should be self.bot =

edgy nexus
#

is dblpy working for anyone

#

because

#

python doesn't detect that i installed it

sturdy forge
restive otter
#

Just use the python examples in pins

calm torrent
restive otter
#

Pinsssss

cobalt ruin
#

@golden wind read up

restive otter
#

A disaster of a lib imo

edgy nexus
#

oliy

#

python won't detect that I installed dblpy

#

it says package not found

#

but i installed it

#

ugh

arctic arch
#

prs are welcome and stuff

#

and blame francis

restive otter
#

just do aiohttp requests yourself instead of using a broken wrapper

calm torrent
#

^^

#

lol

golden wind
#

lol

restive otter
#

as shown in the py examples in pins

calm torrent
#

ill pr when i get home from school lol

golden wind
#

ye i mean it would be helpful if you pr'd or told me which bits were messy so i could fix it instead of just shitting on it ๐Ÿ‘

calm torrent
#

pls don't steal my chance

golden wind
#

constructive criticism

restive otter
#

@golden wind as oliy said read up, I made a listen of issues with the example

golden wind
#

ye i read up

calm torrent
#

@golden wind in __init__ it should be self.bot, why create a session you don't use?

#

ID and token should be allowed in the client init

#

client should be created in the cog init, with the bot.loop as loop

restive otter
#

Imports messy af - dblpy imported, then you do a from? Just do the from.
You create a random session in init which is never used???
bot = bot should be self.bot = bot
Should be two linebreaks before the class declaration

calm torrent
#

and you didn't even use the client

#

i highly doubt the example even works lol

restive otter
#

It doesn't

#

I can tell just by reading it

calm torrent
#

```The event loop_ to use for asynchronous operations. Defaults to None,
in which case the default event loop is used via asyncio.get_event_loop().

```The `event loop`_ to use for asynchronous operations. Defaults to ``asyncio.get_event_loop()``.
#

that's your docstring for the client in source above, below is my version ๐Ÿ‘€

golden wind
#

๐Ÿ‘

calm torrent
#

Install from source should be:
pip install git+https://github.com/DiscordBotList/DBL-Python-Library

edgy nexus
#

whoever wrote dblpy is shit at python

#

ok

uncut crystal
#

Constructive, please.

restive otter
#

Basically

uncut crystal
#

Any criticism or improvements can be sent to the repo in the form of issues and PRs.

restive otter
#

If it's not fixed this time tomorrow I'll do a massive pr

calm torrent
#

print(json.dumps(resp)), if you want to json.dumps it, at least indent=4 or 2

#

Pretty sure asyncio is an unused import in this case

restive otter
#

Dont print, use logging

golden wind
#

yeye

calm torrent
#

and wheres your setup function... test the cog first please

trim bluff
#

Should I use the JS library or keep using snekfetch?

raven zinc
#

keep using snekfetch or whatever other thing

#

unless ur lazy

calm torrent
#

JS lib uses snekfetch

trim bluff
#

If I'm lazy I'll keep using snekfetch because it's already implemented.

#

It looks messy and I'm doing a cleanup of my code.

restive otter
#

I'd keep bulk down and do it yourself

calm torrent
#

and don't provide a static number to the API in the function, use len(self.bot.guilds) and your class funcs should, and must have self as a parameter

trim bluff
#
function updateDbotsStatus() {
  require('snekfetch').post(`https://discordbots.org/api/bots/291650980578197506/stats`)
  .set('Authorization', configuration.apiKeys.discordbots.key)
  .send({server_count: client.guilds.size, shard_id: client.shard.id, shard_count: client.shard.count}).catch(console.log) // eslint-disable-line camelcase
  .then(console.log('Updated discordbots.org status.')).catch(console.log); // SEND!;

  log('Not updating DBots');
}
restive otter
#

@calm torrent can you pr all that? Or open an issue? So it's like all in one place?

calm torrent
#

allow session, timeout and loop as a kwarg to the init of Client

trim bluff
#

Also I have setInterval(updateDbotsStatus, 15 * 1000 * 60);

uncut crystal
#

.then(console.log()) doesn't work intentionally

calm torrent
#

im looking to pr tonight, if you feel it's too late, then ill make an issue now

restive otter
#

I'd issue now with the list so others can work on it

calm torrent
#

ok then

restive otter
#

And then pr if nobody else has later ๐Ÿ‘Œ๐Ÿป

calm torrent
#

it's 6am now haha

trim bluff
#

My server count being "automagically" posted to the api sounds nice.

calm torrent
uncut crystal
#

Appreciated.

restive otter
#

Commented on ๐Ÿ‘Œ๐Ÿป

arctic arch
#

discordie isnt supported as the lib's most likely dead. You can use the postStats function

restive otter
#

I upvoted my Bot 5 secs ago.
Why the Votes with ?days=1 are empty?

calm torrent
#

becuase nobody voted today

restive otter
#

@calm torrent I did

#

And my friend too

#

did you remove and add it again?

#

like

#

it was already upvoted

#

then you removed and added to test?

#

There was never a removal of a vote today

#

Can you not ghost ping people just cause they didn't reply? It's not nice and frankly quite rude smh.

#

Sorry ๐Ÿ˜ฌ
But now it works after some 502..

spark osprey
#

Is the .hasVoted() method asynchronous on Node.js?

summer oracle
#

I think the days param may be borked

#

the results im getting feel more like minutes than days tbh

#

did a call with days=1, got 2 ids, took note of them
did some other stuff for a few minutes
doing the call again -> empty array / other ids
doing the call with days = 5 -> those 2 ids still not there
doign the call with days = 10 -> ids are in the array

#

also onlyids=false is ignored

restive otter
#

Looks like days = minutes?

summer oracle
#

it doesnt matter what is put for onlyids=, as soon as that parameter is in the query, it returns only ids

sudden rampart
#

iirc when that was added it'd do that

inner venture
#

@summer oracle it actually specified that in teh old docs

limpid sorrel
#

so is the days field going to be updated to actual days, or stay as minutes

summer oracle
#

can be minutes for all I care, but then pl0x more than 31 ๐Ÿ˜„

astral urchin
#

oof

#

Is it possible to see how many upvotes someone does in the past 30 days?

#

xD

restive otter
#

could there be something to see if a user voted today or not? maybe a boolean thing in the votes api for each member?

sacred horizon
#

Don't think so, but it seems like it would be a good idea to include the date that the votes were added, as well as how many days ago, for easy reference

manic bough
restive otter
#

i know the way to get the total amount of upvotes all time but is there a way to get just this month count?

arctic arch
#

?days=30
if it would work I'll fix it soon

#

I think I know what went wrong

#

and if you do ?onlyids=false it'll be 'false' which is actually true lol

azure pollen
#

smh tonk

arctic arch
#

smh js

restive otter
#

lmao

#

wonderful

#

oh so ?days isnโ€™t fully working yet?

wintry turtle
#

is only allowing users to claim daily credits/money for the bot if they upvote it considered abuse?

restive otter
#

@wintry turtle no, in matter of fact theyโ€™re almost promoting

#

but yeah thatโ€™s what iโ€™m gonna do, thatโ€™s why iโ€™m trying to figure out the days thing

wintry turtle
#

ok, thanks!

restive otter
#

np

arctic arch
#

fixes published

calm torrent
#

@manic bough The PY wrapper has a lot of issues, import dbl should work but the wrapper has quite a bit of bad code

#

gonna create a pr later

restive otter
#

Where do I put the token on the API?

arctic arch
#

are you using a library?

restive otter
#

Nope

arctic arch
#

the authorization header

#

smh I just realized @cobalt ruin didn't include anything about the things being promises

restive otter
#

My bot's made in Discord Bot Maker so I don't really know exactly how it works.

#

Nvn.

#

Nvm

arctic arch
#

oh ๐Ÿ˜„

#

idk how DBM works

tawdry spindle
#

Pff i know

cyan ruin
#

ew superagent

severe mist
#

Use snekfetch lol zero deps

uncut crystal
#

assuming you're using discord.js

severe mist
#

snekfetch is a standalone package

uncut crystal
#

yeah, but it's a dep if you aren't using discord.js

severe mist
#

It's still a dep even if you are using it if you're on npm 5+ iirc

#

But snekfetch has zero dependencies

#

Super agent requires an additional 10 packages to function

uncut crystal
#

oh that's what you meant

#

fair, although you could take it a step further and just use https

severe mist
#

But what if you're not using node smart

uncut crystal
#

use whatever way your language has of accessing the command line and curl it

#

:^)

#

getting kinda off topic now though, shhh

robust hinge
#

Well

#

Thatโ€™s new

uncut crystal
#

what's new?

robust hinge
#

this channel

uncut crystal
#

correct, do you need anything or

robust hinge
#

that's all

#

I guess thinkW

calm torrent
#

what's the new ratelimit? is it still at 60 stats posts/minute and a hour block if you go against it?

arctic arch
robust hinge
#

this is 60 per minute and it was 10 per minute

#

god bless you Tonkku

#

or oliy

#

or both thinkW

#

any ideas?

#

this isn't working

junior goblet
#

do onlyids=true

restive otter
#

afaik it doesnโ€™t need a value

junior goblet
#

well idk it worked for me adding true so ยฏ_(ใƒ„)_/ยฏ

restive otter
#

Maybe oliy fixed it

raven zinc
#

afaik it never needed a value, but it just checks if onlyids is here iirc

uncut crystal
#

=1 works I think

summer oracle
#

with the global ratelimits in place, what about having a developer key? I dont want to accidently trigger the ratelimit of a production bot while developing. an additional key, that has access to the data of all bots of a developer, would be really dope.

thin vessel
#

ยงeval dbl.getStats("373950085609816074").then(stats => message.reply(stats.server_count))
This works to get server count but what if I want to get the full stats Object

#

just message.reply(stats) doesnt work

arctic arch
#

ratelimits are per ip not per token

cunning forum
#

This may be problematic if someone has a few bots

#

and they host it on a single server

thin vessel
#

What does my issue has to do with ratelimits GWkaseyThumbsup

dull sundial
#

He was answering Napster

full socket
#

@arctic arch Sorry to bother you, but is there anyone currently working on a C#/.Net wrapper for the API?

thin vessel
#

so we can abuse the hell of /users/* as much as we want?

#

Or the ratelimit thingy is poorly written

raven zinc
#

You obviously can't abuse the api as much as you want zoomeyes

thin vessel
#

well it doesnt state any ratelimit for /users/ ๐Ÿ‘€

restive otter
#

well. . .

#

how do u abuse it thou . . . self bots are banable

raven zinc
#

it doesn't state it but it's common sense isn't it ๐Ÿ‘€

cobalt ruin
#

โ€ข Fixed two grammar mistakes in the API docs

raven zinc
golden wind
#

and the missing full stop at the bottom

restive otter
#

Suggestions, please make the ratelimits per token. imo that's how they should work, not per ip.

#

I have quite a few bots on one server, so i could quite easily hit it.

vagrant kayak
#

+1 because the server Modulo runs on is a shared IP with a few other people (private host but a single IP). Not like we'll hit the limit but just for shits and giggles if any other people get added and end up causing problems

restive otter
#

^Is the api using json?

#

yes

#

like any other rest api

#

Okay, I understand now ๐Ÿ˜ƒ

dreamy rain
#

@restive otter the problem with that is that some endpoints are unauthenticated

restive otter
#

Do a separate limits for auth'ed ones

cunning forum
#

Well, use an ip ratelimit for those unless an authorisation header is sent

dreamy rain
#

yeah maybe

cunning forum
#

So allow Auth for all endpoints

#

But require only on some

wintry turtle
#

It would be great if the amount of requests you have left until you get ratelimited is returned to you.

cunning forum
#

Preferably as a header, so
x-ratelimit-left: 42
x-ratelimit-reset: unix timestamp for the next minute

#

Because if it were a json field, it could mess with the API wrappers etc

primal lark
#

@golden wind Hey, the example of the python api is missing the self parameter in all functions including the constructor mmLol

golden wind
#

ye ik its been reported

primal lark
#

ok ๐Ÿ‘

#

@golden wind And the 'r' of this pip install -R requirements.txt should be lower case

golden wind
#

๐Ÿ‘

primal lark
#

@golden wind Sorry for mentioning again, but is it normal that my python is accepting the module name dbl, but not dblpy? ๐Ÿ˜•

golden wind
#

um, its been reported already, idk whats causing it

primal lark
#

Ok .. ๐Ÿ˜ƒ

golden wind
#

i'll look into it

primal lark
#
future: <Task finished coro=<update() done, defined at C:/Users/merli/PycharmProjects/embed_generator_rewrite/run.py:8> exception=TypeError("__init__() missing 1 required positional argument: 'message'",)>
Traceback (most recent call last):
  File "C:/Users/merli/PycharmProjects/embed_generator_rewrite/run.py", line 15, in update
    print(str(await dbl_stats.post_guild_count(10)))
  File "C:\Users\merli\PycharmProjects\embed_generator_rewrite\dbl_stats.py", line 11, in post_guild_count
    await dbl_client.post_server_count(id=botid, token=dbl_token, guild_count=count)
  File "C:\Users\merli\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\client.py", line 77, in post_server_count
    await self.http.post_server_count(id, token, guild_count, shard_count, shard_no)
  File "C:\Users\merli\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\http.py", line 114, in post_server_count
    await self.request('POST', f'{self.BASE}/bots/{id}/stats', json=payload)
  File "C:\Users\merli\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\http.py", line 78, in request
    raise Unauthorized(data.pop('message', 'unknown'))
TypeError: __init__() missing 1 required positional argument: 'message'```
#

Im getting this when im trying to post the server_count. I think its already reported too? ๐Ÿ˜„

#

@golden wind

golden wind
#

that one wasn't