#topgg-api
1 messages ยท Page 95 of 1
oh my... ๐คฆ
can I get the votes of a bot as a int in python?
"as a string"?
My bot logs that its webhook is running, but it doesn't catch any votes whenever it receives a vote. What could I be doing wrong?
My bot logs that its webhook is running, but it doesn't catch any votes whenever it receives a vote. What could I be doing wrong?
@restive otter maybe your auth is wrong
I just checked those, they weren't wrong
vote count? for monthly and total votes use get_bot_info
for last 1000 votes, get_bot_upvotes
okay thanks
This is what I'm trying to do and it's not working, is something about my event wrong or what?
dbl.webhook.on('vote', vote => {
var channel = client.channels.cache.get("731772484285759600");
var user = client.users.cache.get(vote.user);
console.log(`${user.tag} just voted!`);
try {
var embed = new MessageEmbed()
.setAuthor(user.tag, user.avatarURL())
.setColor(randomColor())
.setDescription(`Thanks for voting for Semblance!! :D`)
.setFooter("You can see the vote links by typing +vote :D");
channel.send(embed);
});
This one works though
dblVoting.webhook.on('ready', hook => {
console.log(`Webhook running at https://${hook.hostname}:${hook.port}${hook.path}`)
});
so shouldt it be this? @sullen nymph
info = self.dblpy.get_bot_info(bot_id=708700387770630194)```
because its not working
How come?
because you said I should use get_bot_info
wait+
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = ''
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='/dblwebhook', webhook_auth='', webhook_port='')
@commands.command()
async def topgg(self, ctx):
if ctx.author.id in info.team:
info = self.dblpy.get_bot_info(bot_id=708700387770630194)
await ctx.send(info)
# some more code for upvotes
def setup(bot):
bot.add_cog(TopGG(bot))```
i also imported everything
Are you sure you are not confusing fetch_application from d.py with dblpy's get_bot_info
I wanna get the upvotes later
this is just a test
but i know the error now ty anyways
Why does my ready event for my webhook work, but not my vote event?
i am not able to use webhooks
can anybody help?
im using dblapi.js package
i need the vote event
@restive otter whats your configuration on your top.gg bot edit page (scroll down to webhooks, URL and Authorization)
@twin matrix same as above, and also show code
where is your bot hosted?
vps
then the url is http://YOUR.VPS.IP.ADDRESS:YOURWEBHOOKPORT/dblwebhook
for example http://123.32.52.42:5000/dblwebhook
dblwebhook need to be created ?
yes....
no
dblwebhook is the default path used by dblapi.js
you can change it if you use the option webhookPath:"yourpathhere"
but if you dont use it, then its dblwebhook
dblapi.js does that for you
you only need that if you're listening to requests yourself through a webserver
in top.gg you write what you want
in your code's webhookAuth, you need to write exactly what you wrote in top.gg
is this an example of posting the server count?
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
i saw this on the docs
oh wow thats neat never seen that before
are you sure it's the token? 
how do i make the server count update on the site?
im using the server count example from the docs
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
would it be
dbl.on('guildCreate', () => {
console.log('Server count updated!');
})
```?
just wondering
const snekfetch = require('snekfetch')
setInterval(() => {
snekfetch.post(`https://discordbots.org/api/bots/stats`)
.set('Authorization', 'YOUR DISCORDBOTS.ORG API TOKEN')
.send({ server_count: client.guilds.size })
.then(() => console.log('Updated discordbots.org stats.'))
.catch(err => console.error(`Whoops something went wrong: ${err.body}`));
}, 3600000)
i looked in pins and that was there
ah
it doesnt work
oh wait yes it does indeed work
stops typing
thank you site admins!
๐ค
the api by default posts updates every 30 minutes when you initilize it @hasty mortar
@vapid cape my config
URL: https://0.0.0.0:5000/dblwebhook
auth: secret
the 0.0.0.0 you changed just to hide your actual ip right?
no
0.0.0.0 isnt an ip
I hope so, If you didn't change it for that, your problem is that you have to use the server's ip
oh?
i wonder if 0.0.0.0 is a valid ip.
i mean 1.1.1.1 is a valid ip ๐ค
The webhook logged that it was running, it just wouldn't catch any votes with the vote event
Well that's because 0.0.0.0 isn't your ip
(or ask your vps provider, if you use a vps)
okee doke, thanks ๐
How am I suppose to make my bot actually use my IP? I changed the URL in the webhook options in my bot's edit page but my bot still logs the 0.0.0.0
it will always log 0.0.0.0
ah
0.0.0.0 is basically just an alias for "all available ips on this machine"
(ipv4s*)
yeah, found it on Wikipedia
new DBL(DBL_API_KEY, { webhookPort: 5000, webhookAuth: 123 })``` will this work?
webhookAuth should be a string
"123"
ok
port is fine?
5000
when i test the webhook it doesnt return anything in my console
dbl.webhook.on('vote', vote => {
console.log(vote);
});
i have changed the auth to string
Sadly, I'm dealing with the same problem as you, Firez, which everyone just told me to check if my auth, URL, and webhookauth were right, which they are.
๐ฆ
const dbl = new DBL(DBL_API_KEY, { webhookPort: 5000, webhookAuth: 'pokescape'});
what is wrong in this.
It doesn't look like anything is wrong
^
then why i wont get anything in the console
What's that IP
does the 'vote' event runs
if i test the webhook
Why is there two colons
k
What's 7009
Okay, I'm not sure if that is right
the ip address
Are you sure it's a good idea to post your IP address in a public server

why doesn't the api work for me?
I can't post my server stats
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.cache.size);
}, 1800000);
});
dbl.on('posted', () => {
console.log('Server count posted!');
})```
the 'posted' event never gets called
and no events are called
The official api lib has an autoposter iirc
oh it does?
so all I have to do is just connect?
yep
var dbl = new DBL(API-KEY-THINGY, client);
pretty much just this is all you need for the stats to update ^
const dbl = new DBL(DBL_API_KEY, { webhookPort: 7009, webhookAuth: 'pokescape' });
``` why is it not working
It ain't a great thing to show ur auth password ig
Ik, but keep that in mind when showing screenshots, someone could send fake vote data to ur bot by knowing the auth
I mean they'd need the ip first
but why does this not work
is the port open?
I mean they'd need the ip first
Still, better not to facilitate
did you save before testing?
Yeah, try using postman to see if the port is actually receiving requests
yes
Or use https://apitester.com
Do you know how your APIs are performing? Check your first and third party APIs for functionality and performance with our free and easy-to-use API tester.
thanks
@restive otter my webhook worked
@twin matrix What was wrong with yours and what did you do to make it work? Because mine still doesn't work lol
the ip address was wrong
and save the edited form and then test the webhook
ur webhookPort should match with the port given on ur form
i just have a question with the dbl webhook: should i return a 401 error if the authorization token is wrong?
question to ppl who use discord.py: how to use on_dbl_vote(data)?
it just wont trigger on vote
configure what?
your webhook settings for your bot
where is your bot hosted?
then your webhook url should be https://REPLNAME.ACCOUNTNAME.repl.run/dblwebhook or something like that
you can see it in your repl.it editor, whats your project url
did you set a webhook_path in your dblpy?
no
so then your path should be /dblwebhook by default
your webhook URL is your project url + /dblwebhook
thats what you need to put in the URL field
in your webhook settings in top.gg
do you have a webhook_auth in your dblpy?
no
do you have a webhook_port?
no
then you're using the wrong example
then what example i should use?
yes...
still silence
hey
@vapid cape
@vapid cape
looks correct
are you using any other http server like flask?
or any other thing that listens to a port?
i have a keep_alive func in other file named botwebserver.py
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
import flask, waitress
from threading import Thread
app = flask.Flask('')
@app.route('/')
def main():
return "Bot is online and working."
def run():
waitress.serve(app, host='0.0.0.0', port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
idk how python works with ports, but normally you cant use the same port more than once
unless python somehow does some sort of redirection internally
try testing it without the keepalive server
you can also test it with postman or reqbin, should give you more information on whats wrong
just for a test
even without keep_alive() it still wont work
How can I get the bot to send a message to a particular room when someone votes?
@opal parcel what language do you use?
js
https://top.gg/api/docs#jslib ok so check this out
try using the top.gg lib for this (dblapi.js)
@restive otter try testing with postman or reqbin
@restive otter thats because you're using a service that isnt for bot hosting
ok i try, tnk @trail sigil
ofc its going to shutdown the service if it isnt constantly being pinged
you'll need to setup the ip/port too, so feel free to ask again here once you've set this first bit up
@vapid mango 1) we dont spoonfeed 2) wrong channel
@restive otter thats because you're using a service that isnt for bot hosting
@green mantle then why are discord bots still alive?
Excuse
well, it's our choice, pay or not
i mean you can choose to run a bot and pay or not run a bot and dont pay lol
That's how to do it?
@trail sigil
That's not how DBL hooks work, I think
yeah, but glitch only has port 3000 open
so you need to firstly set the port to 3000
that's right?
so you need to firstly set the port to 3000
@trail sigil ok tnk
api/bots
ty
and then on your bot page, click 'edit' and enter the url to your glitch project, plus the port then followed by /dblwebhook
include the authorisation too
you need /stats after your bot id
ok
my vote webhook isnt works i copied code from docs
what do you have so far?
@trail sigil Can help bro?
@restive otter you've included incorrect property names
it is supposed to be server_count, not serverCount
and shard_count, not shardCount
@opal parcel you need to make a server, because something else is also using that port
so you can try the http module to make a server
then just put the server into your dbl options
But how do I open server
you shouldn't have to download it
it is a standard module that comes with node js
https://nodejs.org/en/knowledge/HTTP/servers/how-to-create-a-HTTP-server/
use the code in the link
and at the constructor the the dbl api, put the server into your options
{ webhookServer: server }
Do I need to change anything in the code?
i need a api for a random cat image
This for for the top.gg api, use #development
There is no error and it does not work to do a vote.
what did you put in your top.gg edit page?
in the url and authorization
also, does "webook running at" show in your console/terminal/logs?
the url is wrong
You cant post directly to a discord webhook
it should go to the webserver that the lib makes for you, the url should be http://yourip:3000/dblwebhook
WHAT
yourip should be a public ip of the server your bot runs on
@opal parcel
I'm no API expert, but I believe yes, you just combine them
How do I combine these
I'd say after the webhook shite, just add , client, but then again, I'm no expert
(token, {web hook options}, client)
Does not work @vapid cape
const dbl = new DBL('token', bot);
const dbl = new DBL(`url`, { webhookPort: 3000, webhookAuth: 'token' });
How do I combine these?
the url webhook
and webhookAuth is not a token
I told you once, he told you twice
What am I supposed to put here?
What am I supposed to put here?
How would i go about getting a DBL api key?
is there a way to use the widgets as images in an embed?
Do i have to wait till my bot gets apporved to get an api?
yes
daymm
is there a way to use the widgets as images in an embed?
anybody?
what widgets
I did it, I press
"Test" and it does not work @vapid cape
show current stuff
I do not need to set up the UrlWebHook anywhere?
@vapid cape
looks good now
wait
always press the save button before testing
oh nvm
yes
okay
since its a string in the headers
If I pass the bot to VPS what should I do in the URL?
@vapid cape
http://YOUR.VPS.IP.ADDRESS:PORT/dblwebhook
Down at the bottom
what webhook
To run the messages from the bot
theres nothing else to do
this
your configuration should be correct, you should receive a "user with id just voted" in your console/terminal when you press the test button
not http://https:// lol
what
why do you have http://https://
Where should I put the webhook from discord
it doesnt
it gives you a "vote" event
and you need to make your own code inside the .on("vote")
Can I make the webhook send stuff to discord webhooks
dbl.webhook.on("vote", vote => {
let user = bot.users.cache.get(vote.user);
user.send("bla")
})
Thanks Tim
@vapid cape
How it will identify the specific room.
channel.send(`${vote.user} just voted for us on top.gg!`)``` or something similar
its for js
i dont think that will work
since you need to identifiy which channel to send it into
and it cant start with user.send
it should say message.send smthing
let me check
user.send() will send a dm to them
if you want to post in a channel, you need to specify which channel
from client.channels.cache
i think he meant to send it in server
because dming to the person that voted to you doesnt maek sense
My script above is for channel (https://canary.discordapp.com/channels/264445053596991498/412006692125933568/732317235892322304) and this is more #development than #topgg-api, why not move there
it does make sense, many people use it to send a "thank you" message
its about api tho
@vapid cape do you have a script that sends it in a specific channel?
Yes
but i just showed how to use the vote event, up to you to code whatever you want with it
even tho my bot is not approved yet ๐ฆ
you can't use the voting api until your bot get approved
but you can setup the code beforehand
the code is the same, all you need to do is pick a channel instead of a user
using a channel id
731944073673441393 if this is my channel id how do i implement that into the code
๐
let channel = bot.channels.cache.get("channel ID")
channel.send(`${vote.user} just voted for us on top.gg!`)```
will it automaticallly know if someone voted for us?
If you put it in the webhook event, yes
the api library
Example of using webhooks to receive vote updates
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { 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!);
});
hmmm
ill do this tomorrow
top.gg page: http://95.121.235.145:5000/dblwebhook (numbers of ip of course not real) auth: Passione12345
code: const dbl = new DBL(topggtoken, { webhookPort: 5000, webhookAuth: 'Passione12345'}, client);
so if the test doesnt work then port 5000 is not open right?
contabo vps
check if contabo needs opening ports
some hosts require you to do it in their admin panels
if you're running a windows vps, you also need to open ports in windows firewall
you can also test with postman or reqbin
should give you a timeout error if the ports are blocked
question about dbl webhooks - if I reload the cog that contains the webhook, will it fail to work?
Lol
I'm a bot
v
i am also a bot
I am a bot too
i had that problem too
ye
oi
can someone help me set up a webhook thing for when someone upvotes my bot?
The api docs are pretty good
If I host my bot on heroku, is there a certain way to setup the webhook URL since it's on heroku or can it still be https://(ip):5000/dblwebhook ?

That's the thing, nothing works still despite my URL using my IP, and yes, I've checked all the Auths if something was wrong, made sure the code was correct, and had someone here check if my code was wrong.
use the url, itโs perfectly fine
const dbl = new DBL(config.apitoken, { 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!`);
console.log(vote.user);
});```
Does anyone know why my console is not getting any voting updates? I loaded the code and I tried to vote but it does not give me the log.
where do i do that?
i just copied the url and clicking test doesnt do anything?
what url did you copy
the url that i receive on my ready log
where is your bot hosted?
better testing it in heroku then
for home pcs, the correct url is http://YOUR.IP.ADDRESS.HERE:WEBHOOKPORT/dblwebhook
but home pcs usually have a firewall in their router/modem
that needs to be port forwarded
heroku doesnt have this issue
but heroku doesnt use IP based urls
the correct url for heroku is https://PROJECTNAME.herokuapp.com/dblwebhook
im gonna make a webhook on my vps
how does the test function work? will it send a message to the console?
https://PROJECTNAME.herokuapp.com/dblwebhook
is this in my code or the url in top.gg
because i put in top.gg it doesnt work
do i need to put anything there
which one is webhookAuth?
the one you define in your code
ie, if you have webhookAuth:"password" then you write password in Authorization in top.gg
i see
it still doesnt work though
i got an error code of H14 instead of a vote log
ah because im running free hosting so idk if running 2 dynos will double the rate of hours usage
most likely will
the only alternative is to use a middleman service to handle votes for you, i recall seeing something like that before
i see. i just got H10 error after switching on web dyno
what is the error
app crashed
it also says web process failed to bind to $PORT within 60 seconds of launch
what port did you give it?
usually 3000
i gave 3000
but you can give it process.env.PORT instead to make it assign the correct port automatically
i think i got it to work??
if i were to get a raspberry pi to host my bot, do i keep the same settings? or is there something that i need to change
you will need to change the URL
if the pi is in your home network, it will be your home IP address and you need to port forward your modem/router
if your home has dynamic IPs, you will need a dynamic DNS service
okay tysm. just to check how long does it take for test to show up in my logs
should show instantly
but some people report delays of up to 30 mins when the api is having issues
alright. it doesnt show much problems rn but if something goes wrong ill just ask here again
๐
Any idea about aws webhook?
Tem br
what exactly makes the difference between
dbl.webhook.on('posted', () => {
and
dbl.on('posted', () => {
One is wrong, the other is correct
both are on the official site
dbl.on('posted', () => {
or will this not work when i use a webhook?
so then this is a mistake on the website?
no idea how that got there
so also
dbl.on('error', error => { right
dbl.webhook.on('error', error => { wrong
?
lul they should defenitely update that
and for v12 discord.js this would be client.guilds.cache.size
yes, but you dont need that if you use the autoposter
ik but just wanted to mention it
ahm btw is there a way to block the autoposter to post the stats if the client.user has a specific ID? for test bots? i guess only through editing the module folder right?
like that?
could that cause any issues?
in my case, i just have an if and only initilize if the client id is right
yeah for the full thing but for now i would need the "voted" event for testing purposes
๐ค
pretty sure if you dont pass the client it wont post stats, so on test bots initlize without the client, on the real bot do
ah right thanks
dbl.webhook.on is for webhook events (ready / vote)
instant to few minutes/hours
oof, right i guess im sitting back
ok its been a hour, is webhook test that slow?
it is posting to the api, just not getting any webhook stuff
test it with reqbin or postman
Tried that
Do I need to include port for my webhook?
where is your bot hosted
on a VPS
then yes
ok ill try that
Huh?
Hmm, where exactly is this?
Nono thats not what I'm looking for,
I'm looking for how I can check whether a specific user voted for my bot in python. I'm trying to make a command where a user must vote for it to work.
oh
oops
I'm trying to have my bot send a message in a specific channel whenever a vote goes through, but my channel variable always becomes undefined for some reason, making it impossible to actually send a message to the channel and my votes always return undefined with the user, so I'm unable to actually post a message about a specific user either. Does anyone have an idea for why this is happening?
dbl.webhook.on('vote', vote => {
var channel = client.channels.cache.get("731772484285759600");
if (vote.user) {
//A bunch of code that's not important for situation
} else {
console.log("Test complete");
}
}
Is your client ready at that point?
No, and it never goes ready for some reason
here's the top part of my script for the dblapi
const { Client, MessageAttachment, MessageEmbed } = require("discord.js");
const client = new Client();
const fs = require("fs");
const request = require('request');
const topGGAuth = JSON.parse(fs.readFileSync("./Scripts/websiteScripts/topGGAuth.json", "utf8"));
const DBL = require("dblapi.js");
[Edit: Problem Solved]
Msi
hi
Hi, does anyone know how to get my bot to send a message on a specific channel when someone votes?
You mean when someone reakts to a message?
When someone votes for my bot
Oh ok then i cant help
You cna just do that with the vote event
The just client.channels.cache.get('ID').send('hello')
@mild otter Can you give me an example?
setup webhook first
check a key?
Yes, check if a DBL token is valid
I'm making an open source discord bot and I'm making something like that
I'd like to verify the dbl key
is there a way to reset the webhook? without restarting the bot
What do you mean?
not to my knowledge
It's to help my users to find errors in their config when they install my bot
itโs not hard to test it yourself
๐ค test it myself?
They could, there are some forks of Atlanta in this server
ok, thatโs fine.
if they get that working
they can easily verify a top.gg token
How? They need to call post stats
How can I check whether a specific user voted for my bot in python? I'm trying to make a command where a user must vote for it to work.
And I don't want to post stats, I just want to check the key
How can I check whether a specific user voted for my bot in python? I'm trying to make a command where a user must vote for it to work.
@restive otter webhooks, Iโm not sure how they work in python, the top.gg docs probably have examples
And I don't want to post stats, I just want to check the key
@rigid lichen they get the key from the official top.gg site, then they can copy it, you donโt need to check it
Oh
Thanks for your help... ๐
I don't know, I was checking the docs yesterday and couldn't really find anything
there is no way to do it
nor would you need to do it
if you think that people cant copy paste a token then they shouldnโt really have a bot
Halo
How do I check the authentication of my webhook vote?
Do any of you even read the channel topic? (TOP.GG API ONLY!!! ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED...)
Ok
Do webhooks authorise themselves?
You mean the webhook auth?
Yea
In the offical js lib
The webhook checks against the webhook auth(whatever you set in your config)
I can find the line here in a sec
ah, so I don't have to do anything?
anyway to know the last day the user voted?
or after how many ms,min, hours or days the user has voted again?
not in api-side in my knowledge, you have to store that information yourself.
did u do pip install dblpy?
pip install dblpy I've did, nothing more...
is that error when you run your bot, or when you install that dblpy?
which version of python you use?
dblpy covers: 3.5, 3.6 & 3.7
this should work, havent tested tho #312614469819826177 message nvm
3.8 supported too
oof, how to update it, I have 2.7 lmao
will google it
Are you sure you are using the right env var
As in, do you have python3 or python3.x or py
Try the commands I listed
Use python3 -m pip or pip3, whichever works
@sullen nymph both works and sends help cmds or sth like that
pip3 install dblpy
succesfully installed 
thx
Hey, I have tried to test a webhook on my local PC. I have port forwarded the 5000 and it's working perfectly.
The issue is, When testing a webhook in TOP GG it does nothing not even posting the server count.
I have configured everything, any mistake I have done?
def __init__(self, bot): self.bot = bot self.token = 'HIDDEN' # set this to your DBL token self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='HIDDEN', webhook_port=5000)
The Password and Token are hidden but I have added them already and the password has been updated on the TOP GG. Nothing works.
Have you tried sending a test request with reqbin?
Yeah I have, It's Status 404
I know, I have added /dblwebhook at the end. Whole URL is: http://IP:1500/dblwebhook
okay but thats still not what your port is set to
webook? :^)
I know bro, That was a snippet of the code. Everything is perfectly written, I have rechecked it. Nothing shows up.
/dblwebhook
I know, I have added /dblwebhook at the end. Whole URL is:
http://IP:1500/dblwebhook
I already did that above.
is this on a vps? linux windows? home network?
Home Network
port forward the port
also windows firewall will need it permitted
and tested on port check tool.
is voting not working right now?
Paint spraycan tool 
i just voted for a few bots and received nothing for it when i know they grant rewards, even my own
Haven't seen that since the 90s
had someone add my bot to their server, got a vote, then it was kicked before they got thanked 
๐
I get people DMing me like "where's my reward?"
Now most of the regulars just know it's DBL being slow
yeah, gotta add to my page that votes are slow recently.
I get people DMing me like "where's my reward?"
same dude for a while i thought it was an issue on my end
I have rewards coded but not enabled for top.gg.
Hoping the delay issues get fixed before too long so I can enable them.
Well there are often glitches like this. It was the same a couple of months ago
The api can be a bit dodgy
Don't wait for it to be flawless otherwise you'll never enable them ๐
Like it seemed to be ok for me over the weekend, but today it was kinda slow again
What's wrong with the API
People voting and it doesn't seem like I'm receiving in <dbl>.webhook.on('vote',..)
Is there any bug
@formal sparrow votes take awhile to be received.
Can be 30 minutes
Hi

const dbll = new DBL(require("./conf.json").dbl, { webhookPort: 5000, webhookAuth: 'whyareyoulookingherelol' });
dbll.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbll.webhook.on('vote', vote => {
client.channels.cache.get("731235069867589783").send(`${vote.user} just voted.`)
});
its not working
why
So, any idea why my dbl webhook isn't working, and how would I test it? Here is my dbl.webhook.on event dbl.webhook.on('vote', vote => { console.log(`User with ID ${vote.user} just voted!`); const channel = client.channels.cache.get("732691255452237904") channel.send(`${vote.user} just voted for us on <https://top.gg/bot/716061781172158464/vote>`) }); and my dbl constructor const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'auth' }, client);
Some problems in da API
So my code is correct?
You set the webhook on your bots edit page right?
Theres a site for testing webhooks, cant remember the name
what does dbl webhook respond with?
Some problems in da API
@formal sparrow no i guess, a bot can use correctly webhook vote
Pretty sure whats sent is on the docs
ah yea
@formal sparrow no i guess, a bot can use correctly webhook vote
@scarlet river a bot?
Which bot
the api is most likely having problems, i tested voting on multiple bots including my own and nothing happens
yes api is having problems
I also tested and got no response, there's problem in API, I'm 100% sure
Doesn't work for me still
It can take 30 minutes
But will it arrive
nobody knows
Are they aware of this issue?
Not sending
Not sending
If it's taking long time, it must be at least 30 mins
No received a response for 30 mins
The question is, do the admins know about this issue?
Yea, veld is working on it AFAIK
The slow response they know about.
why my hostname 0.0.0.0 (i guess its not normal)
thats all avaliable ips to that machine
The lib has it hard-coded to say 0.0.0.0
๐ค
well
its been about 30 minutes
still nothing
Some people had to wait for 2 hours
wow its been real extra bad today
ay
took almost 50 minutes
but it came through
@rapid kettle
getUser
The webhooks are faster now
oo
is there a way to get the list of users who upvote a bot, and how many votes they have ?
What language?
I think there is a way to do that
https://top.gg/api/docs#pylib theres some docs
idk much about python sry
Um what should i add in link? https://legendary-king.is-inside.me/i6OmT3Hm.png
??
No.
Is it possible for my bot to send messages when someone votes for my bot?
Yes.
how do you do?
DBL webhooks
as discussed on https://top.gg/api/docs
But I would be creating a webhook, right?
Nope.
could you give an example of code that makes my bot send a message when someone votes for my bot?
But if I want my bot to send a message when someone votes for it, why is it in the webhooks section?
But then what do I put in the URL field?
How to find my vps?
Where is this vps panel?
where do you host your bot?
Can I send the website link?
DM
Is there something wrong about this? Because it doesn't post my server count automatically on the website
const topGGAuth = JSON.parse(fs.readFileSync("./Scripts/websiteScripts/topGGAuth.json", "utf8"));
const DBL = require('dblapi.js');
const dbl = new DBL(topGGAuth.Auth, {
webhookPort: process.env.PORT, webhookAuth: topGGAuth.webAuth }, client);
that should be right
I'd think so too since the voting works right, just not the automatic stats posting. Maybe it's my client doing something wrong
Same issue
I'm using dblapi.js and have had problems where a vote takes about 3 hours to register. Had anyone else had this problem?
^ ping me if you have any comments or questions
I've been having that problem too. People report that their votes don't show up and they don't get the rewards. It's frustrating ๐ฆ
const app = express();
const server = http.createServer(app);
const dbll = new DBL(require("./conf.json").dbl, { webhookPort: 5000, webhookAuth: 'whyareyourlookinghere', webhookServer: server });
dbll.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbll.webhook.on('vote', vote => {
client.channels.cache.get("731235069867589783").send(`${vote.user} just voted.`)
});
app.get("/", (request, response) => {
response.sendStatus(200);
});
server.listen(5000, () => {
console.log('Listening server...');
});
why its not working
^ that and also if you have firewall rules setup properly on your server it can cause problems if you didnt allow port 5000
like on an ubuntu server if ur using ufw just do a quick ufw allow 5000
you did it as http://yourip:port/dblwebhook ?
i host my bot on heroku
0.0.0.0 means all available ip's
idk exactly
ty
read just below the message I sent
what i put in there?
Anything you want to be a password
i will make a channel and ther send the Bot(webhook) {user} vote {bot}
@sullen nymph how i can make?
Can you send me a code and werde i find my infos?
webhookAuth is just a password you create for yourself to confirm that the requests come from top.gg
on vote, you get a channel from cache and send a message
#development ask there
400 Bad Request (error code: 50035): Invalid Form Body
In embed.image.url: Not a well formed URL
can anyone tell me why this error occured while trying to set embed.set_image to a gifs url , it's only happing for some gifs
How can I check whether a specific user voted for my bot in python? I'm trying to make a command where a user must vote for it to work.
How do I post the shard count? discord.py
That only shows server count
shard_count oop
@frigid basin post_server_count accepts shard_count argument
am i able to setup the posting of stats like guilds etc before the bot is approved?
or do i have to wait
Have to wait.
does anyone know a workaround, fix, or reason why the webhook sometimes take 3 hours?
How can I check whether a specific user voted for my bot in python? I'm trying to make a command where a user must vote for it to work.
No one answer my question wtfrick
weebhook
download ayayaya 10 hours
Quick question, where can I find the latest version for the DBL Java library? I'm helping someone edit their bot and their DBL dependency seems to be outdated. I tried looking it up but found nothing
Glitch.com can host discord now?
is there a vote listener in JDA?
pls ping me
why am i getting {"error":"Unauthorized"} when trying to post my bot's stats?
Token either not set or invalid
it's set and probably valid because is obtained via the My Bots page
Try to reset it
hello just wondering so this is a code i found in the docs
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
Can i use it but not as a webhook?
how can i make it give a reward
or do i check it
then
if found he gets the reward
i think u should have a db
i'm just saying don't bruh at me
it is on their site
Ook

