#topgg-api
1 messages Β· Page 183 of 1
I want to send message if he/she voted
https://webhook-topgg.com is good if you want a quick, no code solution
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
@hearty lintel Hi, sorry for the ping but can you please review the pr?
hello, I'm using the topggpy API for discord.py and this is my code: ```py
class Events(Cog):
"""Events cog"""
def init(self, bot):
self.bot = bot
bot.loop.create_task(self.update_stats())
@tasks.loop(minutes=30)
async def update_stats(self):
try:
await self.bot.wait_until_ready()
self.topggpy = topgg.DBLClient(self, os.getenv("DBL_TOKEN"), autopost=True)
await self.topggpy.post_guild_count()
print(f"Posted server count: {self.topggpy.guild_count}")
except Exception as e:
print(f"Failed to post server count\n{e.__class__.__name__}: {e}")
why it is showing cannot GET / while using test webhook?
<@&817055174613794826>
Can you actually provide a screenshot of the error?
Where does it show this result?
On the website or β¦?
topgg api wrapper in brainfuck when ππ
One message removed from a suspended account.
topggpy thingy not working properly with dpy 2.0? 
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
AttributeError: 'ClientSession' object has no attribute '_connector'
oh wait
its a dpy thingy
sorry my bad
No its a topggpy thing 
π
Yeah no maintainer to fix it
fetch('https://top.gg/api/bots/:bot-id/stats', {
method: 'post',
headers: {
"Authorization":``
},
body: {
server_count: results[0]
}
``` where am i wrong i am getting this error```
status: 401,
statusText: 'Unauthorized',
You have to put the api token for the authorization header
You left it blank
I am wondering if I run same bot twice on two different hosts one with dpy 2.0 and another with previous version (just for this topgg stuff) thats fine right? 
Can someone help me ?
I put my bot on Topgg 3 weeks ago and I don't know how it works, is it already on the waiting list?
Your bot was denied for being offline back in may
What I have to do?
Your bot needs to be online to be approved on topgg, submit your bot again and make sure it stays online for review.
ok
So I'm using the /api/bots to search the bots, like: api/bots?search=<botname> but the api is totally ignoring the search query string in my requests. That is not the case with the limit query param for example, which is respected and I actually get back the limit I set.
I also tried doing api/bots?search=name: <botname> but to no avail either. @ if helping.
so what happens if you look for "Luca"
aka bots?search=Luca
hydra bot is returned as the first
basically it everytime returns a predefined set of results
which I assume is default or the promoted bots idk
this same exact result appears when querying without a query param, hence is why it made me think that the search param is completely ignored?
Cue to search endpoint being broken for years by now
COOOOOL
and like... nobody is gonna fix it or...?
because I don't think any other discord list has this many bots
if they even have a search endpoint
Fuck knows at this point
Scraping Top.gg?

idk ill hit up the api 50000 times and store the data in a local file 
just literally copy the entire database
I mean
(im jk with that)
expected that
so thats why im jk
but if you dont wanna have ratelimit problems why not make a working fckn api 
As Skydust said, its been broken for years
But then to be fair, it isn't really a needed feature, as it will just lead to other bot lists scraping Top.gg
bruh then why even have any search features
on any websites
why have youtube search api fi you could scrape the entire youtube?
(what im saying is this logic is stupid)
Websites aren't designed to be scraped, as that usually leads to malicious use of the data scraped
If the endpoint is ever fixed, then it will be possible
it will not
but unfortunately its not possible at the moment
if it hasn't been
for the past
whatever you said
it will not be now
I can assure you
I'd advise you don't add a search bot command then, because there is no legitimate method to do so at the moment
but I don't have a choice
You do, just don't add the command?
The API doesn't have a working endpoint for searching, so you won't be able to add a command for searching
I'm sad, I'll have to wait another 2 weeks because I didn't buy the business of leaving the bot online π’
-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.
sorry
how do i know if my bot went to topgg? Will there be notification or something?
???
-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.
ok ok
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("token")
app.post("/dblwebhook", webhook.listener((vote) => {
// vote will be your vote object, e.g
console.log(vote.user) // 395526710101278721 < user who voted
const voteEmbed = new MessageEmbed()
.setTitle("Thank you for Voting!")
.setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
.setColor("AQUA")
vote.user.send({ embeds: [voteEmbed] })
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))
app.listen(3000)
``` why won't this work?
ANy errors?
hosting ? how is that related?
because the webhook needs to be accessible
/dblwebhook
its either an IP address, an IP address with a port, or a domain name
A webhook is like a website, it's accessed through the web.
In the code above you're the one hosting it, so topgg needs the url(to your host) to access the webhook.
so instead of /dblwebhook should I put my host's ip address?
let me see
"/dblwebhook" is fine in code.
but when you add the url to your bot/server page on topgg it needs to be a url.
http://YourServerPublicIp:3000/dblwebhook is typically the format
where do i find that?
oh thanks
so i replaced the token and now i am getting this
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/:886801342239211522/stats',
status: 403,
statusText: 'Forbidden',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}```
Remove the :
Edit /bots/:886801342239211522/stats
To /bots/886801342239211522/stats
ohh ok
yea i changed that and ```
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/886801342239211522/stats',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
whats in results[0]?
console.log(results[0])
its an array ..from fetchClientValues ..
are you trying to post stats?
yes
people if my bot is approved, do they mention me in #mod-logs , or do they only mention if it is disapproved?
Is it in this chat that I ask things?
-notified
@blissful storm
Bot Review Notifications
If your bot is approved:
You'll get a DM from @abstract moth, a ping in #logs and you'll be assigned the <@&265125253443878912> role here.
If your bot is declined:
You'll get a DM from @abstract moth and you'll also get a ping in #mod-logs.
π‘ Please make sure you have your DMs activated for this server.
oh i got it
why is this error coming?
The data you're sending not matching the format on the docs
I just downloaded the package and pasted this
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("top.gg");
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
Use the official library
https://www.npmjs.com/package/@top-gg/sdk
Official Top.gg Node SDK. Latest version: 3.1.3, last published: 6 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 6 other projects in the npm registry using @top-gg/sdk.
Oh my-
I thought it was official API
/views
Why this issue happen
I do
const top = new Top.api("token")```
Yes
yes to which question?
Website bot token
ok...which website?
There was 2 possible answers to the question there and you still managed to answer ambiguously⦠lol
Try generating a new token maybe and paste it in again
Make sure to refresh the tab after generating the token
if (command.vote) {
const topgg = new Topgg.Api("")
let voters = await topgg.hasVoted(message.author.id);
if (!voters) return message.reply("you need to vote")
}
}```
I donβt think you need to create a new topgg api wrapper client every time a certain command is run just so you know, probably better to just create it once and attach it to your discord client
This make bot slow
What?
It should be the opposite
Should be faster than creating an entire new rest client each time you run a command
you definitely shouldn't
You mean client.topgg = new..
yes
Hmm
Still not working
"not working" does not provide any context clues for me to help you, I don't know what you want me to do π€·ββοΈ
Could you show us the code you have now?
@dim kettle
seems to me like you changed literally nothing and are expecting it to magically work :p
You're probably not passing the right token
Don't be rude
Let me check
I'm not trying to being rude, I'm trying to point out that doing the same thing isn't going to change anything
And that you need to try to debug the issue or give us more context
Look at the video I sent earlier. Try regenerating the token, refresh the tab then copy it
Okay
I just want my bot to update server count on top.gg which npm package should I use?
topgg-autoposter or top-gg/sdk
You could use both, top-gg/sdk allows you to access most of the APIs listed in the docs, and allows you to manually post stats
topgg-autoposter runs on top of the sdk and posts stats for you every 30min so you don't need your own scheduler
oh so I think autoposer is good for me
Yeah, it is what many people use. Makes it a bit simpler to integrate and keep stats up to date
is it just me or does the top.gg api for java just not work
i double checked that the bot id and token are the correct ones
it never sets server count
and this always returns false even though im 100% sure i voted
pls help
no errors given?
whats the response header?
status header*
like, are you getting a 200 ok/204 response?
hmm, it seems the java library doesn't give access to that info. or if it does I dont know java so I cant find it in the source code.
I'm guessing this is throwing an error if the request isn't successful?
https://github.com/top-gg/java-sdk/blob/a3a7508fc8a731819b3c786666f036d244aa5645/src/main/java/org/discordbots/api/client/impl/DiscordBotListAPIImpl.java#L249
An API wrapper for https://discordbots.org/api/docs that works in Java - java-sdk/DiscordBotListAPIImpl.java at a3a7508fc8a731819b3c786666f036d244aa5645 Β· top-gg/java-sdk
yes
"whenComplete" does not throw errors, so it basically never gets executed if it errors
CompletionStage has another method of catching the exception
exceptionally()?
since when do you know java? π
I thought you use py
I hate java, used to code in, used to work with the api
so i think that means that the url isnt bad its smth else
That won't error either, what happens when you use exceptionally on the getvote one
Aka the one you use to check votes on
Also, what version are you using? The latest release or what exactly
Because refer to this
im using v2.0.1
first of all, that's outdated nonetheless, the current release is 2.1.1, second, try to use the troubleshooting step linked on the message I replied
Use jitpack if you haven't yet, also refresh your maven afterwards
hmm, it says that v2.1.1 doesnt exist eitehr
Likely because of 2.1.1 not being fetched by jitpack, one sec
i deleted the old jar
and i refreshed maven
and i still get the same error
its the same commit and everything
What error are you getting
Unresolved dependency: 'com.github.top-gg:java-sdk:jar:19abf19'
Show the section where you're adding that as a dependency
Where is the :jar: coming from
this thing you mean?
tehre is no :jar: ?
This
Has :jar:
No clue where that's coming from 
Turns out the :jar: is correct so nvm
uhm
i think i fixed it
it was the :jar:
not really
it synced without errors this time
but nothing from the api exists
i think cuz i removed the :jar:
this synced but the jar never downloaded i think
One message removed from a suspended account.
One message removed from a suspended account.
what is wrong here?
app.post("http://myhostip:3000/dblwebhook", webhook.listener((vote) => {}
app.post("/dblwebhook", webhook.listener((vote) => {})
that wouldnt work
yes it would
but it doesn't for me..
working for me rn
let me show code
Then the problem is somewhere else,
Not here
Did you set it up correctly ?
Used the same auth token ?
Is your firewall disabled ?
hm?
yes
where to use same auth?
https://top.gg/bot/<YOUR_BOT_ID>/webhooks
Like this
Show full code
nvm
In your code you have something like this
const webhook = new Topgg.Webhook('topggauth123')

replace topggauth123 with your auth
yes
Are there any docs for v1?
v1 isnt released
oh right
Hey Guys currently I tested my vote webhook and voted for my bot but the api from me dont get the vote? I tested the webhook per panel and it sended the vote but a real vote dont get sended?
Have someone a idea?
More input: post your code etc, censoring your token
- add your steps
- what have you tried
etc
There's also a pinned message describing how to properly post issues for others to understand
But The test button works why should I post my code? xd
I think the page didnt load
= it didnt saved
Hi, i m trying to use top gg python module. do i need to change something here? bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password") cuz rn it doesnt work
did you change "password" to an authorization
(the authorization that you filled in on the site)
doesn't work
No errors
its the same
ping: 80580000 ms
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/886801342239211522/stats',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
``` i am getting this error while trying to post stats... whats wrong?
I put the same auth but then still it wont work
request body is invalid
I need you to check something
Like
Is the request even reaching you?
or being blocked by the firewall
Use a tool like postman (web) to check
or send a request with another device
A few questions that I don't think have been answered.
what's your actual host? some hosts limit what ports you can use.
are you performing these tests on your host, or on a pc at home(youll need to change things around to make it function at home)
Another option to check if you're being blocked by a firewall is add a get request to your code.
app.get("/dblwebhook", (req, res) => {
console.log("test worked")
res.send("Test worked!")
})
Then paste the url you're using here in your browser https://i.imgur.com/D0mJuxr.png
If it says "Test worked!" in your browser then you're url is working
^ this only helps if you're testing on your host, and not at home.
fetch('https://top.gg/api/bots/886801342239211522/stats', {
method: 'post',
headers: {
"Authorization": ``,
},
body: {
"server_count": results[0]
}
})```what am i doing wrong? results[0] is an array of guilds
You post your servercount, not your guilds
Depending on what these guilds are, you could literally do results.length
Or smth, just use the size of said array
i meant the number of guilds... not guilds.. sorry
Check for errors
Set the right content type as the API expects it and stringify your body
https://top.gg/api/bots/:bot_id/stats
what if someone posted wrong server count to this url? 
Submit it again with the correct count π
If we notice abuse we may do corrective action against the bot owner
Excuse me.
How can i make my own vote tracker
I don't need any spoonfeed but can anyone give any example?
Incoming webhooks will be the way to go π https://docs.top.gg/resources/webhooks/
Here is an example using the JS SDK https://docs.top.gg/libraries/javascript/#webhooks
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)
Can I use channel.send()
At the place of console.log?
Depends if your Discord client is accessible in there
It is
Yeah, then you should be able to send a message π
Btw, you also have an endpoint to check if a user has voted https://docs.top.gg/api/bot/#individual-user-vote
Nice fallback if lets say your bot was offline when someone voted. They could run a command to redeem the vote reward
it doesn't send..
console.log doesn't work either
What host do you use?
pterodactyl
is it allowed to tell here?
Yes
you just disappeared
Can you answer the other question, and maybe perform the test I suggested here.
Apologies - i couldn't find anything online regarding that host so I was unable to proceed any further π
oh ok no problems
My host is pterodactyl and yes I am performing it in the host
wait pinged wron person
I did check by using res.send and console.log but it logged nothing
these are the answers..
Can you show your current code?
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("the same auth which I use at top.gg bot webhooks")
app.post("/dblwebhook", webhook.listener((vote) => {
res.send("Vote rewards working")
console.log("Vote rewards working (logged)")
// vote will be your vote object, e.g
// rewards process
const voteEmbed = new MessageEmbed()
.setTitle("Thank you for Voting!")
.setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
.setColor("AQUA")
vote.user.send({ embeds: [voteEmbed] })
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))
app.listen(3000)
So the app.get endpoint here is a seperate event(for the get method your browser uses) than the app.post in your current code.
So the entire thing needs to be added.
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("the same auth which I use at top.gg bot webhooks")
app.post("/dblwebhook", webhook.listener((vote) => {
res.send("Vote rewards working")
console.log("Vote rewards working (logged)")
// vote will be your vote object, e.g
// rewards process
const voteEmbed = new MessageEmbed()
.setTitle("Thank you for Voting!")
.setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
.setColor("AQUA")
vote.user.send({ embeds: [voteEmbed] })
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))
app.get("/dblwebhook", (req, res) => {
console.log("test worked")
res.send("Test worked!")
})
app.listen(3000)
-b 744793808432005130 scam links
diyyo#2443 was successfully banned.
-ub 744793808432005130 compromised account
diyyo#2443 was successfully unban
Where do I put this webhook?
I'm new at this
That was a debug test for another user.
Are you on JS too?
Or what programming language are you using?
What language do you code in ?
For example, a person voted for my server, then the bot mentions the person and says "Nice
@user voted on our server, and won 20k bananas. Come back again in 12 hours"
Python
In Python message bot
You'll need to program that functionality.
It doesn't need to use your bot.
But you'll need to program another bot, or forward the webhook.
ok, the only problem is that i'm brazilian i'm using a translator to talk to you guys but ok i'll go look thanks
ok
If you don't mind the 20k bananas you can simply use
https://webhook-topgg.com/
No coding required
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
not opening
Opening for me
now it's gone
If you want to submit a pull request you can https://github.com/top-gg/java-sdk/pulls
An API wrapper for https://discordbots.org/api/docs that works in Java - Pull requests Β· top-gg/java-sdk
(Also see pins)
Use webhook of @top-gg/sdk
So what is dblapi.js?
Not official library
Hmm...ic thanks :)
Official Top.gg Node SDK. Latest version: 3.1.3, last published: 6 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 6 other projects in the npm registry using @top-gg/sdk.
it doesnt log Test worked..
Problem with your host / firewall then (probably)
shouldn't I create a http server
yes you should
hmm
Are you hosting on a vps ?
Or your pc ?
but with the current code how?
no I am hosting through pterodactyl
not from home
creavite company
its just a server
with multi language
you can do whatever you want in it
host anything
Yes it works with discord bots
yes
Chances are, the port youβve been allocated hasnβt been opened via the firewall
Youβll need to ask the company you host with for help with that
I did
What did they say
he sent this
They use nginx
Itβs Pterodaxtyl, they donβt have server access
They get an allocated account with an ip and port
IDK I'm browsing their docs
https://pterodactyl.io/panel/1.0/webserver_configuration.html
Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
...........
so in the current code of mine how can I create the http server?
I have no clue
Never used any containers except docker and kube
oh
Express is an http server
Sounds like creative does have restricted ports though, as they assigned it a port.
You'll need to find whatever port that is
Ignoring exception in on_ready
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/container/bot.py", line 41, in on_ready
await client.topgg_webhook.run(1222)
File "/home/container/.local/lib/python3.8/site-packages/topgg/webhook.py", line 145, in _run
await self._webserver.start()
File "/home/container/.local/lib/python3.8/site-packages/aiohttp/web_runner.py", line 121, in start
self._server = await loop.create_server(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
raise OSError(err.errno, 'error while attempting '
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 1222): address already in use```
Dows anyone knows what this error means?
how i understand it:
top.gg already uses the ports
but he wants to prove it again now
which is not possible because he already occupies it himself
One message removed from a suspended account.
can i use any port i want? i'm hosting on a pterodactyl panel
so i tried 1333 as example but now my bot don't send the message he have to send when i test the webhook
How do I get link for vote after setting code in replit?
Like it is showing normal one
Without /dblwebhook
What should I do?
Nvm got it
One message removed from a suspended account.
people my server is on Topgg has 10 votes and when I search the server does not appear, only evaluation by link directly in devotee
Why are you like this ?
Or simply use 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.
Then make it with the webhook
What language are you using ?
js / py / assembly ?
JavaScript [ using discord.js package ]
Official Top.gg Node SDK. Latest version: 3.1.3, last published: 6 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 6 other projects in the npm registry using @top-gg/sdk.
Check the webhook section
okie thanks thanks, all other people we ignoring me 
this right?
Yes
Is there an event for when someone votes for my bot
yeah, you can listen for a incoming Webhook event https://docs.top.gg/resources/webhooks/
You can also contact the API to check if someone has voted https://docs.top.gg/api/bot/#individual-user-vote
Here is an example on how to use the Webhook in JavaScript: https://docs.top.gg/libraries/javascript/#webhooks
Since I havent used express with djs ever, could you also maybe share a resource wherein i can implement this in a way that its into my bot code
like bot and express both running in the same environment
The only example I have is that last link. Maybe someone else may have an example
alright thanks, ill implement the check till then!
[Not sure where to ask, please direct] Is there a link which will "scroll down to the review box" for my bot
https://top.gg/bot/YOURBOTID#field-29 does the work rn
But I won't suggest using it (I took it from inspect and they might change it later)
id be glad to help, but i dont really know whats wrong
neither do we, these are the the current issues we have with that library(most of them should be closed as they are all either old issues, or answered, or incomplete).
https://github.com/top-gg/java-sdk/issues
Right now a handful of other devs are using the library without issue, if you're having an issue and the pin in this channel didn't fix it its likely a new issue no one else has encountered.
An API wrapper for https://discordbots.org/api/docs that works in Java - Issues Β· top-gg/java-sdk
i cant sync in the other dependency thats in the pins
and yea, im using the exact correcy repository
i think imma just manually download the jar at that commit if thats even possible
uhm pin this if you will:
<dependency>
<groupId>org.discordbots</groupId>
<artifactId>DBL-Java-Library</artifactId>
<version>19abf19</version>
</dependency>
the other dependency doesnt work for maven atleast
oh, com.github.top-gg:java-sdk:19abf19 is for gradle I thought, I'm guessing that's what you put in?
@scarlet cobalt can you update the pin to include both options for gradle and maven?
gradle: com.github.top-gg:java-sdk:19abf19
maven: 19abf19
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.
thank you β€οΈ
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
it still doesnt work, it gives me this
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 saw that, i dont get why it still doesnt work on my end
oh and also
is hasVoted() deprecated now?
One message removed from a suspended account.
or is it only getVoters()
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.
hmm lemme try debugging
One message removed from a suspended account.
cuz ive done this right
but it always returns false
voted is always null
HUHUHUHHHHH
how
why
does just 2.1.1 work?
nope
for some reason
you have to use the commit hash
and then pin only mentions the gradle dependency to use
i sent the maven dependency to use
is there no good way to check if somebody voted fast instead of having to do it with threads and completion stages?
I'm not a java dev, so I'm just trying things.
Is it possible this is correct?
found the list of files on: https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/
learning about types here: https://maven.apache.org/pom.html#dependencies
<dependencies>
<dependency>
<groupId>com.github.top-gg</groupId>
<artifactId>java-sdk</artifactId>
<type>pom</type>
<version>2.1.1</version>
</dependency>
</dependencies>
After using that it builds fine, but since I have no idea what I'm doing(I don't even know how to run a program yet) I cant validate its working.
Faithie specifically stated to use the commit hash, as there wasn't a Dev to release a new package yet (?)
As said commit contains the fix to that issue
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Is it supposed to be type: pom?
It builds when I add type pom
One message removed from a suspended account.
One message removed from a suspended account.
the available files for 2.1.1
https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/
the available files for 2.0.1(the last version I can use without adding <type>pom</type>)
https://jitpack.io/com/github/top-gg/java-sdk/2.0.1/
java-sdk-2.1.1.jar is missing, so it cant install it
...
@jaunty plank
and yes, its a valid token
https://cdn.discordapp.com/attachments/714045415707770900/985914160292438136/unknown.png
@tropic moat so, only approved bots can use the api. I dont see any bots submitted or approved on the account you're asking for help with.
and you got the token on https://top.gg/bot/:yourbotid/webhooks?
Yes.
Try regenerating the token, refreshing the page and copying it.
Then see if the error still exists
I have done all that and it still persists.
you've done it from your account? or the owning account?
is it possible it was copy pasted wrong, either by you or them?
I'll ask them to do it again.
it seems silly but we've debugged a users token before for hours and it turned out to be a copy paste issue
make sure they refresh after regenerating, then copy it
Odd, works now.
Sometimes the token wont refresh in the browser until the page is refreshed, its an annoying issue for sure.
Ah, well thanks for the reply.
When I try to send a test webhook nothing happens, any idea why?
Did you fill in the webhook url and auth to your webserver?
Topgg webhooks don't work with discord webhooks
You need to host your own webhook server
I do not know how to do that.
mee to
const app = express()
const webhook = new Topgg.Webhook("xxxx_123456")
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(1337)
I have this.
What are you using to run that code?
Home/vps/replit/heroku?
My ready event.
doesn't it work if i don't do this?
And the bots is self hosted.
You'll need to port forward then
Your url will also be
http://yourhomeip:1337/dblwebhook
You will need a public IPv4 in the first place which is likely unrealistic that you got one nowadays
Nope DSLite due the ipv4 shortage is common these days
Which uses IPv6
The IPv4 you got assigned in DSLite tunnel is only usable within your ISPs network to identify you
Itβs no public IPv4 anymore
Strange, I have webservers hosted on my home network, must just be lucky then
Thatβs common nowadays worldwide
Good to know
Yeah me too but I ordered a public IPv4
can Δ± ask a question, woo
Always ^_^
Which will only be given out over here to businesses like I have
So then how can I do this.
Make sure you got a public IPv4 and youβre able to open/forward ports in your router
@jaunty plank in this code
const webhook = new Topgg.Webhook("xxxx_123456")
You wrote Topgg.webhook
right but what is Topgg
You construct the class named Topgg
Looks like you're using the wrong library
I do not how to do that. If I have to go through all that just to use a webhook, I will respectfully pass on having it.
ooh my bad sorry
You will have to when trying to host at home
Hosting at home is always a pain
And sadly I am not made of money π
Your router does forward ports to your devices automatically for security reasons as well as without having an IPv4 you wonβt be able to receive a webhook anyways
At least if you wanna expose a service publicly
Yeah
Some routers nowadays have inbuilt VPN servers and support at least allowing you a tunneled connection from your mobile devices
Which is already quite nice
I want to make my bot obligatory to vote, can you help with this?
Instead of relying and using external services
@jaunty plank can Δ± get help
(body: null)

Isnβt the object headers not Headers. All lowercase
Uhh does JS or the fetch lib care about the case here?
No idea. Probably not tbh
I was thinking about that too when I saw it but then assumed it wouldnβt matter tbh
But idk that, too
Like itβs kinda stupid if they do it. Pretty sure json is case sensitive
Yeah probably
Ah nvm the response pic finally loaded for me. Could be lowercases by the lib as you said
But something does not seem right. Anyways, just lowercase it to see if it works xD
Hmm discord is really greedy with loading user content the last days/weeks
Sometimes takes ages for me, too or doesnβt load at all
Yeah. I keep seeing that discord failed load βpoop iconβ thing for a lot of user provided media
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.
Hey, i try to check if a user(id) voteted for my bot or not, but it always returns 0 (ive checked the user id first from the last 1000 votes endpoint). This is my code so far: ```python
r = requests.get(f"https://top.gg/api/bots/{botid}/check?userId={userid}", headers={"Authorization": TOPGG_TOKEN})
if r.json()["voted"] == 0:
return False
return True
P.S. return r.json()["voted"] == 0 works just fine
Does it happen when you vote too?
yeah, i voted for test and it also returns 0
A test-vote will not change the state of the check endpoint, you have to make an actual vote
They probably meant voting to test it
yes i actual voted
When i use api to log it logs same data 2-3 times at one time
And also https://top.gg/api/bots/botid/votes API is showing less votes that shown on bot page
TopGGAPIError: 401 Unauthorized (You need a token for this endpoint)
at Api._request (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Api.postStats (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:99:9) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/stats',
status: 401,
statusText: 'Unauthorized',
headers: [Headers],
counter: 0
}
}
}```
What did I miss?
anyone help plz
No Auth header
Hmm..i see thanks :)
Yk about this?
#topgg-api message
I don't get it
When I use api to log
You can use api to log ?
Or maybe you mean webhook
Anyway show code
Also check your process (Using top on linux)
Maybe you're running same instances of the code multiple times
Yeah with that thing i meant , when someone vote for my bot the bot send msg to a channel but for eg. i voted so then it send 2-3 message but it had to send only 1
Are you using the official library ?
@top-gg/sdk ?
Yes 
The code - https://srcb.in/7z5TkkcO3X
thx
are you using replit somehow?
Yeah
Free or paid ?
Paid 
Try restarting
Free ones often creates multi instance when you keep them alive by pinging them at a certain duration
IDK how always alive works on replit
Oh IC π but yeah i use paid one. And always alive would be pretty much same ig. Can't it be solved? Like putting osme restrictions?
Like normally when you try to create a webserver it binds to the port you're using
So when you try creating dual instance it'll yeet an error saying "Port in use"
But replit binds your app to the port dynamically and uses the url to access it
My guess is when the repl sleeps and it receives a new request instead of waking the repl it creates a new instance sometimes
IDK much about it tho
Thanks :) i will check them out
the commit hash doesn't work without type pom.
Looking at the build log, maven fails.
https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/build.log or
https://jitpack.io/com/github/top-gg/java-sdk/a3a7508/build.log
β οΈ WARNING:
Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
See the documentation and examples: https://docs.jitpack.io
Looking at the docs I think this is what the error is referring to. https://docs.jitpack.io/building/#gradle-projects
Its been so long since anyone last published I'm guessing its changed since then?
Hi when i vote in top.gg for my bot i dont get rewards but everything is fine even token but idk wht to do for auth
@jaunty plank
What programming language do you use?
Js
Here's our library for js webhooks.
https://docs.top.gg/libraries/javascript/#webhooks
Note: discord webhooks don't work, you need to make your own.
Note 2: the bot must be approved on topgg.
where can i make this webhook?
Webhooks are made with code.
The url is the url to your webserver/endpoint.
The auth you decide.
so if i were for example
using railway
would i use the railway link as the webhook
as in, for this part
Is there a way to check in how many hours user can vote again?
There's not, no
That's something you'd have to track yourself through the webhook:
- Collect the timestamp of the vote
-Have the user check the time - Return the current minus the previous
Get the time left
vote object which is returns from webhook retuns user id, i should get current time stamp with new Date() right?
Please help me using the API
How can I interact with it to take event when somebody voted
I'm using DiscordJs 13.8
Help me with the webhook creation pls
NPM library
https://www.npmjs.com/package/@top-gg/sdk
Webhook documentation:
https://topgg.js.org/classes/webhook
Documentation for @top-gg/sdk
Thankyou for supporting
My confusion is where does this url come from
the url is a standard http url pointed at your server and code.
https://medium.com/@joseph.pyram/9-parts-of-a-url-that-you-should-know-89fea8e11713
it will depend on your hosting provider, if you have a domain, if you have ssl, your available ports, etc.
for example if you're hosting on a vps it will probably look something like
http://yourServerIp:PORT/PATH
yourServerIp is the ip to your server
Port is the associated port with the webserver/express/etc(set in code typically).
Path is the path to the endpoint you set in code.
Nope, local host just means itself. Topgg's local host is its own servers.
If you really need to perform tests you can use postman, or send yourself requests some other way.
begone
Yeah, you can just do a post to the api https://docs.top.gg/api/bot/#post-stats
Thank you!
Heh
I have my Weebhook not working even though I have configured it correctly
What are you using to host it?
I don't use it, it's via Discord
Topgg webhooks do not work directly with discord webhooks
Oh okay, so how does it work?
You need to make your own webhook listener(either using a library, or by yourself)
Or use a third party tool
easiest alternative is https://webhook-topgg.com 
Simplifying top.gg webhooks for all users, allowing non-developers and developers to use webhooks for their bot and server without confusing configuration.
OK, thank you.
#general-int for non english conversations
how can i fix this err Error: 401 Unauthorized (You need a token for this endpoint) at Api._request (C:\Users\schad\OneDrive\discord bot\VScode\New folder\dbot\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) i used this token
const Discord = require('discord.js');
const Topgg = require(`@top-gg/sdk`);
const moment = require("moment");
require("moment-duration-format");
module.exports = async (client, interaction, args) => {
const api = new Topgg.Api(process.env.TOPGG_TOKEN)
let row = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageButton()
.setLabel("Vote for me")
.setURL("https://top.gg/bot/975467042859802635/vote")
.setStyle("LINK"),
);
await api.hasVoted(interaction.user.id).then(voted => {
if (voted) {
client.embed({
title: `π¨γ»Vote`,
desc: `You have voted!`,
color: client.config.colors.succes,
components: [row],
type: 'editreply'
}, interaction)
}
if (!voted) {
client.embed({
title: `π¨γ»Vote`,
desc: `You have not voted!`,
color: client.config.colors.error,
components: [row],
type: 'editreply'
}, interaction)
}
}).catch(error => { client.errNormal({ text: `There was an error by checking this vote!`, editreply: true }, interaction) });
}```
Ok, just a stupid question. Have you tried to console log just to validate if the token environment variable is returning?
If it does, go to your bot webhook page, click the API key regenerate button.
Then before you copy it, clear your browsers cache and refresh the tab. Then copy the new token
what do you mean? That i need to js console.log(api)?
yes it logged
Then try the steps above I mentioned
go to your bots webhook page, click the API key regenerate button.
Then before you copy it, clear your browsers cache and refresh the tab. Then copy the new token
thanks now it worked
Nice π
How can I setup a vote webhook in my bot? (python)
thanks
Hi, I'm making a node.js receiver for receiving which user votes for the bot. I am currently following the api but it isn't sending the user id to my console. I tried searching up what might be my problem, but I couldn't find anything. Does anyone see any obvious errors in my node.js code?
const express = require('express');
const app = express();
const port = 80;
const Topgg = require("@top-gg/sdk")
const topggtoken = process.env['topgg']
const webhook = new Topgg.Webhook(topggtoken)
app.post("/dblwebhook", webhook.listener(vote => {
console.log(vote.user)
}))
app.listen(port, () => console.log('App port online!'));
Thanks for the help!!
where do u host this webserver?
repl
try a different port, not 80 and hit the save button on topgg before test
and make sure the express server is running
sure
thanks
It still doesn't work. I changed the port to 443 and made sure that the server was running. I also have the topgg webhook set up properly.
ok
don't use the secure protocol
yeah
im also hosting my website and discord bot on the same server. That is fine, right? Thanks for the help
http://serverip:port/dblwebhook
π
Try a testing tool if it's able to send a request to your destination
make sure it's a post request as well
ok
connection timeout?
the express server should listen to this port only
actually use your project hostname, not the IP
It shows 403 forbidden
im gonna try to fix it. Never had a forbidden error with replit
im gonna go now
thanks for the help
alr
I'm not going to do this, this is just for the record
Isn't it just really easy to fake the server count by posting a random number you want on it?
Yes
im getting a 408 code when using @top-gg/sdk
TopGGAPIError: 408 Request Timeout
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/stats',
status: 408,
statusText: 'Request Timeout',
headers: [Headers],
counter: 0
}
}
what do i put here?
Your webhooks authorization, something you create yourself and has to be the same on your webhook settings on top.gg
On node.js, how would I find out the weekend multiplier? Assuming that my code works properly, the vote.isWeekend returns with undefined. How would I find out if the weekend multiplier is on?
// (Some code cuts out, assume that packages work correctly)
app.post("/dblwebhook", webhook.listener(vote => {
const user = vote.user
console.log(vote.isWeekend)
}))
I'll make my question a bit more specific. How would I request the isWeekend parameter when topgg posts?
Hello im getting api error when i try to check a user vote status by hasVoted
at Api._request (C:\Users\SuDhi\Desktop\AlexPremium\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.execute (C:\Users\SuDhi\Desktop\AlexPremium\src\commands\general\profile.js:100:17) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api//bots/check?userId=781882376790736937',
status: 408,
statusText: 'Request Timeout',
headers: [Headers],
counter: 0
}
}
}```
is it is my mistake or your mistake?
it was working fine like 1hour before
Ddos
Site is down
Aight lol
how can I remove the link in webhooks?
Last time I checked we do not allow removing webhook urls once one has been set.
If you really need it to stop sending the webhook to the url you provided you can just use a junk url.
http://localhost
why not tho?
Well, webhook saving is configured to only allow users to save if webhook URL is filled with something.
I'm not sure why its setup like that.
Since Topgg started using multiple servers we likely serve data from multiple countries.
Im getting a Unresolved dependency: com.github.DiscordBotList:DBL-Java-Library:jar:2.1.1 error from maven but my dependency xml structure follows what is on jitpack exactly. I also have the jitpack repository as well
https://paste.ofcode.org/55mcCRchgxRj4tzajjN23U
Yeah something is not adding up here, looking at the repo the package structrue isnt even com.github.DiscordBotList
That's definitely outdated wherever you got that
https://github.com/top-gg/java-sdk is the repo, use that on jitpack to get the correct one
An API wrapper for https://discordbots.org/api/docs that works in Java - GitHub - top-gg/java-sdk: An API wrapper for https://discordbots.org/api/docs that works in Java
It seems not only is the top.gg website wiki using the wrong dependency, but so its the github repo README, AND the jitpack they link to is wrong.
If anyone knows the real dependency please ping me!
A user voted for our bot after they had a reminder on via top.gg.
That vote caused a major error and didn't go through.
The vote on our server without a reminder worked fine.
No one else experiences this issue and I believe it may have something to do with the reminder thingy. Though I have no idea.
Error handling request
22.06 12:44:13 [Bot] Traceback (most recent call last):
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
22.06 12:44:13 [Bot] resp = await request_handler(request)
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
22.06 12:44:13 [Bot] resp = await handler(request)
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/webhook.py", line 132, in _bot_vote_handler
22.06 12:44:13 [Bot] self.bot.dispatch("dbl_vote", BotVoteData(**data))
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 279, in __init__
22.06 12:44:13 [Bot] super().__init__(**parse_vote_dict(kwargs))
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 19, in parse_vote_dict
22.06 12:44:13 [Bot] query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 19, in <dictcomp>
22.06 12:44:13 [Bot] query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
22.06 12:44:13 [Bot] ValueError: not enough values to unpack (expected 2, got 1)```
Are you using query params? it seems like your client gets some sort of malformed query string
check the data sent by top.gg
So Hope, whats the correct Maven thing since everywhere else is outdated?
<dependency>
<groupId>com.github.top-gg</groupId>
<artifactId>java-sdk</artifactId>
<version>2.1.1</version>
</dependency>
That doesnt work
I dont think it works on maven currently.
buildlog, maven fails.
https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/build.log
So.... What do i do? Do i have to keep ignoring Github's emails about a failed compilation
so, I know nothing about java.
this is what i've figured out so far, #topgg-api message
I think we just need someone to push the fix, but I cant validate thats whats needed.
Ik Java but not Maven, rip
it doesnt fail wdym
WARNING:
Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
Thats a warning that can be safely ignored
but the .jar file doesnt build.
https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/
^ current version.
https://jitpack.io/com/github/top-gg/java-sdk/2.0.1/
^ old version
which I presume .jar is needed for maven
from the docs "Projects using Gradle need to have either the maven or maven-publish plugin enabled."
there were no changes within any of the gradle-related files between the previous 2018 version and the current
jitpack very likely has had updates since then though
https://jitpack.io/com/github/Team-Woo/java-sdk-topgg/master-9403edcc24-1/
cloned my own version, added the fix. .jar built fine
the only changes are changes from the dependencies of the sdk
so
whats causing it
gradle taking a shid
prob
yeah, seems applying the fix listed on the jitpack docs solves it.
pr kthx
We dont have any endpoints for se... oh hi hope
hi
and if you're attempting to use non-official endpoints (such as ones obtained through inspect element), likely don't expect official and/or accurate support
If this is for your voting site, iirc you're using oauth to obtain user info, if you include guilds in your scope you'll also obtain the current users owner status for the guild you're interested in.
I presume thats what you're looking for.
-maintenance
Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.
During this downtime, the following parts of our site will be affected:
API
Voting
Bot / server / DAO pages
All other functionality
Please refer to #site-status for updates! Thank you for your patience and understanding! π€
Read the message above
Why it appeared that I'm banned
We are under maintenance for the next 3 hours or so
That's why I'm concerned xD
Come back in a few hours, and you should be good
Alright. Tysm
-maintenance
@tropic moat
Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.
During this downtime, the following parts of our site will be affected:
API
Voting
Bot / server / DAO pages
All other functionality
Please refer to #site-status for updates! Thank you for your patience and understanding! π€
The API is down atm
A ping would be handy.
^^
It has been posted to #announcements, #support and #site-status .
A @ everyone ping would have made a lot of people that are not affected flock to the server causing more spam in #general making it even harder to moderate
Ping the dev role.
then create a reaction role for who wants to ping for status
^
π€
We may look into something like that in the future
TNX
Oh lovely. How did I even get ratelimited.
It is apart of the maintenance. Known issue
Come back when the maintenance is over π
Mkay.
What happen
-maintenance
@tender sky
Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.
During this downtime, the following parts of our site will be affected:
API
Voting
Bot / server / DAO pages
All other functionality
Please refer to #site-status for updates! Thank you for your patience and understanding! π€
$vote
i dont vote why?
We are under maintenance. Come back in 3 hours or so
Where do I go to talk to ppl
Hello, I can't connect to the site to do the /vote with the BOT Koya, would it be possible to know why please?
please?
-maintenance
@river mango
Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.
During this downtime, the following parts of our site will be affected:
API
Voting
Bot / server / DAO pages
All other functionality
Please refer to #site-status for updates! Thank you for your patience and understanding! π€
Come back in 2 hours time
Hi I'm checking the topggpy wrapper and played around with it, using Hikari as my development library, starting with the examples, I've noted that the developer gave some examples with Hikari but when I tried it for myself, it doesn't seem to be working as intended.
Specifically, I've tried to setup the WebhookManager and DBLClient, which both takes the bot as an argument, but it returned this:
AttributeError: 'Yuna' object has no attribute 'loop'
After delving into the source code, it seems apparent that it only accepts discord.Client as the bot argument, I've also searched around and read somewhere that topggpy isn't maintained so there are errors that are very different from the example given, such as the WebhookManager not having set_data method, are there any alternatives if it doesn't work for hikari, considering most of the support are meant for dpy?
0
Hey, I'm trying to test my Top.gg webhook before my bot has been verified on the platform, so I'm using Postman to try and mimic the request top.gg will make to my server, I've managed to get the Authorization header working but I keep getting an Invalid body 400 error, I've tried form-data, x-www-form-urlencoded, and query parameters but none work, I'm using the fields as posted on this documentation article: https://docs.top.gg/resources/webhooks/#data-format. I'm using the node sdk
$vote
the format is json
just fyi
also, you wont need to mess around with the content type if you're using one of the libraries, it does it itself
Worked, thank you
Also, should one consider handling the requests over https to avoid the authorization token from being stolen?
Cloudflare automatically upgrades the protocol so doesn't matter really
0 is when user hasn't voted in past 12 hours and 1 is user has voted right?

yeah
How would I set up vote reminders?
Vote reminders will need a database and webhooks.
When someone votes, you'll store the time they voted.
If the vote is 12 hours old you'll remind then and delete the row.
Or have a column with a boolean for if the reminder has been given.
Thank you β€οΈ
cant we use setTimeout in webhook?
SetTimeout will clear all reminders every time the bots restarted
yea thats true
but like we will need to constantly fetch the database too ig
Not necessarily, you can do it every minute or so.
You can also fetch hourly, set timeouts for each one that will happen within the next hour if you really wanted to.
But its really not necessary to do something like that until you're getting hundreds or thousands of votes an hour.
wait should it be
<dependency>
<groupId>com.github.DiscordBotList</groupId>
<artifactId>DBL-Java-Library</artifactId>
<version>2.1.1</version>
</dependency>
these are the only one that are working for me
<dependency>
<groupId>com.github.top-gg</groupId>
<artifactId>java-sdk</artifactId>
<version>2.0.0</version>
</dependency>
``````xml
<dependency>
<groupId>com.github.top-gg</groupId>
<artifactId>java-sdk</artifactId>
<version>2.0.1</version>
</dependency>
Hey! It seems maven doesn't work currently with the java lib.
I think I fixed it in the most recent pull request, but I cant test it(not a java developer).
can you try PR14-SNAPSHOT.
Here's the pr on GitHub: https://github.com/top-gg/java-sdk/pull/14
<dependency>
<groupId>com.github.top-gg</groupId>
<artifactId>java-sdk</artifactId>
<version>PR14-SNAPSHOT</version>
</dependency>
Added fix to comply with Jitpacks documentation.
https://docs.jitpack.io/building/#gradle-projects
This should fix installation issues for maven users.
Yep I'll try
@jaunty plank
is that on a forced clean install?
should be
that img was the wrong artifact i cjanged it but still doesnt work
wait
YO @jaunty plank IT WORKED
i think i messed up the depend
when i first tried
sweet ^_^
thx
Thanks for testing, hopefully someone can merge it soon
its xml <groupId>com.github.Top-gg</groupId> not
<groupId>com.github.top-gg</groupId>```
Strange, com.github.top-gg builds for me
not sure ^_^, i'm just glad it works
ye
@jaunty plank are you able to pin a message
might want to pin that msg with the api
i just tested the webhooks and saw that u dont really need auth to receive webhook data
π
the auth is for the webhook listener to determine where the webhook came from
its not strictly necessary, but it is highly advised.
but how to set auth header in a post request without using the sdk. just add res.setHeader("Authorization", "token") before console logging the data?
for the api?
You set the header before you send the request.
for webhooks topgg sets the header before sending the request
so like
app.post("/", (req,res) => {
res.setHeader(...)
...
})
this?
using express?
yes