#topgg-api
1 messages ยท Page 105 of 1
@merry stump Yeah, you can use custom HTML and css
but how
help

Ok
api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api
like if you agree
why
Can someone point me to the python API for server count b4 I go and get lost in the google void lol ๐
Ty
my approved bot is not showing up in its api page?
I am mega confused on webhooks and votes. Can anyone explain without saying "Look at the docs"?
I just want to receive vote updates
Anyone?
.
The documentation explains it the most accurate
Let me rephrase my question.
Can someone help me with webhooks WITHOUT telling me to go to #topgg-api and read the docs?
"If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in our #topgg-api channel"
Thanks
basically
you open a port on your VPS and put that in the vote webhook
and it will send data
Thanks mate
๐๐๐๐๐๐
๐๐๐๐๐๐
ok

Hello
How can i add my webnook
to my server thing
hello
@willow sphinx Hello
sorry for ping
Your bot needs to be approved
you open a port on your VPS and put that in the vote webhook
How do I open a port on repl.it/glitch
Use port 3000
lol
Okay.
Is the test button broken? Or does my webhook not work for tests?
How do I use the webhook.
@median badger Yeah but I don't understand how to make a webserver is it like some php code or something.
Yeah but I don't understand how to make a webserver is it like some php code or something.
@tropic star do it with express or something similar
all you need to do is listen for POST requests
k
How do I trigger an event like when someone votes
my raspberry pi
no would i need to?
would having a dynamic ip be a problem
that could cause issues occasionally, yeah
So how can I make it ping the user who voted?
Wait yeah!
And also are there any other mistakes?
It's still won't work. @rapid kettle.
where u hostin
Repl.it is a simple yet powerful online IDE, Editor, Compiler, Interpreter, and REPL. Code, compile, run, and host in 50+ programming languages: Clojure, Haskell, Kotlin, QBasic, Forth, LOLCODE, BrainF, Emoticon, Bloop, Unlambda, JavaScript, CoffeeScript, Scheme, APL, Lua, Pyt...
Wdym?
on the page
ok
const http = require('http');
const app = express();
const server = http.createServer(app);
const DBL = require('dblapi.js');
const dbl = new DBL(`Bot token here`, { webhookAuth: 'my password here' ,webhookServer: server});
dbl.webhook.on('ready', hook => {
console.log(`Succes, webbhook running on http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
app.get('/', (req, res) => {
res.sendStatus(200);
});
server.listen(5000, () => {
console.log('Listening');
});```
bot token doesnt go there
on the page
Like where on the page?
Hey is there a problem with the test ping? I can't seem to test my webhook
Yeah votes are working though
I just had a few come through
It's just the test ping
@magic vapor do you want the DSL webhook just out of curiosity?
So do I need to port forward to detect votes with webhooks?
@magic vapor do you want the DSL webhook just out of curiosity?
@rapid kettle for now yes.
Is there a specific protocol I need to use?
I mean which one of these?
@magic vapor So basically, the POST request gets sent to the URL that you provide, and you can pick it up with app.post("/", (req, res) => {})
@teal trail i'd go for tcp-udp
Ok, thanks ๐
and the auth is provided in the Authorization header
Where is that?
and the body is in the req.body
@tropic star just down the bottom of your edit page
And shall I do HTTP for the service?
the POST body would be json { "guild": "guild ID", "user": "user ID", "type": "test or upvote", "query": "?a=1&b=2" }
@rapid kettle #development
And shall I do HTTP for the service?
@teal trail im gonna guess and say yes
@magic vapor what
can you see the issue happenjng in the bot and help @rapid kettle
And is there a specific IP address I need to portforward to or just to anyone
And is there a specific IP address I need to portforward to or just to anyone
@teal trail just to anyone
What else could be wrong?
Ok, thanks
?
did you set the URL to your repl URL
The webhook URL?
Yes
did you set the URL to your repl URL
@rapid kettle nope ๐ณ.
their is a problem in the api , what shall i do now?
That's the problem I guess.
that will be the problem
dblapi.js, what the fuck
bruh
time to make this code better
@rapid kettle What should the link look like?
Ok.
Shall i run it on the port 5000?
Yeah.
so for the webhook link do I just put https://BotName.replname.repl.co:5000
Ok, thanks
Oh.
Does the test button not work?
It doesnt error if I do the test one in the docs
Where did you get that from @teal trail?
If you go to the api docs and then go to My Bots you can test it from there
Still nothing happens but nothing errors
So how can I test it?
Do I need to do any extra steps on repl or do I just run it on port 8080?
Is there any way to test it?
Cause I voted on an alt and still nothing happened
It's suggested you use reqbin or postman
so do I put the .co link in the webhook link?
Yeah
sohttps://BotName.replname.repl.co:8080 or just https://BotName.replname.repl.co
Latter
when I test or vote still nothing happens. The passwords are the same, the port is 8080, the link is set correctly
^same.
It's suggested you use reqbin or postman
@sullen nymph
How do I use it?
Yes how do we use reqbin.
Send a JSON following the proper data format from the docs in the request body
default endpoint is /dblwebhook so add that ig
I cannot see a request body in the docs
Press the webhooks tab
Then?
Add an Authorization header with your auth key as value on reqbin and send any JSON in request body
No need for the reading docs
I'm confused now.
So do I have this in the content tab?
Eh yeah
What userid do I put?
Because I still get 404. I put my repl .co link in the field
So how would it be?
It does not work with my .co link
It works with other adresses but not with my .co adress
no because I don't use bad stuff :P
You should look into a vps...
It is only for testing purposes rn
still
we have a more perminent solution for our public one
the environment is much different
can you recogmend a hosting company?
contabo, galaxygate, hetzner
Slowly getting off-topic
Sorry
for some reason it won't let me test the webhook
the alert doesn't show up, and nothing happens in the bot
await self.dblpy.post_guild_count(server_count, self.client.shard_count)
this should post the server count and shard count properly right?
for some reason it's posting the guild count and shard count both as the guild count
any idea why?
I'm sending the client to the top.gg api but if I go on the bot page, it shows 3 servers. If I go to my account it shows 1011. Does anyone know how to fix this
@restive otter dblpy actually supports posting a list of server counts
That's basically server count of each shard
sooo feel free to do that 
karuane aku tak mudun
@teal trail repl.co domains should work fine with webhooks too
I've got my bot posting a message to my server everytime someone votes the support server
ah so are dbl webhooks broken? i have a server to receive them but it seems the test button doesn't work and when someone votes no webhook is sent
@tough stream are you listening for POST requests to the EXACT URL that you put on DSL?
also test webhooks take like four seconds to send if you do anything while it's sending the test webhook it will not do anything
yep, it was working up until the DBL website started changing early october
for dblpy, is there a on_member_vote or something of that nature?
Where can I find this again?
Thanks.
are webhook tests not working or is that just me
no it seems they're just not working at all
it also seems that the website isn't sending any webhooks at all
i've confirmed that all my settings on dbl are correct and that my endpoint is receiving requests
really? i'm not
i'm literally relying on people to type a command to receive voting rewards
might be something wrong with your vote event then
the think is i don't think there is? i did a test with the typical json and proper authorization on https://reqbin.com/ to my endpoint and checked that my endpoint works, then checked if my settings on dbl matched
and they do
@ripe ether wululu see dblpy docs
My bot has not been approved yet, so is there a way where I can write code to do something on a vote to test it, so as soon as it comes out I can be ready?
@sullen nymph
Use on_dbl_vote and/or on_dbl_test and send post requests to the VPS
The only requirement for votes to pass from dblpy is to have the Authorization header with value set to your webhook_auth value
but expect a very breaking change in next release (v1.0.0)
Yeah see docs also
You need to initiate DBLClient with webhook_x arguments
A simple API wrapper for top.gg written in Python. Contribute to top-gg/DBL-Python-Library development by creating an account on GitHub.
Hello, I'm having some troubles setting up the dsl api, I can't use the event on_dbl_vote, it just doesn't get called when a user adds a vote. Instead the event on_guild_post works just fine. Can somebody help me out?
(I'm not using a webhook)
@sullen nymph sorry for ping but in all the examples i have to give self.token='', do i put my bot token here, or what do I do? also how would i simulate the vote
@sage silo DSL vote support will be added in next version
@ripe ether that's for top.gg token. You don't really have to simulate the entire data, just send some JSON in POST request body and print it
what was the request data you sent
Oh
OH, thanks anyway
huh
ah, i see, alright thanks!
Mettius, you can use Flask/Sanic/aiohttp.web to host a webhook for DSL
Uh why the 2
send 2 as number ig
Though er
might not work as expected
shard count must be sent with guild count for each shard
uhhhh
don't know, not a js dev
DBL votes are supported, DSL aren't
oh, alright, thanks so much, you have been really helpful!
hopefully the verification doesn't take like a full 5 weeks, but it probably will
Bet your house it will
and even more, like 7+ weeks instead
Have fun improving your bot or doing something else in the meantime ๐
alright to by that estimate it will be 5 days before thanksgiving at the minimum
thats nice to know
Unless it's put on hold until thanksgiving wink wink totally can't do that
@restive otter dblpy actually supports posting a list of server counts
@sullen nymph that shouldnโt be the issue tho right? Iโm sure I can just pass in the guild count value
Uhh
It very well can, tbh
I don't specifically remember what exactly was bugged apart from shard IDs not working properly
await self.dblpy.post_guild_count([server_count1, servercount2, servercount3]) so something like this shd be enough? @sullen nymph
I've tried looking at the docs, but I can't seem to get the webhook to work even though ive put the webhook id and the top.gg id in
@restive otter yeah
top.gg will get the sum of all server counts and use that for the total number
@grizzled mulch what's your code like?
fr
Is the webhook test button broken? I'm seeing in the console:
Request:
POST to https://top.gg/servers/api/testWebhook
{ "bot": "713586207119900693", "type": "test", "query": "?test=data¬RandomNumber=8" }
Response:
400 Bad Request
{ "error": "Invalid request" }
p/help
@half plover correct
any idea when it'll be fixed?
In next big update, which is... whenever 
how can I track server votes? ?????
can someone explain vote webhooks to me?
wtf is that link 
@restive otter @lyric smelt
hmm
you have the google tracking in that xd
@sharp wigeon it's Cloudflare cache for the API docs page
they simply blindly copied the URL without removing the query string
@restive otter @lyric smelt
@slim hemlock what should I do
@slim hemlock i read that many times
what do you use to run code?
@slim hemlock PY
then check python menu
I just need to know if there is anyway to get server votes
ho
Error: listen EADDRINUSE: address already in use :::3000
hw can i fix that
i got this err when defining dbl for webhook
it means port 3000 is already used
try chanege that to another port like 5000
Do I need my bot approved in order to use the API?
NO. You can go to top.gg/bot/<yourbotid>/webhooks
This is what I found out, and I wanted to let you know. Before anyone asks, just say "Leon said it".
I wonder if that's intentional

ok i wanted to test it but
memes
{"error":"Not approved"}

this means you should approve it, shiv
just use reqbin โค๏ธ
import dbl
import discord
from discord.ext import commands
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjcwNzY0MTAzMzIxMDU5MzM1MSIsImJvdCI6dHJ1ZSwiaWF0IjoxNTk3NjI5MTE5fQ.00hxNvBquo_no5sOGp_on4ShOykH9VKOXCyBhlY6rTo' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=False)
async def on_dbl_vote():
async with aiohttp.ClientSession() as session:
webhook = Webhook.from_url('https://discordapp.com/api/webhooks/762378507002445889/JwEXlFzJrd0wlJhVPSs-4oIFQERawMHaJzKA1ucHyFYHWWQBbg-0TTgKKbqdRgFxEWnn', adapter=AsyncWebhookAdapter(session))
await webhook.send('Hello World', username='Foo')
def setup(bot):
bot.add_cog(TopGG(bot))
does anyone know why this doesn't work?
oh crap
and possibly the webhook link too
Code-wise all good, see if your port is open and any firewall isn't blocking any requests
ok
is there a way to use on_dbl_vote() without cogs?
Sure, just initiate the DBLClient somewhere with webhook settings
Strongly advising you not to blindly update without code updates with the next version btw, there will be a breaking change regarding webhooks
ah is dbl going through API changes? my old implementation of webhooks completely broke, and the test button isn't working :<
Well eh, anyone who uses dblpy. There's a very different system for webhooks planned to be implemented
nah, not DBL itself
dblpy's new version
right
because i was using a flask webserver to receive post requests but dbl suddenly stopped sending them yesterday
the test button is known to be broken and there's already a fix. An update to fix it will be pushed with several other things
dude
this is for topgg api
they gave you wrong info
-api
TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs
Hey
Is there a way i can catch the upvote event for a server using discordbotlist api with .NET library?
I have a problem with the API. I want to get information about upvote on a webhook using express. I wrote this code and it doesn't work.
const express = require("express")
const bodyParser = require("body-parser")
const app = express()
app.use(bodyParser.json())
app.use(express.json({ extended: true }))
app.post("/hook", (req, res) => {
console.log(req.body)
res.status(200).end()
})
app.listen(5000, () => console.log("[API | OK] Api server started on 5000...."))
Check this @potent tide https://github.com/Giuliopime/top.gg-webhook-tutorial
Oh wait you wanna use express?
Not the dblapi?
Make sure your VPS firewall port is open
Also the test qebhook button on top.gg is broken atm
Make sure your VPS firewall port is open
@jagged pine port is opened
How do I get the total number of votes the bot has using the python API wrapper?
monthly or total?
monthly
get_bot_info
ah so i get the monthlyPoints key pair from the returned dictionary?
Mhm
ok thanks!
๐
@potent tide why is there a 5000 at the end
There should be hook
From rhe code you sent
Yeah but he has /hook in the code
why not test the /hook endpoint itself
It should be :5000/hook
instead of the main domain page
@potent tide why is there a 5000 at the end
I specified the IP address of the VPS
It should be :5000/hook
^
I specified the ip and :port
http:// and webhook test button isn't working atm
I have nothing outputs
Hm
I dont know what url to send my webhook to
where do i send it?
what
who pinged me?
ยฏ_(ใ)_/ยฏ
I dont know what url to send my webhook to
where do i send it?
Hey
Is there a way i can catch the upvote event for a server using discordbotlist api with .NET library?
Still cant find a way to do that ๐ฅ
I dont know what url to send my webhook to
@eternal iron have an HTTP server listening for HTTP POST requests to the URL
hello
i voted for my bot
and i aint getting logs
Webhook from dbl is running at http://private/dblwebhook
I have a problem with dblapi.js
I took the sample code
const DBL = require('dblapi.js');
const dbl = new DBL("", { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
And on the site specified IP vps and :5000/dblwebhook
And there is nothing.
import dbl
import discord
from discord.ext import commands
from discord import Webhook, AsyncWebhookAdapter
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = 'I have my token here'
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=False)
@commands.Cog.listener()
async def on_dbl_vote(data):
channel = self.client.get_channel(762378445841235998)
await channel.send(data)
def setup(bot):
bot.add_cog(TopGG(bot))
Does anyone know why this doesn't work?
I don't get an error
oh, do I have to use webhooks?
Yeah
since it's a JSON, I can just do a aiohttp request and get all of the info right?
or does the data parameter give me the info in the json?
I need to write a whole guide since people keep misunderstanding what the webhook is
webhook_path is the thing after the main URL
http://your.vps.ip.address:port/webhook_path
oh
so I just do like http://111.111.11:5000/webhook_path?
or would webhook_path be my webhook url
it's uhh
an endpoint specifically set up for your webhook
so if you set webhook_path to /dblwebhook123, the URL becomes http://111.111.111.111:5000/dblwebhook123
oh
is the test button on https://top.gg/api/docs#mybots working?
or is the test button on the edit page the only one thats broken?
do I have to run my bot on my VPS for it to work?
so do I put http://111.111.111.111:5000/dblwebhook123 in my webhook url spot on my edit page
and put like /dblwebhook123 in the webhook url spot in my code?
hello
i have been setup dbl webhook and i can post server count but i can't receive a meesage to the webhook when someone voting
did you configure your webhook properly?
in your top.gg edit page, there is the webhook settings you have to fill up
sorry wrong chat lol
i have been setup dbl webhook and i can post server count but i can't receive a meesage to the webhook when someone voting
@elfin bolt
0w0
anyone can help pls?

`
@elfin bolt show your webhook configuration
then you dont need express at all
nor server
you also dont need postStats, and you put the client in the wrong place
where i must put it?
new DBL("token", { webhookPort:25573, webhookAuth:"yourwebhookauth" }, client)
you can remove http, server and app
ok thx i'll try
you can also remove the setInterval and postStats
you can use these to console.log when it votes
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`dbl error:`, e);
})
There's no vote event 
dbl.webhook.on
I'm making a vote reward system, but my code didn't work.
Is there anything wrong?
const DBL = require("dblapi.js");
const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'password'});
....
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
sendLog(`User with ID ${vote.user} just voted!`);
});
Yeah from the looks of it https post requests aren't being sent at all
And the test button still doesn't work even though "there is a fix"
is this normal?
yes
nice :D
is there anything wrong with my config?
i have that print(body) for any request to that endpoint, but when someone votes i get nothing
Make sure port is open, URL is correct, and firewall isn't blocked requests
Didnโt the test button fucking die?
yes... it would be great if the fix that was mentioned yesterday could be deployed asap so i can actually test what my issue is
the save button broke too
I have a problem with dblapi.js
I took the sample codeconst DBL = require('dblapi.js'); const dbl = new DBL("", { webhookPort: 5000, webhookAuth: 'password' }); dbl.webhook.on('ready', hook => { console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`); }); dbl.webhook.on('vote', vote => { console.log(`User with ID ${vote.user} just voted!`); });And on the site specified IP vps and :5000/dblwebhook
And there is nothing.
is there a way to add fallback stuff to the DSL API so if for whatever dumb reason DSL webhooks don't function (aka status code is not 200) then it will do the stuff which i tell it (or maybe even send me a DM through @wild lantern botum)
-api
TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs
Literally translate the text Luca sent
@sullen nymph Ok Gracias
orrospular
hello
how can i get spo presence
I listening spotify right now
but its look like custom status
@tight hound this is for the DBL API only, not the api of your library; go to the library's support server or to #development
oh ok ty
the test button doesn't seem to work on the webhook setup page, if I vote for my bot a POST request shows in my logs but pressing the test button does nothing
It doesn't work
@craggy sentinel
-b 589632747073437696 Spamming and then leaving
Banned Nikiand US#4432 (@faint marten)
e
How can I find the API token of my bot?
Hi, Can someone help me out with sending my bot's stats?
there is a function called post_guild_count() in py, does it have any argument?
And also what kind of data will I recieve when someone voted?
Hello, Can i get help here where to get the Auth password and Webhook URL?
Itโs where the Webhook is hosted
and auth is a way of verifying requests
itโs sent in the headers
the site says there is a problem saving the webhook
is it because my bot is unapproved or is it for some other reason?
because itโs unapproved
alright thank you
anyone ever just read the docs
How can I make like a "voting-logs" channel in my server? Like when someone votes the bot on top.gg it'll post a message in voting-logs that this person voted. What exactly can I do to achieve this?
when vote is emitted, then get the guild with the channel, get the channel, then send to the channel with vote.user
Can we not get a API key for our bot before it is on top gg? 
nope
Where do I get dbitoken?
https://top.gg/api/docs#mybots @restive otter
Thanks
how could i set the password for my webhook ouath?
the bots page, edit near the bottom
can u provide a screenshot?
oh okay
(node:19288) UnhandledPromiseRejectionWarning: Error: socket hang up
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
it didn't log anything although someone voted
anyone?
One message removed from a suspended account.
One message removed from a suspended account.
he said he is helping someone else iirc
yes
How can I make like a "voting-logs" channel in my server? Like when someone votes the bot on top.gg it'll post a message in voting-logs that this person voted. What exactly can I do to achieve this?
@merry zodiac Have your bot listen for vote events to the top.gg API then when it detects one verify that it's coming from top.gg by using your API key then if it passes the verification have your bot send a message in your server
ah ok thanks!
Js
just create a web server that listens for post requests
Ok
My 5000 port is already used. If i change it will something happen to vote listener? If so, what shall I do?
where will i get this ( top.gg token )
where will i get this ( top.gg token )
@restive otter on your (approved) bot's page
Ok
@restive otter My bot is still not approved
Why when someone votes, the bot announces it twice ?
Why when someone votes, the bot announces it twice ?
@covert geyser the bot is probab running
somewhere else
trying disconnecting ur host and run the cmd
if it runs then the bot is running somewhere
hey
hi
if it runs then the bot is running somewhere
@restive otter Tried, the bot is running only in my VPS
Reset the token
That'll stop anywhere else from running
Then restart the bot on the VPS with the new token
I don't need to do that, I said my bot only runs in my VPS. It does not run elsewhere, I tested.
I don't need to do that, I said my bot only runs in my VPS. It does not run elsewhere, I tested.
@covert geyser just do it
u wont lose anything
My 5000 port is already used. If i change it will something happen to vote listener? If so, what shall I do?
@restive otter no
Just change the port on the site
Just change the port on the site
@rapid kettle I searched a lot but couldn't find somewhere that determine the port in website
how would i go about connecting my bot to the api so it can send an embed when someone votes for my support server
Check latest pin
@jovial kiln that only documents how i would send an embed for when my bot is verified.
Not the support server
@covert geyser again, its on your end
let sniper1 = args.splice(0).join(' ');
// let sniper2 = msg.content.slice(1).join(' ');
let sniper2 = args.slice(1);
let sniper3 = args.slice(2);```why is this isn't working
when i use my cmd like !addsnipers first second third
{ t1sniper1: 'first second third' } it prints all in first array



The way I'd do it is suggest you two @restive otter @analog quest to use the appropriate channel, #development
-api
TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs
Is there any way to make you read the message right above yours?
@covert geyser again, its on your end
@median badger I did it, I reset the token.. but same problem.
The bot still send twice the reward message.
i feel like i had this same issue with the default example
const t1sniperlink2 = await page.evaluate((fileData) => window.find(fileData), [fileData.team1.t1sniper2]); isn't this correct way to use eval?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`)
if(config.sendToChannel === false || !client.channels.cache.get(config.channelId)){
console.log(`User with ID ${vote.user} just voted!`)
/* Gets username */
dbl.getBot(vote.user).then(bot => {
console.log(bot.username)
});
}
if(config.sendToChannel === true || client.channels.cache.get(config.channelId)){
let channel = client.channels.cache.get(config.channelId)
/* Gets username */
dbl.getBot(vote.user).then(bot => {
channel.send(`User with ID ${bot.username} just voted!`)
});
}
});
it isn't sending the votes to my channel nor logging it in console
dbl.webhook.on isn't working yeet
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`)
I think so, put in the URL and press the test button on your bot webpage
Kk
@restive otter
Which is best. Api for chatbot
this is for top.gg api only @restive otter move to #development
you have to provide your webhook to top.gg to send updates to
means your firewall has to be configured to let shit on port 5000 through to whatever you are hosting the bot on
if you are hosting it locally, that is
I'm passing the client object inside the DBL constructor in dblapi.js but it doesn't automatically update the server count
I'm using dblapi.js v 2.4.1
Hold on - is it possible to implement voting by simply using the on_dbl_vote event?
Can you help me how to setup and i can receive vote updates
ok i mean i setup now and wait until works later.
also you are botdev, shouldn't you know this stuff 
ok thanks for help
am i using this correctly?
dbl.getStats("264811613708746752").then(stats => {
status_list = [`honkhelp | ${server_count} servers`]
};
One message removed from a suspended account.
One message removed from a suspended account.
if you wanna get server count, client.guilds.cache.size
One message removed from a suspended account.
if you wanna get server count,
client.guilds.cache.size
@restive otter yeah, but then i don't know how tosetIntervalto refresh that
umm let's go to #development
When I have a value inside of the Authorization field, the webhooks dont post. This issue only occurs for bots not for servers
Has anyone else noticed this?
whenever there is a value inside of the Authorization field of webhooks they wont post to me
but if there is no value in there, it posts fine
Nvm, I guess there was some lag or something
Hi, I want to know how to do an advantage when someone votes for my server, they get the rank of voter, how do I do it
plz
plz help mee
๐ญ
plz help me
anybody
bruh
read the API docs
you have an API or a callback url on your bot/api for the bot
how
that requests some data in body
based on the docs provided in API
then you put that url as the callback/endpoint to hit on vote with info
Do you need to activate it?
read the docs
the docs show it all
you need an API endpoint that recieves the data that dbl will send you on vote
that contains user info, and a token to verify the request
you can have an API endpoint do some shit when it gets hit
go to discord evoloper and create new bot and go to visual studio and go to my server and create a webhooks ?@ebon mist
how Do you need to activate it?
DSL supports role rewards
do you know what an API is?
no
Fucking christ
yeah dont make a discord bot, go back to basics
you dont have the knowledge for this 
yet
I do not know anything
Sigh
go like
Cut the chatter
watch a tutorial or read some docs and make a website or smthn(no php or asp)
I'm about to mute you two if you keep this conversation in here
@gilded imp I told you to move to #support
ok
I can't get api even though I add my bot and it says you don't have a bot
Needs to be approved
Thanks
is it possible to use the vote's api for server and not for bot ?
.
@grave sundial query isnโt always defined
if it's undefined that should mean the vote was directly from the site?
I need help! I'm trying to set up a vote webhook, but I keep getting this error message
I'll do everything right, copy and paste these, and then ERROR MESSAGE. can someone help me :)
- Translation for the text, which is in German: The following is displayed on top.gg:
Pleaaaaase Help me โฅ
Hey guys! How can I call a method every time an user votes for a server?
I dont understand how webhooks work sorry
Is there any event for it?
What the ... why don't we show me a bot?
One message removed from a suspended account.
is it possible that the API is not working because my bot is not yet vertified?Can that be because of that?
One message removed from a suspended account.
One message removed from a suspended account.
And that's why the bot is still displayed ...? Ah ... now I understand
Sorry, I use Google Translate, I can speak English, but not soooo good that I can write whole sentences with it (I know the grammar is a catastrophe in this sentence)
I hope you can understand me ;-;
I just see a message like this ... What happens if the bot is not accepted? Will it stay that way forever, or can you then ask again about it?
Thanks for your help ^^ So from above
I can speak a bit german in #general-int if you still need help
OK nice ^^
const t1sniperlink1 = await page.$(`a[href*="/player/111111/Firstname_SecondName"]`);
is it possible to avoid those "/player/ID/" and evaluate "First_Second" name
When I am setting up my webhook, what am I supposed to set webhook path to? I am hosting my bot locally.
Hi
sorry man just noticed that question, its just the path
/dblwebhook for example
@harsh drum you need to open ports to the webhook
If you use vps then you can do it easily.
The path is the path to the dbl webhook.
@restive otter I'm not sure I understand? How come O have to manually do the networking for this webhook but the library will automatically connect?
I am hosting my bot locally too so how do I go about that
And also in top.gg webhook url what do I put there if I'm hosting locally?
There are no tutorials at all and the docs explain nothing, it's so hard to understand what I'm msupposed to do here
if you are hosting your bot locally, you will likely need to port forward your dbl webhook port so that it is accessible by top.gg to send the webhook to
My IP changes sometimes... How can I make sure this doesn't stop it from working?
use a dynamic DNS service
Yes! afraid.org offers a lot for free
@potent basalt 0.0.0.0 means "any IP" you need to put the IP of the VPS bruh
@restive otter how can i get IP of VPS
like it should tell you
try doing curl https://portquiz.net in bash
Hey, is there a way to send a message everytime the bot gets added to a server via top.gg?
@restive otter i found the ip. What next?
@potent basalt put <IP>:<PORT>/<WEBHOOK_PATH> as the URL for webhooks
don't forget to put the correct http protocol
I'd always go for HTTPS
If the VPS doesn't have https stop using it
๐
i have tried many times to make the top.gg website show my bots server count but i can never understand it. sorry if its easy but i just dont get it
@restive otter Like this?
Is there an API endpoint for updating the bot?
Is there any documentation on dsl voting webhooks?
Is there any documentation on dsl voting webhooks?
@light talon pins
thanks
@potent basalt i can't help you with every step
Ik his is for discord bots, but how can i get all votes for a discord server? Because there is no API docs for servers and can't get a token for a server...
Ik his is for discord bots, but how can i get all votes for a discord server? Because there is no API docs for servers and can't get a token for a server...
@charred seal The DSL API is still in beta
But you can use webhooks with it
The dblapi libraries don't support DSL yet
The pins in this channel show how to use it
Is there a way to get a more detailed overview of recent bot votes? Like a vote timestamp/time + whether it was counted as 2 or 1
Wdym by the last part? "counted as 2 or 1"
@restive otter if the weekend multiplier is applied
I am sure my bot is handling them correctly, but my database contains 1 more vote than dbl has saved
no wait, this is weird
I could post my code if anyone wants to look at it
@junior tusk <vote>.isWeekend
yes I'm using that and the total vote amount in the database is different than the total vote amount in dbl's database
that's what I realised when I said "no wait, this is weird"
weird
so there's probably something going wrong in how I save it in the database, or (which is not the case, I guess) dbl didn't save it correctly
what makes an official api library official
yes I'm using that and the total vote amount in the database is different than the total vote amount in dbl's database
@junior tusk just a thought, does your database reset the number of votes at the end of the month? If so, maybe your db resets at a different time to the top.gg db and that timeframe between the two resets is where that extra vote slipped in?
I need help with the API, how can I get the password for top.gg?
@quartz obsidian in the webhooks tab in your bot's profile editing pagehttps://top.gg/bot/YOURBOTIDHERE/webhooks
@golden adder thanks for the answer. But my votes reset at 2 am UTC, the same as DBL does
I asked them once
@quartz obsidian in the webhooks tab in your bot's profile editing page
https://top.gg/bot/YOURBOTIDHERE/webhooks
@golden adder ohh, ok thanks!
And for the port, what should I put?
I just used 5000 like the docs say, but you can open any port for it
Oh ok, yeah cuz I also put 5000
Alright thanks so much again, sorry for bothering
im new to the api, how'd i go about getting the voters discord id?
thanks
wha
why do I get that error?
the channel exist, I use that channel somewhere else in my code
that one is also not working
#development, that's a discord.js error
@south crow sanฤฑrฤฑm kanalฤฑ bulamฤฑyor
-notr @north geode
@north geode
ฤฐngilizceden baลka dillerde sohbet etmek iรงin #general-int kanalฤฑnฤฑ, top.gg hakkฤฑnda (Tรผrkรงe olarak da) destek almak iรงin #support kanalฤฑnฤฑ kullanฤฑn.
Bu kanalda Tรผrkรงe konuลmayฤฑn.
ok
-api
TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs
how do i get server votes? cant find anything about it in the api docs, only about bot votes
any documentations for the webhooks?
See pins for the request payload
Any Java experts around?
someone help me. i can't put a hyperlink in the footer of an embed
im using python
text doesn't work in the footer
-api
TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs
Use #development
Hello, I want to make a voting reward for my bot. I've read the documentation, but I do not understand, what should I put there? I tried to put there my webhook URL, but doesn't seem to work
Is there an API endpoint for updating the bot description etc?
(I am using python)
is the api only for bots or also for servers?
Currently the api for dsl is in beta, read the pins in this channel
DSL API isn't a thing as of yet
I thought it was in beta?
Well if you consider webhook support an API...
Ah yeah
Rip
how do i setup the DBL vote logs
@commands.command(hidden=True)
async def test(self, ctx):
"""test."""
test = await self.dblpy.generate_widget_small()
await ctx.send(test)```
Is it me or none of the generated images can be shown on Discord?
how do i setup the DBL vote logs
@peak lodge U gotta be approved by top.gg
thats python
oh i only know js
I think thats an issue for lot of us, widgets arent showing up
-api
Hi, I verified my port forwarding is working on this website https://www.canyouseeme.org/ but when I do test upvote or real upvote my webhook does not receive anything ...
A free open port check tool used to detect open ports on your connection. Test if port forwarding is correctly setup or if your port is being blocked by your firewall or ISP.
What could be the issue
I have my events
@client.event
async def on_dbl_vote(data):
print(data)
@client.event
async def on_dbl_test(data):
print(data)
``` set up
I have never done networking or used webhook before I need help
There are no tutorials for this
Did you init it
dont share your creds lol
They aren't my creds obviously
Doesn't it default to /dblwebook?
also
@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="")```
^^ this is for a cog
My code is the same just with less formatting in the print and not in a cog
In top.gg it is set to https://my.ip.goes.here:5000/dblwebhook
oh ure not using a cog
No just for testing to make sure it works I couldn't be bothered to put it in a cog
I'll do that when I actually implement it to my bot
it doesnt print anything on your console?
No
It just does nothing
I tried voting for the bot on a dummy account, and also using the built in test function
Neither did anything
well try with the path set in init
when you try to access to that link, do you get on an error webpage
Going to this page in the browser just says "site took too long to respond"
aight then the link is not reachable
In the router I set it to share https server on 5000, should it be http server?
Here, I will try with HTTP server
its hosted on your pc?
ye try with http
https is when you have a ssl certificate
Also mine works with https so for some reason u cant reach it
Ok, let me try again
If its still not working, try to install a webserver on your pc such as IIS or Wamp
With http server i see 405
I just save votes to my db and attach a timestamp. Obviously that's not precise when the DBL API is slow to respond since sometimes it can take up to 30 minutes to fire the webhook event.
Honestly though do we need anything more precise? Like, being off by 30 minutes for the DM reminder my bot sends doesn't make that much of a difference. The user will still have 11h30min to vote again.
I store that info too but I run it in a separate process so if my bot crashes for any reason and misses the event, my voting manager process will still pick it up, save it to the db and send the confirmation DM to the user.
The only way my system can fail is if my host goes offline but I've had 100% uptime so far
Get a cheap VPS ๐คทโโ๏ธ
At least to manage the voting?
Yeah
Take a look at Pulseheberg. They have the best value VPS plans I've seen. Been using them for 6 months now no problems.
Can I add fallback stuff to webhooks? Like if the vote reward webhook doesn't work the API will do smth else?
sadly no
I wish we had fallback webhooks (as I want to collect them accurately too), but rn there is no fallbacks
and they send the webhook once
Hi guys, when running the bot code on a windows PC the webhooks are receiving events and when you go to the url it says 405, but when running on linux pc webhooks aren't receiving events and when going to url it says "refused to connect"
Is there something extra I have to do to make this work on linux
Nevermind, the issue is not with the PC
i'll keep it bookmarked for the future, thanks
@restive otter you could just create data for the user on dbl vote
Nevermind, the issue is not with the PC
@harsh drum You fixed it ?
UnhandledPromiseRejectionWarning: Error: 403 Forbidden
@harsh drum You fixed it ?
@restive otter Yep
Are u working on dblpy?
hmm





