#topgg-api
1 messages · Page 132 of 1
wheres your bot being hosted?
youll use your repl url
replurl/dblwebhook
kk
you should change the port in the code to 8080
repl expects 8080 for all webservers(including webhooks)
and for votes, do i need to add some extra command or it counts itself? i dont want to receive notis of people voting. The number would go up right if people vote?
yep it goes up automatically
so where do i put the host ip?
no need to use an ip if using replit
ok
its just replurl/dblwebhook
thanks
np
sorry if im being annoying
its no problem at all, its what im here for
so it goes in webhookPort?
op sorry i explained that terribly.
in webhookPort use 8080
okay
on the site in the url section use yourreplurl/dblwebhook
your bots page, click edit, left side click "webhooks"
in this code i need to add client id in place of 'client' or just put it as it is?
whatever you named your bots client.
no
the name of the variable of your bots client.
like
const client = new Discord.client();
. ^ this here
or whatever
ok
if using dbd it might be bot.client or even client.client
do you mind dming me the url you used?
sure
i am still having some issues :/
its giving me error
401 unauthorized
it says you need a token for this endpoint
you there woo?
did you fill in the token?
where lol
in the code
'topggtoken'
you can find the top.gg token here https://top.gg/api/docs#mybots
oh lemme tr
try
i am unable to figure this out
i got the token
but i am unable to figure how to work it out, its always crashing
should i dm you my screenshot?
sure
how can i get the avatar url of the person who voted for my bot? (i got sent here again haha)
The Webhook returns their User ID, you can use that ID to get that users avatar
On how to do that, read the docs of your Library
is it this?
dbl.getUser("95579865788456960").then(user => {
console.log(user.username) // "Tonkku"
});
If you want to get the actual avatar, use your discord library
Check the docs for that i meant
well i got this working somehiow
With the dbl library? It does return the avatar too, though only the on stored on top.gg
also is it user.displayAvatarURL
i think it is
i meant like how to get the user who voted and that code i sent did it
now it screams at me for user.displayAvatarURL
Because it can happen that a user changed their avatar and it doesn't exist on top.gg anymore
This
Use the id and get the avatar through your discord bot library
Read the docs for that
honestly i wish i was a professional
can we use another bot voting thing like we vote my bot name testing and like i have another called testing2 and can we access the voting through my testing 2 bot?
anyone can help me?
umm
i want people to get gift when then vote my another bot
my order it is in top.gg and when someone vote it another bot give them soething
oh O_O
then i wont lol
That is against the api guidelines btw
So just don't
K
Hi, why on top.gg does it mean that my bot is on 2 servers while it is on about 25 servers? please (ping me in case of answer)
means youre posting the count wrong
no
setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size,
})
}, 1800000)
@green mantle
I am using the correct token
It's not ```js
client.guilds.cache.size
ok
no that gives me 24 (the number of servers)
and not 2
what do you mean ?
I never test no
how to do ?
@shut flume ?
ok
Hello if im using glitch.com and i want to see who votted .
What to write in Webhook Url
Just simply www.glitch.com?
No
Your glitch project URL
Only project url?
And the path ofc
Example:- like this?
https://projectname.glitch.me
Or i need to put /webhook in last
yes but add your webhook server’s path
https://projectname.glitch.me/webhook
I did this still not working
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth3356') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user) // 221221226561929217
}) // attach the middleware
app.listen(5040) // your port```
I ran this but how am I supposed get the webhook url to add it top.gg
?
http://serverip:port/path
Thanks i solved
replace serverip and port with your server ip and webhook port
path with the webhook path, in your case dblwebhook
My error i put https
Test it with a request client such as postman first
Is your bot/webhook hosted locally?
for now yea
if yes, you need to portforward, can't help you with that
oh ok ill add it to the server now
the python library can autopost the guild count. how often does that happen?
Is it possible to send a message in a channel when someone votes?
you will need to use webhooks to allow your bot know when it gets a vote, then send a message to the channel you want
I just found this in the dblpy docs
async def on_dbl_vote(data):
print(data)```
And what do I need to do before I can use that?
does the go sdk have the same autopost functionality dblpy does?
topgg-autoposter does, the SDK doesn't
class TopGG(commands.Cog):
"""
This example uses dblpy's webhook system.
In order to run the webhook, at least webhook_port must be specified (number between 1024 and 49151).
"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='topggauth69', webhook_port=5000)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
"""An event that is called whenever someone votes for the bot on top.gg."""
print("Received an upvote:", "\n", data, sep="")
@commands.Cog.listener()
async def on_dbl_test(self, data):
"""An event that is called whenever someone tests the webhook system for your bot on top.gg."""
print("Received a test upvote:", "\n", data, sep="")
def setup(bot):
bot.add_cog(TopGG(bot))```
I have this
now
the webhook_path
what is that
webhook_path is just the string that comes after the domain/IP:port
/dblwebhook leading to the proper link being http://ip:port/dblwebhook
mhm
thats js, i need a golang one
what "bot" do I have to give when calling setup()
bot arg is the bot object that's passed by discord.py internally
Unless you're using the Client object instead?
hello
@tropic halo you can make a GET request to https://top.gg/api/bots/yourbotid and it should give you a points value in the body
no problem
what do i do if i made a bot with discordgo then?
its returning unauthorized
you need to set the authorisation header
headers: { Autothorization: 'TOP-GG TOKEN' }
you can find the topgg token under webhooks on your bot edit page
ah thanks a lot!
when I use on_dbl_vote with my heroku webhook I get a problem:
at=error code=H14 desc="No web processes running" method=GET path="/dblwebhook" host=python-bot-69.herokuapp.com request_id=d963025d-ee07-4cfb-a860-3be798e6ccaa fwd="165.22.130.154" dyno= connect= service= status=503 bytes= protocol=https
am I supposed to be using another webhook?
also @dapper copper is there a tutorial where i can get started with the $$ for the votes i get? my bot got 15k votes (points) i got from that api ;-; and i saw somewhere we can get paid for votes
You have to be in auctions
ah i applied for it ig
you can find out more here: https://top.gg/advertise
Spice up your Discord experience with our diverse range of Discord bots
waiting for the response
ah ok
there was no follow up which got me confused
jsut a "luca will dm you"
thanks a lot!
I can't get on_dbl_vote working😭 when I use the heroku webhook it says no web processes running
how did anyone create a webhook and use it
idk it doesn't work
hey, I'm getting this weird err
https://prnt.sc/xzijrw
It was working just fine and suddenly i'm getting this err.. idk how/why
any idea?
how do I get my dbl token?
though the site has some issues at the moment
well, using 0.0.0.0 is kinda weird for a webhook i think
or
or that webhook_path requires entire path http://ip:port/other things?
0.0.0.0 is not a valid webhook ip
http://ip:port/path
ip:port with corresponding ip of your server and port etc
I cannot find any docs for top.gg servers
only bots
so that I can send a message when someone votes for the server
any idea?
anyone?
check your token, it may have gotten regenerated and needs to be updated in your code
if i don't put my bot client in the dbl constructor will postStats still work?
oh nevermind
it requires the id
Like
How do I make the role rewards?
Not the roles itself, but putting them and configuring them on the dashboard
there is a option to give a user a role when he votes
Where is that?
np
?
why does https://top.gg/api/bots/id need authentication?
I think your bot needs to be approved but i'm not sure
I am trying to send a specific channel message when someone votes for my bot, but I fail to do this. Is there anyone who can help me?
must to put webhook_path
to work o_dbl_vote ?
Endpoint to fetch reviews?
nope
seems like a question for #development not top.gg api
oops was in the wrong channel my bad
what's that btw?
Something you can technically ignore
@sullen nymph btw, are you aware of this? It's subtracting utc timestamp by local timestamp.
Eh, I've never made a PR before, but let's see
done ig
will take a look in a bit
Hi, how do I set up webhooks?
I have tried connecting it but it won't work. I would love it if someone can assist me privately. Thanks.
Am ready to provide requested info.
I just used to vote bot
How do i get the webhookAuth/password?
Ok so i can just do webhookAuth: 'secretpassword.exe'
Is there a way to test if my code works?
(with webhooks)
yes
How?
test button
Hmm
Doesnt work and i got this code
dbl.webhook.on('vote', vote => {
const webhook = new Discord.WebhookClient("2","i8x")
webhook.send("Big thanks to: ${vote.user} he just voted for Ark mobile bot! <3 ")
console.log(`User with ID ${vote.user} just voted!`);
thats old
What?
there is a new library for js
can u send the npm documentation for it?
It's a good practice against malicious use
i think you should update the c# library page then cause the Unauthorized API Usage section doesn't work
You can contribute to it if you want to
If only there was an active maintainer
Here's my code:
const express = require('express');
const Topgg = require('@top-gg/sdk');
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
// eslint-disable-next-line no-unused-vars
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user);
});
app.listen(3000);
And this is what Top.gg looks like:
Why won't it work
API is slow atm to sending webhook votes
hello is it possible top post shard count in discord.py ?
i don't find any info about it
i know how to read a docs
but tell me where in discord.py about shard
if i ask here, it's because i don't find it
https://dblpy.readthedocs.io/en/latest/?badge=latest can help then
@sullen nymph There's an issue with the python-sdk readme
You write "posting server count manually" with an example of tasks.loop to do it automatically
maybe you can rewrite it to "posting server count every {} minutes"?
I can go ahead and make PR if you'd like
also "With autopost" with an example of just an event listener
Could possibly specify "Posting server count manually every X minutes", but feel free to create a PR
your webhook url htttps://severip ... check the link which was provided for me , they have listed it on the readme.md
api.postStats({
serverCount: client.guilds.cache.size,
shardId: client.shard.ids[0], // if you're sharding
shardCount: client.options.shardCount
}) Should I pass here the server count of all shard?
hello where should I post my data too?
to what webhook
and should I have any headers?
that one?
nope I got error code 404
cc @sullen nymph
how would I define the lib?
@compact creek library version?
It shouldnt be
i could find it
You don't
Latest
it said I could
It should be working then
Not anymore
either a you code issue or site issue
hmm I'll check some stuff one sec
Docs aren't updated
Yep
It's on my VPS and it's correct details
Hello I have a doubt, what exactly does this do?
those are the query params on the user's browser whne they voted
for example, if you vote from a reminder, there's a reminderClicked query parameter
hmm thx
What happens when i hit test in the webhooks page?
It will post a test request lol
My bot was posting stats last night, work up this morning to find it had randomly crashed saying it cannot post "Id" of undefined, its never done this before and I havent changed its code, anyone know why this happens?
You should provide more info
So I am supposed to know what id belongs to
But I havent had any code issues for 4 months and I havent changed the code in 4 months so why would it be helpful lmao, I'll post it here anyway but yeah
restarting the server literally fixed it I just wanted to know why it broke
const DBL = require("dblapi.js");
const dbl = new DBL('token', client);
client.login('token');
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
And before u say it, yes I have defined discord and client
Well if it said "id of undefined" that means that shards wasn't defined
doesnt help me
Had 0 issues with the code
If that was actually the case
I would get that error everytime I boot the bot up
1 error 1 time isnt caused by a syntax error
Anywayyyyy I just removed the shard parts bcs cba
Well the shards exist when you boot it, but after some time they dont exist anymore
Im not very familiar with shards
I had restarted the bot hours before it happened
Doubt they disappear after a couple hours or smt lol
@mellow aspen read pins in this channel
dblapi.js, now known as
node-sdkor@top-gg/sdkhas been remade.
(actually just read the whole pinned message)
<a href="https://discord.com/oauth2/authorize?client_id=786351005821567027&scope=bot&permissions=838721">INVITE NOW!</a>```
This will work?
how do i check if array is undefiend log js [ undefined ]
Try it and see
ok
Also wrong channel
oh wait ye lol
Wrong channel too
Sorey
WOOPS
LOL
console.log(req.guild)
)}```
Hello for server voting webhook, my `req` returns well, but why my `req.guild` or `re.body.guild` is undefined, but `req.headers.authorization` works too,
req.body.guild works in my other bot
@little matrix are u parsing the body?
https://top.gg/api/bots/botId/check?userId=userId123
Does this value change after 24 hours?
It will return 1 since the user has voted and will start returning 0 12 hours after that
ty
I made a command for when a user type it, it will use the .hasVoted to verify if he really voted and present it. But I don't want to reward more than once for the same vote, would I have to create a timer?
Preferably use a webhook instead
Is there any difference from the other?
install dblpy from the github repo
does that version of dblpy support py3.9?
yeah
Nice, thanks!
How can i get message.author ?
in a message event
Yes
Yes
dbl.webhook.on("vote", (vote, message) => {
when i try to install the top-gg/sdk with npm it gives me an error,
does anyone know whats wrong
You get vote.user
which is an ID
there's no message in a vote request
Why specifically author
A message author is literally just a user/member object in d.js. In this case you get the voter' ID by accessing vote.user and get the user object from that
you can fetch the user using the id that u get from vote.user
I use that but its not showing the votes that user have its show all users vote
I want to get that user vote!
Not total users vote.
And im using database for storing data
Use webhooks and track the votes for yourself
I want to count how much vote i have/a user have!
its @top-gg/sdk
Each vote-request contains the user id from the voter
Which you can use to track them
ohhh thanks im really stupid to miss that
Hmm i know but its giving all users votes not a single user im doing mistake with db.
Thankyou for help ❤
is there any way to do test vote?
it's simply the password you provide in the authentication field of your bot's webhook page and in the code
the wrapper module you use will compare the password top.gg sends with the requests with one you have set in the code
just for safety
should i put here and in code the same password?
or only in code?
yeah, there and in your code
Your webhook url
which is http://yourip:port/dblwebhook
replace yourip and port with your servers ip and the port you entered on your webhook options
how to find my ip?
it is the ip of the server your bot is hosted on
you dont need to put anything there if you dont have a webhook
i have hosted in glitch so ?
i am using webhook
okay!
then it is most likely your glitch project url. Can't tell for certain though because i never used glitch for myself
😦
bruh i cannot make it work 😦 sorry for ur time waste
I need some help for setting bot vote logs. Can anyone help me please.
Language:- discord.py
Dm me if you know the same
@rain heart you were the one who approved my bot. BTW thanks for help


what can cause a 400 status code
your request body might be invalid
check that you're setting the Content-Type header correctly
that worked, thx
np
as you can see, my bot now has its server count
good job
😳
how can I give rewards to people who bump on the website?
and is that possible?
I have a custom bot that my mods made that gives cookies for bumping disboard, but I wanted to add tops to it.
bumping = voting to me
but thanks
besides disboard, discord.me, and tops, is there any other websites that are effective at generating member invites?
Can't give you any help about that, sorry
d
Why do I get this error when the bot sends its stats?
04.02 00:10:04 [Bot] (node:41) UnhandledPromiseRejectionWarning: Top.GG API Error: 404 Not Found
04.02 00:10:04 [Bot] at Api._request (/node_modules/@top-gg/sdk/dist/structs/Api.js:74:19)
04.02 00:10:04 [Bot] at runMicrotasks (<anonymous>)
04.02 00:10:04 [Bot] at processTicksAndRejections (internal/process/task_queues.js:97:5)
04.02 00:10:04 [Bot] at async Api.postStats (/node_modules/@top-gg/sdk/dist/structs/Api.js:94:9)
04.02 00:10:04 [Bot] (node:41) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
what library are you using to post stats?
@jaunty plank https://img.pyrocdn.com/Dp5miA4A
it says in the error
he's using top-gg/sdk
ik but like
the lib shouldn't give a 404
Its just returning the value the HTTP server returns
any lib would
yes i had forgotten about that
Is there any way to see how long before a user can vote for my bot again?
Just a FYI all, https://top.gg/api/docs was moved to https://docs.top.gg/
mhm


how to add this on my bot?
what do you use(js, py etc)
this on top gg page
🤦
i meant what language you use
oof XD
css
bruh
from writh a description
i meant the p r o g r a m m i n g language
the bot lang is .js
finally
use topgg-autoposter
const AutoPoster = require('topgg-autoposter')
const poster = AutoPoster('topggtoken', client) // your djs client/shardingmanager or eris client
tnx
Guys, for some reason in Top.gg it dosent show how many servers my bot is in. Is there a way to make it show it?
@restive otter maybe you know?
by using top.gg api
what do you use(js py etc)
Js @restive otter
this
Do I just copy n paste this in my index.js? @restive otter
And how do I even find my top.gg token?
your bots page > webhook >generate token
And that’s it? @restive otter
Just that
paste your token(top.gg) and your done
Woah, alr thanks!
HOLY SHIT MY BOTS IN 40 SERVERS @restive otter
And is there a way to find out which servers my bots in?
topgg-autoposter shows me wrong server count why?
Like how manually?
Oo oki leme try
Hello guys is there any api which counts in how many server the bot is
Your bot Library should be capable of that, though #development as this is the wrong channel
k thanks
🙂
What should I do to remove this?
Can someone show me an example of what the API sends to your webhook when you vote? What does the JSON response say basically?
alright ty
The actual json schema is also mentioned on the docs
Oh is it?
Ah thank you
Is there a video of changing the server number here? I am Turkish and did not understand anything about the api site.
The docs has a few examples on how to do it, see the link above
这是什么?
Jk i know english
So yeah the server count isnt working
The updates are really slow
And im using cURL
to update server stats
Once you've posted, you can't remove it
post 0
I suggest using the library instead of manual cUrl requests
curl -X POST -d "{\"serverCount\": "$servercount"}" https://top.gg/bots/$clientid/stats -H "Authorization: $topggauth"
Posting 0 doesn't remove it
ngl would be a good idea to just hide the servercount if it is zero
Try -1
anything below 0 won't work
only numbers and array of integers is are accepted
I mean, can't say that's a bad idea to implement in v1 
The team has kinda far greater priorities atm so
Yeah
So this is what I have but it doesn't send anything or show any errors
@commands.Cog.listener()
async def on_dbl_vote(self, data):
c = self.client.get_channel(739931876872945775)
user = self.client.fetch_user(int(data['user']))
e = discord.Embed(
title="New Upvote",
description=f"{user.mention} `{user}` has voted for me on [Top.gg](https://top.gg/bot/{self.client.user.id})!",
color=0xfffff
)
await c.send(embed=e)
self.dblpy = dbl.DBLClient(self.client, self.dbl, webhook_path="/dblwebhook", webhook_auth="something_you_cant_see", webhook_port=5000, autopost=True)
@compact creek Hey broo
hi
hello
Are there any issues with the API? My vote logs (server not bot) stopped working properly around 10pm yesterday. It's been working flawlessly for months until now. I'm not at my PC so I can't really easily debug this
Normal vote webhooks seem to work properly, just tested it on my bot
Server votes.. right?
Let me check server votes aswell, one moment
I know our members reported that they got a message about the way votes work for servers being changed to prevent fraud
Yeah they cannot vote more than 2 times on the same ip
Also just tested server webhooks, they work aswell
This was me voting. I never even voted before that. Ok it may be something new getting rate limited lol.. I was curious since I can't touch the code at the moment.. Thanks mate.
Means a user can vote only twice a month?
No, they can only vote twice on different accounts per ip every 12 hours
Oh.
To migate vote manipulation
Hm
i was going to question smth but actually nvmd and thanks for that lmao
How do I setup different Vote Rank rewards after Multiple Votes?????
No there's not
is there anything to rely on like first step instructions for webhooks? if so may i get a link to the tutorial
like learning webhooks from scratch? or using one of our libraries?
your libraries
since i can google the webhook stuff
thanks there
okay
new api link is poggers
Urmmm How do you get the voting setup with the new API. Monkey brain Troy was using the old API
wait there's a new api?
Nah he was using the old one
I was using DBL.
oh aight

Yea sorry webhooks

Yooooo
Yea urmm ngl if anyone can help me I am actually too stupid for this

Like I thought I setup the webhooks correctly 👀 but maybe not or maybe I messed up on the API I really am not sure
just the problem is that sometimes, requests to the server are sent correctly, but the answer is not correct, well, or the API configurator performs garbage
Hello, i have a question about api.hasVoted(id)
does this check whether the user voted in the last 12 hours or voted at all
Last 12 hrs
okay thank you for your quick reply 🙂
h
I'm trying to check if a single user has voted for the bot with this url.
https://top.gg/api/bots/741937758360305747/check?userId=739679013773246486
It works but when i use node-fetch, it says {"error":"Unauthorized"}
You need your bot token in the authorization header
Oh
I know but it works with get request?
Yeah the check endpoint can be used with a get request
When i visit it manually it just works
It says forbidden
If you want to make a node-fetch request, you need to have the Authorization header with your top.gg token
Ok it worked thanks
Is the api Webhooks posting properly? I have set one up and pressed "test", it says it's performing the POST, but I have waited 6 minutes and nothing has happened.
By the way
I'm using discord Webhooks
do dblapi.js still works?
It does but please use @top-gg/sdk
i cannot make it work with @top-gg/sdk
any errors?
nope
please dont use glitch
then what can i use?
do it work in it?
just nvm
use the example for the webhook
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
ok
so it will work in repl.it cuz people says it wont work in glitch?
it should work in glitch too
Are you using Glitch for Discord bots
yes
idk i tried but it didnt work
i will make new project of glitch then try once again then if it dont work then i am using repl.it
Go to your bots edit page > Webhook
yes ik it
Then for the url
i did all thing
url?
yeah
what to put there
i have putted http://evereststudio.glitch.me:3000/dblwebhook
evereststudio.glitch.me is my glitch project
Don't put the port in the URL
then?
then what
remove your port
where to put port then
it should be http://evereststudio.glitch.me/dblwebhook
nope
let me try
You host on port 3000 but point to port 443, which is HTTPS
I'm searching how send a message when somebody vote for my bot (Discord.py) 🤔 But i do not find
listen for the webhook event, get the user id from the webhook, then use a channel ID to get a channel in your server for example, then send the message in there
how can i find the webhook event ? @rain heart
ok, thanks 👍
Having issues with updating Brief description within top.gg - keeps directing to 504 error
Screenshot the error and post it here @fallen drift
regular top.gg stuff 
Been happening for a few days
Edied, been around for months
Might be why.
Let me try editing mine
Mine edited just fine; it’s most likely your issue
Great
webhook_path (str) – The path for the webhook request.
What is the path ? It's the webhook url ? (https://dblpy.readthedocs.io/en/latest/api.html#dbl.DBLClient)
for example http://yourserverip:port/dblwebhook
dblwebhook would be your webhook_path for example
you can change it to http://yourserverip:port/myWebhook too
serverip is the server's ip your bot is hosted on, port is what you define yourself
thanks 😄
Hum, open a port can create security holes ?
i mean you need to open a port for your webhook
yes, but open a port can create security issues
If you dont feel comfortable with opening a port for your webhook then don't
read the docs
You cannot use port 80
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook('web auth')
app.post('/dbl', webhook.middleware(), (req, res) => {
console.log(req.vote.user)
})
app.listen(34473)
I am trying to make a bot which can track votes of my server but when someone vote it is not showing 
did you enter it in your bot page settings?
wait wrong
in your server page settings
no how can i do that?
@rain heart do you know where the token is on the new docs, I cant find it.
bot page settings -> Webhooks -> Token
ah, its no longer on the docs then? 😦
sad
is there a new api?
oh i don't see anything for dblapi.js tho
because dblapi.js is deprecated
ah
Do i specify my IP address in the webhook url if I'm testing it locally?
like http://IP/dblwebhook?
yep, if your testing locally you will need to port forward as well.
So like http://IP:PORT/dblwebhook
yep
So I'm trying to get the votes locally for now then after i setup it up ill update the bot. But i cannot received them, i just don't get logged anything. Here is my code:
Is the check API to see if they've voted once in the last 12 hours, or once in the last voting period?
and here are the webhook settings, I blurred out my ip address.
once in the last voting period
make sure you press save first before being able to test it
I did do it several times
@rain heart So basically last month?
Yes for now.
Oh wait wrong understanding, if they voted once in the 12 hours cycle
Thanks!
You need to portforward, i suggest testing your webhook in production so you wouldn't need to open ports on your router just for your webhook
or hosting a test-version of your webhook
just not on your pc, unless you're willing to go through the hassle of portforwarding just to test your webhook
Ah, i may just try it on my hosting i guess. For heroku i put the app name right?
Not 100% sure, but worth a try
Hm, okay, thanks.
I assume you didn't add the webhook url to your bot page settings
If your bot is hosted locally, you need to portforward, the format would be http://yourip:port/path
If your bot is hosted on a server, http://serverip:port/path
حازم البوت تعال الاخ جاوبك@restive otter
#general-int for Arabic
i know but hes my frined soo i told him
@rain heart thx pro
top.gg is missing my bot's server count.
It says 627 but is available on 850+ servers.
can anyone help
you said ask on api channel
i didn't said ask same question
Since my bot just got approved recently, i would like it to show some stats like in the image below
how do i go about this
-servercount
To have your bot's server count displayed on DBL, please read the documentation on server/shard posting.
well i keep getting this error even tho ive already defined my token
i got and generated a token from here
i had it in my config vars in heroku
...
the hosting platform?
u can retrieve data from the config vars and use it in ur bot
was reading docs and saw something about topgg-autoposter and decided to use that
incase that helps
I have this code:
dbl.hasVoted(message.author.id).then(voted => {
client.commands.get('command_name').run(client, message, args)
})
To check if someone has voted, it is not an if/else statement so I cannot make it do something if they haven't voted. How do I do this? Any help will be appreciated :)
voted is a boolean
could work
Do I have to put in any IDs or..?
The then() method returns a Promise. It
takes up to two arguments: callback functions for the success and failure cases of the
Promise.
I'll have a look at it, thanks
how can I check if a user has voted in python.
...
Reading the docs helps you with it
This rule has scared me...
You may not reward users for voting for another bot other than the one being used. This includes other bots you may own.
A user votes for Bot A, they should not be receiving Bot B's currency.
I own a server and when people vote i reward them with Dank Memer cash?
As I own a dank memer community serveR?
@trail sigil can u help?
is this ok?
they vote for a server or vote for a bot?
server
that should be fine, as far as i am aware of we do not have any issues with this
if there is an issue we'll just contact you and ask you to sort it out, so no need to worry too much
What do I put for these 2 things:
webhook_path='/dblwebhook',and webhook_auth='password'
webhook_auth is the webhook authorization key that will be used as a password
webhook_path is a route that will be used by the webhook
aka the thing that comes after the domain/IP:port
So if webhook_path is /dblwebhook, then your URL becomes http://ip:port/dblwebhook
hi can someone help me about setting up the server count for my bot on the website?
Hi
How to get DBL_token?
Alright so my webhooks aren't working and I've got no idea why. I'm on the latest version of dblpy and I am using discord.py:
@commands.Cog.listener()
async def on_dbl_test(self, data):
c = self.client.get_channel(739931876872945775)
user = self.client.fetch_user(int(data['user']))
e = discord.Embed(
title="Test Upvote",
description=f"{user.mention} `{user}` has test voted for me on [Top.gg](https://top.gg/bot/{self.client.user.id})!",
color=0xfffff
)
await c.send(embed=e)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
c = self.client.get_channel(739931876872945775)
user = self.client.fetch_user(int(data['user']))
e = discord.Embed(
title="New Upvote",
description=f"{user.mention} `{user}` has voted for me on [Top.gg](https://top.gg/bot/{self.client.user.id})!",
color=0xfffff
)
await c.send(embed=e)
self.dbl = self.config.keys.dbl_api_token
self.dblpy = dbl.DBLClient(self.client, self.dbl, webhook_path='/dblwebhook', webhook_auth='shshssh', webhook_port=1024, autopost=True)
I think it's been allowed through my firewall but I've got no clue how to check that
What about this?
go to top.gg/:botid/edit and click webhooks and then at the top of your page is the token
can some help me set the server count for my bot i have npm installed top-gg/SDK and i got my token but i can`t seem to get my head around how to set it up
If your just posting counts id use the autoposter
wdym?
i want to post the numbers of the servers my bot is in
The auto poster can do that in 2 lines of code
i see ty!
@jaunty plank would it take time to show on the website?
30 minutes typically
oh ok i was worried that i did something wrong so i applied it without the autoposter
213
no
bot for spotify
You type an random password
ok?
wrong server
the password is just to verify that requests come from top.gg and no someone else
so you can put whatever you want
huh i got a question how can i set the server count in the overview under the prefix ?
const Topgg = require('@top-gg/sdk')
const api = new Topgg.Api(process.env.TOPTOKEN)
setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size,
})
}, 1800000)```this is my code
can you tell me how or show me the right path for it ?
that should work
it only shows there not under the overview
its prob cache
you gotta wait some time
oh ok
or just shift+F5 or Ctrl+F5
then waiting is the best option
what does that do?
refresh page
i did refresh it by pressing the button nothing happend
guess gotta wait
but thank you!
pk thanks very much
ok
?
https://docs.top.gg is the new one
i remember there being docs for widgets on the old one
you cannot use discord webhooks
https://docs.top.gg you need to make it yourself
you need to program your own
how
read the page link
@rain heart would that work? i`ve created one code without webhook:
@client.event
async def on_dbl_test(data):
guilds = client.get_guild(804061218288828436)
channels = guilds.get_channel(807701770675290192)
user = client.fetch_user(int(data['user']))
e = discord.Embed(
title="Test Upvote",
description=f"{user} has test voted for me on Top.gg!",
color=0xfffff
)
await channels.send(embed=e)
@client.event
async def on_dbl_vote(data):
guilds = client.get_guild(804061218288828436)
channels = guilds.get_channel(807701770675290192)
user = client.fetch_user(int(data['user']))
e = discord.Embed(
title="New Upvote",
description=f"{user} has voted for me on Top.gg!",
color=0xfffff
)
await channels.send(embed=e)```
I suggest to read through this https://dblpy.readthedocs.io/en/latest/
i will read it
i have read this. But can you tell me: would my code from upper work<?
i have no clue of python, I'd suggest just https://tryitands.ee
clicking the refresh button is not like pressing ctrl + f5
ctrl + f5 purges the cache
Hi, I want help
how to translate a bot into any language?(Exactly yours, on my discord server)
none of my servers are showing up on the top.gg website and it asked me to join here for help?
That's a #support issue. This is just for API support.
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook('web auth')
app.post('/dbl', webhook.middleware(), (req, res) => {
console.log(req.vote.user)
})
app.listen(34473)
I am trying to make a bot which can track votes of my server but when someone vote it is not showing 
id track in mongodb, log to db, then just count++
hi
umm from where do i get the auth token for my bot?


hmm ok



