#topgg-api
1 messages · Page 137 of 1
Thanks. I figured it was daily but could not tell.
✅
rpg vote
hi
i'm trying to use dblpy's post_guild_count() function with the parameter of the guild count but it's doing some weird thing and posting it as shard count instead
@sullen nymph I did the post_guild_count(guild_count, shard_count, shard_id) thing but it's telling me that there are 4 arguments given
and whenever I do post_guild_count([shard_guild_count...]) it posts the sum as the shard count as well in addition to the guild count
Show your code
Does passing the list suit your case atm?
i also tried just post_guild_count(total_server_count) but that didn't work either
i'm manual sharding so ya
shouldn't it work if i just pass the first argument of guild_count

i'm just guessing but i think the guild_count parameter doesn't exist
wdym buy suit my case
Are there people starting to do commands here again 
Yeah there's an open PR on github about it, veld just needs to go through them
i see
It doesn't?
What?
async def post_guild_count(self, guild_count: Union[int, List[int]] = None, shard_count: int = None,
shard_id: int = None):

idk when i put post_guild_count(guild_count, shard_count, shard_id) it's saying there were four parameters given but expected three
I'll try some stuff out in a bit
aight
like when i put post_guild_count(guild_count, shard_count) it sets the guild_count as the shard_count on the website and the server count is just some different number that i didn't input
Send your full code
What dblpy version r u on? And also can you send the full code
i downloaded the latest version
and that's pretty much the function but if you want the whole task
this was the only dblpy code i changed after i started manually sharding
Shouldn’t post_guild_count(int) just directly post that int as server count to top.gg
Or am I wrong
Well whats the error
post_guild_count(int) is posting the int as the shard count
And nothing else
So Its saying I have like ten thousand shards on the website right now
Hi! Idk why the code is not working, I am using a Command Handler and idk nothing about the API: ```js
const DBL = require('top.gg');
module.exports = (client, vote) => {
const DBLTOKEN = client.config.tokenTopGG;
const password = client.config.password;
const dbl = new DBL(DBLTOKEN, { webhookPort: 5000, webhookAuth: password });
let canal = client.channels.cache.get("764593358357790724");
canal.send(`User with ID ${vote.user} just voted!`);
}```
https://docs.top.gg if you know nothing about it
The problem is that Idk how to start coding with the API
xD
Can I do that every time a user votes my bot, the bot replies in a channel a message?
Yes, have you tried the example in the pinned messages? With the webhook because that is how I do it and it works fine
Oh, okay, thanks, I didn't see it!
An unofficial PHP 8 API wrapper for top.GG API is now out, anyone who wishes to test it is very welcome, all feedback is very appreciated as well. https://github.com/vapourlabs/TopPHP
A top.gg API wrapper written in PHP 8. Contribute to vapourlabs/TopPHP development by creating an account on GitHub.
@hushed reef you should call it tophp

