#topgg-api
1 messages ยท Page 6 of 1
webhooks are like a website, they use the internet the same exact way you do when you go to any website.
except they are intended for program to program communication not program to user.
The webhooks in that library essentially make a webserver that listens to requests from Topgg and it then fires an event.
Topgg sends the webhook to the url you put on your bot/server edit page in the webhook section.
the route is the thing that goes at the end of the url
so, https://1.1.1.1:port/ROUTE
is that just some kind of example? a placeholder?
there shouldnt be one there ๐ค
I dont, I think it might just have been something I tried in the past and forgot about
in any case at least I know it useless
The url youll use will depend on a few factors, such as your host, if you plan on using a domain, etc.
So for the code thats given from that link I sent is that all thats required? or do I need to actually own a domain or something
itll depend on your specific conditions.
if you have a vps with a public IP, you would use something like this.
http://VPSIPHERE:PORTHERE/ROUTEHERE
Ah I see my bot is hosted on a vps but I was just trying to get to work locally to test it
locally takes a bit more work, local testing requires your router to be configured properly.
as well as any local firewalls or anything
Ive disabled my firewall but the router doesnt actually belong to me as it comes with my rent
so I guess I need to test this all from a vps
So for the code itself again referencing the link I sent what exactly do I need to specify?
And where
like what do you need to do code wise?
The link you sent was the source code of the library, not an example.
just a note, the code written in that example was for the old discord py version.
The new one will need you to place the async stuff in an async context iirc.
I'm not a python dev, I just know the absolute basics.
right
Yeah I think for the time being im going to give up trying to make webhooks work
Although I think I can make use of your webhook system
actually nvm id need message content
Without getting ratelimited how do I know that an user (message author) has voted or not?
[ Ima do it everytime a premium cmd gets executed. ]
It gets ratelimited in just 5-6 mins.
Please @me while helping
use webhooks
More specifically, store the user ID and timestamp when someone votes, and check that database to confirm if they have voted.
How exactly votes work, does votes from users get removed after 12 hours?
if not when does it gets reset?
When does their vote state get removed?
you just replied to the answer
exactly
hope thankfully youre no longer a mod here
lmao
idk why the <IEntity> list still contains voters after 12 hours
since im not using webhooks i was just restricting users to not use vote command and check for votes after 12 hours, but for smr the votes are still there after 12 hours
and bot just keep sending them rewards instead of telling them to vote 
best to use https://docs.top.gg/api/bot/#individual-user-vote if you don't want to use webhooks
Thanks, this seems reliable
well, you need to use webhooks to actively know when a user can vote again, aswell as when a user has initially voted
this, will provide ALL votes that were made by users, iirc it does not respect the times when a user can vote again
your only go-to is webhooks
I can just set a timer when user send vote command again to claim rewards
sure that can work, but that will not work reliably
as the user can just say "yes I voted 11 hours ago, gonna use the command now" then you'll have people in your support asking why they cant claim
How do i use webhooks
i can say regardless of what time you vote, you can only claim rewards every 12 hours lel
what 
but i think there should be a field which shows at which specific time the user has last voted
that endpoint tells you if a user has voted in the last 12 hours
this can just take the whole webhooks out of the picture
just doesn't tell you the time
Yes i understand
i'm not talking to you i'm talking to aurel cus idk what he's saying
He said i wouldn't know for sure what time user will be able to vote again
"will provide ALL votes that were made by users" idk what this part is suppose to mean
"iirc it does not respect the times when a user can vote again" it does, if a user can vote again it'll return 0
per docs:
"gets the last 1000 votes of your bot"
it does not claim any retention duration after a vote expired
its always there, doesn't matter if the vote expired or not
i was never referring to the check endpoint
ohhh
yeah the link goes to the check endpoint, not the 1000 last one
The check endpoint one does have a pretty bad ratelimit on it.
It can work as a temporary solution for small bots but its not ideal.
Especially if you check frequently(on command usage)
yeah itโs best to use webhooks but he didnโt want to use them ๐คท
Hey, not that great with APIs and stuff, but would this work for sending over stats for top.gg
@tasks.loop(minutes=30)
async def update_stats():
await client.wait_until_ready()
async with aiohttp.ClientSession() as session:
await session.post(url = f"https://top.gg/api/bot/783790110537416705/stats", headers = {"Authorization": dbl_token}, data = {"server_count": len(client.guilds), "shard_count": client.shard_count})
print(f"SUCCESS: Bot data sent to top.gg")
In Python but cant use the library as I'm not using discord.py
I believe you're missing the content type header which may cause an error.
ah thats why
something like this then?
@tasks.loop(minutes=30)
async def update_stats():
await client.wait_until_ready()
async with aiohttp.ClientSession() as session:
await session.post(url = f"https://top.gg/api/bot/783790110537416705/stats", headers = {"Authorization": dbl_token, "Content-Type": "application/json"}, data = {"server_count": len(client.guilds), "shard_count": client.shard_count})
print(f"SUCCESS: Bot data sent to top.gg")
im not sure how it works
webhooks are like a website, they use the internet the same exact way you do when you go to any website.
except they are intended for program to program communication not program to user.
Webhooks essentially make a webserver that listens to requests from Topgg and then fires an event.
Topgg sends the webhook to the url you put on your bot/server edit page in the webhook section.
A 'webserver' comes in many forms, for example I have a computer in my house thats a 'webserver'. my vps is a webserver, replit and heroku can be webservers.
This is giving me a status 400 error, does anyone know what I'm doing wrong ๐
Found the issue! Asked chatGPT and it somehow fixed the code for me
oh ok
๐
I think we will just add chatgtp here so I dont have to look at this channel
Is there a way to grant a role to someone when they vote
Will they vote for what? Server or bot?
Server
Pre-requisites Follow through the steps toย publish your server. Once this step is done, follow the information below on how to use role rewards. What are role rewards? Role rewards are given to a user upon voting for a server. If you h...
dont have credit card
thats the problem
Otherwise aws also gives pretty good free tier
parents?
How does a webhook post request look like?
how can i have the topgg key for authorize my bot?
check the pinned messages
Don't have the webhook option
oh
Hi is the webhook down? I am not getting vote rewards any more and I did not change any codeโฆ
There is no way to get the reviews right? Is there a way to suggest such endpoint?
Is there a way to know how much time is left to vote for not again
not through the API, you have to manually track it with webhooks
If you want to do it through like a bot you could make a command with a timer on it showing when they could vote again but that might be a little complicated
https://i.imgur.com/K8nG0fg.png
https://i.imgur.com/rItzGhC.png
What am I doing wrong?
You might explain what you mean by "vs code IP address"?
I am running it locally on vs code. So ig I have to put the ip address in webhook url right?
Running it locally on your PC, will also require to open the selected port in your local firewall and to forward the port from your router to your client (your PC).
Incoming connections aren't forwarded or opened by default
It's genuinely easier to test your code on your server which may only require to open the port in the firewall (if dropped by default)
will it be easy to run it on ubuntu?
nvm got it working. thanks
Hmm alright
is it possible to get number of votes for a bot
yes, by using the bot endpoint and using the "points" and "monthlyPoints" data
any docs lik?
is api key and token same?
No
Api is safe but you must'nt share token
what
the terms are the same
now that I'm finally home and got approved on top.gg
can someone explain vote commands for d.py
oh wait
I can use webhooks
How do one search for server here?
damn
the webhook isn't getting any requests
it's the same thing I used for discordbotlist
so
thats not our content
oh?
there was a webhook place in top.gg
the auth is below that
if that's what you mean
oh
yeah it is
mb
yeah I ain't doing the webhook route
lol
ok
Just a heads up, the api has a very small ratelimit, most bots get ratelimited pretty quickly from what ive seen
I doubt I'll get upvotes like crazy
besides
it's a really really small bot rn
@jaunty plank do you know d.py? If so can you explain how to setup auth and stuff with the token and everything
I already have an idea on how to do vote commands
I just need to set it up with top.gg now
using our library you can check if someone voted, if they have run the command if they haven't don't.
https://topggpy.readthedocs.io/en/stable/api.html#topgg.DBLClient.get_user_vote
It will perform this check every time anyone runs the command
all I gotta do is make a function?
how bout this?
how do I setup this
thats used in the client of the lib
https://topggpy.readthedocs.io/en/stable/api.html#client
and what's the lib name to install and import ๐
the guild count updates on top.gg automatically right?
there's no reason for me to add a whole loop for it
I think
Youll need to enable autopost
bot.topggpy = topgg.DBLClient(bot, dbl_token, autopost=True, post_shard_count=True)
ok so
theoretically
@client.event
async def get_user_vote(user_id: int):
votedb.votes.insert_one(
{
"user_id": user_id,
"voted": "true",
"vote_time": datetime.datetime.now()
}
)
would this work
cause I don't really understannd the
dfunction
tbh
is the function called once the user votes
oh
yeah I gotta change it wait
its not an event, its a function.
Webhooks provide an event for you if thats what you want
oh I was looking for on_dbl_vote lol
I got the wrong one
thats for webhooks
yep, the webhook manager fires an event on the bot
https://topggpy.readthedocs.io/en/stable/webhooks.html#webhookmanager:~:text=The Client object that will be utilized by this managerโs webhook(s) to emit events.
our py docs kinda suck ๐
We have very few py devs tbh
I'm not even a py dev, I use js.
I just have learned enough to help people
Traceback (most recent call last):
File "/home/container/.local/lib/python3.9/site-packages/topgg/client.py", line 151, in _auto_post
await self.post_guild_count(
File "/home/container/.local/lib/python3.9/site-packages/topgg/client.py", line 212, in post_guild_count
await self.http.post_guild_count(guild_count, shard_count, shard_id)
File "/home/container/.local/lib/python3.9/site-packages/topgg/http.py", line 192, in post_guild_count
await self.request("POST", "/bots/stats", json=payload)
File "/home/container/.local/lib/python3.9/site-packages/topgg/http.py", line 165, in request
raise errors.Unauthorized(resp, data)
topgg.errors.Unauthorized: Unauthorized (status code: 401)
โ ๏ธ
did I
piss off
the top.gg admins
Did you use your topgg token?
If you did and you got this error regen the token then refresh the page before copying it
since i need someone to vote the bot to actually test if my bot works, i need a thing that simulates a user that votes the bot
If you were listening to the bot votes via Top.gg webhooks, it has a button called "Test" which you can test the webhook with, which'll send fake/test payload to your webhook to test it
Other than that an actual user would have to vote to test it out
Your webhook URL is most likely invalid
i just generated
What is it? (Strip out any IP addresses in the URL if any when showing it)
so it works
but I'm wondering
how do I make an event for when someone votes
cause I want it to dm them
is there an event for that or
That's what webhooks are for
al;right
holy shit
I found a site that saved my ass
so much time
so much
so so much
๐
nice ๐
hey i am getting error as "invalid token provided" when i try to get data from dblstatistics
Thats related to them, reach out to their support
Dblstatistics is not made by top.gg
Is it possible to get the ID of the owner of a bot x with the ID of bot x?
If the bot is not on a team, yes
Using the bot endpoint
If the bot is on a team, the owners array in the response will be empty
Some bot developers are having an issue with your site I think, and it's causing the bot to have issues, which then causes me to have issues down the line. After speaking at length with the devs, they said they've done all they can to fix to problem and that it's a Top.gg API issue and told me to report here. Basically, there's this bot, Flexo Music, that is giving me an issue. There is a certain button command that is locked behind a premium service, however you can also access this command by voting for the bot on the website. After voting for the bot, I was still not able to have access to the command, and continued to get the same message about how I needed to either vote for the bot or subscribe to the premium service to use it. I submitted a ticket and spoke at length with the developers, who are now saying it's an issue with Top.gg after trying to fix it themselves for a while. I was given little information on what the problem actually is internally, but it might have something to do with the bot for some reason not recognizing my vote despite both top.gg and an entirely separate bot knowing that I did. I'm still in contact with the devs if you want me to ask them anything, and any additional info that you guys need I'll do my best to provide.
Alrighty, I'll tell them you said this and we'll see what their response is. Hopefully we can get this fixed.
Actually they might be here in the server, so if they can just message here so I'm not the middleman that would be cool.
they can also try to reach out to this channel for debugging
Cool, I'll try to suggest that, since I know little about the code behind all of this stuff.
i'm just a guy
They appear to have gone offline, but hopefully they're back soon so we can sort this out.
P
@rain heart You around? I think they may be online now and might reach out for help here for help with debugging.
not sure what debugging needs to be done, it will be something on their side
top.gg even retries the vote webhook if it fails their end
Yeah, but they disagree, so there's some disconnect there and I kinda can't be the middleman for it because I don't speak bot coder.
That's why I'm trying to get a conversation going. I'd ping their name but I'm having trouble getting it with how their tag is.
If they want to join here and discuss it they can, might be easier for you
You could copy their ID
I tried but it has a space in it right near the start so it messes up when I'm typing out the ping lol
Ah
It doesn't look like Aurel is here anyway, which I kinda predicated would happen.
It's gonna be one of those days I guess
Lol
this
its 110% an issue their end
Yes, I think they're already in the server. I'm trying to get both of you here at the same time so there can be a conversation.
if they just state the issue they have, we can respond when we see it
otherwise we wont get anywhere
I'm not saying I don't believe you, I'm just saying that that's something that you guys might have to tell them yourselves because they're telling me it's not.
alr
Yeah idk, when they pop on no one is here, but when you guys pop on they're gone again.
A little frustrating but we'll get through it
okay they're apparently going to sleep now

And by the time they wake up tomorrow the situation might be different since the voting thing is on a timer.
This is very frustrating, but that you guys for listening and bearing with me.
I may or may not be here again soon.
def good indicator of them not caring about their users but yeah ignoring the sleep part
The bot itself is honestly not bad and has a lot of potential, but there appear to be some issues that need sanding out, from my experience, and that's where the trouble is starting.
Thanks again for being very supportive in this though ๐
this channel is for developerss to reach out to us, our docs(which the need to use to do what they are doing) clearly states||https://docs.top.gg/#getting-help|| they need to reach out to us here if any issues occur.
We don't really reach out to devs, they need to reach out to us. You've done everything you can, its up to them to reach out to us now.
I know, I know. I wasn't trying to get you guys to reach out to them. In that message I meant like when they were already here and talking about it with you guys, you guys would have to tell them that yourselves. I wasn't trying to imply that you guys have to try to pull their attention yourselves or anything.
Does the response in https://top.gg/api/bots/:bot_id/check endpoint return a boolean value (0 or 1) of whether the user has voted in the last 12 hours or if the user has ever voted for the bot, or how many times the user has voted?
! Menuka Abhiman !#4767
thats not an ID lmao
Bro I don't know, what other than that is the ID?
He meant a numerical ID unique to each account
320994717334503436
This is your ID
You need to enable developer mode in discord settings and then right click on someone and select "copy id"
It's in the "advanced" tab
Where can I find my topgg token ?
It should be in the "webhooks" tab
But apparently it's only available for bots
That would make sense 
Do I have to post my bot's server to topgg api ? If yes , can y'all tell me how
I mean cant find the api docs for this specific thing
Cuz I want my bot's servers to be shown
Oh great, just a request to post method lovely
Hi, is there anyway to get when the user voted?
theres not, you can track that yourself using webhooks
Where to find the /vote listener codes ??
const Topgg = require("@top-gg/sdk");
const express = require("express");
const app = express();
const webhook = new Topgg.Webhook("hula!");
app.get("/", (req, res) => {
console.log(req.body); // Call your action on the request here
res.status(200).end(); // Responding is important
});
app.post(
"/dblwebhook",
webhook.listener((vote) => {
console.log(vote);
}
};
app.listen(3000, () => console.log(`รฐลธลกโฌ Server running on port 3000`));
console.log("Ready!");
});```
would anyone know by any chance why my voting system doesn't work?
It just doesn't fire at all even when i vote
I am trying to catch server votes btw
all the api documentation is just about votes...
have you set your webhook url on top.gg aswell?
is it publicly accessible? (not localhost/127.0.0.1, a publicly accessible url)
just wanna ask are we able to extract how many votes a person has voted via webhook?
you can track that yourself through incoming webhook requests
basically i have to count by myself
yes
Let me find it one sec
Yes Iโve put it to my vps ip:port
ensure that url is publicly accessible
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("your webhook auth")
app.post("/dblwebhook", webhook.listener(vote => {
// vote will be your vote object, e.g
console.log(vote.user) // 395526710101278721 < user who voted\
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))
app.listen(80)```
Does anyone know why I get the github code from top.gg I test it and it doesn't work?
And I already put my information on the website in the webhook
is the url publicly accessible (aka not localhost, but a url you can just open in your browser)
Yes I put the IP of my hosting
have you tried accessing the URL on your browser?
if so, what do you get in response?
As well?
But I try to enter the URL of my hosting nothing happens
then your url is not publicly accessible, wait for someone who can help you with that
So would it be a hosting error?
its either your setup being wrong (code-wise) or your networking being wrong (no portforwarded, port being used already, firewall)
try pinging the url and see what happens
are there any discord.py 2.0 examples?
Nope, but its pretty simple to figure out.
alright so, I am trying to get the user with djs but I am getting the error "cache is undefined" what am I doing wrong here?
https://srcb.in/HQ9PblvT2s
Are you sure the error is cache is undefined?
Can you copy paste the error?
it was because I didn't put the code where I initialize the client
wsg zariel
Not a chat channel
import topgg
# This example uses topggpy's webhook system.
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
# The port must be a number between 1024 and 49151.
bot.topgg_webhook.run(5000) # this method can be awaited as well
@bot.event
async def on_dbl_vote(data):
print(data)
Does anyone know why code from docs doesn't work?
Traceback (most recent call last):
File "/home/ubuntu/arranebot/main.py", line 18, in <module>
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
NameError: name 'bot' is not defined
thanks
# This example uses topggpy's webhook system.
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
# The port must be a number between 1024 and 49151.
bot.topgg_webhook.run(5000) # this method can be awaited as well
@bot.event
async def on_dbl_vote(data):
print(data)```
I am getting same error.
nah
even better
just add it
as:
@bot.event
async def on_ready():
bot.topgg = topgg.WebhookManager ...etc
Yep, any async context will do.
Discordpy reccomends using setup hook(I think on_ready can fire multiple times, which can cause issues)
I want a code when someone vote the bot the bot send msg to a channel v14 js
topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")```
What do I put under `"/dblwebhook"` and `"password"`?
/dblwebhook is the path for your url
password is the authorization, you are the one who decides it.
Wait url to what?
do I need to set up a flask server or something?
your webhook url
Wait is this the channel URL WITHIN discord?
nope
This thing
*not channel url
webhook channel url
is that right?
nope, topgg webhooks are not discord webhooks.
The url is the url to your webhook server(which the library creates)
If the library creates it, how do I access it?
๐ I dont know what you mean. like send a request to it?
Where do I get the url in the first place
do I need something external
to the webhook server
In the webhook url field
its just an http server, so you don't really need to access it.
the webhook url will depend on your host
So I don't need to worry about it?
Oh phew. How do I reset it? Every time I try to delete it, it says I need a valid web address
Ah ok
It just randomly installed discord.py and messed up my libs when installing topggpy via pip
I use pycord
that's probably why
This would've been so much easier if it was a webhook
tysm for your help and patience!
it is a webhook, just not a discord webhook
I mean api*
I'm scatter brained today
sorry
apis dont provide events like webhooks do
We do provide an api endpoint for checking if someone has voted in the past 12 hours
let url = `https://top.gg/api/bots/stats`;
let post = await axios.post(url, {
body: JSON.stringify({
server_count: totalguild,
shard_count: client.cluster.info.TOTAL_SHARDS,
}),
headers: {
"Content-Type": "application/json",
"Authorization": `${client.config.topg}`,
},
});
console.log(post)```
this always gives me unzutharized
but i put the correct token
@jaunty plank sorry for ping but can you help me
is it not possible to just make it so it does not install discord.py and works independently for other libs ?
the topggpy just installs discord.py and then it messes with rest of the code. which then inturn if used with other libraries, stop working. and it won't even send any errors (incase of me, its clearly not working at all and is basically not even throwing any kind of errors).
Nvm. I found my answer. its just i had to pass --no-deps parameter while installing
my vote webhook doesnt work, the url is http://<host server ip adress>:8087/dblwebhook and when i run the bot it says the webhook is running but it doesnt log when i vote
the code is
app.post('/dblwebhook', dblWebhook.listener(vote => {
console.log(`User voted on Top.gg! (id: ${vote.user})`);
client.voteCooldown.set(vote.user, true);
}));
app.listen(8087, () => {
console.log('Top.gg vote webhook is listening on port 8087!');
});
have you ensured your url is publicly accessible and is not a localhost ip address for example
i set the url on top.gg i dont know what authorization means
im using pebblehost and i set up the url using the additional ports menu
refer to " Webhook server" on https://www.npmjs.com/package/@top-gg/sdk
Official Top.gg Node SDK. Latest version: 3.1.3, last published: a year ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 9 other projects in the npm registry using @top-gg/sdk.
oh i see
try accessing the url on your browser yourself
if you arent able to, then top.gg wont be either
tysm this works
I am trying to use topgg webhooks for my bot however, when I open this link, I get 404. (tho i copied the exact example as shown in topggpy's pypi page).
Can I know what I am doing wrong ?
And when I run it on a hosting service, i get 405- Method not allowed on browser.
The second one is correct, as you cant make a get request
However, inspite of that, I am not able to receive anything from the library. And I assume that its because I use py-cord and that library is meant for discord.py only.
Yes,i did.
Does anyone know why it returns this instead of the right IP?
it always says 0.0.0.0, its hardcoded.
hm
yes
Itโs a server error which means itโs on top.ggs end
this is probably wrongly displayed
but 0.0.0.0 means any connection
it could also be 127.0.0.1 or localhost, meaning that is only bounds to localhost, which means that your webhook can only be reached out through localhost
as long as its 0.0.0.0 it should be aight
Why is it saying Cannot find reference in topgg.py ?
oh wait, is topgg api only working with the discord.py lib ?
๐ this doesnt look like topggpy
afaik the topggpy lib only works with discord.py
The api though(without the library) can work with anything.
https://docs.top.gg/api/@reference/
ok thx
I tried a different thing now, but I if I send a test to the webhook url I don't get any response. Here is my Code to https://pastebin.com/tMQ3RjNU
Also if I connect to the url via the browser, it says 405 Method Not Allowed
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I don't know what I am doing wrong :(
im using the topgg python sdk, and code that used to work suddenly doesnt.
the code (almost verbatim from the examples found here: https://docs.top.gg/libraries/python/)
@bot.event
async def on_connect():
bot.topggpy = topgg.DBLClient(bot, topggToken)
update_stats.start()
@tasks.loop(seconds=60)
async def update_stats():
"""This function runs every 30 minutes to automatically update your server count."""
try:
await bot.topggpy.post_guild_count()
print(f"Posted server count ({bot.topggpy.guild_count})")
except Exception as e:
print(f"Failed to post server count\n{e.__class__.__name__}: {e}")
result:
Ignoring exception in on_connect
Traceback (most recent call last):
File "C:\Users\***\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 377, in _run_event
await coro(*args, **kwargs)
File "C:\Users\poppy\python\egirl\main.py", line 45, in on_connect
bot.topggpy = topgg.DBLClient(bot, topggToken)
TypeError: __init__() takes 2 positional arguments but 3 were given
again, this code used to run normally and post the server count, so im not sure what changed.
is this a valid solution? @river socket
yeah, that fixed it! thank you so much
How do I get the API token?
After your bot is accepted
Okay. Thanks
Why isn't the bot's icon visible on the page
https://akai.needs.rest/jPmbT.png
sorry, im not sure where should i ask this haha
also refresh data didnt help.
refresh token than refresh data,
Didn't update the logo 
Not sure what that has to do with the token
Have you pressed edit then save after refreshing data?
yea
also, server count is not showing up but the task worked fine
https://akai.needs.rest/81WG8.png
Nvm the website kinda slow
Now it is showing logo as well as server count
lol
can someone help me with setting up a counter of how many servers my bot is in on the top.gg website?
ig its somewhere in the docs but I just can't find it
I searched "servers" and didn't find anything I think
why do i receive multiple post requests
because youre not sending 200 http code
Hello.. Can someone tell me how can I receive messages like this when someone vote my server?
(from webhook)
but is it for server?
welp i meant by sending a custom message
router.post("/topgg_votes", (req, res) => {
if (req.get("Authorization") !== "AUTHORIZATIONKEY") return;
let vote = req.body
client.channels.cache.get("votechannelid").send({
embeds: [new EmbedBuilder()
.setTitle("New Vote")
.setColor(resolveColor("#FFFFFF"))
.setDescription(`<@${vote.user}> (${vote.user}) just voted to <@${vote.bot}> on top.gg`)
.setThumbnail(client.users.cache.get(vote.user)?.displayAvatarURL())]
})
res.sendStatus(200)
})``` i dont know what you mean but just add this to your express router and it works
https://burak.go-get-a.life/5URqdsZSw.png dont forget this
hm... i don't knew javascript... can't it be done with python?
hm
If you just need a message then you can use this site 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.
It's worth reading pinned messages
hello, I get this error when trying to autopost the guild count
Traceback (most recent call last):
File "/home/Claude/venv/lib/python3.11/site-packages/topgg/client.py", line 151, in _auto_post
await self.post_guild_count(
File "/home/Claude/venv/lib/python3.11/site-packages/topgg/client.py", line 212, in post_guild_count
await self.http.post_guild_count(guild_count, shard_count, shard_id)
File "/home/Claude/venv/lib/python3.11/site-packages/topgg/http.py", line 192, in post_guild_count
await self.request("POST", "/bots/stats", json=payload)
File "/home/Claude/venv/lib/python3.11/site-packages/topgg/http.py", line 165, in request
raise errors.Unauthorized(resp, data)
topgg.errors.Unauthorized: Unauthorized (status code: 401)
but only sometimes
this error shows up
How do i setup the vote logger thing?
Read pinned messages
Oh thx
The token you have provided is invalid
Go to your webhook settings, press regenerate, reload the website and use the one that is noe displayed
ok thx
guys can anyone help me in making a vote to use cmd interaction
its is showing error to define client
what definition should i give
@steady sand
Yes
You can directly use .setURL i guess
please learn how to code/how to read docs
Use this:
.setTitle("title")
.setURL("url")```
but what is the problem here
did i ask u man
Pls don't be rude
you only try it and see. it will send something like this -> [VOTE NOW](your url)
ok sry
And if you need help except top.gg api then head over to #development , I'll help you out there

hmm, interesting. Well, guess I'll just not implement it yet
you have an approved bot though no?
yeah but its about another bot
specifically this feature and some other commands that I'll make voter only
as long as you're not asking users to vote for another bot to get access to something, its fine
Punishing Users for Not Voting Products listed on our site should not punish users who have not voted for their bot, they can do this by restricting a large majority of their features or completely blocking them off from using the bot. We want t...
hm wait, so I can use my approved bot's token for testing?
I'm taking a fair guess, but if its for testing on yourself, not on other bot users, yeah its probably fine
sure, thanks
https://docs.top.gg/api/bot/
https://top.gg/api/bots/:bot_id/votes
Not sure if it's just the user has voted at some point or if its during the last 12 hour period
The past 12 hours
What do you mean
Thankyou man u made my day
Hi! I'm trying to set up a vote webhook to my server via an IP address - is there any specific way you have to format it?
My url is http://IPHERE:8080/topggvote (IPHERE being the real IP)
It receives post requests when I use cURL but test votes aren't working
const app = express();
const webhook = new Topgg.Webhook(process.env.BOTAUTH);
app.post(
"/dblwebhook",
webhook.listener(vote => {
console.log(vote);
})
);
app.listen(3000, () => {
console.log(`Webhook server online at 3000`);
});
Currently I'm trying to setup a webhook to detect the votes. However, I don't receive any logging in the console. I'm doing this on a VPS without a firewall according to my knowledge which is why I put http://[insertIP]:3000/dblwebhook in the Webhook URL input on the website
Does anyone know why I don't get any response from the webhook? Thanks! (I don't even receive the bottom Webhook server online at 3000 log)
hey, are you testing on a local machine?
๐ it sounds like something else is going on if that log isnt happening.
Are you sure this file is actually being used? ie if you just put a console log somewhere(outside of an event) does it log?
I tried logging webhook underneath its declaration but it doesn't log... Does that indicate the code doesn't run?
but conveniently my client.login is underneath this code block and my bot is running perfectly fine
yeah, none of that code is being ran if it doesnt log anything.
thats strange ๐
Yeah
try just logging "test"
Where
Wdym correct
my bad its 10 am i didnt read that you put the port as 3000 lol
1 sec im gonna look at what my webhook is
Nothing logs... ๐ค
const app = express();
const webhook = new Topgg.Webhook(process.env.BOTTOKEN);
console.log("Hi");
app.post(
lemme try something like this
have you tried navigating to just the ip and port
Nope nothing logs...

Wdym
With just a browser?
have you done js const express = require("express")
Yup
are you sure? in the code you sent it doesn't use that 
Yeah it's just on the top of my file
ah ok
Or do I need a separate file for all of this code?
try visiting the IP:PORT in your browser
noope
it should show this when you visit it
I can't connect to this...
wait nothing logs when you just run the file and log hi on startup?
that means the server is not running
that means the file itself isnt running lol
does it log Webhook server online at 3000 ?
What's strange is that my client.login is right under the code block and my bot runs just fine so I doubt that's where something went wrong
try doing
Port forwarded correctly?
not the issue
app.listen(3000, () => {
console.log(`Webhook server online at 3000`);
client.login(`token`)
});```
too many people trying to give help, so its just everyone going in circles.
i'm going based off the fact the bot is running just fine but the server isn't starting 
But my bot is running on the same server
thats what i mean
does it log Webhook server online at 3000 at all?
based on your that should be logging when the server starts
Nope
could you try this?
No the only thing I'm running is my bot and I've never messed around with the ports...

top.gg uses markup, so you can use html tags for images
but also #support yea
One idea, try moving the code somewhere else, like below client.login() since you know thats running.
Ok I'll try that out
Nothing changed...
What I've found out is that other things that I log doesn't seem to show up other than some logs I did before starting to work on the server
I'll try to go through whether something went wrong when I am pushing stuff to my VPS or smth to work it out
๐ yeah, possibly an issue unrelated to express or webhooks.
I wouldnt have a clue how to help there sorry 
Thanks for the help regardless!
I tested it locally and it worked, then moved to a server and it didn't
okkk..... if i try to do the webhook in python.
File "/Users/simomac/Documents/discord-bot/fishy.py", line 1781, in <module>
bot.topggpy = topgg.DBLClient(bot, dbl_token, autopost=True, post_shard_count=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/topgg/client.py", line 98, in __init__
self.http = HTTPClient(token, loop=self.loop, session=kwargs.get("session"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/topgg/http.py", line 84, in __init__
self.session = kwargs.get("session") or aiohttp.ClientSession(loop=self.loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 228, in __init__
loop = get_running_loop(loop)
^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/helpers.py", line 288, in get_running_loop
if not loop.is_running():
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 108, in __getattr__
raise AttributeError(msg)
AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook
so i think i have to await it, but awaiting dont work outside functions
That error means it needs to be in an async context, such as in an async function, or setup_hook
When someone vote for my bot, how much time before the api set the value for the user from 0 to 1?
instant probably, maybe 30 minutes depending on cache
just use webhooks
or that yes
Is there any repo showcasing how exactly we can track votes on server/bot and reward using topggpy?
im trying to make something like Vote Tracker#2244 bot that will track and give roles to people who voted on a specific server.
I went through topgg api and topggpy lib docs but it cant seem to help. So a basic code example or a guide would help a lot
iirc the api wrappers don't support that, you will have to track votes yourself
if you check the pinned messages, you can see how you can do it
can you link the exact message please. I cant seem to find it
this
oh thanks, make things easier
http://IP:PORT/dblwebhook
what am i doing wrong? i put my IP and my Bot and then in my bots config i have a field "webhook_link" do i use this same link above here or do i copy a webhook i created in the channel i wish for the webhook to be sent?
it should be ip:port not ip/:port
/generate
typo, but how you said is how i have it
And that URL IS publicly accessible? Such as by you opening it on your browser and it not being a local ip?
Could someone tell me how to update my server count to the top.gg website with discord.py?
Can I get info from other bots with the topgg api?
to find out who owns a bot with its ID
How do i setup a top.gg WebHook? https://docs.top.gg/resources/webhooks/ cant help me
And how can i do it like Github? When i edit my GitHub page, it will automatically send a message to a specific Channel
You need to make a publicly accessible webhook hosted from your webserver that allows github to let you know when you have edited your github page. Read githubs docs for that
i use Discord Webhook for my GitHub change log
Hi
yes, thats something discord does, discord is able to understand what data github sends. It is unable to understand anything else sent to the webhook unless its in the same format as what github sends
I really suggest you to read that link above to understand what a webhook is, aswell as reading the github docs if you're planning on making that. though #development since it doesnt have anything to do with top.gg anymore
hey! youll need to use our api https://docs.top.gg/api/bot/#post-stats
But how can you check that I'm not lying ?
If you post the wrong count its not that hard to find out, your bots in approximately 59 servers right now.
https://i.imgur.com/05UfzRW.png
If you submit that your bot is on 1000 servers, it will of course be deleted
Is there a rate limit for api requests ?
~~Hopefully someone can help me here.
My bot in the last 2 days has randomly gone offline around the same time. It's in around 200 servers. Errors do not show anything crazy, but today I did see a few disnake errors around "Interaction took more than 3 seconds to be responded to.". I assume these happened just before it started to die.
When I try to rerun to start it up it just hangs and shows nothing... yesterday after a few attempts 20mins it starts working again. I have nothing to work with here and its frustrating.
Any ideas?~~
wrong channel, seems like a #development question not one related to the topgg api
Can we get something like this? https://docs.discordbotlist.com/commands-list
Show your Discord Bot commands on discordbotlist.com
wrong server
oh nvm, nope, top.gg doesn't support something like that
Hi, I use topggpy module and I want to get if a user has voted for my bot on top.gg, I do
self.bot.topggpy = topgg.DBLClient(bot, dbl_token, autopost=False)
and after that:
print(await self.bot.topggpy.get_user_vote(interaction.user.id))
But I am forbiden:
topgg.errors.Forbidden: Forbidden (status code: 403).
Someone know why?
yes but the token work fine for my vote weebhook
and it work fine with post guild count
await self.bot.topggpy.post_guild_count(guild_count=guilds_count, shard_count=self.bot.shard_count)
webhooks do not interact with the api itself
though as already mentioned, 403 usually means your token is invalid
yes xD
but for post count it work fine
and I have reverified and is it the good token
the token is here right?
I have copied the token here and put in dbl_token variable:
Here is the headers that topggpy send when It ask to get user vote
there are the token
and It work when I do post guild count
what I do wrong?
I have reseted my bot token and now I don't have 403 error but 401
and now 403
bruh I don't understand anything
I don't now why my bot token don't work fine
oh okayyy I have found why
the stable version (1.4.0) don't work with get_user_vote
you need to update to 2.0.0a0 version
finnaly no
sometime that work, sometime no
maybe ratelimit but I don't have the 429 code error
what it means ? 504, message='Gateway Time-out', url=URL('https://top.gg/api/bots/
it happen today
Probably a problem with the site itself
yes itโs a server error
This means that the request to the API endpoint of the website "top.gg" timed out. The 504 status code indicates that the server didn't receive a timely response from an upstream server, and is usually a temporary issue.
I can't add bots to my discord
LMAO

Why is top.gg server count post giving me this error ?
Unauthorized (status code: 401)
invalid token provided
Doesn't make sense as it worked an hour ago lol
I tried searching for my issue - I get the same issue as the message I replied to, but doesn't seem like there's a solution to it yet.
I randomly get the error:
line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
line 132, in _bot_vote_handler
self.bot.dispatch("dbl_vote", BotVoteData(**data))
^^^^^^^^^^^^^^^^^^^
line 279, in __init__
super().__init__(**parse_vote_dict(kwargs))
^^^^^^^^^^^^^^^^^^^^^^^
line 19, in parse_vote_dict
query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
line 19, in <dictcomp>
query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
ValueError: not enough values to unpack (expected 2, got 1)
on votes. Votes work most of the time (~98%+) but I randomly get this error at times. I'm not sure what its caused by.
Using Python 3.11 / topggpy library
Lol
From what we gathered it was a user who had vote reminders on. It was resolved when they turned it off. Honestly have no clue why and not sure if they will fix it..
Sounds like broken query parameters on the url then
If you're referring to vote reninders on like a bot
How to get total votes of user
We dont track how many times an individual user voted, youll need to use webhooks and track how many times they have voted yourself.
as woo said, the api doesnt provide that data
๐ฅฒ
Hello, I have do this code:
# post guild count to top.gg with aiohttp
import aiohttp
import asyncio
token = "my token x)"
async def post_guild_count(guild_count):
async with aiohttp.ClientSession() as session:
async with session.post(
'https://top.gg/api/bots/893494390142697493/stats',
data={'server_count': guild_count},
headers={"Authorization": token}
) as response:
print("Status:", response.status)
print(await response.json())
asyncio.run(post_guild_count(18798))```
but sometime top.gg respond 401
and sometime 200
[jourdelune@jourdelune-OptiPlex-3050 test]$ /bin/python3.11 /home/jourdelune/Bureau/test/tmp.py
Status: 401
{'error': 'Unauthorized'}
[jourdelune@jourdelune-OptiPlex-3050 test]$ /bin/python3.11 /home/jourdelune/Bureau/test/tmp.py
Status: 200
{}
I run the same code.
and the stats are not update in top.gg: https://top.gg/bot/893494390142697493
Shows 18k on my end
Shrug
okay xD
we're not referring to vote reminders at all, just the normal vote itself using the sample code:
@commands.Cog.listener()
async def on_dbl_vote(self, data):
am referring to the error, that is the logic on parsing the query string, aka a thing provided by top.gg (for example https://top.gg/bot/botid/vote?voteReminderIdentifier=19324934839)
unsure why that error occurs though
not enough values to unpack (expected 2, got 1) could hint towards a query parameter not being completed, such as ?voteReminder but it expected ?voteReminder=19291
are you able to actively reproduce it?
I'll try and test it when I can vote
because if thats caused by this case then thats incorrectly parsed within the library
How do I update the profile picture of my bot on Top.gg up to date with the bot's Discord profile picture?
Click "refresh data" on your bot page and then click edit and save
Then just wait for it to update
Also direct such questions next time to #support
Thank you for the response. I thought it would be updated via the API like bot stats, therefore I asked here. Sorry for the inconvenience.
When I request to the api, 200 code is nice. But what is the code for rate limit?
429
i want to connect my servers custom bot with top.gg to reward ppl with currency etc when they vote. i need to add the custom bot to top gg right to get its api. but it got rejected for not having help command i dont know how this works
you can simply ignore this error, disconnections are a common thing
Where can I find an example of request get and post (with setup) ?
I dont know aiohttp, but their docs probably have examples on how to send a request, how to set the method, headers, and body if applicable.
topgg update ??
What do you mean?
server down for update ?
Could be, could be not
text probides you a unformatted string
How do I test this voting feature?
.text() = logically, text.
If you want a dict, you may want .json().
i tried the test vote thing on webhooks page, and it just keeps spamming my webserver with test votes. isnt it supposed to send it only like once?
You need to respond to the webhook with a successful status.
oh-
webhooks retry if they get no response, since they think you didnt receive them.
Some error statuses will result in a retry too.
Nope, you just need to respond to the webhook
Hey, I know I might sound dumb but I'm really new to programming. I'd appreciate if someone can explain this code to me & help me in setting it up within my bot.
For context, I'm willing to reward a user with currency & items as they drop a vote on top.gg as well as send them a dm.
Also, I'm done reading the docs and pinned messages!
import topgg
# This example uses topggpy's webhook system.
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
# The port must be a number between 1024 and 49151.
bot.topgg_webhook.run(5000) # this method can be awaited as well
@bot.event
async def on_dbl_vote(data):
"""An event that is called whenever someone votes for the bot on Top.gg."""
if data["type"] == "test":
# this is roughly equivalent to
# `return await on_dbl_test(data)` in this case
return bot.dispatch("dbl_test", data)
print(f"Received a vote:\n{data}")```
Is your question focused purely on this code, or do you not know what webhooks are/how they work too?
pretty much the second one
I know about discord webhooks and what they're used for, and I read the pinned message explaining the top.gg webhooks
Webhooks use http for you to receive requests.
Topggs servers will send an http request on the url you provide and that will fire the on_dbl_vote event containing this data https://docs.top.gg/resources/webhooks/#bot-webhooks
giving rewards will depend on your database
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")```
can you tell me what's /dblwebhook and password?
/dblwebhook is the path of the url
http://IP:port/dblwebhook
Password is a unique code you choose which topgg will send in the webhook headers, its for you(or well the library) to verify it came from topgg
you can set both to whatever you want, as long as they follow basic rules(path starts with /, password needs to be filled in on topgg)
and what's port?
also, I can extract voter's id from the data like this right?
@bot.event
async def on_dbl_vote(data):
user_id = int(data["user"])```
Port is a networking term, its a way for a server to have multiple webservers on one machine(or on one ip)
Its not too important, as long as you have no other programs listening on that port, and its publicly accessible
its set here
# The port must be a number between 1024 and 49151.
bot.topgg_webhook.run(5000) # this method can be awaited as well
oh so I can just copy paste the code without thinking much about it
looks right to me, i'm not a py dev, but looks right ๐
I didnt know discordpy uses ints for ids, interesting.
alright lastly, for the /dblwebhook and password, I can type anything here & then type the same thing inside my code? https://prnt.sc/jRCw3jIW2Ltn
yes
webhook url needs to be a url.
can you gimme an example of webhook url which is a url ๐
http://example.com/dblwebhook
The url will depend on where the code is hosted, the webhook url has to reach it.
Do Iโve to get the url from somewhere?
Its going to depend.
For example, if I'm hosting from a vps I would use http://MyVPSIP:PORT/PATH
What if Iโm hosting my bot on Visual studio code for now?
visual studio code is an ide, not a host.
using webhooks from a home computer is not recommended, but it is possible.
Youll need to configure your router to portforward the port you set in code.
The port forward will need to be configured to go to your computer.
Doing this will depend on your router, ever router has its own way of doing it.
The url will be
http://yourHomeIP:PORT/Path
The home IP will need to be the public IP that topgg can reach you at.
chatgpt suggested me that I can create a webhook from webhook.site, is that service trustable/efficient? I don't really trust chatgpt too much lol
dont rely on chatgpt lol
I've never used it, not entirely sure what it does
well I see, what's the easiest way for me to get myself a webhook url
I'm so lost atm
๐ It might help to learn about webhooks and urls.
a url in the most simplified way is just a way for a computer/server to send a request to another.
In this case, its just the url to your home router(with the router port forwarding requests), on a port and path.
Dont think about it like something you get, its something you already have.
i see
http://YOURHOMEIP:5000/dblwebhook
Replace YOURHOMEIP with your public ip, you can find this by googling "whats my ip" with all vpns and proxies turned off.
that would be the url
youll still need to port forward however
https://portforward.com/router.htm
^ can help with portforwarding on your router.
Open ports on your router with our port forwarding guides. We have guides specific to your router.
I see, what's port forwarding & what are it's uses/features?
well, its a big topic.
When a request comes in on a proper server the server is assigned an IP, that IP only goes to that server so requests know exactly where to go.
When hosting a webservice like webhooks from home your router has an IP, that IP serves all your devices at home, so your router doesn't know which one to send it to.
routers have portforwarding, all that means is it sends all incoming requests on a specific port(5000 in your case) to a specific computer on your network.
I see, that makes it clear
How do I get the IP of my VPS?
My VPS doesn't provide static IPs yet.
Can you provide the name of this site?
Hey, I used a website called make.com to create a webhook, when I'm running send test on top.gg, it's successfully determining the entry. https://prnt.sc/2NldI-Y1sRQS
However, when I placed this webhook in my code next to my password, I got some error
that path should start with /
Because that is the path, to elaborate
What the webhook option does within your code is to host a webserver that handles whatever path is set there, most commonly /dblwebhook
That is not where you paste in a webhook url
The webserver WITHIN your code is to be able to process webhook requests made to that webserver within your code
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("https://hook.eu1.make.com/hasadjhjadsadsa","abc1234")
bot.topgg_webhook.run(5000) ```
You cannot use a third party service and expect it to work directly on your code
thats not my real webhook/password but
Yes that is not correct
thats an example of what I'm putting in
That is not what its meant for
Oh, what I should be putting in there
wait isn't there a way to just do it with bot's top.gg token?
That is supposed to be a path that the webhook manager is going to setup within the webserver its going to host
So for example, /dblwebhook in there would result in the webserver setting up that path to be http://example.com/dblwebhook
oh
There is if your goal is not to use webhooks
Read the docs
lemme do that
text returns the plaintext response
.json will attempt to convert it into a dictionary right away
I suggest using .text() and parsing it yourself using json to be able to catch errors
How do I create a bit for support/help in my server
.
?
How do I send a DM to a person if he/she voted the bot
Hi
Get the user from the id provided on the vote data, check if they share a server, dm
Read the pinned messages
/bots
what do you need help with
what do you mean with "Not working"
idk what to do
please describe what you have tried and what your goal is
I want to add
How many server that my bot is in it
what i do?
read the docs, it describes how you're able to use the API within your bot to post your server stats
idk how to do
How to do to create an event who send a message when the users who vote for my bot in real time ?
For javascript
But is top.gg webhook compatible with discord bot program ?
What happen if I don't await the bot.togg.run_webhook
if you're unable to provide your own code within that bot program, you likely wont be able to use it
So it works with discord bots and discord webhooks ?
it doesnt work with discord webhooks
So top gg webhooks are for discord bots
I was confused between Discord and top.gg webhooks
Hello
TopGG webhook in basic terms, help you know when certain things are happening on your bots' page (assuming cause im new also)
I joined this server recently because the site shut down on me
Is there a rate limit with top gg webhooks? For example if more than 60 persons vote for my bot in less than 60 seconds, will I be rate limit ?
No, that's why webhooks are a good way to get votes
i wanna fetch 'reminders' of my bot and tried using voting sdk by installing it from github but facing this error
show how you are importing it into your code
voting sdk? ๐
how in the world did you find that
lol
it't not installing because it isn't a valid package
https://www.npmjs.com/package/@top-gg/sdk is the real package
Official Top.gg Node SDK. Latest version: 3.1.3, last published: a year ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 7 other projects in the npm registry using @top-gg/sdk.
its unreleased
I didnt realize we put it on our public github
Voting sdk lol
its not even an sdk ๐คท
So I need to stock the users from myself ?
You get a vote, save it to a database and do whatever you want with it
๐คท
Yeah, using npm link
theres a devsetup.md file somewhere, it doesnt include the fact it needs to be built.
but follow those steps and build it and you can use it.
Its a super simple lib, you can figure it out just by reading the code tbh.
pretty much
Api endpoint for reviews?
How To Make Users Vote Every 12hrs?
You can't force anyone to vote
You can remind them that they can vote 12 hours after their last vote
If you do that they also need a method to opt out of reminders
I found it on github of topgg
nvm i've fixed my issue
that's not what I meant exactly
Basically I want to lock a feature until they vote
They get the feature for 12hrs until they can vote again
https://docs.top.gg/api/bot/#individual-user-vote
Didn't you guys say top.gg doesn't keep track of user votes?
No? That endpoint has existed for years
So the value of the "votes" key is the total votes of that specific user?
The voted property for https://top.gg/api/bots/:bot_id/check is a Boolean value represented by an integer so 0 for hasn't voted and 1 for has voted
I agree on that point
I'll see if we can change that to make it clearer 
What's weird is the use of 1/0 and not true/false
How can we send a reminder to the user that you can vote now?
wait for 12 hrs
send user a dm
if not can vote:
dont_send()
is there any docs to learn how can i use?
thank u
me when channel description
what format is the data sent to the webhook url? json?
i think its x-www-form-urlencoded but just to be sure
json
Like where to put that
guys, why my result is undefined?
Wait so i got it but i have a doubt.
While using topgg autoposter
What should we put in that "client part" next to the topggtoken
Like should we put the client ID or something??
That is strange
Can you send me the whole script?
I will do the best I can
the error is obvious

Oh
oh and also the code is completely invalid
@brittle cape please learn js before using it
Then wait for it to be approved
have you tried reading the context
Have you tried reading the messages in the first place?
Published is not the same as approved, clarification messages exist.
Then wait for it to be approved
Meaning after you've submitted/published it, then you need to wait for it to be approved.
And yes, the message was a message for both the user having issues and the other user above.
Does anyone know if there is an issue right now with vote webhooks being called twice. My server sometimes logs 2 requests from top.gg
See #support as i already sent a video ๐ธ
thats not what I meant
