#topgg-api
1 messages · Page 11 of 1
Took me 5 seconds https://topgg.js.org/classes/api#hasVoted
Documentation for @top-gg/sdk
Hello. I have a simple question. I want to create a helper bot for another pre-existing bot. This helper bot would add features to the pre-existing bot. One such feature would be a vote reminder.
The pre-existing bot allows users to vote for the bot in Top.gg to gain certain benefits in-game.
I want to know if it is possible to check whether or not a user has voted for that pre-existing bot without me owning that bot.
Thank you.
You can't interact with the API before getting approval, so nope
After I get approval, with my own bot
If I have my own authentication token, can I use it to see others' bots' votes?
Oh
Thanks
I didn't wanna waste days waiting for an approval to be told it's useless
Is there a way to get an authentication token without registering my bot to Top.gg? I'm developing it, and kinda need to keep doing so before the "main feature" is actually available. As it stands, I can basically guarantee it won't pass review.
Not possible no
ah damn
I'm at a standstill I guess
I need the token to see if the feature works, but I need the feature to work before I get the token
I have exactly the same problem!
I might also use the pre release version, but at the moment I tried to make the HTTP POST request myself
If I make a HTTP GET request on my BOTs stats, then there i find the new server count
But the BOT page of topgg still shows the old number
Is there some time delay of the BOT overview page refreshing the server count from the API stats?
Okay the pre-release version in fact fixes the dependency problem, but I am having other difficulties using it. But the BOT ovewview page shows my new bot count now. So i think i will stick to my own solution of POST request using the request package 😄
hey i was implementing the vote listener using webhook
i deployed the code in aws lambda functions
when im using the test event the wbhook is sending the data of vote
but when i use real vote it doen't send any request to my webhook
could someone answer this
@chrome pier
please do not ping staff members whenever someone see your message they will reply to it
Hello
@restive otter keep in mind that unofficial libraries aren't covered in here and is not top.ggs responsibility if you use it
You can use it, but won't receive support for it here
im trying to use the python library and it keeps saying the port is already in use but its definitely not
future: <Task finished name='Task-2' coro=<WebhookManager._run() done, defined at /home/ubuntu/.local/lib/python3.8/site-packages/topgg/webhook.py:144> exception=OSError(98, "error while attempting to bind on address ('0.0.0.0', 4898): address already in use")>
but lsof -i :4898 says nothing
Is your bot sharded? and are you running the webhook on each shard?
not sharded
Is it possible its being run multiple times?
i dont see how, its just at the top of my code not in on_ready or anything
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
bot.topgg_webhook.run(4898)```
If you change the port do you get the same error?
is the token of the bot the api of the bot?
the api of my bot?
They try to say if bot token is a Top.GGs Api boy token
If they mean the bot token from Discord for your discord bot is the API Token for a bot listed on Top.gg
then no it is not
Quick question, how big is the import for the api approximately?
I dont understand the question.
Are you asking about the size of a specific package/library? or?
the python libary
15kb~
The download from pip is 15.6 kb
https://pypi.org/project/topggpy/#files
Unless you're referring to something other than size.
ah okay. Btw. I'm using discord4py which is similar to discord.py BUT when I run pip install topggpy, I think it also installs discord.py. Right?
I don't want discord.py, but I want the topgg-api to wirk. Do I need discord.py?
The current release depends on discord.py
Theres a pre-release linked up here which doesnt depend on discord.py iirc
:/ sad. But okay
is there a .js version of this
also on the webhook documentation it don't work
https://top.gg/bot/1137417865016918149/webhooks calls invalid
@jaunty plank
Your bot has be approved first then you can use topgg api
ah okay
Make sure your process is not running twice or more
its not
Wtf the intellisense of the topgg js lib
Can someone tell me ?
It was working on my bot, but it doesn't work on my webserver
Nevermind, I'm using now an unofficial api
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'm using webhook-topgg.com
now
I gave up on the topgg-sdk
Because it wasn't doing the quest
request*
Couldn't handle the auth verification
One message removed from a suspended account.
Thx you
Is there a way to check whether or not User 1234 has voted for Bot 1534, if I don't own Bot 1534?
I have an authentication token for my own bot, just wondering if there's any possible way to get info about another's votes
const axios = require('axios');
const botId = '1534';
const userId = '1234';
const authorizationToken = 'aXeZ3jyD3d437.TOKEN_HIDDEN';
const headers = {
'Authorization': authorizationToken
};
const url = `https://top.gg/api/bots/${botId}/check?userId=${userId}`;
axios.get(url, {
headers
})
.then(response => {
const voted = response.data.voted;
if (voted === 1) {
console.log('The user has voted for the bot!');
} else {
console.log('The user has not voted for the bot.');
}
})
.catch(error => {
console.error('Error:', error.message);
});
One message removed from a suspended account.
no
and tbh i am not sure of any use case that should allow that
only the token for the bot can get that information.
I dont think we want bot owners to give that out.
Helper bot checking for voting reminder
Many bots don't give confirmation of votage
Suggestion: Maybe creating a secondary, or tertiary authentication token with limits to what data it can access would help support the creation of helper bots, further enriching the development community.
You wouldn't want to get votes from the api for that.
Rather use webhooks to send a message when a vote is received.
Reminders would also have to be based off when the vote is received(12 hours after receiving the vote webhook).
Several services already do that, which the bot owner can paste a webhook link onto top.gg created by the service.
For example, my site webhook-topgg
A bot developer or server owner can create a discord webhook.
My service then uses that discord webhook to create a URL to webhook-topgg. that url when posted to from top.gg will send a message with the discord webhook.
Any bot could do the same without access to the bots main token. It just will require the bot owner to agree to it, and to use a webhook url your service creates for them.
More people working on these things is a good thing.
Just the things you want to do don't really need token access.
With votetracker being gone there's certainly space for more services offering what you want to do.
I may misunderstand, but why would you care who's voted for a bot you don't own?
Anyone can help me in this error ?
Hello our website is currently down check #site-status for more informations.
I post to https://top.gg/api/bots/1052574339662348328/stats with the token from the website frechly generated and copy pasted but get 401 why could that be?
generate, refresh the page, then copy that token
thats what I meant with generated
and also with the reloading?
yep
axios(`https://top.gg/api/bots/1052574339662348328/stats`, {
data: JSON.stringify({
server_count: guildsCount,
}),
method: "POST",
headers: {
Authorization: 'yes',
"Content-Type": "application/json"
}
})
thats the exact code I use at my other bots too but this one gets 401
then the token you're using is invalid
try regenerating it, then refreshing the page, then copy pasting the one you see
then see if it works
I already did it the same time when posting the snippet here
how often do I need to do it again 
cant help then