sorry
tks
For now you can only fetch the last 1000 votes/month
Ah unfortunate, would be nice if there could be basic endpoints for stuff like bots, reviews, teams & stuff
So far there are no GET or POST requests that support getting review information from either a User or Bot
I think all of that stuff might come with the new migration efforts, but don't take my word for it since I don't work for Top.GG
Would be nice, had an idea to display random reviews on bot site :p
where?
I am looking at the docs but can't really find it anywhere
go to https://top.gg/bot/bot_id/webhooks and the click Show Token
thank you!
There isn't a introduction to using api access + html?>
only js, python, go tec.
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook('my auth')
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
webhook.send(req.vote.user.username+' has voted!\nAs reward he/she got **250** coins.')
})
app.listen(3000)```
does this works?
try it and see
oh i dont have a webserver
you need to host the webhook through your bots code
hmm
I copy code from this page
npm i express
ehh
gotta love how some responses are snake_case, some are camelCase, and some are just nocaps
app.get('/', function (req, res) {
res.send('Hello World')
})
const ap = AutoPoster('token top', client)
ap.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
const Topgg = require("@top-gg/sdk");
const webhook = new Topgg.Webhook("auth ");
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote wil lbe your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
app.listen(3000);```
```const { Webhook } = require(@top-gg/sdk)
const express = require('express')
const app = express()
const AutoPoster = require('topgg-autoposter')```
nothing happens when I click on the test
I have everything filled in the webhooks tab too
I don't know why it doesn't work
have you tried using a request client?
?
@sullen nymph were you able to find any issues with post_guild_count or is it just me being small brain
No issues whatsoever code-wise
huh
Really don't know why this is happening in the first place
do you know why my post_guild_count([int, int, int]) is posting it as shard coutn and guild count then
o
weird
is it because I'm calling it from one instance only
no just the guild count of each shard
the list is a list of each shard's guild count
o you mean the output
ya that's what's happening
What in the fuck
hold on let me reproduce it
that's the list
that's the website
wait what the hell
now it's different
it's just posting the one instance's guild count as both guild count and server count
I'm not sure if it's my dumb ass or top.gg
Either way that's wrong and I'll work on it tomorrow
hello
hey, need anything?
Hi how do I get dbl tokens.
on your bot page settings -> webhooks
@rain heart pin pls
How to get your Top.gg token
Hit the Edit Button on your bot page
Press the Webhooks button on the sidebar
Hit Show Token
Copy
Thx
you may want to regen that token
i think he did before he sent that
^
from discord.ext import commands
import dbl
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = 'token'
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='botpassword', webhook_port=5000,autopost=True)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("Received an upvote:", "\n", data)
@commands.Cog.listener()
async def on_dbl_test(self, data):
print("Received a test upvote:", "\n", data)
def setup(bot):
bot.add_cog(TopGG(bot))```
I didn't get any error and this also didn't work and can't figure out why ? Please help.
idk
Who knows :(
!p bad bunny
async def get_user_vote(self, user_id: int) -> bool:
await self._ensure_bot_user()
data = await self.http.get_user_vote(self.bot_id, user_id)
return bool(data['voted'])
@commands.command()
async def votecheck(self, ctx, *, arg=None):
if arg == None:
arg == ctx.author.id
data = TopGG().get_user_vote(self, arg)
await ctx.send(data)
So inside my TopGG python cog I've done this to check if a user has voted but I get an error.
TypeError: __init__() missing 1 required positional argument: 'bot'
def __init__(self, bot):
self.bot = bot
self.token = (token)
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)
What have I done wrong?
yes
@barren kestrel
Btw It's inside my cog I am trying to access it
- If that command is in another cog, you can do
bot.get_cog('TopGG')to get the object rather than instantiating it again, otherwise, refer it withself. - You don't pass self when calling a method that's bound to an object because it's already passed automatically. You only pass that if you're calling it with the class type
It's not in another cog
otherwise, refer it with
self.
If it matters, my bot is verified with only the guild member intent
just read
2 If I don't use self then it won't work
Well it doesn't work at all
eitehr way
Because you only do 1 of the things I mentioned
also, why are you copying DBLClient method into your cog
await self.dblpy.get_user_vote(arg) should do the job.
Just remove this
async def get_user_vote(self, user_id: int) -> bool: await self._ensure_bot_user() data = await self.http.get_user_vote(self.bot_id, user_id) return bool(data['voted'])
your cog doesn't even have http attribute and _ensure_bot_user method.
uh ok
Uh doesn't work.
what's your new code and define doesn't work
TypeError: Invalid variable type: mapping value should be str or int, got None
This is the error give me 2 sec to get the code
@commands.command()
async def votecheck(self, ctx, *, arg=None):
if arg == None:
arg == ctx.author.id
data = await self.dblpy.get_user_vote(arg)
await ctx.send(str(data))
Am I being stupid or?
arg = ctx...
?
You need to assign it rather than comparing it
You are
oh SHIT
only one =

Thanks dude
Bruh being this stupid where am I going with my life.... ||jk||
yes, you can even do arg = arg or ctx.author.id to make it 1 liner
So "or" will do ctx.author.id if arg is None?
not if arg is None, rather, if it's falsy
Bruh wtf
It gives me False anyways
Like I voted but it's just no
Show code, Show error
The top.gg dev docs only specifies bot votes , is there a way we can track server votes too?
DSL doesn't have an API
boring
Though it does support webhooks
U mean wrong channel?
I mean that the servers part of top.gg supports webhooks that you can host and track votes with
See webserver frameworks for your programming language. There isn't really a specific documentation for that
can someone tell me how do i use the webhooks
i mean can i use the discord webhooks?
ok
hi
Is there any way to see how many bots are added to top.gg and my bot is on which place based on the votes it received in the top list?
oh my god
Not the currently active ones
Yep
I would like to add two new stats to it
One is the overall count of already approved bots
And the other one is my bot's place if we order all bots added to topgg already based on the votes in a descending number
That would be too much calls
Unless that endpoint returns the total number of bots, it's pretty much the only way
Rip
Yo-
How do I setup the api on my bot-?
(Not for voting, for server stats etc), Bot is written in TS.
well, you can always try just doing HTTP requests with the way TS has it coded
AFAIK there's only a JS API wrapper rn, not one for TS
It does but it's a wrong count currently (atleast it did last time I checked on Friday which was probs just a side effect of the issues at that time)
Ye^^ just meant in general that there's a count to answer the question :)
that's the same thing
the js lib is also written in ts so
i thought TS being a superset made it diff
you can still import a js lib in ts
and since it's compiled and has all of the typings it acts like a normal ts lib
neat
or https://npm.im/topgg-autoposter if you use a traditional js library
@kindred walrus u wanna add support for detritus for the autoposter lol?
could do, but im busy as fuck, and i doubt detritus users would need that
gonna be very frank, you gotta have 2 braincells to use detritus cuz of ts
dontasktoask
I Didnt Understand
See My Code Once
dbl_client = dbl.DBLClient(client,dbl_token)
Parameters Are Already defined
You need to initialize the webhook parameters if you want to receive on_dbl_vote
and enter the webhook url in your bot page settings
read the docs: https://docs.top.gg
read the docs
Is Thre Any Limitation On Th webhook url?
What DOes It Needs to be?
Any URL Or Some Specific Kind of
check the docs on how you define parameters for your webhook
I am unsure if my API usage is correct.
I have followed it to the tee, does my bot needs to be approved
before it can submit server numbers to it?
Yes
OK thx
where are the terms and conditions or requirements for the bot to be approved?
i want to ensure I am following as much rules
thank you
its been over 2 weeks (i think) since i had applied.
Going to check to ensure it doesn't get rejected... waiting again going to be soo soo long.
How can I get my API token. When I try to access to the link I get this error. Thks!
Thks @sullen nymph!
where can i get an api key? according to the docs its in the "My Bots" page but i cant seem to find that anywhere
or am i just blind?
check pins
yw
Hi, I have a problem with the voting webhook, everything seems to work fine with the test button but when someone votes, top.gg seems not to send any post request... Someone will have an idea?
is your code only setup for test webhooks?
No, setup for vote and test webhooks
what library are you using?
For my bot, it's complexe, my bot only read the content of a file who contain a list of upvoters every x seconds, this is a PHP page that takes care of receiving post requests from top.gg and adding the user id to the voting file
-p sen kaşındın lan
With the test button, a line is added to the file but no post request is sent when someone actually votes.
my tip: don't use a file
files are prone to data loss or corruption
also, a list of 100 users is a thing, a list of 1000 users is a whole different thing, there's a limit where the file will struggle to even open
Now the theory is spreading that the snipe command against the ToS because the dank mememer has removed it. What do you think about that?
404, nice
which of these im speaking brazilian
just read that
should i still use dblapi.js or top-gg/sdk
use @top-gg/sdk
how would i set up vote rewards for a server
@sonic sorrel can we get a -wrongserver
Sorry
-wrongserver @sharp bay
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Top.gg Discord" button at the top of our website. If there isn't a button that says Support Server, then we can't help you. Sorry :(
It's best to ask in their support server if you're having issues with their bot
they left 
How to create a own Invite
Am i getting something wrong - i am expecting to see a votecount for the past 12 hours in this response...?
https://gyazo.com/948e2d4fde928e6bf5ac0cd309ec14c2
ah, ok thanks
pog
hell
See #support and #site-status
Thank
How can i get total upvote count? cant seem to find it in the docs and doing a botstats query only returns server/shards info
GET /api/bots/bot_id
thanks, missed the plural 🤦♂️ i was using 'bot'
np
you need to add your webhook url to your bot page settings
read the docs
I can't really help
really Sorry to disturb
@rain heart Please Help with just one thing
While constructing DBL Client
I cannot help you with coding related things, i don't code in js
nope
Whats The Right one among these
dbl_client = dbl.DBLClient(client,dbl_token,dbl_webhook)
Or
dbl_client = dbl.DBLClient(bot : client,token : dbl_token,webhook_auth : dbl_webhook:
TYsm
On to hoping that that's not how you will write your code
lol
i cant invites botshttps://top.gg/invite
known issue, be patient
can someone help me in the dev channel please? #development message
fuck
wrong channel
how to do discordpy vote command
how do you get the invite link, including its set permissions, from a bot's page
anyone know how to fix npm WARN discordchat@1.0.0?
thx
q
Hey, whats the best way to confirm someone voted for your server so they can be awarded?
the easiest way is just using the API to check individual votes
the a bit harder, but more reliable way is to track votes yourself using webhooks. This would also make instant-rewards after voting possible.
hey, guys i have problem in api , i try token of my bot in local , and its stuck : when i put it in host is still stuck in 1 shard and server count
thanks i'll
quick question for hasVoted
how is it determined
how long is the said vote valid for?
they take long time to respond ?? in mail ?
strange i've had someone tell me that the incentive i applied to the bot works even tho they havent voted for the bot. hmmm i dont think my code is wrong but hmm
strange indeed
what mail?
you tell me contact support
Where i can get topgg vote api (link)
Thanks
I didnt find what I was looking for
Can someone tell me whats this link?
https://discord.boats/api/bot/yourbotid/voted?id=authorID;voted;error
Is that from topgg?
no
no
there's no way you actually are asking this
hi
The number of votes is not going up on server pages/I am not getting my voted role for servers (votes are still being processed correctly however, will show all votes when fixed).
but idk what i can use in support
I just realized that you copy pasted that bit
yes but this is my porblem
hi
could it be at all possible hasvoted returns true even after 12 hours since last vote?
How can i do this,
Since i'd like to setup a voting channel
You set it yourself
how
on the website
on what website?
your servers edit page
o k
then your URL is where you’re sending the request to
and the url i assume has to be a website i own too?
no, it can just be an IP
can it be an ip of the server the bot is hosted on?
hmm ok, i'll work with that info, thank you
say you’ve got a post request listener running on port 2345 and on /dblwebhook
You’d put
http://ip:2345/dblwebhook into the site
ok, I did the auth thing
are you hosting a webserver anywhere?
nope
well you need to host a webserver
h o w
do you know any programming languages
ok cool
but how do I host it
you can use the @waxen widget-gg/sdk
on a server
you could use repl.it if you wanted to
but how do I host it?????
running your code on the server
with node?
yea
can you send me the link to the docs?
wdym
do I host it with node ?
you run it with node
running it from the downloads folder is very concerning

how do u link the voting to the bot
Hey there, i'd like to use node-fetch to get how many times a user has voted for my bot at top.gg. I know the link where to GET the information but i'm not sure how to get that information in my js code. Could someone help ?
wdym
How do i create a webhoot which send msg in a channel that who voted the bot
Is it intended to be in a command or some kind of loop?
Ah, hold on
You can't get specifically the number of times a user has voted for a bot
You have to track each vote via webhooks yourself
What's your library?
https://npmjs.com/@top-gg/sdk this might come in handy
O ok
well, in the api it says u can
Show please 👀
Well, that's only to check if a user voted for your bot in the past 12 hours
oh oof
const client = Discord.Client()
const Topgg = require('@top-gg/sdk')
const api = new Topgg.Api('Your top.gg token')
setInterval(() => { api.postStats({
serverCount: client.guilds.cache.size
}) }, 600000)```
Is this correct?
Try It And See
TIAS :)
Nope
Auth key
oh kay
Hello, is there a way to fix this :
the user does a .vote cmd 2hrs after voting on top.gg, and he gets his rewards. The day after, he does the cmd only 10sec after voting on top.gg, but the bot says there is still a 2hrs cooldown
So basically the bot has its own vote cooldown, but how I get topgg's cooldown to replace it ?
found nothing on the api 
There's no cooldown that top.gg provides really
If you're using webhooks, you need to track the timestamp of a vote and rely on that
so I only have to get the snowflake of the last vote of the user ?
You essentially get the "current" timestamp when someone votes, so you get the time and store that
Then you generally possibly want to utilize that by calculating the time when a command is executed and the time when the user voted
yep I'll do that

