#topgg-api
1 messages ยท Page 94 of 1
Yes
then
http://pubip:port/dblwebhook
yeah that page refused to connect :P
dm you the ip?
Aye
you need to port forward if this is on a home network.
if you have a firewall, you need to let it through there
It's /bots/BOT_ID/votes I believe @wooden pewter
same error
thats the same or not?
oh okey
oh wait
console.log(totalVotes)
do this
and see what it logs
I think it's a Promise
and you need to do .then on that or await that
yap its a promise
yea ok
fetch(...).then(res => res.json()).then(json => {
console.log(json.monthlyPoints);
});
try like this
-api
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
@sullen nymph me ajuddaaaaaaaaaaa
This is a channel for help with top.gg API
Also non-English goes in #support and #memes-and-media
que
is there a way to test if the test button is actually working, i swear my route is setup correctly 
did you save before testing?
yeh
Use reqbin and manually post to your endpoint to see if it works then
alright cheers
gl
so its just a normal post request and thats it?
mhm
I'm using the Python library for DBL and it is not posting the server amount
any console errors
None
code?
I've just noticed a mistake, ignore my existance
What's the normal troubleshooting process from here, just hit a wall post request works from reqbin and my machine but when i run the test on the edit page nothing happens.
think its 30 mins
is it normal for it to randomly show the server count of a single shard on the top.gg website? sometimes it says the actual server count and other times it says the count of one shard
could you implement a post request to edit your bots data via api (like description, prefix, usw)
i want to update my long description when my bot has an update
Then press edit bot
but i dont want to make a website to display the newest features, and also dont do this by myself
Don't think you can update it through an api
but y should i write this html myself when mmy bot can generate it?
Huh
Don't think you can update it through an api
@median badger
yeah i know, it was an suggestion for the api to implement this feature
Add it there
How can I use DiscordBotListAPI for java to check if a user has voted
thanks, got it working
the token is on the api page? or bot page?
im not really sure tbh
heres the docs for the api
o
heres where the api tokens are
ty
hi, i keep getting the error Error: 401 Unauthorized
I keep getting a 403 error when trying to post bot stats
are you posting to the right client id?
one token per one id
you cant post to another bot with a different one's token afaik
Yeah I'm posting to the right client id
is the token right?
Forbidden
^
which usually means the token is right, but wrong bot
Normally bad token is a 401
I got rate limited earlier for some reason
But idk if that has anything to do with this
You can try again tomorrow I suppose
Where can I find my dbl token?
Dbl tokens are given out once your bot has been approved
Here's the url tho once you are
how would i have an event when someone votes on discord.py? im trying with on_dbl_vote() but i cant get it to do anything
i just did this self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)
do i need the webhook for the event to work?
yes
how would i do that?
where is your bot hosted?
its running on my pc at the moment
are you doing to transfer it to a server anytime soon?
i want to wrap up the bulk of development before i do
because its easier to develop if its running on my pc
your home network will likely require you to port forward your modem/router for webhooks to work
most hosting solutions dont require that
if thats the case then i think i cant even do it because my stupid isp uses DS-lite
so no ipv4
yeah so you might wanna hold it off until you get it hosted
i can just get it hosted now since the vote thing is one of the last major things i wanted to add anyways
what would be a good place to host?
there are a few popular options in #development pins
ok ill have a look
you can also look through lowendbox.com
thanks
check the webhook example of dblpy
then head over to your top.gg bot's edit page
scroll down to the webhooks section
ok
i already have the code from the example in my bot
what do i put in url and authorization?
port and path are what you define in webhook_port and webhook_path in dblpy
yeah i already figured that
Authorization should be the same as in webhook_auth in dblpy
i also did that
is this the correct syntax fir the test?
async def on_dbl_test(self, data):
print("TEST")
print(data)```
i believe so
Yes
from a few milliseconds to minutes
await bot_list.post_guild_count(len(bot.guilds))
await bot_list.post_guild_count(shard_count=len(bot.latencies))
any way of doing this in one line?
pycharm reckons shard_count is an unexpected argument when i try
ayaya let's open the docs, shall we?
post_guild_count accesses the given bot's property guilds and calls len() on it
The first argument in the function is actually the shard count
so I just need await bot_list.post_guild_count(shard_count=len(bot.latencies)), and the guild count is done automatically?
Yeah
python: on one bot the api works fine, on the second bot it says "no module named dbl"
Define "second bot"
Is the module installed locally as a folder in the bot's folder?
Are you using virtual environment?
Hello! ๐
Can someone give me a little bit of information about DBL webhooks?
I would really appreciate it ๐
both bots are in the same folder, that might be causing some issues
this is all it says import dbl ModuleNotFoundError: No module named 'dbl'
is the webhook delayed today or something?
or just me?
DM's are coming after a few mins
Yeah they are
not API related
Your bot is trying to access "client" before client even gets defined
Your client needs to be defined first
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
Dbl needs to be initialized first.
for some reason the API is missing some votes, or has delayed votes.. or literally doesnt send any vote webhooks at all.. did the api or package update recently?
You need a webserver and make it post to a Discord webhook
top.gg doesn't support Discord webhooks
thought that
okay so i was using the mimu discord bot to do a welcome message right and i was doing an embed but when i try to do the {user_avatar} only a link pops up and not the actual image
-api
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
-wrongserver
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(
Hi
I Need a API?
@restive otter for what
Thanks Pal
np
You dont get a token until your verified.
yes
oh ty
how to use webhooks?
nvm
const DBL = require('dblapi.js');
const dbl = new DBL(DBL_API_KEY, { webhookPort: 5000, webhookAuth: '123'});
dbl.webhook.on('vote', vote => {
console.log(vote)
});```
will this work?
if a user votes
any alternative app to accept webhook request on my local host
i am currently using ngrok
but it stops after 7 hours
Express?
@jagged sky you know the dblpy module does that for you right?
i have read that
import dbl
import discord
from discord.ext import commands, tasks
import asyncio
import logging
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))```
to accept webhook u need to specify a url
which url
one you make up lmao
yes.
it makes a endpoint
๐ค no? what?
how do u do it?
yes
then use the dblpy module...

the webhook path is what goes on the end
webhook_path='/dblwebhook'
how do u make webhook path
http://your.ip.here.yes:port/dblwebhook
have u done it with ur bot?
yes...
itll work with ip?
yes?
alright lemme check
your public ip
i specified my public ip with port and tested it. not working
have you actually set it on dbl...
"""Handles interactions with the top.gg API"""
def __init__(self, bot):
self.bot = bot
self.token = 'token my' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True,webhook_path='http://blah blah/dblwebhook',webhook_port=port here) # Autopost will post your guild count every 30 minutes
async def on_guild_post():
print("Server count posted successfully")
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print(data)
user = data["user"]
mem = self.bot.get_user(user)
await mem.send("Test")
my port could be closed . lemme check
thnx
i have opened port via windows firewall. am still not recieving. what could be the error
webhook_path='http://blah blah/dblwebhook' that
chnaged that
have you set it on dbl
yes
and set the auth
do you have on_dbl_test
you're using the test button yes?
yes
then you need that event for that to fire
i see lol thanks again
async def on_dbl_test(self, data):
print("TEST works")
print(data)```
still not working
try it with auth
bb'help
Suggestion:
Make api return a success message if request succeeds in updating stats for bots.
Currently sends {}
it responds with status 200 OK
Right.. I forgot to check that
const DBL = require('dblapi.js');
let token = `sd.sa.sfd-fds`;
const dbl = new DBL(token, { 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(vote);
console.log(`User with ID ${vote.user} just voted!`);
});
the above code is logging "Webhook running"
but does not log votes
@jaunty plank i'm not entirely sure how webhooks work, what would i need to put in there?
the public ip of the device with this code on it
so go to your bot page
and click 'edit'
and scroll down a little to the 'webhook' section
http://theip:port/wehookpath
just pop this into the url section
click 'edit'
does that mean i need to open port 5000 on my router?
yup
is there any other way to listen for votes?
nope
the thing you have currently is fine
include the listeners too, so you can easily see in the console what is happening
ya i already have that
@trail sigil wait how do I do that
set the url?
include the listeners too, so you can easily see in the console what is happening
that is just the dbl.webhook.on bits
yup
ensure ur using ur public ip too and that the port is fully open
(you can check this by using a port checker website)
auth field?
oh ya its set
its weird cause when i open port check the port it says its closed
well the port is closed then
Port checks sometimes always say its closed
ya
i have another port open for sure I use for a minecraft server
but port checks it as closed
What are you running it on?
iirc, port will appear closed if nothing is running on that ip
Make sure you allow the port through firewall
so make sure your bot is running when checking
mcafee blocks ports
Not sure why i'd be banned, never used it before
Is this correct
that's what it says on the webpage
lol
that's not the token lmao
thats ur bot id
that's the bot's id
ah
am i supposed to put the secret token there?
lol no
ok thanks
you put your DBL token
not ur discord token btw
AH i see
should be a command
Thanks guys I'd have never figured that one out
nice
you should have a check for that
@wintry pollen no, nobody is trading accounts here
Fuck
pogey
const DBL = require('dblapi.js');
const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
dbl.webhook.on('ready', hook => {
console.log(Webhook running with path ${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});
app.get('/', (req, res) => {
// ...
});
server.listen(5000, () => {
console.log('Listening');
is the app.get('/', (req,res) => { }) needed for getting who votes
How exactly can I setup webhooks inside of my python bot?
I created a channel webhook for my support server and gave that link, but I am not sure what is the right way to do it
okay so i did everything and it's not doing anything when people voet
@dire sentinel top.gg webhooks are not compatible with discord webhooks. you need to setup a webserver to receive top.gg webhooks, either using one of the official top.gg libraries, or setup a webserver yourself. the URL field in your top.gg page should point to the server where your bot/webserver is hosted, either a project url, website or hosting IP address
@frozen jolt what did you put in your top.gg URL and Authorization? does "listening" show up in your terminal/console?
yes it does
So I just put my server's ip address in there and I'm good?
in your bot's edit page
scroll down to the webhooks section
@dire sentinel server's ip address and port, and the path, depending on your configuration. are you using dblpy?
Yes I am
https://top.gg/bot/:ID/edit is this what i put there
what goes in bot
id as in bot's id or top gg id
then your url should look like this http://SERVER.IP.ADDRESS.HERE:WEBHOOK_PORTHERE/WEBHOOK_PATHHERE @dire sentinel
Which port should I use for the webhook port
the one you chose in your dblpy configuration
commonly used ports are 3000 and 5000
@frozen jolt go to your top.gg bot's edit page
where you input your description, etc
yeah i am there
scroll down
Huh, I didn't choose a port anywhere
then the url should be your repl.it proeject name
and not sure if replit allows port 5000, does it?
uh
i think you have to use port 3000, and use your project url directly
well try it then
what is Authorization?
what you write in webhookAuth
ok
Ok what exactly is the webhook path?
the thingy after ip:port in URL
Yea how do I find it tho
default path in dblapi.js is /dblwebhook
so in repl.it, your full url should be https://PROJECTNAME.ACCOUNTNAME.repl.run/dblwebhook
or something like that, not much familiar with repl.it
So I have to open the port that I selected on my server right?
the dblpy webhook example already shows you a path, you can change it if you want, or keep it the same
depends on your hosting
most vps providers have ports open by default
some require setting them in a firewall
Alright I believe I have to open it manually for mine
@frozen jolt where is your bot hosted
@vapid cape https://kaneki--p025.repl.co is where i am hosting i had a friend vote for it and it didn't work
i mean i used that link for url on the top gg website
no
that's for keeping bot online through pinging service
i don't know what i am doing anymore 
ok
did you press the save button
Yea
server.all('/', (req, res)=>{
res.send('Your bot is alive!')
})
server = express();
http is port 80
Yea
you used port 80 in your webhook_port?
Yep
port 80 is a privileged port, only works if your bot is running as admin
Oh
Well this is an http request right?
Can I open TCP requests at port 5000 and get it to work?
@frozen jolt is that the same server thats listening on port 5000?
no
@dire sentinel yes
do i have to call that for this?
idk how repl.it works
if it allows multiple ports
but the project url only uses one
if it allows using more than one port, then the other port will not be accessible through the normal url
i see
dbl.webhook.on('ready', hook => {
console.log(Webhook running with path ${hook.path});
});
this is working
and i am doing
app.listen(5000, () => {
console.log('App (dbl): Listening');
});
the other one as 3000 port
I allowed TCP requests on 5000 but the test still doesn't go through
I am on AWS
And I am using the DNS url
should I use the IPv4?
@frozen jolt chose one port, either 3000 or 5000, and put everything on it
@dire sentinel are you using the on_dbl_test event? afaik dblpy has a separate event for testing
async def on_dbl_test(self, data):
print(data)```
That is the code I have
So yes
for the sake of testing, can one of your vote for my bot
There is a test event
Where you can just click the test button on the edit page to test ur webhook
Same this is tuff times

try using reqbin to send yourself a request
both of you
ReqBin is an online API testing and prototyping tool. Test your API by posting REST, SOAP, and HTTP API requests right from your browser, and check server responses.
i think
Paste the webhook URL in there?
so is
server.all('/', (req, res)=>{
res.send('Your bot is alive!')
})
imporatnt and needed?
And keep the US option?
doesnt matter
Operation Timeout
that means either blocked in firewall or server not found
Ok let me mess with my server settings
I dont know but maybe the webhook path is wrong?
thanks tim for helping hopefully i can figure it out thx tho
is yours in js or python
Py

๐ข
well, if you guys show your code maybe something else can be done about it
Do you want me to show where I initiate the DBL client?
in your case, i'd need to see the entire http/server/express/dbl code
DBL token
Here is the URL:
http://ec2-IPV4.HERE.us-east-2.compute.amazonaws.com:5000/dblwebhook
Code:
webhook_port=5000)```
o lol
it's still not reachable

toss me the full URL in DMs
Im scared lol
lol
Can u tell me what im supposed to see
I'll just be sending test requests until it works and DMing you what I get
i wouldn't be doing it rapidly
@frozen jolt your url seems to be working lol
If you visit the page in browser you'd be getting code 405 saying "method not allowed"
Oh, it just says The connection has timed out
something wrong with the URL
@vapid cape i tried https://repl.it/@P025/kaneki#index.js and https://kaneki--p025.repl.co because i wasn't sure which one and the Auth ||kaneki4099||
Lucky
Yea
did you configure security groups in your amazon admin panel?
show your dblpy code
def __init__(self, client):
self.client = client
# Declare DBL client
self.dbl_token = 'TOKEN'
self.dbl = dbl.DBLClient(self.client, self.dbl_token, webhook_path='/dblwebhook', webhook_auth='PASSWORD',
webhook_port=5000)```
i mean
you're not supposed to use all of that
should be http://xxx.xxx.xxx.xxx:5000/dblwebhook
is your ec2 windows or linux?
windows
Oh
I dont need to restart or anything when I open it right?
I turned off the firewall and still see nothing
reqbin still shows operation timed out?
Yea
try creating a barebones webserver to see if it works
like if you were to host your own website
No idea how to do that
HOLY CRAP
BRUH
BRUH
I pressed ctrl-C on command prompt at some point so it paused all statements from printing to the console
๐คฆโโ๏ธ
Now I see the requests
Thank you @vapid cape
Ur a god
lmao
Actually I discovered that I didn't actually press ctrl-C but everytime a request is sent it stops the bot from working
sigh a new issue for me to solve
-api @robust summit
@robust summit
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
@left egret ^
-b @robust summit Trying to sell cracked web scripts in #topgg-api
Banned `ษฎใTRใDaXer#7587 (@robust summit)
thank eri
โค๏ธ
-b [MENTION] Trying to sell cracked web scripts in #topgg-api
Ok, what the actual fuck?
what happened?
F
imagine paying for web scripts
i dont remember the last thing i used that wasnt open source and i had to pay for... oh wait, it was invision power board in like 2001
or was it vbulletin, one or the other ๐
My bot 115 server but dbl 91 shows
Are you updating the info?
@delicate anchor
@frozen ore yes
show code
oh yeah
speaking of the api
why am i getting unauthorized when posting count when both the tokens are correct and it was working a couple days ago without issue ๐ค
Tried regenerating yet
toss me the token
post shards
i really cba todo that
how do I get the amount of votes with the API in Java, please ping if you have the answer
Api docs
An API wrapper for https://discordbots.org/api/docs that works in Java - DiscordBotList/DBL-Java-Library
Hey guys, it appears that my API server is no longer responding to DBL, I have had the same code for a very long time now and nothing has changed, it's stopped responding entirely. DBL is not sending me anything at all, can someone assist me?
Is everything just backed up atm?
ip peluwang kedua
can someone help me setup the api for python
what's your code like
wdym
have you tried using dblpy or are you just asking for overall help because you have absolutely no clue what you are supposed to do?
no i installed dblpy
with pip
and looked at the docs
but when i tried it didnt work
what does your code look like
why do I recognize that auth from somewhere
where
gotta go reset that now
your going to have to regen anyway
no idiot
The webhook_auth
and yeah the token as well
yeah i put a little red over it
Anyway, I assume the URL and authorization stuff is handled on the website part?
You censored the most insignificant thing out of the whole token I believe
nice to know but i dont feel like someone is going out of their way to get a bot
that is pretty small
Sorry to surprise you...
so wdym with website
Anyhow, have you made sure your port is properly open and forwarded in router settings?
The bot's Edit page
i've tried it on google cloud aswell, i've opened port 5000
still nada
ive set ingress and egress rules
Tried using reqbin to send requests to the machine yourself?
eh works too
http
alr
@sullen nymph I Thinks you should add the extra params to allow for ssl ๐ค
reverse proxy gang
also do you think many users will be able to use it
You'd just be better off accessing aiohttp.web directly
if it supports SSL because I cba to search the docs
@restive otter
@sleek rampart yes?
Lmao
?
@restive otter what are u coding?
online shop
-api
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
oop
also, probably shouldnt tag random people
I made this code for my bot that sends a DM saying thanks to people that votes, why it doesnโt works?
A webhook is only needed when you have 1000+ votes right?
@dire sentinel webhooks allow DBL to send you data when a vote is received, rather than you not knowing until you request.
This saves you sending wasteful requests to the API asking if a user voted, or requesting all the users that have voted.
Overall, it saves processing power for you, and DBL.
@restive otter 11
Is it just me or the vote webhook is lagging? I got tons of complains from my botโs players saying they waited hours for it to finally update.
usually it can take up to 30 minutes
Hey, I don't understand how the BiConsumer is working (in Java), how can I do a method like this :
private DiscordBotListAPI api = bot.getDiscordBotAPI();
public boolean hasVoted(String id){
//here
}
const dbl = new DBL(config.dbl, bot);
dbl.on('vote', vote => {
console.log(vote);
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
Not working someone know why?
dbl doesnt have a vote event
so i need to use like this
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
?
ok thx
@queen lotus
http://ip:port/webhookpath
Ip is your bots public ip
Port and webhook path you set
In the program
i have to create http server?
where is your bot hosted?
GalaxyGate
then yes, you need a webserver but dblapi.js does it for you
check the webhook example for dblapi.js
all of this just for check who voted to my bot?
yes
oh
when you set a webhook port, dbl.webhook is created and dbl.webhook contains a small webserver inside it that handles everything for you
ok
hey i tried out the webhook feature from the dblapi.js module and when i test it (i specified the port and the ip of my vps) nothing logs ?
i don't know what is wrong
Votes can take 30 minutes to be sent via the webhook
The servers have been quite slow recently
i think i know why
i done make webhook
lmfao im kinda dumb
On the website you need to give the url
is there any way to use the weekend endpoint without a token?
@runic trail how to use?
then?
Its a webhook you make in your bot
how to i know the port?
where?
Look at the docs
gimme the link
how to see port wtf
@limpid vale Please research webhooks before trying to use one
where is your bot hosted @limpid vale
How often should a bot update its server count
the default is 30 minutes iirc
Thanks
How do i post the server count?
what library?
discord.js
https://top.gg/api/docs#jslib
^ great docs
And how do i post it now?
Like if i try it it says postStats requires 1 argument
as an argument i put client.guilds.size
@jaunty plank can you help me?
Does it have an automatic interval?
yeah, you just need this part
your token can be found here
https://top.gg/api/docs#mybots
const DBL = require("dblapi.js");
const dbl = new DBL('Token', Client);
I got this
Because the other two i already have in there
it updates every 30 minutes, should be updated on startup aswell @rotund lake
no it didn't
https://top.gg/newbot @sterile cape
no it didn't
@jaunty plank it should say so then
you can use these events to check if it posts/errors
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
Yeah i have them
no errors?
hmm
its supposed to post on startup ^
try giving it some time, otherwise im unsure tbh
okay
But it has nothing to do with my const's?
const { Client, Collection } = require("discord.js");
const { RichEmbed } = require("discord.js");
const randomPuppy = require("random-puppy");
const Discord = require('discord.js');
const { config } = require("dotenv");
const fs = require("fs");
const DBL = require("dblapi.js");
const dbl = new DBL('Token', Client);
oh actually wait
๐ค
OHHH
I am stupid
Sorry
I had the wrong client at the end of the last const
Yeah now it works
perfect
Thanks anyways
whats the ratelimit on status changes?
Rule of thumb is once per 2 min
I can't seem to find a way to receive the vote
Webhook example
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(vote); // Do what you need to do });
already tried this
is there a github example with this on it
has someone a Java script for a fn item shop command?
what

Fetching bot data, votes being an example
oh
.
-dotpost
Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.
huh
webhooks being either slow or not going through
Hello, how can I post server count? I always get 401 error. I even tried to downgrade the version of the discord.js, but it still doesn't work. I have the newest version of dblapi.js. The token is 100% valid, it does work without the postStats method.
My code (for v11.3.2):
const config = require("./config.json");
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(config.dbl.token, { webhookPort: 3000, webhookAuth: config.dbl.password });
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
});
client.on("ready", () => dbl.postStats(client.guilds.size));
client.login(config.token);```
Error:
(node:11884) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized
at IncomingMessage.<anonymous> (C:\Users\BramboraSK\Desktop\post\node_modules\dblapi.js\src\index.js:118:25)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1218:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)```
Regen your dbl token
ok thanks, working now
The webhook is suddenly extremely slow, is it just me?
It took few minutes to actually get request
same
is the api being slow? i have it send message when someoen votes and it takes very long and sometimes it's instant
Yes, API is currently slow
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!`); });
how can i know what i need to write webhookAuth
auth is the password you set @scarlet river
you set it in your program
and then set it to the same thing on your bot edit page
ลuan ne yapmam lazฤฑm oy vermenin aรงฤฑlmasฤฑ iรงim
is adding a role to all the members in a server (besides bots) abusing the api?
Recently its only been letting me add bots to a limit of 4 server but i have perms in more than 10 servers what going on
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
This is help
I need help
Where do i go then
WITH OFFICIAL TOP.GG
Anyways, anyone know how I would go about making a webhook
Whats a websocket
Webhook
webhook*
A webserver library in your language
oh
alr, ill get to work
correct
Ok
In which language do you program the website?
What
@vapid mango do you have under 3 iq
there is no specific way to do that, you can use getVotes to obtain the last 1000 votes, and then count the users, or you can use webhooks to receive votes in real time, and store them
Then about almost half of the bot here will be deleted :|
This is stupe, if the bot can do it it's not api abuse lmao
-api
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL TOP.GG API LIBRARIES AND API DOCS FOUND AT
https://top.gg/api/docs
is there a way to use events without having to set up a webhook and all of that?
cause ive been trying to use the on_dbl_vote event, but saw that you need a webhook or somn like that
It takes like 5 minutes to setup a webhook with the official libraries.
on the dbl api, how do I check if a user has voted in the last x time, or their total votes
you can't use api before your bot is approved
okay. thanks
Hey
Is the api down ?
At dbl.webhook.on('vote', vote => { it gives an error saying: Cannot read property 'on' of undefined, what am I doing wrong?
const dbl = new DBL(topGGAuth.Auth, { wehookPort: 5000, webhookAuth: topGGAuth.webAuth }); Which I did
moocow
show your full code then






