#topgg-api
1 messages · Page 104 of 1
@tardy sandal 4 - 6 weeks


Is there any dbl vote tracking code written using discord.js? When someone votes, they will send a thank you message to the channel I chose.
anyone here know the command code for memes
how do i make a vote leadorboard...
is there a method to list everyone who has voted
How to DM a user when he/she is voted?
there is an endpoint to fetch the latest votes (I think up to 1000) of the bot, but when you bot gets more votes (1000 a month iirc), you will need to switch over to using webhooks instead
||If there is no body answer I will go to Among Us||
@charred scarab the easiest way would be to setup a webhook listener for top.gg votes, and then every time a user votes you can have it dm the user
implementation depends on the library that you are using, but generally I think in js and py it should be relatively easy to setup
there is an endpoint to fetch the latest votes (I think up to 1000) of the bot, but when you bot gets more votes (1000 a month iirc), you will need to switch over to using webhooks instead
@fierce silo adding on to my point, if you want to use webhooks you will need to maintain your own list of votes, such as using a database to store who has voted and when, so that you are able to obtain the recent votes of your bot.
Also, the libraries that you are using might have convenient functions to access these values
if you are using the official top.gg js api library, the method will be db.getVotes()
although when your bot gets more votes in the future (or if you want to get more than 1000 votes), using a webhook system is mandatory
fixed
or did you just delete it
lol
were you posting your bots guild count for each shard?
yep
||sa||
hi
how do I get a user voting
if that doesnt work
dbl.getVotes().then(votes => {
if (votes.find(vote => vote.id == message.author.id)) {
// code here
} else
var embedtwo = new Discord.RichEmbed()
.setTitle('Error')
.setDescription("You must be a bot voter to use this command. https://top.gg/bot/663898249538568243")
message.channel.send(embedtwo)
});
but I get
TypeError: dbl.getVotes is not a function
I also trued hasVoted
@versed junco first of all, this is development question, second of all, update to V12
what are you supposed to put in the "webhook_path" on the webhook? do you create a folder or a file or something, idk (cc @restive otter)
One message removed from a suspended account.
@hearty jacinth do you mean vote for bots?
Ye like how bots have a reward for voting
There’s webhooks
Yea whatever is there a api for doing something like giving a person xp for example when they vote?
Yea
Name?
The webhooks
Ah
@restive otter it was related to dblapi.js even if the error wasn't
@patent cloak still looking for an answer?
@patent cloak still looking for an answer?
@sullen nymph someone said “the webhook token”but yeah i’m still unsure
It's the thing after your domain/IP and port
Must start with /
aka http://ip.or.domain.address:port/webhook_path
ah ok, and with the port, on my vps do i need to do anything to open it? or am i good to just put the d.py example and modify it as much as i need to
ah ok, and with the port, on my vps do i need to do anything to open it? or am i good to just put the d.py example and modify it as much as i need to
@patent cloak open port with ufw if it's Linux
also make sure no firewall is blocking requests
for local hosts it's the same tbh
where can i find my DBL token
@hollow mountain on your bot's edit page at https://top.gg/bot/your_bot_id/edit
(node:1600) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized
how can I start my authorization of dblapi.js?
okay 2 things
1 that's the most basic feature to create and pretty much every tutorial has that command
2 development support in #development this is for api support
-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
im testing my webhooks and i dont see any of the JSON Params listed in the docs.
i cant find where isWeekend and user is located
Alguém do Brasil T^T
@viral veldt did you try logging it?
what'd you see?
IncomingMessage {
0|Counting-API | _readableState: ReadableState {
0|Counting-API | objectMode: false,
0|Counting-API | highWaterMark: 16384,
0|Counting-API | buffer: BufferList { head: null, tail: null, length: 0 },
0|Counting-API | length: 0,
0|Counting-API | pipes: null,
0|Counting-API | pipesCount: 0,
0|Counting-API | flowing: null,
0|Counting-API | ended: false,
0|Counting-API | endEmitted: false,
0|Counting-API | reading: false,
0|Counting-API | sync: true,
0|Counting-API | needReadable: false,
``` etc
i did a find and replace for isWeekend and bot with no results
ahh
and the body was empty
try logging res.body
i did
what did it come out as?
and the result was {}
yup
i see
are you parsing it?
like do you have an app.use(express.json()) below the app declaration?
you need to use express.json() or bodyParser.json()
oh and its req.body too
Is it allowed for me to require someone to vote before they can setup my bot?
nope
nope
K
Where do I find the api to find votes on my bot
@silent pilot isn't it obvious...no?
I'm not passing the client to the post stats. Instead I'm getting the total guild count across shards and posting that. It works 95% of the time but once or twice it has done this instead. Any reason why?
People with sharded bots, how do you post your server count to DBL?
Like, you can see it's been posting the total count just fine, but out of the blue over the last 12h it's been messing up. https://dbl.marcorennmaus.de/bot/675996677366218774
View PixxieBot's historical performance from Discord Bot List (top.gg). Updates every hour.
Server count should be 2,412
How long does it typically take for top.gg to have counted a vote (as in, my bot can read hasVoted for that user)
Curious because right now my bot takes about a minute or two before it sees that person has voted
I see, so it's not my bot, that's good.
@golden adder you gotta post the stats for each shard
@true talon 🤔 but I don't want shard count on my DBL page
if your bot is shared you're kinda forced to
-api
@royal veldt do you need help or something dude?
@royal veldt do you need help or something dude?
@empty jay nah i got it figured out
🤦♂️
const DBL = require("dblapi.js");
const dbl = new DBL('eyJhbGciOiJIUzI1NiIsInR5cCI6IXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXr3ZUaY7eXjyHb3JqCptFOJPbdC5pzGIGi1fcKc', { webhookPort: 5000, webhookAuth: 'password' }, bot);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
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!`);
});```
i didnt get
anything in console
nice token leak@dusty crater
it's not even a legit token
don't ping me...I was telling them its not a legit token
hi, is there only a vote api for bot? I need to know if theres an api for server votes
hey bro
Hello @restive otter, who u make the system for ur server?
not related with top.gg's api @tardy stone
@restive otter for server votes you can use webhooks
What is webhooks?
@willow spindle ugh? ive read it was for bot votes
go to server's page > Edit > scroll down
aight thanks
@silent pilot isn't it obvious...no?
@restive otter nope. I can’t find the code to find votes
http://0.0.0.0:5000/dblwebhook
is this url correct
that is what it shows in the logs
Replace 0.0.0.0 with your IP address when entering the URL anywhere
@hearty tiger Post server count, https://top.gg/api/docs
That wasn't directed at you
😁
where can i find the post server count thingi
Webhook running at http://0.0.0.0:5000/dblwebhook
Hi, Red Sparrow Admin is now online!
Server count posted!```
y is this
0.0.0.0
placeholder?
its not working
Replace 0.0.0.0 with your IP address when entering the URL anywhere
0.0.0.0 just says "available on all possible addresses"
const dbl = new DBL('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfcKc',{ webhookPort: 5000, webhookAuth: 'xxxxxxx' }, bot);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
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!`);
});```
it doesnt work
the vote
when i try to test it
and press test
DM the URL you entered and Authorization key you use
@sullen nymph
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
```?
what's the code before it
token is invalid
errors don't lie
what do i put in
const dbl = new DBL(config.discordBotList, { webhookPort: 5000, webhookAuth: '' });
webhookAuth
the password?
anything you entered in the Authorization field on top.gg
It's a password you create yourself to confirm that the requests are actually coming from top.gg
Actually why are you using webhook
i want to get the votes and then send the user a thank you message :()
Ah, makes sense
the hell
I dont know what I am doing wrong
const dbl = new DBL(config.discordBotList, { webhookPort: 5000, webhookAuth: 'authCode' });
const dblClient = new DBL('authCode', client);
dblClient.on('posted', () => {
console.log('Server count posted!');
})
dblClient.on('error', e => {
console.log(`Oops! ${e}`);
})
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
const ownerOfZex = client.guilds.cache.get('277105132922208258')
ownerOfZex.send(`User with ID ${vote.user} just voted!`);
console.log(vote)
});
oh wait
i think i put the authCode to token spot
🙂
yea
well, not for webhooks
that was the issue lol
i used the webhook code and put it in the place which is meant for token
but i gotta fix webhook ;xx;x
the test button will send a test request
You're already logging on the vote event so you're already doing that ^^
the vote event handles both vote and test requests
The test botton sends a "fake" vote event yes
ohhh
when i click test it doesnt log anything
dbl.webhook.on('vote', vote => {
const ownerOfZex = client.guilds.cache.get('277105132922208258')
ownerOfZex.send(`User with ID ${vote.user} just voted!`);
console.log('newVote')
console.log(vote)
});
hmm
Did you get a DM from the bot?
const ownerOfZex = client.guilds.cache.get('277105132922208258')
ownerOfZex.send(`User with ID ${vote.user} just voted!`);
webhook.on was triggered
and its ready
i think
Webhook running at http://0.0.0.0:5000/dblwebhook
this look ready 🙂
if it was wrong would it still trigger the .on?
im using a bot
called
dblVote or something
its possible for 2 users to use it right
or was that why the error was happening
Yea im using that bot
Then go to their support server instead ^^
No, i dont need help with that bot
Guys it's just a guild id
im just asking cause they are also using the webhook
so
does it affect the error ?
you need to send an user/member
In the webhook settings on top.gg you need to input the URL your webhook is running and what password you set for it
Is there anyone who will give registration bot Infrastructure?
Yes
yea
URL/Authorization
its below
Is there anyone who will give registration bot Infrastructure?
-api @odd shore
@odd shore
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
What
Read the embed
const dbl = new DBL(config.discordBotList, { webhookPort: 5000, webhookAuth: 'authCode' });
Is this correct way of using the webhook?
Yes
config.discordBotList is
How can I get a message in my discord server whenever somebody votes for my bot?
Oh alr
Yes
hm
I have url input too
You're not using 0.0.0.0 there right?
is it safe to share it here?
what is DBL vote?
Sure
what should be the auth code of the webhook if i want it to send a msg in a channel of my server whenever somebody has voted for my bot?
and it start spamming null 😭
Just make sure it's also the same on your webhook
@hearty tiger debug, console.log "1" on the ready event, "2" on error, "3" on vote, etc...
Then test and see what's it's spamming
ok
alr
dbl.webhook.on('vote', vote => {
console.log('2')
const ownerOfZex = client.guilds.cache.get('277105132922208258')
console.log('3')
ownerOfZex.send(`User with ID ${vote.user} just voted!`);
console.log('4')
console.log('newVote')
console.log(vote)
});
for this
it doesnt log 2,3,4 when i click test
and how can i see which channel it'll send the msg in when somebody has voted?
use the vote event
@opal kettle on the vote even you can do whatever you want, DM the user to thank them for the vote, DM yourself that you got a vote or send it a specific channel
on the
voteeven you can do whatever you want, DM the user to thank them for the vote, DM yourself that you got a vote or send it a specific channel
@dense basalt alr i understand
@hearty tiger nono, do it per event, so "1" on the ready event, "2" on the error event, "3" on the vote event, etc..
@dense basalt isnt both of them different
Not sure what you mean by that
const dbl = new DBL(config.discordBotList, { webhookPort: 5000, webhookAuth: 'authCode' });
const dblClient = new DBL('authCode', client);
dblClient.on('posted', () => {
console.log("1")
})
dblClient.on('error', e => {
console.log("2")
})
dbl.webhook.on('ready', hook => {
console.log("3")
});
dbl.webhook.on('vote', vote => {
console.log("4")
});
I meant like this
(Ignore the bad formatting, Discord sucks)
Like this, you will know what event is being spammed
And if you test your vote and it logs "4" then you know it works
(node:32128) UnhandledPromiseRejectionWarning: TypeError: command.run is not a function
uh

at Client.<anonymous> (C:\Users\LXPC\OneDrive\Documents\GitHub\Zex Discord Bot\events\message.js:63:17)
What is on that line
message.js:63:17
Seems like Null is being caused by something in your message event
Creating two clients is fine, he doesn't provide his Discord client to the first one which means that one doesn't post stats
sapmming null....
What if you remove the DBL part, does it still spam it?
yeaa
If you need help with that ask in #development
Did you replace authCode with your actual token here
const dblClient = new DBL('authCode', client);
Zex#0023 has logged on
(node:38312) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 messageDelete listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
null
null
null
null
null
null
null
null
Like you do in your other DBL client
nvm its sapmming null again
config.discordBotList
Hm not sure then
how can i check my bots total votes?
i mean i want to make it display on an embed
and send it to me whenever somebody votes it'll also show the total votes of my bot
is it something like 'bot.votes'?
anyone?

ping?
@opal kettle When my bot will checked -_- I uploaded more than 30 hours ago !

I need help, my djs bot says an error while connecting
const dbl = new DBL('my token', client);
^
ReferenceError: Cannot access 'client' before initialization
at Object.<anonymous> (/home/container/server.js:3:180)
@opal kettle When my bot will checked -_- I uploaded more than 30 hours ago !
@twilit gale Bruh
I waited more than 3 moths
why npm i discord.py doesn't work?
https://npmjs.com/package/blapi @weak wyvern
idk about python but i think its pip instal discord.py
lmao
I don't have any role in this server ):
https://npmjs.com/package/blapi @weak wyvern
@opal kettle Thank u
And do u know why my discord.py bot os getting this error?
Failed to post server count
Forbidden: Forbidden (status code: 403)
Traceback (most recent call last):
File "/home/runner/Botxd/cogs/TopGG.py", line 29, in update_stats
await self.dblpy.post_guild_count()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/dbl/client.py", line 142, in post_guild_count
await self.http.post_guild_count(self.bot_id, self.guild_count(), shard_count, shard_no)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/dbl/http.py", line 169, in post_guild_count
await self.request('POST', '/bots/{}/stats'.format(bot_id), json=payload)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/dbl/http.py", line 143, in request
raise errors.Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403)
Ah ok
What doing blapi? (Sorry for my english, i'm not english)
what does error code 1006 mean?
What's your dblpy version?
@sullen nymph How to see
I don't know ):
You're trying to post stats for a bot that's not listed
@sullen nymph My bot is listed, @upbeat surge
But turned off, bq it cannot start, is getting the error
I'm so sorry
pip show dblpy
Ah
version 0.4.0
Name: dblpy
Version: 0.4.0
Summary: A simple API wrapper for top.gg written in Python.
Home-page: https://github.com/top-gg/DBL-Python-Library
Author: Assanali Mukhanov, top.gg
Author-email: shivaco.osu@gmail.com
License: MIT
Location: c:\users\vps\appdata\local\programs\python\python38-32\lib\site-packages
Requires: discord.py, aiohttp, ratelimiter
Required-by:
A simple API wrapper for top.gg written in Python. Contribute to top-gg/DBL-Python-Library development by creating an account on GitHub.
what does error code 1006 mean?
does anybody know?
uhhh
I...
Don't remember if that's the latest version
so just try pip install -U dblpy and try again
Ok
Works
Thanks @sullen nymph
I still need help
I need help, my djs bot says an error while connecting
const dbl = new DBL('my token', client);
^
ReferenceError: Cannot access 'client' before initialization
at Object.<anonymous> (/home/container/server.js:3:180)
What's your code like
What's your code like
@sullen nymph Wait
Try to add the line
const dbl = new DBL('your token' , client);
in exports.run
@weak wyvern
He declared const client = new Discord.Client() after the code he sent probably
npm i python
Hello @restive otter, who u make the system for ur server?
@mental seal i added a webhook URL on my DSL server edit page and the URL is just a POST request to/dsl_webhookroute in my express.js server that checks if the request is from top.gg and sends a message in my guild if it is a valid DSL vote
big brain time bois
Hey everyone. How is your day going?
Hi
@mental seal i added a webhook URL on my DSL server edit page and the URL is just a POST request to
/dsl_webhookroute in my express.js server that checks if the request is from top.gg and sends a message in my guild if it is a valid DSL votebig brain time bois
@restive otter Wow, i goes try, thank u
uwu
pee

that's a nice flag but #general-int next time please
npm install dblapi.js
npm ERR! Unexpected token in JSON at position 0 while parsing near
i have this error
You need inser your bot token x)
?
!among us
This has autopost right?
client.dbl = new DBL(apiKey, client);
How to specify the correct servercount when using shards? Currently only the servercount of a single shard is displayed
you post it yourself
using dbl.postStats()
dbl.postStats(<guild amount>, <shard ID>, <shard total>)
with an interval?
what library?
discord.js
<client>.shard.ids
but this is an array...?
it works for me
ok, thanks 😄
I just got a raspberry pi and i want to convert my stuff to the pi. I use discord.js What do i do once i tranfrer the files? so i have to download the packages
Ty
client netwirk sockt disconnected before secure tls connection was established
How can I send a test upvote to check it works?
click 'test webhook' on the edit page
tyvm
self.dbl = dbl.DBLClient(self.bot, token, autopost=True, webhook_auth="snacc")
@commands.Cog.listener("on_dbl_test")
async def on_dbl_test(self, data):
print(data)
I am not getting anything. What am i missing?
i think you are missing webhook_path @wild cargo
It defaults to "/dblwebhook"
oh then idk, the api is confusing to me lol
I have no idea why it isn't working
self.dbl = dbl.DBLClient(self.bot, token, autopost=True, webhook_port=10010, webhook_auth="snacc")
I can see the request in my server logs but the dblclient doesnt do anything
Transfermarkt APIsi olan var mı
yooo what am i supposed to put in the url
i put http://my.IP.Address:5000/dblwebhook
and it still logs https://0.0.0.0:5000/dblwebhook
@restive otter the logs displays 0.0.0.0, but it should still works
i pressed test and nothing happens
make sure port is open
how 
that your pass is correct
pass is correct i know that for a fact
@charred scarab the easiest way would be to setup a webhook listener for top.gg votes, and then every time a user votes you can have it dm the user
@austere swallow how to do it ...
now how do you do a setData trigger every time someone votes?
Anybody can make a bot for me
oo
Wait what Shivaco isn't a mod anymore?
Wrong channel and break
I still cannot seem to get the webhook working
dbl.DBLClient(self.bot, token, autopost=True, webhook_port=10010, webhook_auth="snacc")
Python3.8
It autoposts, but doesnt get the votes
yed
pain
Umm Im New To This, Can Anyone Guide Me How To Do The Post Thing With The Webhook & All
guild
See the last pin btw
ok its still user
{
"guild": "358630393869631498",
"user": "247741991310327810",
"type": "upvote",
"query": ""
}
``` this is what I got at some point when testing my server
That’s it
just needed to make sure
that’s the payload
wait what other types are there?
test and upvote
test
it will just delete ur entire botum
This is the wrong channel to ask
Read channel topics
Okay thanks
┬─┬ ノ( ゜-゜ノ)
those aren't the things responsible for the actual server count
Move to #general-int if you are going to speak Turkish
tüm türkler among us odasına gelsin
@patent juniper I need a bot for my server!
sa
How to get a dbl client token???
https://top..gg/api/docs#mybots once your bot is approved
Do i need to access API to make a system like if someone gives 1 vote, bot will give them 1 Vote role, if someone gives 2 votes, bot will give them 2 Votes role, if someone gives 5 votes.... etc.
Yes
And i need to wait minimum 6 weeks to access this API?
Check pins in support
Exactly what it says
Epic
I don't wanna add my bot to the website, i just wanna award my members for voting but i still need to wait 6 weeks for that.
Yes
I mean you could just make your own website but you do you
I mean you could just make your own website but you do you
@median badger That means i need to buy a website first lol
No
Yeah maybe
Let's keep on topic
But i don't wanna waste money just to give members some vote roles
Whats the point of vote roles if you dont even want to add the bot
To make them vote my server, not the bot
Bot is only for my own server anyway, private bot
Then just use the role thing on the server list
A user can only vote once per 12 hours anyway
A user can only vote once per 12 hours anyway
@median badger Yeah i know but i wanna make a giveaway that lasts 1 week and make a system like more votes = more chance to win, to make this i need to count their votes and give them those vote roles
Only possible by reaching the API i guess, so rip
Thanks for the help anyway
how to keep the music bot 24*7 in vc ??
how i use the webhook, i did not understand this
how i use the webhook, i did not understand this
@mental seal bhot saari ways h use krne ka
Best uses are :- welcome text like sx4
Or chat colliders.
h
how can i get my bot server count on api ?
^
@restive otter hindi in #general-int pls
also why hinglish
the documentation is confusing as hell
i've just read everything and still didn't understand how to properly setup a voting log webhook
should i use the discord server webhook option?
the documentation is confusing as hell
i've just read everything and still didn't understand how to properly setup a voting log webhook
should i use the discord server webhook option?
@fresh surge
bruh the webhook stuff is the only API we have yet
there is no wrapper for DSL API yet and there is no documentation except smth in pins
You can’t use discord webhooks
@fresh surge you need to make a webserver then send the requests there
Ok, but what do I need to do on the server side?
||get gnomed||
Ok, but what do I need to do on the server side?
nvm just figured it out by myself
-faq 3 
I cannot seem to get my dbl webhook working, It's autoposting, it's just not getting the votes
Ping me if anyone replies
so considering bots are no longer being added to this server, will there be API methods for setting a bot's status? Or will status indicators be removed from DBL entirely?
soon™️ @thin forum
I setup on_dbl_vote and got someone to test vote for me and it didn't pop up on my print screen 
Use on_dbl_test and press the test button
👍 will try that
P.s. make sure your firewall isn't blocking requests and the port is open
ah... that might be why then
using an Amazon EC2 server
and its security is beefy
Mhm
Hey can users vote using the bot or they still need to use the site?
Like a vote command that votes for the bot.
-faq
how to build bot
@west patrol you need an API key, and the only way to get one is by having a approved bot
Oh im so sorry about it. Wrong Server 😄
what
what
I have send my message to wrong guild.
wut
if you don't understand what Hasmetli.js meant:
I sent message into wrong guild.
I have a channel intended to be used for top.gg API discussions, but oh wait... it's this channel
im play among us in roblox Impostor [BETA]
Read channel topics, for crying out loud
Anyone have a tutorial video for webhooks in python, or just a tutorial for DBL without webhooks?
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
Error:TypeError: Cannot read property 'on' of undefined
Is anyone else having this error with their vote command? or know a solution behind this??
Is there no other way to use the vote event do I need to go though the wehook method??
Ah I see
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
The page where you view your api key and all that isnt showing my bot for some reason, does your bot need to be approved in order for it to show, or is this some glitch
It needs to be approved first yes
ok thanks, I was just concerned this might've been some glitch
how do i fix the N/a?
client.on("ready", () => {
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
setInterval(() => {
dbl.postStats(client.guilds.size, serverCount);
}, 1800000);
});``` I have this as my ready event
does it take a while to update?
please @ me
@summer folio
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}`);
})
```This is in the documentation found here https://top.gg/api/docs if people could send a number then they would just enter any number to make it seem that they're bot is popular
@summer folio
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}`); }) ```This is in the documentation found here https://top.gg/api/docs if people could send a number then they would just enter any number to make it seem that they're bot is popular
@modest topaz I got it from the docs
That code line was from it
you must be using the outdated docs, idk
I got it from there
That link
Oh does it take 30 mins as my intervel is 30
It’s been 20 mins
I’ll come back in 10
how can i get shard count on top.gg api ?
i have "404 Unauthorized error"
ping me please
Will there ever be a server vote api endpoint?
@sterile zephyr there’s the webhooks
How reasonable would you consider adding a DBLClient.run_webhook() method?
Hey, I got this code for my server
const server = http.createServer((req, res) => {
let data=""
req.on('data', chunk => {
data+=chunk.toString();
})
req.on('end', () => {
res.writeHead(200, {'Content-Type': 'text/html','connected':false});
res.end(data) ;
sendMessage(data);
})
}).listen(8880);
To get the user id, I dot JSON.parse(data).user but that's not seems to work, someone know why ?
does get_user_vote still work in the python wrapper? it keeps returning False for me
It returns whatever the API returns, and the endpoint get_user_vote uses does have issues with delays
Yeah, webhooks are recommended for fetching votes
I've set up my webhook but it still show up as http://0.0.0.0:5000/dblwebhook
0.0.0.0 is a placeholder, replace it with your actual IP address when entering it somewhere
Whoops
will dblapi.js throw an error if i pass the wrong token in the contructor or will it just silently return null
Anyone I got hacked in Minecraft and I was level 11 and then when I logged in my account I so that it was not my normal account 😦
And know I am level 2
levels in mc?
thats bad
is it like levels in a server or what?
im rly confused abt the level part
I got hacked then I am level 2 know I was 11 before hacked
yeah i know that much but how do i know what minecraft level i am
was it on just hypixel or something or..
oh....
@restive otter its where the webhook is hosted
@restive otter 401 Unauthorized error will be appearing
Noticed errors: will be appearing
Fix: will appear
@gaunt steeple off topic bois here
okay?
Question, is the retry-after header in seconds? Please ping me if you've got an answer 🙏
hello? is there a way to make images from api using any package (like canvas) and make them gif?
images from api
Widgets?
am i allowed to send the link?
Sure
like this
See channel topic lol

How do I make a role reward webhook.
do you know any programming languages?
Some Java and Lua
java has basic webserver right?
Uhm, idk I ain't that interested in java so I only know a little.
I'm a roblox scripter.
cuz all the DSL webhook does is send a POST request containing an object a bit like this
{
"user": "user ID",
"guild": "guild ID",
"type": "test or upvote",
"query": "test=48&test2=59"
}``` iirc
When I use it it says
The webhook setting does NOT post messages to Discord channels. It is designed for use with an external service only.
but why would you need a role reward webhook?
yes, it doesn't post to Discord channels
Idk
oh
you need to setup a POST request receiver
and make sure its secure
just check the Authorization header iirc
.
yes i know
oh
@stiff echo an alternative to using a DSL webhook is using a bot
@digital mango Do you know any programming langs?
Nope lol
hi
Med student
im new
ok, so I'd recommend using a bot to do that
round to the nearest 10,000
however i could guide you on setting one up in js
hahahhah
For the webhooks?
um ok
there are many bots that receive POST requests and notify you of them for you
Like I want uh msgs being sent from the webhook
Yea, that requires a webserver listening for POST requests
{
"user": "user ID",
"guild": "guild ID",
"type": "test or upvote",
"query": "test=48&test2=59"
}``` this is what is sent along with the POST
and the auth is in the Authorization header
Yes
Instead of my name
I want that from a bot (which is webhook)
So it looks cleaner
but sure DM me the invite to the server and i can do it
Ok r u 18+?
nope
Ask in #development
yes
yea
Is it listening for POST requests?
uh i can make it
{
"user": "user ID",
"guild": "guild ID",
"type": "test or upvote",
"query": "test=48&test2=59"
}``` this is what is sent along with the POST
and the auth is in the `Authorization` header
yea
oh wait lemme see
I recommend checking Authorization header to keep it secure
what web server you use?
It’s req.header("Authorization") and you’re right
alright
do you have the json parser thing tho?
hm wdym
it’s app.use(express.json()) at the top of the file, it allows you to access the bodies (this is if it doesn’t work for you)
i have body-parser
yea
perfect
know how json works?
mhm
I assume you do
Yep
you can just use the app.post as your event
oh yeah i prefer using my bots event collector so i can handle stuff back in the server.js file
instead of the dashboard
Oh makes sense yea
I don’t think the Python automated server count is working
Running a timer now to confirm this
oh
oof
Wanted to double check before I wasted my time; Do the request methods for getting the information of a bot/user now require an API token? I know it used to previously allow it without the token in the past, but I've been getting Unauthorized as of now.
my token i svalid as i literally just got it from the page
@nova nacelle yeah, all requests require authentication
got it, thanks
Ok I got it to work, turns out it doesn't like having a space between the : and the token in the header, feel like this is something that shouldn't be an issue and perhaps brought to the attention of the API devs? @burnt trellis
Sorry for the ping I just don't want this to be missed lol
I'm not sure how curl is different vs say axios/node-fetch when doing headers.
No I get that.
I think that's a curl thing and how request are being received on the server side.
Not like it's some code that says string == " authhhcode"
I feel like me using curl shouldn't affect it, unless it's a http thing but that would be weird
Hey, does the bot.monthlyPoints reset directly after a month or will it stay the previous amount until someone votes? Please mention me when reacting
// fails
@bold fulcrum whitespace BEFORE the : in headers doesn't matter but the whitespace AFTER the colon causes an error
Hey, does the bot.monthlyPoints reset directly after a month or will it stay the previous amount until someone votes? Please mention me when reacting
anyone?
@junior tusk it resets monthly
but let's say I have 100 votes on 30 September 23:59 UTC. A minute later, the vote amount on the page will still be 100 as nobody has voted then. Will the bot.monthlyPoints variable then also stay 100 until someone votes?
@junior tusk nope it will instatly reset
that'd be really strange tho
Well there's two options
Either a) the bot page itself asimply caches the votes from last month separately and votes are stored differently, meaning you will get 0 from monthlPoints, or b) you'll still get 100 as no one has voted and you'd have to perform checks yourself
And I wish I was certain about my answer, but I could probably test it in a bit
yeah same, thanks in advance
@sullen nymph sorry for bothering, have you already looked at it?
Eh fuck it I'll do my dishes later
no take your time mate
@junior tusk so with a little bit of testing and my very stale memory
My conclusion is it monthlyPoints will stay the same until the next vote
but you can rely on the /votes endpoint since that gets reset, as far as I understand
okay thanks for testing. I guess I don't need that endpoint, I only should force monthlyPoints to be 0 when I reset my leaderboard at 01-xx-xxxx 00:00:00 UTC
I appreciate it
This is not autoposting guild count, anyone knows why?
client.dbl = new DBL(apiKey, client);
i presume all of these are sent in the body object
yes @calm zodiac they are
Discord will you load your shit for once
lmao
is it bot/server vote data
at least for dsl
yeah it is
cause i have to make my own test thing now 
I was wondering how to set up the thing where they vote for your server and you give them a role
any helpful links would help me 
DSL bot can do that
Discord Server List, see your server's settings page
ah okay
So it says Zelda Lewd Cafe (I am not sure what this server is could be the server I own but old name) and I don't see my current server called Waifu Station
The bot is in that server
Try reinviting the bot
okay
Okay it worked
not sure what's going on but I kicked, reinvited it, and it worked
thx
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!`);
});
what we have to replace to webhook port and webhook auth ?
OMG THE LEGENDARY NUMBER 69
please use #general ... this channel is only for api topics
anyone help me about this https://discordapp.com/channels/264445053596991498/412006692125933568/761371608308645928
oki! Thanks Your A good Mod
keep webhookPort, webhookAuth is a password you create yourself and enter on top.gg and in your code
Auth is essentially a password to confirm that requests are coming from top.gg
http://your.vps.ip.address:port/dblwebhook
mine vps where the bot is hosted right ?
yeah
@sullen nymph i have to enter vps public ip or private ip ?
public
Hmm......
👀
ping
كينجي كانيموتو
How do I get a API for my bot?
does the test button have any indication that the request is successful? ive kept pressing the test button and it doesnt work :/
yea it died
I've reprted it
ly
thanks :D ill try later
2 things:
- Is there anyway to make it so whenever somebody votes for a Server, my Bot runs an action using the top.gg npm package?
- How can I obtain a Token to use the API?
for 2) You receive an API token once your bot is approved
from the dashboard
k
how to fix this error and what about this is ?
@limber dawn #development and you have 11 ready and vote listeners