What are voting credits for?
bro this is the api channel
I thought you can?
In python
await bot.get_cog("Topgg").dblpy.get_bot_upvotes()```
It returns a list of all the votes (last 1000 votes only for each month)
So then to find out how many times a user has voted you iterate through the list and find the count of it.
then don't use other channels for it
it's locked for a reason

That's last 1000 votes, not totally
Yeah there's quite limitations
I'd suggest using Webhooks from the start on than relying on the last 1000 votes
How can I do that?
My Bot Is Approved
You can't when your bot isn't approved
HELLO
hey can we do anything for you?
hmm
understandable, have a nice day
This is my code
But
I want to be able to check the mentioned use if they voted
how could I do that?
^my code doesnt work
what doesn't work
error logs please
etc
also, hasVoted requires the User ID
not the member object
Like it keeps checking if I the author of message voted
I want it to be like
n!votecheck
shows mine
n!votecheck 669452973755072524 (hope's id)
check if hope voted
you are checking for the author id
how can I check for an id that is in an arg?
args[0] as you want the first argument
you're using args[1]
Collection places start from 0, not 1
oh
this is my updated
EKE
ill do inna gist
but i need to change the message.atuhor.id
how do I make it
now you're literally defining args[0] as the author
which doesn't make sense
Ask someone who can explain it better
ok
?
Its a known issue that has been going on for about a week yes
it should be fixed soon
How do I transfer a listing to someone else?
you can dm a mod to request your bot to be deleted in order for the new account to resubmit it
I dont want it deleted and resubmitted, that way I have to wait more
kk
where can I get my token?
on your bot page settings -> webhooks
Does any one know why the Upvote Webhook isnt working ? I've configured exacly as the docs say to, but it doesnt work
Hi
I believe it's because #support message
I'm waiting for the upvote webhook and reward roles to be back up too
very weird, do your reward roles work as well?
How to do the server count and the votes
Easiest way is to POST the JSON string containing the server count every X time to the top.gg API @lyric bridge
One line of code if you’re using any lib to do HTTP requests for you like node-fetch for example etc.
What
But l use dbd.js yo code my bot
Well regarding your anwser you should use the library mentioned in the docs.
Or at least update your existing one to the latest one you can find in the docs.
...
Ohh, thanks so
Will it work with dbd.js
I’m trying to use the translator on here
dontdont ban pls
wrong channel, dm them if you want to ask how
again, wrong channel, move over to #general
What is the maximum amount of bots I can request from .getBots at once?
how would i know someone upvoted my bot?
hey I know its off-topic but #support channel is locked so,
does my bot needs to be in english only to be approved on topgg? what if my bot doesn't support english at all , will it still be approved?
No, it doesn’t need to be English only, you can have it in a different language, it might take longer than depending on the language
500
Is there a way to get more than 500 sorted by server count?
Manual sorting after fetching all bots
Well, yeah, you'll have to increment that by 500 after each request
and then sort the data
Yeah it's better than not having an option! Thank you for your help.

hi i'm trying to post my bot's server count to top.gg manually because dblpy doesn't work on python 3.9 but i keep getting a 403 forbidden error despite my api key being in the Authorization header
i regenerated it multiple times so i'm sure it's valid
how can i fix this
Pretty sure it isn't valid then or your request is bad, test it using a Request client
Endpoint
Is the user object of the bot you're passing to DBLClient approved on top.gg?
I need more sleep
ok turns out im an idiot. i used my test bot's id instead of my actual bot's in the url which isn't on top.gg
lol
thanks anyway
like get the
e
hi i need a bot that give roles when they vote
may i know what top.gg api
uhh is there a way to get the time a user voted 😐
const json = fetch(`https://top.gg/api/bots/763506280421392456/voted?userID=${message.author.id}`, {
headers: {
"Authorization": token,
"response": "voted"
}
})
if(!json) {
return message.channel.send('Not Voted')
}
if(json) {
return message.channel.send('Voted')
}
}
}```
Logging Json returns: `Promise { <pending> }`
I'm looking to see if author has voted or not
Top.GG's webhooks are just an integration with their API service and you're offered endpoint access with the API wrapper you're using, in this case it would be Dblpy
However you choose to carry out running your code is separate
is hasVoted returning correct values for you guys?
hasVoted returns 1 when given user voted in the last 12 hours, 0 when not
so i'm guessing my code must be ultimately wrong for it to return true when i havent voted
I can't get
Read it
library the one for your language
Ok
Hi python module developers
I wanted to be one of you in developing dbl python library
Example of one of my libraries: https://pypi.org/project/pastep
Just contribute to the python library on github and you're good to go
AttributeError: 'DBLClient' object has no attribute 'get_bot_votes' why it happens?
i did everything fine
get_bot_votes doesn't exist i think, is it on the latest version?
upvotes
oh ok
let data = await fetch(`https://top.gg/api/bots/${bot}/stats`, {
method: "POST",
body: {
"server_count": 100
},
headers: {
"Content-Type": "application/json",
"Authorization": "Token"
}
}).then(r => r.json())```
It returns error ```js
Unexpected token o in JSON at position 1```
are you passing an actual token?
Yes
and just to make sure this is the JS lib?
It's just JS
Yes
bot returns an ID, right?
yes
Yea bot id
it's by default an integer that has to be converted to string in this case
but he does an f-string so it's fine
console.log the response
I did it does same error i sent above
i'm assuming body is the argument that JS uses for "JSON" ?
I don't know JS well enough for this
It's not the token
It's a fucked up JSON sent to the server
i want to know what the error exception means with token o
is that a literal value or a passed failure?
Well i fixed it myself
let json = {
"server_count": 100
}
let body = JSON.stringify(json)```
JSON.stringify fixed it
Ah yes, the cause of all issues
i used to have that error
try json parse or json stringify
or even both
hi
i wanna make a webhook
for my server
when someone vote
my bot listen
and give a special role
or other rewards