I even did it with fetch inside of the browser on the top.gg page and it drops 401
wow it was bcs of the token
I spammed generate now
10 times
now the token works
are you using js?
yes
Auto-Poster for Top.gg. Latest version: 2.0.1, last published: 2 years ago. Start using topgg-autoposter in your project by running npm i topgg-autoposter. There are 2 other projects in the npm registry using topgg-autoposter.
hell nah
it’s help fb
I wont use a package for 1 post request
it actually does 2 posts shard count, server count
Topgg not sending webhook request (fixed)
> uses axios

imagine still using third party HTTP libraries in 2023 tbh
modern node has bulit-in fetch 
You can use webhooks
I recommend this tutorial if you don't know where to start
https://youtu.be/RU-urn3bK84
In this video, we make a Top.gg server webhook that sends a message to a channel whenever someone votes for your server! To do this, we use an unofficial Top.gg tool, webhook-topgg, that helps integrate Top.gg webhooks with Discord webhooks.
Sorry for all the weird white noise! I'm not completely sure why they appeared, as they weren't there ...
ah ok, what you can do is you can set up a listener that actively checks the channel where the webhook sends the votes (names of people who voted)
and everytime theres a new user, grab the data, and then go from there (give reward to user with [id])
are you coding in python or js?
You can also use the top.gg webhook directly
https://docs.top.gg/resources/webhooks/
hi guyd
-api
This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/
If you need help with other development, please use #development.
so when using
$httpGet[https://top.gg/api/bots/bot ID/check?userId=user ID]
0 = haven't voted
1 = voted?
or it counts all votes
Just checking if user has voted
in the past 12 hours right?
Yeah i think so
Thanks
You are welcome
-api
One message removed from a suspended account.
☠️
Xiub
-api
This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/
If you need help with other development, please use #development.
hello i need help with api so i wanna setup topgg api if someone vote for bot
but idk where to start
https://docs.top.gg is the point to start then
https://top.gg/api/bots/:bot_id/check does it return total month votes or like todays vote?
that returns 1 or 0 depending on if the user has voted in the last 12 hours or not
ah i see
-api
This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/
If you need help with other development, please use #development.

is there a way to check for servers too?
top.gg/servers doesn't have an api, only webhooks
ah i see
what are /dblwebhook and password>?
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
/dblwebhook is the path of the webserver and password the Authorization header
so for example http://website.com/dblwebhook
ah i see
@untold sparrow
keep to the topic of the channel please
use #memes-and-media for misc links
I am trying to use the webhooks to send vote events to my website to handle user rewards for voting etc. But I cannot get it to work, what does the auth send as, in testing my endpoint I cannot figure out what auth type to send the key as.
As the Authorization header has the docs state too
Just as a normal string, no bearer, no nothing
What do you mean with "get API"
Does anyone know why the guild count is not updated in the code from https://docs.top.gg/libraries/python/
Can some1 help me?
Ping?
I can give you some info to get more info in return
- provide more details
- explain what you're doing and what your approach was
Your messages don't help at all
I use docker to host my bot. Which ip do i have to put in on top.gg
- Do you have a web server in your bot's process yet?
- Expose the port on docker
- Configure your firewall to port forward that port to the internet
- If you want to use a domain, point an A record to that public IP in your domain's DNS settings
- Enter the URL (e.g.
http://1.1.1.1:3000/api/vote) on top.gg
Hi, I was trying to post a review about a server
But when I clicked on "Post review" nothing happened
So can somebody help me with it?
Sorry I don't know if it's the correct channel for my query
You should probably ask about this in #support instead
Oh okay thanks a bunch!
hello
how can i change page of my bot
what more thing's that i can use
to make it more attractive
?
thanks, worked
i know this is a very weird question...but is there a way that you can "unvote" me?
i need to check if my interval check works
since when can webhooks execute commands?
ik
i wanted to make a cmd that have an embed that changes when the user voted
nvm problem solved
keep in mind that what you're doing with the setInterval there, could hit ratelimits
just warning you beforehand
yes
its every 5 sec
and my bot is not very popular

it keeps saying that the port is already in use when i try use the pytohn library
i made an entirely new bot and tried to use it and it worked, but putting it in my normal bot in exactly the same way doesnt work
im not hosting anything else on the same port and its only being ran once so idk why it doesnt work on my normal bot?
one of my users are complaining that they arent able to access the voting perks of my bot
they claimed that they voted roughly 15 minutes ago, which the last vote recorded by my bot was done around 46 minutes ago
user id: 703573067707842590
bot page: https://top.gg/bot/886196406761693204/vote
vote api endpoint: https://top.gg/api/bots/886196406761693204/check?userId=703573067707842590 (responds with 0 i.e. false)
Spice up your Discord experience with our diverse range of Discord Bots and Servers as well as other spaces to discover DAOs.
have them try again, do they get the "you've already voted" error message?
how do i make system like when someone votes my bot on top.gg and if that user is in my support server then the user will get voter role for 12 hrs
i am using javascript
the guilds counter in top.gg still doesn't work for me inside the python code
I saw some codes on the web but they are for java
You need an approved bot on top.gg to obtain an API token
I don't see any approved bots from you
# 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.
what is that /dblwebhook
another webhoookk?
That's the path the Webserver will serve the webhook
So for example https://example.com/dblwebhook
i don t recieve any console log when test voting ```const webhook = new Topgg.Webhook('my auth');
app.use(express.json());
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
try {
const ui = req.vote.user;
console.log(ui);
res.sendStatus(200);
} catch (error) {
console.error(error);
res.sendStatus(500);
}
});
app.listen(8000, () => {
console.log('Server listening on Port 8000');
});
or thisconst wh = new Webhook('my auth
')
app.post("/webhook", wh.listener((vote) => {
console.log(vote.user); // => 395526710101278721
}));```
Did you fill out the webhook url and auth on the site?
yes
it sends the vote message in guild when vote tested but the code dosen t register the actual vote
if I put localhost url there does it work?
I need something to test
If you need to test locally you'll need something locally on your computer to test with.
Curl or postman are two I frequently use.
yeah I just did it
it works perfectly now
Hey, I currently have something along the lines of
this.app.post(
'<someURL>',
webhook.listener(async (vote) => {
await this.handleVote(vote)
})
)
This works just fine webhook is Ofc a new Webhook with an authentication string. How would I go about making this dynamic rather then hard coded? For example getting a guild Id, and if the auth string matches what I have saved in a db
Do you mind dropping a link?
hi could you help me do it too
It’s empty…
I log vote inside of my handleVote function
Just read the docs, it tells everything
ok but what are you doing with the query?
I want the authorisation string lol
If you don't provide anything, yes it is
But what do you want to do with the authorization string
idc about revealing it but i did
You can make your life more easier using queries
ok, so this is empty, yet when I log req.headers['authorisation'] it logs the correct auth string
Is that intended?
To get this, when someone votes
For what reason though
Sometime in the future I want to implement a top.gg voting bot, and I wouldn’t want random people sending post requests through my website
So I’d need to check if the auth string matches the guild id which’ll all be in my db
Then that won't be possible with the Library
It’s in the headers, the listener has 3 params right? vote, request, response. I just used the request.headers
Oh no, since you need to put the auth into the thingy
Ah that’s fine I’ll just try code my own lol
Someone teach me how to make a custom widget for my bot please?
Widget? What do you mean
Nevermind, just tell me what is the api that shows the bot's total votes?
@rough crater help me with this please
You don't have to
File "bot.py", line 42, in <module>
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
TypeError: __init__() takes 1 positional argument but 2 were given``` i cant find any docs for v2.0.0a that work
Is this service made with python?
I don't know how to do it in bdscript, does anyone know?
Depends on what are you even trying to do
You can't set up webhook in bdscript, that's for sure
I'm trying to return the amount of votes from the bot, do you know how to do it?
Wait I can just update the server count to anything? 🤔
Yes, you can
But if you gonna put something that's not true
You can guess what's gonna happen
Yeah I won't obviously
But still kinda weird
Is there no way you can figure out from discord in how many servers a bot is?
Without breaking ToS? No
yes, it tells you on your bot page on https://discord.com/developers
I mean, I know that
I meant, for top.gg in order to update the listings instead of having users do it manually and check for abuse
But if they could, they probably would so
sadge
Ok it updated, just took a awhile
I will probably just update it automatically in my bot once every day or something
One message removed from a suspended account.
One message removed from a suspended account.
Yeah it doesn't need to be like 100% accurate, already pretty cool it is possible at all
- only in 40 servers now
How do I get my bot's api key?
Or weebhooks
check the pinned messages for the api token
Hello,
I have a question about the webhooks.
I have hosted my bot on my own home-server, an I want to add rewards for voting but i don't know how to send a webhook to my home-server.
I have already read everything but I didn't find anything.
Can someone help me?
Hello
learn about port forwarding
you can't use localhost for that
Ok
What's the recommended time interval of refreshing bot stats?
also I get this issues
TopGGAPIError: 504 Gateway Timeout
at Api._request (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:61:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Api.postStats (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:86:9) {
response: {
statusCode: 504,
headers: {
date: 'Wed, 23 Aug 2023 20:09:22 GMT',
'content-type': 'text/html',
'content-length': '167',
connection: 'keep-alive',
'set-cookie': [Array],
'cache-control': 'private',
'cf-cache-status': 'DYNAMIC',
'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
'x-content-type-options': 'nosniff',
server: 'cloudflare',
'cf-ray': '7fb5fcb3bebe4237-EWR',
'alt-svc': 'h3=":443"; ma=86400'
},
trailers: {},
opaque: null,
body: BodyReadable {
_readableState: [ReadableState],
_read: [Function: bound resume],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
[Symbol(kCapture)]: false,
[Symbol(abort)]: [Function (anonymous)],
[Symbol(kConsume)]: [Object],
[Symbol(kBody)]: null,
[Symbol(kContentType)]: 'text/html',
[Symbol(kReading)]: false
},
context: undefined
}
}
what's the reason
also on "error" event, is there any way to manually post bot stats
that’s means topgg api is down
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.
Exactly ^
One message removed from a suspended account.
Probably should be a bit more appropriate if you don't mind editing it ^-^
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Yeah that's fine
Ik but I thought I got rate limited or somewhat
because I refresh every 10 minutes ig
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.
so what about adding the autoposter on the guildCreate and guildRemove events
that will ensure that autoposter will only work when a server adds the bot or removes 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.
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.
so can we just use https://github.com/top-gg/top.gg-voting-node-sdk instant of @top-gg/sdk?
the autoposter design should be like what i did for Top.gg's Rust SDK tbh
make the library do the automatic perodic posting themselves, and just make the developer feed the new data to the autoposter object so it can be automatically posted later
boom no more ratelimits

??
or we can use both?
ik but I don't know how to exactly post them
no voting-node-sdk still private, use topgg-sdk instead
but look, guildCreate and GuildDelete are events that works only when your bot joins/leaves a server
so if you execute the autoposter there it will update values only when your bot join/leave a server
which means bot stats will be more live (synced with actual stats)
but if your bot frequently gets invited to servers, you will hit a ratelimit
server stats being more synced in Top.gg doesn't matter
since you can at least update every 15 to 30 minutes without ratelimiting
ik but I have perfection issues
why he said to use it?
it still an insider-preview package
also you can't install it using npm
because it's private, requires authentication
so just use @wild lantern/sdk it's easy af
perfection issues?
idk what do they call it but it's like I want to make everything seems perfect for me
so you have to have your bot ratelimited to be perfect
remember if your bot gets ratelimited it cant post to the Top.gg API for a long time
i am using it rn but i was just checking if there is a easier way or not
which wouldn't be "perfect", but you do you ig
currently, it's the easiest way available
ah so i just have to make my own reminder system
yep, I just made mine
catch last voted timestamp and send a message after 12h of that
oh so u using db?
yes
how u checking the user time? like how u doing it?
like u using some kind of package to get timerout?
wdym by how to check user time?
how do u get exact time to send reminder
like are u using Node Schedule to do it?
use whatever you want
what are u using?
you can use setInterval(myReminder, 12 * 60 * 60 * 1000);
or use something like node-cron
setInterval will not work if u restart bot
ye?
cron.schedule('0 */12 * * *', () => {
reminder();
});
if you code it right it will work
calculate the difference between lastvoted and now timestamp
umm u saying it will work even u restart the bot?
if you do something like this, yes
function remind(lastVoted) {
const twelveHours = 12 * 60 * 60 * 1000; // Convert 12 hours to milliseconds
const currentTime = Date.now();
const timeSinceLastVote = currentTime - lastVoted;
if (timeSinceLastVote >= twelveHours) {
// It has been at least 12 hours since the last vote
// Your code for the reminder action here
console.log("Reminder: It's time to vote again!");
} else {
const remainingTime = twelveHours - timeSinceLastVote;
setTimeout(remind, remainingTime, lastVoted);
}
}
huh how it suppose to work?
i want a vote reminder for each voter
bruh catch both of voter id and his vote timestamp
store them in a db so you don't lose the data after restarts
and do your thing
ok will try
One message removed from a suspended account.
One message removed from a suspended account.
then let them do their thing
One message removed from a suspended account.
api down?
¯_(ツ)_/¯
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.
yeah it showed 504
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.
xD
no
there had been suggestions for it before, but due to the nature of how we don't allow incentivising reviews, that suggestion was probably scrapped
ah alright
I tried to use that in my landing page but nvm lol, I'll make a command for reviews or something else
*planned
Guys how can do/learn vote checker system on my bot?
read docs
Why am i getting this error?
Uncaught AxiosError AxiosError
at processPromiseRejections (internal/process/promises:288:13)
at processTicksAndRejections (internal/process/task_queues:96:32)
That error doesn't help much, provide the full error
Full error doesn't fit on the console
you aren't providing auth
Ensure you're setting the content type to json
ty
lol
You don’t need your bot to be approved to be granted a topgg api right?
When a user votes for my bot, how can i access that user's username and print it to the console (like '... user voted')?
I didn't understand where i underlined, where do i need to enter the webhook url, is it enough this way?
or where do we need to enter auth?
im trying to use the api in discord.py but im only getting errors can someone help me?
Your bot needs to be approved before you get an api token
How can i determine if a user has voted or not?
It will post when user has voted and it won’t post when user hasn’t voted
What should i use for this?
It’s your choice to use it or not
/bots/:botid/check?userId=1234 is there something similar to this that does what i said?
use this its much easier to check vote by using commands https://www.npmjs.com/package/@top-gg/sdk
Official Top.gg Node SDK. Latest version: 3.1.5, last published: 4 months 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.
Documentation for @top-gg/sdk
I need an example but i can't find an example anywhere about what i want
Is this a misuse?
const topgg = new Topgg.Api(client.config.TopggToken) //top.gg token
const hasVoted = await topgg.hasVoted(message.author.id);
Ty :)
How can i find out my IP address and PORT address? I think i need it for the following part 🥹
If you’re using your pc host it, it’s localhost and port is any but if you’re hosting it on vps it will tell you port and ip
Oh okey thx
How can i get the user's current total number of votes this month? (Sorry for ping)
im not sure, it’s on github somewhere I believe
Not possible, has to be tracked yourself
Server count is 0
One message removed from a suspended account.
As ?
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 python
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.
thankyou
One message removed from a suspended account.
One message removed from a suspended account.
what bro
what thing
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.
i just don’t think it matters
people using dotnet and java will know how to look at the implementation in code
- the fact that they’re strictly typed
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
is there a .net core library?
The only one referenced in the api docs and on nuget is for the dotnet framework which isnt compatible with linux and my bots host is linux so I have to use dotnet core
Does the api tell how much time remaining for a user to vote again?
nope
you should use a webhook for that, store in a databse when a user has last voted and then use that to work out when they can vote again
Hmm
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.
Hello, I'm making a bot in discord.py and am trying to setup a way for users to get rewarded for voting. However, I'm not familiar with any of this webhook stuff and have searched everywhere for a source on what to do to set this up. Really just looking for a proper example on how to do this. I've checked through the entire documentation and still am not sure how to go about this
Thank you! I have another question. I want to include the top.gg bot's widget as an image in an embed, but for whatever reason when I use the widget's img src url, it doesn't show in the embed. It's the link that's formatted like https://top.gg/api/widget/application_id_here.svg Is there a special way of getting this image to show in an embed? Simply passing it as the image url does not work.
It's an SVG, which is not an image
Not an image supported by discord*
And embedding it in a command wont work either, as it would never update due to caching
ahh ok I had a feeling that might be why. Oh well, thank you again!
So how could I make my bot send me a message when I vote?
When top.gg dont get a response from vote webhook, how many times it does the retry and whats the interval?
sry for dusturb but can u tell me whare i can find top.gg api key?
-help
Commands for Your Role:
avatar
botinfo
help
ping
roleinfo
serverinfo
userinfo
https://top.gg/api/v2/bots?search=luca
isnt working
but docs say thats the endpoint
404
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
wish people read the docs 
Read the docs provided above
I did, they dont provide any info
it says unauthorized, but the docs didnt say i need or where to get a key
1 sec, hang tight 
I already did. It doesnt even say the full endpoint
Base url is listed on https://docs.top.gg/api/@reference/ and you can read about how authentication works there too
You need to provide an authentication header with your top.gg secret which is why it's currently telling you the endpoint is unauthorised
ok thanks.
it doesnt work
no matter what i change the search to https://top.gg/api/bots?search=wick
it outputs the EXACT same list of bots
search API has been non functional for a while
bruhhhh
oohh, sorry
Would love to see it fixed
-api
This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/
If you need help with other development, please use #development.
'"certifiedBot": false' this part shows if you are certified on discord or top gg?
that is deprecated
that is referring to a feature that was previously a thing on top.gg
Hello, I wrote a code to send a message to the channel when they voted for my bot, but I couldn't get the top.gg api, how can I get it? can you help me?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@scarlet cobalt
One message removed from a suspended account.
have you gotten access to your repos
One message removed from a suspended account.
nice
One message removed from a suspended account.
i wish they would also work on docs.top.gg
One message removed from a suspended account.
I dont understand. I want to Use the API just for rewarding users with (server) money, but the approval process kind of expects my bot to be meant for public use. my bot is custom and not meant for other servers. Is there a way this will still get approved?
when whoever reviews it invites it to their server, its not going to function properly because many commands are channel specific
you dont need to add a bot for it
servers doesn't have an api like bots do
only webhooks
yeah but i have to get a token in order to acces api, yes?
yes
as the api you're talking about isn't supported for servers
if you're planning on using votes for your server, consider using webhooks
im just trying to make a "on vote" event that gives people server money when they vote for my server. do I need api acces for that
you can do that with server webhooks
ok
why it dosent work?
hi how can i use the api for guilds
the doc only talks about bots
what do you mean when you say "guilds"?
servers
the api can be used to retrieve/post info only related to bots
the return value 1 indicates true if the user voted and 0 if not
but it's for bots too
oh wait, server, no
you can't use that endpoint for servers
you can setup webhooks for servers however
ok i'll try that
doesn't do anything when i press send test
or am i supposed to only put the token of the webhook?
oh it's not a discord webhook 💀
ok it's the stupidest thing ever but it works
because your unauthorized
idk try regenerating your api key
well send code
its from the modules the bot cannot start just an error from that
idk
let me check something
what
thats not code
that only have is
const DBL = require("dblapi.js");
const dbl = new DBL(DBL_TOKEN, { webhookPort: 5000, webhookAuth: '' }, client);
with the webhookAuth
still
TopGGAPIError: 401 Unauthorized (You need a token for this endpoint)
i tried to use the token of other bot
and its working
but the the bot that this need to be on its saying this
idk
weird
send updated code
almost if not the same from here
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("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
}))
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const { AutoPoster } = require('topgg-autoposter')
const ap = AutoPoster('Token', client)
ap.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
app.listen(5000)
and your putting your token in place of Token right?
hm not sure then
with the other token bot is working just fine
try regenerating and make sure your copying the entire token
are you logging into discord in this code
in the pc i am trying the code, no
well you probably need to login before running the code with your client
well in this code your not logged in
🤷
yeah idk
just ping me if you get any errors in 'js'
pong
guys I need a quick help
I want to do a manual POST request to my webhook, what kind of Authorisation should I use
There is a way to use the API to see how many times a member has voted?
I don't speak English, someone speak English??
I'm not sure if there is, but you can use webhooks and log everytime user votes on a database, afterwards you can fetch that data
no there isn’t
u would need to do the above
track it yourself
via webhooks
I vote once, but it comes to me with more than one vote
you gotta respond with a 200 status or it'll retry
how
help !!!
<@&817055174613794826>
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.
pong
I am trying to do similar .. vote reward using botghost webhook in top.gg and custom event.
did you get anywhere. The Botghost response seems to be one solid piece.
Fyi, use #development , as that's not an official library
Hey, can I change the description of the bot using the api?
nope
Too bad :/ is it planned? because it is cumbersome to change the description on several platforms manually during updates
Anyone know how we can edit webhooks
was this in reply to me?
I see the api has a use for voting for a bot, but is it possible to use the api to get a user var etc when someone votes for a server?
yeah
so just use a server ID ?
but we don't have Tokens for servers
so how do we authorise?
or do i use the webhook to vote .. and then the user id api ?
trying to create a vote reward system for my server when users vote on my botghost bot.
That was easy, 3 MONTHS GO DUDE?????
yeh, i still can't find anyone sharing their event or command, have you got a working one for server votes?
So what is your issue?'
I have my botghost webhook in top.gg server setting.
I am then using a custom event .. on webhook use - get api - etc
what api do i use?
if you have something working would you mind dm'ing me a share code?
There is no server api .. sooo.
is it possible to get the user id when the webhook is used?
Uh you should ask help in botghost support I am not smart enough 😅
Yeh you did it for you bot ... not server.
Topgg was down it’s should be up soon
oh okey
is top gg api working?
One message removed from a suspended account.
Well who can help me
One message removed from a suspended account.
Almost 24 hours. How long can I wait?
One message removed from a suspended account.
But 4 others is working right?
One message removed from a suspended account.
I have a question is it possible to see which user has voted the bot how many times ?
like without storing in database
i have a error using topggpy could someone help me?
post your error messages or elaborate what issue you are facing, someone will help out
topggpy wasnt updated in like 2 years you better off doing api calls yourself
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.
Time to update the readme just so it looks newly updated

Why my bot getting dup votes? Like every some sec It shows that same person have voted?
Is it top.gg problem or my?
Rip isnt anyone here to help? I want it to be fixed urgently. People are waiting to vote :/
I want to do a manual POST request to my webhook, what kind of Authorisation should I use
You need to respond to the http request.
Webhooks will retry up to 10 times if no response is given.
Any string will do.
oh just send 200?
Yeah
Does the api check bot client id or, can I fetch upvote status of one bot from another bot?
by upvote status I mean to pass user id to check if they have upvoted
Ty
@wild lantern
'
Hi Team, what should I do if I am trying to look up data of specific discord bot, i.e., - Number of Users and Growth Trends
How do i get my server ip?
just like bots webhooks , is it also posible for servers ?
i get notifyed or user gets a role on vaote
somthing like that
It's your VPS ip
Because you have to host this webhook somewhere, and the easiest way is using express.js
Yes, it is. You can easily use the website that is in the pinned messages or simply use a bot that will assign a role when someone votes for your server
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
Is there any pre made bot?
This is not official right
Is it trusted
Bots for assigning roles for votes can be found on top.gg. As for this page, it was created by one of the moderators so yea, it is trusted
does dblapi.js module still work?
Probably, but it has been deprecated for years.
https://www.npmjs.com/package/@top-gg/sdk
Is the current library
Official Top.gg Node SDK. Latest version: 3.1.6, last published: 8 days 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.
So what happens if a u verified bot added the api?
Once a bot is approved you get an api token
One message removed from a suspended account.
Is there any problem if I continue to use it?
Using deprecated software is generally not a good idea, if any security issues occur, or it stops working we won't fix it.
does current one can check user is voted or not?
Yeah
Thank you.
bro i haven't receive my redeem credits option on the vote page but i have compleated 101 votes
how does that works
@rain heart
-api
This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/
If you need help with other development, please use #development.
query: '?reminderClicked', this doesnt give me the guild they come from tho?
the webhook i receive
{
user: 'ID',
type: 'upvote',
query: '?reminderClicked', <<<<<
isWeekend: false,
bot: 'ID'
}
so even if they first landed with a query, if they opt for reminder, then i dont know which guild they come from
if you provide the message with that query
you can just add guildid=123458 to the url
just literally provide it
that's what I do already
show the code you use to send your reminders
with the query string that you are setting
ho i can gite my top gg token for bot
-pins
One message removed from a suspended account.
yes
i just uodate data and he shows ty bro
One message removed from a suspended account.
click "Click here"
tokens aren't shown on the first attempt for whatever reason
TOPGG_API_KEY ??
?
hi i need if some one vote for bot automatically bot send to him msg in dm
can you help me
#topgg-api is your place to ask, providing:
- what have you done already
- whats your approach
- do you have any ideas you could implement
and wait for someone who can help
literally read my last message
-pins
@rain heart yooo thanks for the video
will be very useful to include it in my SDK's readme

-pins
👍
monthlyPoints is correct
It gives me "undefine" in console
I did the same code to retrieve the information to know if the person voted and it works but not to give me the number of votes in the month
const response = await axios.get(`https://top.gg/api/bots/1091794522599596092/check?userId=${UserSelect}`, {
headers: {
Authorization: `Bearer ${TOPGG_TOKEN}`
}
});
const voteStatus = response.data.voted;
const checkVote = await axios.get(`https://top.gg/api/bots/1091794522599596092`, {
headers: {
Authorization: `Bearer ${TOPGG_TOKEN}`
}
});
const CountVote = checkVote;
Well then print out the whole data
I just remove the .monthlyPoints
I want to know what content is sent by the API
When I remove it I get this message in the console
@rain heart I found it, I'm just stupid, I had to put "checkVote.data.monthlyPoints;" to find the element and not "checkVote.monthlyPoints;"
Thank you anyway for taking the time to help me!
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123')
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user) // 121919449996460033
}) // attach the middleware
app.listen(3000) // your port
this is the code for when someone vote it will be sent to the console.log ?
yes
what is // Your express app
should i replace it with anything ?
No, this is comment
You can remove it or leave it, it doesn't matter because it only explains what is what
^
yea i know
just i need to replace the topggauth123 with a WebhookUrl ?
I suggest you read the comment on that line
const webhook = new Topgg.Webhook("topggauth123"); // add your Top.gg webhook authorization (not bot token)
from where i can get it
not bot token as in the token you use to authorize your bot to discord
no worries 
nothing happened
the console is clean
WRONG INFO
@inland wyvern hey.
heyy
let me login to top gg ill show you
sure take your time
oop this is what happens when im trying to multitask 💀 sorry bout that
@icy aurora
Top.gg webhooks do not work with discord webhooks.
You need a webserver to use top.gg webhooks
how can i get that
This code creates a webserver.
You just need the public url that webserver is accessable at, which will depend on your host
there is any tuto or something that help me ?
@inland wyvern ^ for 👇🏻
^
Need improvements
One message removed from a suspended account.
When I get a bot owned by a team, it doesn't return all team members but only the team owner
Is that a bug or something else?
It may either show the user who submitted the bot, or the owner of the team
Don't think a team one is implemented
Error: 503 Service Unavailabe
@topgg/sdk module gives this error
Also Error: 504 gateway timeout
thats because the website is down
Do you know when it will be up
nope

