#topgg-api
1 messages · Page 179 of 1
also also i dont know if you know but okay is spelled okay not, okey
I'm from balkan, sorry. My english is not best.
my bot didn't sent message for vote, and in console there is no errors
According to : https://docs.top.gg/api/bot/#post-body
shard_count is not required. However I got a response of https://chicksgold.gyazo.com/f501b61e6f44e6eb40bc5f3b87ba8955
Is the documentation incorrect?
Scratch that. Apparently sending 0 is an invalid number for that parameter. Although I'm not sharding yet so it's valid to me 😛 - Was mapping to 0 as my DTO was non-nullable. Making it nullable resolved it.
I would expect 0 to be valid for that request.
shard_count isn't required if you only send server_count
Due to my DTO mapping the request ended up being
{
"server_count": 5,
"shards" : 0,
"shard_id": 0,
"shard_count": 0
}```
My guess is the shard_id: 0 is what caused the shard_count required bit
you wont need to post the other stuff except server count if you're not sharding
Yes, as I said I updated my DTO to be nullable.
Which would then map
{
"server_count": 5,
"shards" : null,
"shard_id": null,
"shard_count": null
}
I was just saying I would expect 0 to be fine.
w.e the matter. Resolved
dbl_token = os.environ['dbl_token']
client.topggpy = topgg.DBLClient(client, dbl_token, autopost=True)
@client.event
async def on_autopost_success():
print(
f"Posted server count ({client.topggpy.guild_count})"
)
Getting this error:
Ignoring exception in auto post loop:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/client.py", line 151, in _auto_post
await self.post_guild_count(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/client.py", line 212, in post_guild_count
await self.http.post_guild_count(guild_count, shard_count, shard_id)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/http.py", line 192, in post_guild_count
await self.request("POST", "/bots/stats", json=payload)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/http.py", line 163, in request
raise errors.HTTPException(resp, data)
topgg.errors.HTTPException: Bad Request (status code: 400)
what library are you using?
Python (topggpy 1.4.0)
Any ideas? 
cant help then
it seems like i am receiving the webhook from a vote multiple times, anyone have this issue?
Alright
I tried to keep it simple with the autopost, I'll see if the manual task loop is any better
the library should handle that itself normally
I can't seem to figure out what I've done wrong though...
topggpy ||specifically the latest 1.4.0|| is a top.gg library... is it not?
https://github.com/top-gg/python-sdk
It is, yes
There's 2.0.0a on the GitHub, however. It has a few drastic changes in its structure
@rain heart @sullen nymph well I regenerated my Top.gg token
fixed the issue. Strange it wasn't giving me an authorization error though
then you likely got an invalid token before since cache do be like that
I always receive 401 unauthorized when posting my bot's stats even though I use the right token
Then you're not actually using the right one
Regenerate your token, refresh the page and copy it then
why this error is coming it was alright 1 hour ago
the api is experiencing some issues
oh ok
I'm trying to regen my bot token, but pressing "Click here" does nothing
refresh the page afterwards
kinda think the api is broken... for some reason the auto poster isen't updating and my vote webhook is complet broken
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
nope
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i lookt in docs. and i think it should all be set up since it worket before when i had other host but a got a new one. and i set the ip up and i use the app port in the webhook port aswel..
well i have had this problem since like 4 weeks back. :)
nvm fixed it.
thanks anyways xd
can't belive it took me 4 weeks to fix 
Topgg > edit your bot > menu webhook
-upto
i somehow cant reset my api token and if i use my current one i get a unauthorized
refresh the page after regenerating the token
worked, tysm7
@ebon nacelle
Can someone in my dm help me to make vote tracker (Step by step)
why this didn't working....
that library is deprecated,
https://docs.top.gg/libraries/javascript/#installation
0.0.0.0 isnt a public ip.
Do you run the code locally at home or on a server?
Locally at home
Also there's no need to hide the port
Okay
Well when running at home you have to make sure to add a firewall wall on your PC to allow incoming requests on that port.
Also need to setup port forwarding in your router.
And you need to actually have a real public IPv4 address and not a DS lite tunnel.
I need to set here the IPv4?
No ISPs I know yet support port forwarding for IPv6
So yes, without a real public IPv4 you can not receive anything your ISP is filtering out
okey i puted ipv4
forwarding, i need to set protocor. Here is the choices: TCP | UDP.
what to define
TCP
You actually don't need to put an IP in there
As no other service will contact you on that port
If you want to you can whitelist the IP topgg doing requests with
159.203.105.187
Show me a screenshot how your GUI looks without the IP addresses
(only if it is in English)
Ahh
That's your local device IP
You should have a list of network devices in your router showing the devices IP addresses
The one you're running your code on is the one you need
You need to create a firewall rule on the PC you're running the code on
Probably Windows?!
Follow this
You can edit/delete and see the firewall later on in your GUI
You must open the Windows command prompt as Administrator
Keep in mind to adjust your port
this will not affect my network?
No
The one you defined
you received the webhook?
yea
Ok now the bad news
Your public IP isn't static, means that wont work forever
The local IP (your network IP) isn't static, too means that wont work forever, too
(as long as you didn't set it as a static one)
That means it's possible the stuff doesn't work anymore in a few hours, days, weeks etc.
You will have to update both IPs whenever they change (most likely daily) or use a server to host the code on with a static IP
it depends on your location, my ip has been the same for a few years and we dont pay for a static ip.
some places it does change often
My ip can't change without permission
I have on mobile app all settings
for my router
where do i get my dbl token?
your bot page, edit, webhooks
Your ISP decides when your IP will be changed
That can happen at any time if you don’t have a static address
However it’s not guaranteed it doesn’t change means your port forwarding won’t work anymore some day
(as well as your local network address)
Which isn’t static in your router by default, too
So.. you should at least keep that in mind is what I wanna say
Pls rich
how long does it take for the data to update after posting data to the api?
What would you all recommend for the best way to set up vote reminders for a bot?
I have the webhook working great and the database is fine as well, just not quite sure how to go about the 12 hour reminders
Track the time yourself
Either on execution:
- store epoch
- user tried voting
- check if the time between first epoch and now epoch is 12 hours apart. If not, tell them to wait (possibly state how long until then), if yes, tell them they can vote again
If once can revote:
Start a timer from when they voted to 12 hours, DM them once it expires
Basically the theoretical way on doing it
Just took a look at epoch the other day and got a good sense of how it works so should be easy enough to implement
Ty again ^^
Yup yup
<req>.vote.isWeekend() will work?
just a small note, isWeekend isnt defined for test buttons currently only actual votes.
ok
Ye i saw
That it doesnt return with it
how do i get my webhook token for my bot? it's not showing up when i go to webhooks?
also it asks for webhook destination and i have no clue what to put there
please ping when reply
You need to use the button to generate a token if you haven't done already
The destination to enter basically is your endpoint
You're listening for topgg sending requests (webhooks) to your endpoint
Means they need your hostname (FQDN) or most likely your public IP address (and port if specified) of the device your code is running on, listening for incoming requests
ping
Pong
Lucky timing
okay so i have a code written out and im not sure its right? but i did get the authorizationtoken but don't know how to get webhook url and i made a password under where the webhook url goes
Where do you run your code? Locally or on a server?
GitHub
errr okay
sure why not
i forgot the ending
oh gosh
yeh :/
related code?
I'm not interessted in your embeds
don't need to see your messages to the user
we just wanna figure out your webhook url for github
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
app.post('/dblwebhook', webhook.listener(vote => {
// vote is your vote object
console.log(vote.user) // 221221226561929217
})) getVotes() {
if (!this.options.token)
throw new Error("Missing token");
return this._request("GET", "/bots/votes");
}
/**
* Get whether or not a user has voted in the last 12 hours
* @param {Snowflake} id User ID
* @returns {Boolean} Whether the user has voted in the last 12 hours
* @example
* ```js
* await api.hasVoted('205680187394752512')
* // => true/false
* ```
*/
async hasVoted(id) {
if (!id)
throw new Error("Missing ID");
return this._request("GET", "/bots/check", { userId: id }).then((x) => !!x.voted);
}
/**
* Whether or not the weekend multiplier is active
* @returns {Boolean} Whether the multiplier is active
* @example
* ```js
* await api.isWeekend()
* // => true/false
* ```
*/
async isWeekend() ;{
return this._request("GET", "/weekend").then((x) => x.is_weekend);}
exports.Api = Api;
app.listen(3000) // your port
module.exports = {
name: "vote",
aliases: ['v'], //aliases are optional
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
{"Authorization"; "token here"}
}
}```
errr you might wanna use source bin or related
okay how do i do that?
okie
errr that confuses me quite a lot
did you copy something from the start to the end?
Does this api work with dpy?
i copied what my friend had written in his top.gg code on github and then put in the handler he gave me
ok well let's just talk about the webhook listener
okie
alright I'm back
app.listen(3000)
you created your webserver on port 3000
didn't even know you can run things on github
but now you need to find out the hostname or IP that server is binding to
actually i dont understand what the 3000 part was for? i thought that was supposed to be there. bare in mind im a total newbie to all of this...
well and I unfortunately can't really help you with github
do you have a console where you run that stuff?
I have visual studio code if that counts
how do you execute your code on github?
what i do is type in the code and commit it to the main branch
which was entirely set up for me by this friend of mine who hasn't been too helpful
Do you use something like Heroku to use that code?
Yehhh i use heroku
it is? okay so is that the key to this code?
iirc you have some project url on that platform
whats iirc?
if I remember correctly
okie so these are my options
overview, resources, deploy, metrics, activity, access and settings
On Heroku you should be able to link a GitHub repo
thats what we did yeh
on the dashboard problably overview
there should be something showing your proiject url
idk like your-project.heroku.idk.com
your github url is not needed here
its not Github its git only
hopefully you seen that
its a heroku link to my project im pretty sure
huh what?
i sent the link but deleted it cause idk what kind of access that gives lol but its a heroku link not github
is this link what i put in the webhook url on top.gg?
your hroku project url is the webhook url you have to enter on topgg
As well as the path you specified (probably /dblwebhook) and the port you set (3000)
okay so url goes by the dblwebhook and in place of 3000?
right i get what you meant now
i do appreciate all of your help.. is there a part of the code that needs to be taken out? its still throwing an error. i understand if you cant give this information though
You should probably go with the example from topgg if you're really unexperienced
That will just create a webhook listener on the specified port
okay thank you
The parameter vote contains anything you need to know
You can user the vote.user to fetch a Discord user through your bot's client
Then send him a message or whatever you like to do
send a dm? i don't know how to put DM in my code yet
Is your bot is nodejs or python?
nodejs.. javascript
<client>.users.fetch("userID").then(u => u.send("Blah"))
that doesn't work
in the spot of userID what do i put? cause any one can vote
fetch returns a promise
Thank God you were here the way I've been doing things is complex and mega ugly code
ohh
I remember
you need to resolve the promise first
i still don't know what a promise is and no one will explain D;
fetch().then((user) => user.send(..))
Well tbh at this point you're missing the Basic knowledge of the language, webhooks etc.
You might wanna learn that stuff before working with it
All requires at least some fundamental knowledge to work with
A promise is something you shouldn't break
It's like impossible to explain the basics when you're not aware of them
Hello, I seem to be having a problem with the Top.gg Java library:
dbl = new DiscordBotListAPI.Builder()
.token("insert token")
.botId("insert id")
.build();
dbl.hasVoted("my user id").whenComplete((hasVoted, failure) -> {
System.out.println(hasVoted);
});
hasVoted just recently started to return null. It was working fine for a few months prior to this, and I hadn't made any changes to my code. Any help would be appreciated, thanks!
Try catch and see if you get any exceptions
nope, none caught
probably an api change?
Nope, would've been announced
Regenerate your token, refresh the page after doing so
Catch exceptionally instead
. exceptionally
regenerated my token already, and what does it mean to catch exceptionally / how would I do it?
I used:
try {
} catch(Exception e) {
e.printStackTrace();
}
Use . exceptionally on the hasVoted method
like this?
dbl.hasVoted("454773340163538955").whenComplete((hasVoted, failure) -> {
System.out.println(hasVoted);
}).exceptionally(ex -> false);
is this how you send to dms? client.channels.cache.get(vote.user).send({embeds:[votedm]});
yes
good day, i tried to get user async from my new bot (still not present in search results cause issue with it apparently) but i get thiss "issue". Anyone can tell me if its because of the misssing bot in the search results or maybe not yet active? or if its something i did wrong?
Fetch vote.user then send dm
Very helpful I want to know the way to send dms to a user with id I already have the vote.user from topgg also I found it yesterday
what
Well his answer is indeed the way how you do it.
You fetch the user ID via. your bot connection to the Discord API you got from topgg and send the fetched user a DM.
Means you need your API connection instance (client) to do an user fetch.
<client>.users.fetch(vote.user);
fetch() will return a promise here, keep that in mind
anyone have any clue on why this happens? or why i get the waiting for activation message?
where I will get my topgg token?
refer to the pinned messages
you need an approved bot to get the token
anyone knows why I have no connection to the api?
so you got globally ratelimited
forever?
check back in 24 hours while not posting anything to the api
100+ a day so idk if every 12h is possible I'd do it
ehh, still nothing you'd need to post every 12 h
I mean as long as it follows the ratelimit stuff, you aight
just generally suggest something more high
can I just change the token to prevent the bot sending the stats?
Also as a quick note as the /resources/ratelimits page states you'll recieve a 429 and you're getting a 418:
HTTP 429 return code is used when breaking a request rate limit.
HTTP 418 return code is used when an IP has been auto-banned for continuing to send requests after receiving 429 codes.```
well it's for sure bc of the every 3 seconds lmao
I'll just wait a day then
and try to send it slower
So I am basically switching my bot from javascript to java cause I feel like I understand java better and the discord api for java more… anyways I was looking through the docs for top.gg for the java api but I can’t find the way to trigger something when someone votes, I can only find how to detect if someone is voted, and to check if it like the weekend vote.
I dont think the java library supports webhooks currently.
Sadness.
There's unofficially maintained ones right now that might work
One by me and one by someone else
There's one made by me https://github.com/Hopeful-Developers/topggwebhooks4j
And one made by another developer
https://github.com/JoshiCodes/TopGGWebhook
There's another one made by someone else that supports different botlists, can't find it rn though
Copy pasting what I sent a few weeks ago
Java Webhook Library for Top.gg. Contribute to Hopeful-Developers/topggwebhooks4j development by creating an account on GitHub.
Ty.
hi why am i getting this error? https://i.poxgur.com/28NnnF.png
Seems you are using the wrong http method for what you are doing
But what tho? I've been getting this error recently before it was fine
What endpoint are you using?
posting my server count and shard count and votes? is that what u mean
Are you using the topggypy lib or writing it yourself? Or using someone else's library.
topggpy
Strange 👀
yah
it started like last week
I feel like it started whenever they posted this update #site-status message
If you are sure the error is coming from topggpy youd probably be best off reporting the issue on github
I dont work on the py library no
oh ok
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
yah i believe cause every time it posts the server count it spams that error
ok ill report it
@meager meteor do you use the webhook
so i used my eval command and did this
and when i go onto the stats page for the api it returns ```json
{"server_count":25,"shards":null,"shard_count":1} // correct
but when i go onto the top.gg page it still says that the server count is 2(on my beta bot it was 2 but now the eval is using my main bot) instead of 25
does it take long to post or did i do smth wrong yup it just takes long
well lets hope today i wont be ignnored... anyone can help with this pls? 🙂
It's not being ignored, just not someone here who could help you
The value on the website isn’t been updated immediately
Give it some time, maybe up to an hour to update as it’s cached
Yeah the caching behavior is just crap
But to be fair it’s also not really important to have an up to date count at any reload
right then where should i post? the support said i should do it here...
In here, waiting for someone who can actually help
i see. then ill wait i guess and repost every once in a while
nvm
TopGGAPIError: 403 Forbidden (You don't have access to this endpoint)
Basically what the error tells you
Does someone has a c# bot example for interaction with API, or documentation using c#?
How would I track guild votes, using the Server Webhooks thing on the docs. https://docs.top.gg/resources/webhooks/#server-webhooks
You can use any of the libraries that support that. They are listed in the docs
Hello, is there any API that tracks server vote count per member on topgg?
One message removed from a suspended account.
One message removed from a suspended account.
well more specifically trying to get data from the user that uses the vote commndn to check his last vote/date of vote and see if he did another vote.
since the bot is not yet indexed or in the search results...
i guess that is the issue, but i cant be sure for now tbh...
One message removed from a suspended account.
i mean i have the bot approved, its present in the topgg but it does not appear in the search results.
altho the vote page appearss in theory
One message removed from a suspended account.
well...if i try to "get" the user data on my bot i get that message
well..try to check what the object has available to know how to handle it more specifically.
One message removed from a suspended account.
One message removed from a suspended account.
hm...then what am i doing wrong?
One message removed from a suspended account.
sure a sec
One message removed from a suspended account.
One message removed from a suspended account.
AuthDiscordBotListApi DblApi = new AuthDiscordBotListApi(799667058673319957, "token got from the webhook page of the bot");
object bot = DblApi.GetBotAsync(799667058673319957);
object user = DblApi.GetUserAsync(ctx.User.Id);
the token is the "secret" one that you get when you click reveal
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
for now, the rest is internal stuff. i wante to see what user has in terms of fields and data available
so i know how to proceed
but with a breakpoint i find only "waiting foor activation"
as a result
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ok O.o..so i have to do like object user = await api.GetUserAsync()?
One message removed from a suspended account.
sure
One message removed from a suspended account.
One message removed from a suspended account.
i do get id and other stuff
but nothing about the vote but i guess it is another "function" of the user object
One message removed from a suspended account.
cause, since i have not much knowledge yet of webhooks and i could not create one, i wanted to get the "last vote datetime" so i can check if its different from the last one saved
One message removed from a suspended account.
and then save the new one 🙂
One message removed from a suspended account.
i see.
One message removed from a suspended account.
One message removed from a suspended account.
yeah apparently.
One message removed from a suspended account.
thank you very much for your help and support 🙂 in case i have other issues ill make sure to messages you in case you allow me ofc.
One message removed from a suspended account.
oh..
One message removed from a suspended account.
good thing i did not started on it then XD
well i can use otther wrappers or create an API
not an issue there.
One message removed from a suspended account.
but thats for the future. for now i wanted a easier and simpler voting thingy
and this is what i found
which property gets last vote datetime? if you dont mind sharing since i got ya here 🙂
is there also a property for "number" of total votes or like monthly total votes and similar?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
noice, thx a lot 🙂 for help as well for the support.
One message removed from a suspended account.
nope you have been essential and more than enough help to me 🙂 had to wait couple days but worth it to solve this issue, thx a bunch 🙂
One message removed from a suspended account.
🙂 thank you i will remember to do that next time.
Thanks! I'm new to webhooks, is there anything I need to setup to use the webook?
Ye
I already have
Can we use this api for a vote tracking bot??
Weird shit
Wdym
Not you
Ohk
My problem...
I'm not sure how you want to do that
Yah it's interesting lol
yes you can
(since there are bots already doing that then it's possible)
(also you might wanna use webhook instead of the api)
Can you help me a bit
I don't want the code I wanna know that what do you mean by using webhook
As right now some bots needs some kind of authorization and something other too
Can I buy personal bot
-api
This channel is ONLY for the Top.gg API!
This channel is only for: suggestions/help/bugs to do with official API libraries and API docs found at: https://docs.top.gg
Any Off-Topic conversation may get deleted and muted.
If you need help with development about your bot or development in general, feel free to use #development.
To be able to be give WL
we're not a server that provides bots
consider hiring a developer through fiverr or freelancer
Any idea where
-needdev
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
and what is the reason ?

is the problem from my code ?
const Topgg = require('@top-gg/sdk')
const topgg = new Topgg.Api(process.env.ggToken)
const mMember = message.mentions.members.first() || message.member
const voted = await topgg.hasVoted(mMember.id)
const { AutoPoster } = require('topgg-autoposter')
const ap = AutoPoster("key", client)
ap.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
so i have one question, in the c# api, or in general i guess, i see no field that contains the voting date/datetime, i guess there is no such info?
which means the "hasvoted(userid)" becomes false after 12 h?
@scarlet cobalt
One message removed from a suspended account.
well...the hasvoted yes
but i cant find any datetime field for the vote
so i guess there is no such thing?
Not a thing nope
darn...
Refer to the webhook schema https://docs.top.gg
i am not using webhooks tho
not yet at least.
i am basically trying to get if the user has voted after he did vote on the website.
and now the only way is the hasvoted i guess.
which i guess becomes false after the 12 h has elapsed
so the user has to vote again for it to become true again
at least i hope it is like this cause otherwise i have no other clue on how to check if the user voted and when :S
sadly not an expert on web nor webhook, i will learn to do it eventually but for now i must settle for a simple solution...
Does the one you made pause the thread it is on when it is running?
It starts a httpserver itself, yeah
teapot, just for confirmation, can you confirm that the voted bool becomes false after 12h? (aka when they can vote again)
It does
oh good. thx 🙂 at least there is that. not the best solution but will do for the time being until i complete a webhook
I wouldn’t recommend sending requests Everytime to check
That would result in ratelimits
i only do it when the user uses the command
If someone spammed, it would spam the api
i get a getmeasync and then check for voted.
hmmm i could make a timer.
so let them sue this command once every 1h at best.
if needed be.
or do it ONLY if 12h passedx
Do you have a database?
stopping them before.
yes
i can save the datetime when they use the command
and check if 12h elapsed
🙂 so i avoid spamming
Create a simple webhook that gets the userid and the timestamp of them voting and stores in DB
Not hard to make at all
And would mean no cringe ratelimits
i dunno how to do it. i dont doubt it might be simple..
but i simply have no clue how to make the webhook how you told me, i would so happily use a webhook
but i have 0 knowledge of it.
What language?
c#
Ah
using DSharp plus...
so yeah...
i need to set up an API, make the settings...etc
and after create a httppost receive i guess.
Sadly not a lib for that
To avoid confusion, it creates its own thread and runs on there, so you'd be able to use more code after starting it
So I won't have to make it on a different thread myself?
Correct
Hello, I wanted to create server vote counter feature on my bot using top.gg webhook. Do I need to register my bot first on topgg? My bot is a private bot and currently running for a specific server. Any help would be appreciated. Thanks!
are you're talking about Auth tokens for webhooks ?
you can use this for reference https://docs.top.gg/resources/webhooks/
Does the test button for voting not show "isWeekend" when the data is sent?
It does not send weekend data for test votes
Only for real votes
okay perfect, ty
how do I get the token from topgg?
read pins
Has anyone created an application that parses through all of Top.GG bots, gets the prefix of of each one, and create a Most Common Prefix chart?
Thought it would a cool stats thing to look at, but not sure what the rate limiting is like for the API
@rain heart Pls Can you tell me how to make Vote Require command
I think its usefulness would come in handy for new bot developers choosing an uncommon prefix for their bots
But, I guess now everyone's moving to slash commands, so maybe not so much in modern times
just use your bot's mention <@your-bot-id> as prefix, that'd be the most unique prefix
Hello im very very very new, how to make it so everyone someone votes the bot, a webhook sends a message in a channel that this person voted
how do i even set this up lmao
Easiest way is https://webhook-topgg.com
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
thank you
Is there a way to give someone a role when he vote for the bot?
Use a vote tracker bot
Hi a question, ¿How do I connect my bot to the top.gg API so that it sends a message to a channel when a user has given my bot a vote?
what issue are you facing?
I'm using the java top.gg api library, after calling setStats the server count on the website has always updated fairly quickly
over the past week or so, none of the updates have taken effect
on either of my bots
any errors logging?
I don't see any errors no
Might just be caching on the bot pages then, that always happpens
ah, looks like I asked at the wrong time - I ran a manual postman request the other day and the bot that I'm most concerned about it updating was updated overnight 😆 but it's still not updating through the library in the bot oddly enough
yeah I've always noticed some caching
I haven't confirmed the inbuilt library working for ~1 week
i have the same exact issue
it was working fine, then all of a sudden it returns 401. I refreshed the token and it still doesn’t work, yet when i send a request using insomnia i get 200. something is broken in the library
(same with checking votes)
When someone upvotes my bot on top.gg, it looks like it sometimes just doesn't send any http request to my webhook at all, but when I send a request to my webhook endpoint manually, it always works. Am I the only one who currently experiences this?
Yeah
My user accounts seems to be affected by the issue, too. When I upvote my bot, my webhook endpoint doesn't receive any incoming request, but when I edit my bot and send a test request, everything works fine all of a sudden
seems like firewall issue
Yes, I noticed that too. It can only be Cloudflare though, so now I've tried everything to make sure that it doesn't intercept with top.gg webhooks, and we'll see whether the issue has been fixed now 
UPDATE: when I upvote on top.gg, I get a confirmation ("Thanks for voting!"). But when I refresh the page afterwards, it will tell me that I can upvote again
So it looks like top.gg doesn't really register my vote and for many other bot users
try voting now and tell me if the same happens
if it doesnt tell you you already voted, the vote did not go through
Nothing has changed unfortunately, the vote still does not go through
are you using a vpn
Yes
It has worked now, thank you
Good 👍
Can I use this channel for the topgg sdk module?
One message removed from a suspended account.
I cant regen Bot’s token in Topgg
so how do I create the command in d.js, and when a user votes for the bot, it allows them to run that command from the other lang.
like I create the requirement in d.js and if I run a command from my bot from python, if I have not voted, it says to vote.
wym webhook server
It's plugin for vote requirement
It's for gcommands framework
You can check code
so I just add this to my current bot code?
so i have this right now using d.py, my friend said he already added the password to the topgg guild page webhook area or something like that (i don't have access to it), but it's not triggering it (send the "Received vote" to the channel) nor printing it. i installed the topgg package through git (git+https://github.com/top-gg/python-sdk/). what did i missed?

Is someone going to help me
hello there! I want to know can I give direct discord webhook url for post request? for example, if I put https://discord.com/api/webhooks/956150216699027466/omiC...., looks like it doesn't sending any info whenever click on vote either test webhook button, if this is incorrect way, which way should I use for it?
The webhook setting does not support normal discord webhooks, you'd need another server that does so, such as https://webhook-topgg.com
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
If you wish to reward users for voting, you need to make your own webhook setup
oh alright! thanks for letting me know!
is there any other things that i need to do?
the webhook url and auth has been added?
if so, whats your hosting method? vps, home, replit, heroku, etc.
ah i dont think so, i'm hosting in heroku right now
i've only told him to put the "password"
https://[name of app].herokuapp.com/dblwebhook
youll also need a web dyno enabled on heroku
is it possible to put 2 of these? i'll have 2 app soon (if 1 of them free dynos ran out)
we only support one webhook at a time, if you need to communicate between two heroku instances youll need to setup your own ipc.
ah alright, also you said "webhook url and auth", that is the url (...herokuapp.com) and what is the auth?
taking a guess, but its probably whatever you have set as "TOPGG_PASSWORD" in the environment variable shown here.
I dont know the python library too well.
ahh alright i'll try that, thank you so much!
Hi, I use the JAVA top-gg api for my bot, for over a year I've used the template provided on github
api.hasVoted(userId).whenComplete((hasVoted, e) -> {
if(hasVoted)
System.out.println("This person has voted!");
else
System.out.println("This person has not voted!");
});
To work out if a user has voted, but it no longer works despite neither the token or botId changing and when I manually go to the URL which gets built it does display
{"voted":1}
However, when I run the code I get back a 401 unauthorized trying to access the response (therefore hasVoted is now Null and it doesn't execute anything)
you mean the api auth token ?
Go to https://top.gg/bot/<YourBotID>/webhooks
For reference: https://docs.top.gg/api/@reference/#authentication
The token you have provided is invalid
Regenerate it, refresh the page and use it
Going directly to that URL on your browser gives you the correct response as the site is just using your credentials to use the API
Does the token expire or something then?
It does not, you provided an invalid one
I haven't changed the code in over a year and it's broken in the past 1-2 weeks
I'll still try regen though
still the same issue when regenerating a new token and putting it in the builder
Then you might be trying to get the data from a bot that the token doesn't belong to
You cannot enter a different bot id from a bot that the token doesn't come from
the token I regenerated for the bot is found on the top.gg/bot/<id>/webhooks page with the same id provided in the url being used on the builder (if thats what you mean?)
How can I update server count using nextcord (python), and no the official library doesnt support nextcord
generally youd post the stats using whatever http request method works with nextcord
Yea the token
By bot id tht means discord one?
There's only one on bots
Why I'm getting this error?
topgg server is down maybe?
i have same issue too
are the staff at top.gg aware their libraries (as a minimum the java library) have not been working for over a week?
in what way is it not working?
well they don't let you post the stats
and I've heard from someone else the votes aren't working
from the sound of it, they aren't working at all
I dont think the java library supports vote webhooks.
unless you mean making a request to the vote endpoint
if I were to guess, since t he library hasn't updated at all - some site update with user agents or something caused the requests from the libraries to no longer be allowed
yeah I don't use that, apparently it does
at any rate, setStats does not set the stats
any errors?
and it's definitely the library, I've heard the same thing from a minimum of 5 developers, all with the same timeframe
manual api requests work
no errors either
If we had any changes to the api I wasnt informed.
I'm not a java dev, but looking over the libraries source code I dont see anything that would cause it to not function.
in my opinion, the most likely cause is cloudflare blocking the request
due to user-agent stuff or other firewall related blocks
because nothing changed on the library obviously, it's been working all along
the site seems to simply not be accepting the requests from it though
that's really strange.
I'll stick it in a staff channel, hopefully xet/cassie gets a chance to look at it.
at any rate, I think I speak for most of us developers who use the library instead of simply making the requests manually, it would be nice if you'd let a developer know, I'm sure it's a very simple fix if they know what's wrong
awesome, thank you!
update: another developer says the requests from the library are returning a 401 unauthorized - I haven't personally confirmed if this is what it's returning for all my bots as the requests are all done in the background with the library but it might help narrow the search down
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I've only used java
One message removed from a suspended account.
One message removed from a suspended account.
the token is definitely valid, postman works
the thing is, nothing changed with the library
it feels to me like the site simply isn't accepting the request
for some reason
One message removed from a suspended account.
One message removed from a suspended account.
yeah, that's why I feel like it's the website itself
One message removed from a suspended account.
or maybe just a website update that didn't get applied to the java library
One message removed from a suspended account.
if you guys aren't seeing any issues with the other libraries it could very well be just the java one in that case
One message removed from a suspended account.
it seems like the issues happened just over a week ago
started happening*
if that narrows the search down for what's likely causing it
One message removed from a suspended account.
ah, have you tested it to be sure it works in the past week?
One message removed from a suspended account.
One message removed from a suspended account.
sounds good, hopefully it's limited to just the java library malfunctioning
In case that happens to you, try regenerating your token several times
One message removed from a suspended account.
Haven't had one for years
One message removed from a suspended account.
I can try regenerating the token - though the issues happened to multiple people at the same time, and both of my listed bots stopped posting at the same time
One message removed from a suspended account.
One message removed from a suspended account.
scrolling up through this chat, looks like everyone who has the issue uses the java library
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
alright nice
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I'll try to find the specific issue with postman requests in a bit, though it looks like the website just went down for maintenance
One message removed from a suspended account.
One message removed from a suspended account.
yeah they're practically the same language syntax-wise anyway
I'll send you a ping if I can find the issue when the sites back
One message removed from a suspended account.
I wonder where the lightning bot is voting
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
lol
One message removed from a suspended account.
made it quite a while then
I was wondering why there was never any updates to it every time I imported it in gradle is was always 2.0.1 😆
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Only like half the libraries have active/any maintainers funnily enough
As far as I recall, even the Python one has been ditched
One message removed from a suspended account.
.vote
One message removed from a suspended account.
sg!vote
One message removed from a suspended account.
Works but there's no maintainer
One message removed from a suspended account.
One message removed from a suspended account.
Are you sure you wanna take over 3 libraries
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Hi
Hell no thanks
One message removed from a suspended account.
Hi offerte parrot?
Scd
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
it's likely only going to be a single line of code to fix it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I've never worked with github or open source projects at all, so at any rate between the two of us we should be able to find a solution lol
P.S. You may want to check which domain it works with, Faith
One message removed from a suspended account.
One message removed from a suspended account.
Ah
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
!clear
One message removed from a suspended account.
!vote
..
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
is there an endpoint for topgg to return the total amount of votes my bot has? I looked at the docs are it only appears to return the last 1000 votes, but I just want an agregate.
If you just want the number then the bot data structure has a field called points
Fetch the bot info (https://docs.top.gg/api/bot/#find-one-bot) and use the points
@scarlet cobalt so I believe I found the issue - the library is apparently in fact trying to access discordbots.org, it should be a very easy fix (line 27 & 28 of DiscordBotListAPIImpl.java)
Found at: main\java\org\discordbots\api\client\impl\DiscordBotListAPIImpl.java
it's possible the previous maintainer fixed it in one place but missed it there
Discordbots.org should still work.
at any rate, all of the requests appear to use that base URL, which when executed returns a 401 unauthorized
discordbots.org redirects to top.gg
yep
One message removed from a suspended account.
One message removed from a suspended account.
we still want to have discordbots.org work
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
It still should be fixed in the library, but the old domain should work too.
One message removed from a suspended account.
hang on, the source code I just downloaded for the library has discordbots.org in there
One message removed from a suspended account.
github
An API wrapper for https://discordbots.org/api/docs that works in Java - top-gg/java-sdk
One message removed from a suspended account.
One message removed from a suspended account.
seems like it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
who previously published the java sdk
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you wont have access to publish
how to post server count btw 💀
One message removed from a suspended account.
language?
js
One message removed from a suspended account.
Auto-Poster for Top.gg. Latest version: 2.0.1, last published: 4 months ago. Start using topgg-autoposter in your project by running npm i topgg-autoposter. There is 1 other project in the npm registry using topgg-autoposter.
ty
Thanks!
read the pinned messages
I'm constantly getting this error any fix?
Did anyone mess with api because sometimes broke my bot
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Well you must know otherwise you wouldn't be called very smart
Which library did you write out of curiosity?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I see well I'm using the java one
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
about what?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
It's okay
hi can someone help me to use the top.gg api for a "premium" command im trying to make
in discord.py
Create a webhook server
- For topggpy: https://dblpy.readthedocs.io/en/stable/api.html#topgg.WebhookManager.dbl_webhook
- For JavaScript (forgor the name):
https://topgg.js.org/#webhook-server - If you like hardcoding: https://docs.top.gg/resources/webhooks/
When someone votes:
- Save their id
- And probably time
When someone uses the premium commands:
- Check if the user has voted before (from database)
- if the user has voted before execute the command
- else show an error saying "vote to use this command UwU"
huh ?
stable what?
ohh
Ehh I mean something to note. You never know what version they use
I thought the python lib was dumped

Plz take over
I wish I knew python

if you have done it can you send me the code? If not its totally alright!
there's a rule in this server saying no spoonfeeding code
and I just said I don't know python
Sorry I did not see the message.
Oh alrighty!
One message removed from a suspended account.
One message removed from a suspended account.
read the docs
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Does the api return any data when you make a post request for the server count? (like a success or anything)
One message removed from a suspended account.
Is it a json or status code
One message removed from a suspended account.
200?
One message removed from a suspended account.
any way to do smth like this?
topGG.on(`posted`).then(() => {
console.log(`[Top.GG] Posted bot statistics!`);
}).catch((error) => {
console.log(`[Top.GG] Failed to post bot statistics! ${error.message}`);
});
One message removed from a suspended account.
api.postStats({
serverCount: 28199,
shardCount: 1
}).then(() => {
console.log("boo")
}).catch(console.error)
is this a package you made that's basically the master build with the updated domain in it?
aka is the only reason there isn't a full library update yet because you don't have permissions to the github?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I think I'll probably wait it out myself, 132k servers vs 136k won't affect peoples view of my bot that much lol
at any rate, thanks for working on it - I'm glad it's being fixed/already fixed if you change the url
hey
i’m putting my token in and i keep getting this
Your token is invalid, generate a new one, refresh the page, then copy the new token
i am
it may seem like the old one at first, but the first part of the token is the same on your bot
it fixed
do you guys think the api will be able to stay up for 2 days in a row without giving a 503?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
how can i see when can i vote again?
new Date(lastVote + 12*60*60*1000)
tnx