?
This is a basic example on how to create a webhook for a bot / server
https://github.com/Giuliopime/top.gg-webhook-tutorial
Wel
Im diffrent
I cant even look
I use java
Not javascript
So this is useless for me
I only need the vote webhook for servers
I only find for bots
You just host a webserver that follows the data format in pins
Similar principle with the bots webhook
I can do that
But i want to know
How the request for servers look like
Its body and parameters and headers etc
The data format is the request body in JSON
user
You mean response structure?
Exactly
That
Ok thx
user and guild are snowflakes, meaning they're IDs in string
Still waiting for veld to approve my pr with adding that to the docs 

Im gonna make 1 server for all server lists and other api so i must know the structure so i detect which server list requested
Rely on the guild key then
Just have different endpoints for each list
out of this channel's scope
Yeah thx for helping
Or query parameters like ?list=coolserversnet
An array of endpoints 👀
Hmm they dont send this
Hope does your library do that 🤣
For servers
You set it
It has servers support too, but only for top.gg webhooks
Haven't bothered implementing other server lists/bot lists
Ok so i have to do it manually
Possibly yeah
Any library for receiving request and sending response like okhttp?
Okhttp is only a client
You need one that starts a httpserver
Yes
You could technically just rewrite the library and have it parse different json data
I just want to receive request and give me its http method and body, and parameters and header, and easily send a response
Go #development i have further question
Thank you
hi! i want to add an option in my bot that when someone votes, add some money in their economy, how can i do that?
look for the API wrapper of your programming language and code a conditional if statement check for when the user votes that you just add money into your DB or w/e.
how can i define 'vote' event?
If you're using microsoft Visual Studio, Live server is a good one
use the webhooks
read docs
Hey. Do you support plain http/direct IP requests back to webhooks?
yes plain http or ip-based webhooks work
something like http://48.32.11.115:8000/webhook for example right
hello i want to add voting obligation to my discord bot how can i do
with web requests or using a library pinned in this channel
how can define vote event in discord.js i want to add money in economy when someone votes how i can do that?
o sorry
how do i get my dbl key
pins
wdym
read the pins
ok
thank you so much
how do i set up the auth
Authorization
with the webhook
how do i get the Authorization code from my webhook
you make the auth code
?
i did but it wouldnt let me save it
There was a problem saving the webhook 
ok let me look
how do i do it
Just wait till it gets approved
ok how long do you think that will take trying to hit a deadline
hopefully it tonight
your issue is just your bots not approved so webhooks cant work.
ok thank you
is it just the test button not working? or the whole webhook?
i hope it dosenot take a week tho
the queue is over a week right now, my guess is 3+ weeks.
i think both
test webhooks for servers dont work currently.
its been 8+ weeks before
yeah it might've been longer i dont actually know
the other dev posted the application for the bot
i just know a rough waiting time
oh
chak dms
took me like less than 7 days i think dont remember kek
colors .js
One message removed from a suspended account.
dblpy 0.4.0 doesn't work well with Python 3.9
use git repo
pip3 install git+https://github.com/top-gg/python-sdk/
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
I have a problem with the java api
when i use it like in the github, i become thes error message:
Exception in thread "main" java.lang.NoClassDefFoundError: com/fatboyindustrial/gsonjavatime/OffsetDateTimeConverter
at org.discordbots.api.client.impl.DiscordBotListAPIImpl.<init>(DiscordBotListAPIImpl.java:40)
at org.discordbots.api.client.DiscordBotListAPI$Builder.build(DiscordBotListAPI.java:54)
at de.eftron.listener.VoteListner.start(VoteListner.java:23)
at de.eftron.main.Main.main(Main.java:230)
Caused by: java.lang.ClassNotFoundException: com.fatboyindustrial.gsonjavatime.OffsetDateTimeConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 4 more
i cant fix it
nobody?
Ow, sorry
Keep it in #development
what ?
Your question doesn't relate to top.gg API, so keep it in #development
webhooks
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
python btw
i used that to see who votes for my bot, and its not printing data
Test requests emit on_dbl_test in dblpy v0.4.0
Make sure your port is open and you are specifying necessary webhook arguments
yeah pretty much if you didn't install it from GitHub, it's 0.4.0
Show the rest of your code
import dbl
import discord
from discord.ext import commands, tasks
import asyncio
import logging
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'Ha you thought' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
# The decorator below will work only on discord.py 1.1.0+
# In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())
@tasks.loop(minutes=30.0)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
# if you are not using the tasks extension, put the line below
await asyncio.sleep(1800)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))
@sullen nymph
Use the on_dbl_test listener also for test requests
What did you enter on your bot's Edit page in webhook URL and Authorization?
yeah, no api for servers
Anyone know which module I can make so that if someone votes for my server on top.gg it executes some code?
Read pins
What pin must I read ? i'm not english sso it's difficult for me to read in english ;-;
This channel
What's the library that you use?
I know, but in this channel there are 4 pins
discord.js
Waou bro i'm sorry but i dont understand this english, it isn't my english at school 
use a translator#
The translators aren't good bro
Better than not being able to understand english at all
Okay, I translate but, it's for the servers ?
Because, on YouTube, it's only video for BOT but I want for SERVER
servers doesn't have a api