should work again
since when did https://top.gg/api/bots?search=Luca become authorised

ah wait nvm brian fart
brain*
i'm logged out, before it required users logged in
if you're logged in, you're authorized
yeh
wait does it actually allow using it without being logged in?
nvm lol
How do you extract a user's information from a webhook so that it is saved in a json file and can enable the commands that are by vote? Even though I saw the guides, it was worse.
top.gg sends only the user ID when the user voted. you will have to implement your own logic on fetching this user from your bot's cache or setting their ID in a database and checking against it when anyone uses commands to see if they have voted.
Some quick question
https://top.gg/api/bots/:bot_id/check
this endpoint indicates that the user has at least voted once ? or does it indicates if he can or can't vote right now ?
Because if I want my bot to know who can vote or who can not, I have to log it myself using the webhook, right ?
it treats it as a binary truthy/falsy value
1 means they have voted in the last 12 hours, 0 means they haven't
thanks !
The API sends the ID of someone who is not on the same server as the bot, so the bot cannot send messages to other users when their votes expire, it only tries to send to this user and cannot because they are not on the same server. How can i bypass if this user is not on the same server as the bot?
That's not possible
That is a intentional limitation on discords end
Also
If a user is voting, but isn't in a server with your bot
That's sus
So don't know why they should be getting rewards to begin with
I found several variants of codes on how to obtain user information, but the truth is I'm terrible with webhooks. Look, this code is from Python, it is "supposed" to save the user ID information and the timestamp of when they vote, in the votes.json file, but the information is not being saved.
https://pastebin.com/vYBQHUrJ
If anyone knows how I can modify it so that it correctly saves the user's ID and timestamp, I would appreciate it.
It's not hard to implement it at all:
Save the user id, along with the timestamp
Just get the current time of request, store it with the user id, done
If you haven't worked with saving data yet, try to approach that first by making a test project
I can show a c# example and you can try to convert it to python if you'd like
yes please
Alr sec
The project to receive and authenticate votes using webhooks:
https://github.com/SylveonDeko/Mewdeko/tree/main/src/Mewdeko.Votes
The service to actually receive and process votes:
https://github.com/SylveonDeko/Mewdeko/blob/main/src/Mewdeko/Modules/Votes/Services/VoteService.cs
It uses redis to send the data
Across processes
Hey i need help...
With
oohh thanks ❤️
Np
I have a python bot with an artificial intelligence system that allows image generation, the problem is that I want to limit the use of the command with votes. I want when the command is used to ask to vote if the user has not yet voted
Actually my bot is on pending but it's for the update...
I'm in that same situation now xD
One message removed from a suspended account.
I was accepted in less than three days with my first bot which was a music bot but now I see that we can wait a good while...
oohhh
That thing about you having to vote to be able to use commands is pretty cool.
Ah ok
I'm not really using it that much, it's just a leftover dependency
One message removed from a suspended account.
One message removed from a suspended account.
Since I'm manually processing votes anyway
One message removed from a suspended account.
Yes i know 😄
One message removed from a suspended account.
It kinda sucks which is why I don't have it lel
Yeah, usually
One message removed from a suspended account.
I put it on because I pay open ai for that, it's the least I can do
I am with python
HtmlKid ?

