#topgg-api
1 messages · Page 100 of 1
uh Im an idiot lol I just realised the server Im specifying is for my actual bot, but the development bot Im testing it on is hosted locally 
what url would I use for locally hosting?
Your local machine's public IP :^)
port forward?
the port is open and listening, I'm not sure how to 'forward' a port though
is there a way to get when someone votes without using webhooks? cus I cannot figure out how to get this to work
May want to check your firewall
it may be blocking requests before they even get to the server
there IS a response
its not being blocked
both on my console AND on the website
@spiral steeple
-api
Fixed: Problem was => im stupid
oo
please explain @kindred walrus
did you not add http
please tell me it was that

so, i didnt put http, that was number one. Then to check if it was running, i purposed port 3001 for the test server and pushed the dbl to 3002. Then i fixed http, but forgot to open 3002 port

f
its hard to be this intelligent, it creates gravity

its hard to be this intelligent, it creates gravity
@kindred walrus although it's a couple thousand of us but ite
const discord = require("discord.js");
const client = new discord.Client();
const DBL = require('dblapi.js');
const dbl = new DBL(process.env.DBLTOKEN, {
webhookPort: 5000,
webhookAuth: process.env.WEBHOOKAUTH,
});
client.on("ready", () => {
console.log("Ready!");
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!`);
vote.user.addRole('644095266651111434');
const exampleEmbed = new discord.RichEmbed()
.setColor('#de1fff')
.setTitle("" + vote.user + "just upvoted Ellie.")
let myGuild = client.guilds.get('618759363263201280');
let joinchannel = myGuild.channels.get('640602559425413130');
joinchannel.send(exampleEmbed);
});```
it's not sending the test
and it isnt saying the webhook is running
(i havent touched anything but the token and authorisation)
your webhook events dont need to be in the client ready events
const discord = require("discord.js");
const client = new discord.Client();
const DBL = require('top.gg');
const dbl = new DBL(process.env.DBLTOKEN, { webhookPort: 5000, webhookAuth: process.env.WEBHOOKAUTH });
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!`);
vote.user.addRole('644095266651111434');
const exampleEmbed = new discord.RichEmbed()
.setColor('#de1fff')
.setTitle("" + vote.user + "just upvoted Ellie.")
let myGuild = client.guilds.get('618759363263201280');
let joinchannel = myGuild.channels.get('640602559425413130');
joinchannel.send(exampleEmbed);
});```
fixed
still not sending the message when testing webhook
is the ready event going off tho?
did you put your webhook url on the website?
ye
did you use your actual ip, not 0.0.0.0
no
that's the ip it's decided to say
i had no involvement with http://0.0.0.0:5000/dblwebhook
0.0.0.0 is just a placeholder
how would i set the ip
for the lib you dont need to, its just a placeholder.
for the website you just need to put
http://botsserverpubip:5000/dblwebhook
if your hosting this on a home network youll need to portforward.
you also need to let port 5000 past any firewalls
hosting on glitch
discordapp webhooks dont work with dbl
what
your making a webhook server
your bot does that
will it when i test it?
if you put the proper url in, not a discord one
what's the proper url?
iirc, youll have to use your glitch url.
https://glitch.happyfox.com/kb/article/50-how-do-i-find-the-url-for-my-app/
with the proper path /dblwebhook
with glitch, theres a few hoops you end up having to jump through due to the major restrictions of the platform
?
belive so.
the webhook server 404's any get requests(if you put it in your browser)
i didnt actually make a directory called dbl webhook tho
so if i run a test it will work?
iirc, glitch also restricts every process to a specific port
what port
process.env.PORT or something?
wdym
the correct way is process.env.PORT
So you cant do url:port
ay
ah
but yeah, there ya go
probably should delete this message
https://discordapp.com/channels/264445053596991498/412006692125933568/744681778094014547
just so your glitch url isnt public
and the one up above a bit
vote.user.addRole('644095266651111434');
^
TypeError: vote.user.addRole is not a function```
you cant access a user like that
o?
the vote.user is just the user id
you have to fetch or get the user
before editing the user.
you also actually will need to get a guildMember to give a role
how can i achieve this
dont think you can directly do .addRole to the fetch since its a promise
guild will also have to be gotten.
how do I get the id of someone who voted and the time?
Hey
Hello, every time i use the bot status API from discord bot list, it doesn't updates
First one is from the bot
second is from google
at the same time
Can someone help me?
What lang do you use?
Language?
For your bot
Programming language?
DBScript
idk if this can be considered as a language
but yeah
i use BDScript
what even is that
unfortunate, i cannot help you then.
It's from a app Called Bot Designer For Discord
DBD
or BDFD
I make my bots in mobile
So it is JavaScript basically
i think your image is just cached
maybe show us your code
(but #development would be a better place tho)

we will see
Wait
The command is in portuguese ;-;
I'm brazilian
i don't think you guys are gonna understand
google translate might help out 
ok
$title[Ajuda!] $color[fffa00] $description[🙋**|** Olá! Você precisa de ajuda? Entre no meu site na seção de comandos agora! 🖇**|** Link: https://allukabot94.webnode.com/comandos/ Espero que aproveite o tempo que passar comigo! Ah, para visualizar o site inteiro entre em: https://allukabot94.webnode.com/ **Vote em Mim!** https://top.gg/bot/728368312874172466/vote **Meu status do Discord Bot List:**] $image[https://top.gg/api/widget/728368312874172466.png] $footer[Me adicione e entre no meu servidor de suporte! Agradeço!]
Still not updated
links went 
Can you show me a ss of your Guild Post code?
dbl.on('posted', () => {
console.log('Server count posted!');
})
Do you have this in your Bots code? (I assume you use JavaScript)
@restive otter can you please go to #memes-and-media, this isnt the right place to chat.
dbl.on('posted', () => {
console.log('Server count posted!');
})
Do you have this in your Bots code? (I assume you use JavaScript)
@fiery shadow No
DBScript
Ok
bye
I just wanted help
well, bye i guess.
You can add a ?v=xxx to force update it if you want
I mean technically it can be anything, but ?v= is just kinda universal
for some reason, i was thinking redirect to get around the caching
lol
but that makes a lot more sense
let vote = false
dbl.hasVoted(message.author.id).then(async voted => {
await vote == true
});
return console.log(vote)```
always returns false
Preciso de um sistema de anunciar tipo #anunciar para anunciar para todos os membros do ds como faço, eu faço pelo dbd discord bot designer
Version Inglish
I need an #announce advertising system to advertise to all ds members as I do, I do it for the dbd discord bot designer

Ds > Discord
way of speaking
let vote = false;
if(dbl.hasVoted(message.author.id)) {
vote = true;
}
if(!dbl.hasVoted(message.author.id)) {
vote = false;
}
console.log(vote)```
always returning true
:/
uh
Yandere dev 2.0
Lol
Hey
i need help on how do i generate the DBL_API_KEY
bc the website is kind of mest up
alright
Spice up your Discord experience with our diverse range of Discord bots
Is it possible to check if a bot is online using the API?
Because on bot's profile you can see his status, so I thought maybe you can use the API.
You can just use discord's API lol
Can you chech if the bot is online
no
That data isnt in a database, it's fetched from luca and cached most likely, so they dont have any way to serve it over the api
dblapi.js is the official @north tree
ty
@restive otter it is unofficial wrapper
dbl.on('posted', () => {
console.log('Sunucu sayısı başarıyla DBL gönderildi!');
})
dbl.on('error', e => {
console.log(`oha! ${e}`);
})
////POST STATS
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
i use this, but my bot restart every 30 minute. how can i fix this
why does it restart
IDK too
do you have any error in your console?@north tree
Did you mean to be in #development?
oh ye
When i try to use the API image that shows the servers that the bot is in, it shows: "undefined"
why?
it's like:
[servers| undefined]
Widget shows undefined because you never posted server count
how do i set the status of my bot to say how many servers its in?
i tried searching that up but it didn't come up
how can i do this
-servercount
To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.
is that in python?
any language that supports HTTP requests
it says field - server_count?
@sullen nymph
it says field - server_count?
what should i do with that
You don't have an approved bot to get an API token yet
ok thank you!
👍
what it means by "field" is a JSON key
Are you using an official top.gg library by any chance?
Do you need help with the widget or server count
Do you need help with the widget or server count
@sullen nymph i want the widget to show how many servers my bot is in
What's your bot written in?
No idea what that is
In any case, you'll have to send a POST request to https://top.gg/api/bots/YOUR_BOTS_ID/stats
@fringe dust
Where do u find ur Bot Id
-id
An ID is a unique number which is used to identify a user, bot, channel, or message. To obtain an ID, right click on it and click "Copy ID"; this can be done from mobile by holding down.
Should you not see the option to acquire an ID, you need to enable "Developer Mode" which can be done from your user settings, under "appearance".
-id
Yes, that link
@sullen nymph can i send u a link to my server, and u can join it and DM me my bot's id?
but it only shows this
And please refer to the docs as to what to send in the request body as I'm on phone
Do you not see the message Luca sent?
Wait
@willow solar A browser sends GET by default
You'll need to make your program send a POST request
You'll need to make your program send a POST request
@sullen nymph IDK HOW
to
do
it
-id
Unfortunately, me neither 
;-;
Probably the program you are using has a way to send POST request or has top.gg support
i have no clue what Luca sent
but I don't think you'll be able to do it with it
#topgg-api message you don't see this message?
i do
i read it over and over agin
but i don't understand
what do i right click on?
Did you turn Developer Mode on?
where do i do that?
const dbl = new DBL(dbltoken, client);
let hasVoted = false;
try {
hasVoted = await dbl.hasVoted(message.author.id);
} catch (err) {
hasVoted = false;
}
console.log(hasVoted)```
always returns false
when user votes recently and uses the command
this returns a false, even for users that have voted... then, after 5-10 minutes/sometimes a bot restart, it returns true. Is there a time that it takes to process the vote?
const options = {
url: `https://top.gg/api/bots/552367827370377218/check?userId=${message.author.id}`,
json: true,
headers: {
'Authorization': 'api token'
}
};
get(options).then(async body => {
if(body.voted == 1){
console.log("true")
}
else{
console.log("false")
}
this also returns false
is the api delay?
idk
y ya answering then
Supongo que puedes hacer webscrapping, pero creo que hay una API de top.gg, no lo intente aun pero parece algo facil de hacer @worn vault
no te entendi una verga 👍
como hago eso de webscrapping
English-only in this channel
sry shiv
@worn vault, well.. are you using djs/py ?
and mayb we should also move to #development
You can send a GET request to https://top.gg/api/bots/YOUR_BOTS_ID, parse the response as JSON, and get the points or monthlyPoints keys
@worn vault ^
Or use dblapi.js which might simplify life
with what package can i send a get request¿
Anything that sends HTTP requests
Something thai isn't deprecated tbh
Can't spoonfeed so 
Could use built-in fetch but sure
request is deprecated iirc
Log in on the website
See https://top.gg/api/docs for more info
Spice up your Discord experience with our diverse range of Discord bots
@sullen nymph
not a js dev myself
i tried to use superagent and it says Error: Unauthorized
@sullen nymph
what do i do
@worn vault See the authorization part in the docs
and how do i use my authorization token with superagent
Send it in request headers
let {body} = await superagent
.get('https://top.gg/api/bots/727567210649747546')
.set("Authorization", "my token")
?
@sullen nymph u there¿
No idea, not a js dev
cuz i go to the superagent docs and it says that
to set headers
imma try it
it worked
nice
api of server voting???
what's this?
Is there an api for Server votting and people will get rewards in the server?

😭
Is there an api for Server votting and people will get rewards in the server?
@plush pier not as of yet
It may be planned though
join all
Hey when i start my bot i get this error:
Code:
const server_count = client.guilds.cache.size;```
```js
client.on("ready", async () => {
console.log("ready");
setInterval(() => {
dbl.postStats(server_count);
}, 1800000);
}); ``` Error:
`[dblapi.js autopost] Failed to post stats: {"error":"Required parameter server_count or shards missing"}`
Help?
try server_count,1,1
okay
Its undefined
Bruh
oh
it worked when i did frist
first added it to my bot**
Please ping if you can help
did you define server_count?
also, if you use the autoposter you dont need to use postStats
did you define server_count?
@vapid cape Yest
that is what it said to do
as the error
server_count
also, if you use the autoposter you dont need to use postStats
@vapid cape how to do the auto poster?
Please ping me
when you create the dbl instance
you add your client as the last parameter
for example
new DBL("your topgg token here", client)
yes
okay
you dont need the setInterval nor the postStats anymore
ah
testing it
@vapid cape dblapi.js autopost] Failed to post stats: {"error":"Required parameter server_count or shards missing"}
show full code
okay
const Statcord = require("statcord.js");
const Discord = require("discord.js");
const path = require('path');
const glob = require('glob');
const fs = require('fs');
const DBL = require("dblapi.js");
// Require the config.json file, and define our Client.
const config = require('./config.json');
const client = new Discord.Client();
const statcord = new Statcord.Client("statcord.com", client);
client.config = config;
const dbl = new DBL('my token', client);
// Create two Collections where we can store our commands and aliases in.
// Store these collections on the client object so we can access them inside commands etc.
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
client.on("ready", async () => {
console.log("ready");
// Start auto posting
let initalPost = await statcord.autopost();
// If there is an error, console.error and exit
if (initalPost) {
console.error(initalPost);
process.exit();
}
});
```
its the top part
its 100 lines so
and that isnt important at bottom
Hi
@vapid cape
whats your dblapi.js version?
current version is 2.4.0
at IncomingMessage.<anonymous> (C:\Discordb0ts\FalkenB0t\node_modules\dblapi.js\src\index.js:118:25)
at IncomingMessage.emit (events.js:333:22)
at endReadableNT (_stream_readable.js:1201:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)```
@vapid cape
what do I need to do to disable the dbl code?
I've been trying to locate the code for that, but not finding it very weel
you want to disable dblapi.js?
it’s just new DBL()
@vapid cape fixed now Thanks for the help!
and all the webhook stuff (dbl.webhook)
@vapid cape yes, this bot was written by someone else, but they stopped working on it and let me have the code. So the DBL stuff is their entry on the site, not mine.
it’s just new DBL() and all the webhook stuff (dbl.webhook)
if you’re using dblapi.js
look into your bot's files and remove all calls to dblapi, including ^
what .js would have that code?
most likely index
I don't see it in index.js or functions.js (which is the biggest file)
what other files are there?
ahhh
there's dbl code in ready.js
const DBL = require("dblapi.js");
module.exports = async (client) => {
const dbl = new DBL(client.config.topgg, client)
dbl.postStats(client.guilds.size)
console.log("Bot Online - Server Indexing Starting...");
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity(`Connecting ${client.guilds.cache.size} Servers`);
//indexes all servers
client.getNetwork()
//updates every 30 mins
setInterval(() => {
dbl.postStats(client.guilds.size)
client.user.setActivity(`Connecting ${client.guilds.cache.size} Servers`);
}, 1800000)
}
is this entire module exclusively for dblapi / the site?
yes
this is a networking bot with a small sql db.
How would I setup the webhook for my bot?
depends on the language
@restive otter Why r u everywhere i go
@restive otter Why r u everywhere i go
@brazen burrow umm cuz im a bot developer and i join important server
-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
You mean nfsw servers also?
Keep this channel on topic
So I'm trying to do that vote thingy with the webhook but it doesn't seem to work 🤔 . Is there anything wrong with my code? https://srcb.in/4f5d68bb1c
you can autopost and have webhook with one line
const flat = new DBL(
'token',
{ webhookPort: 5000, webhookAuth: 'password' },
<client>
);```
also, are you sure the ports are forwarded?
@rapid kettle wdym?
where are you hosting?
VPS?
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})```
Does this post the Guilds en client users
Nani!?
Is this the thing that auto updates the server counter?
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
yes.
ok thanks
So I want to send a message to a specific channel when someone votes for my bot. I know that I would need to use a webhook but the problem is I don't know how to use it. Could someone maybe help me?
which language?
NodeJS @vapid cape
you need a webserver
you can use something like express.js and manually set the routes, or you can use dblapi.js which does it for you
@vapid cape I installed the dblapi.js package and I figured out how to do the server posting but the webhook documentation didn't make sense to me.
where is your bot hosted?
It's called FatCat hosting. It's a payed hosting service.
it looks like this @vapid cape
do they give you an ip address?
Yes @vapid cape
for the webhook what does the hook.path need to be?
@vapid cape How do I change the IP address for the webhook?
you need to go to your bot's edit page in top.gg
and configure the webhook there
the URL field should be your bot's ip address and port
like this http://xxx.xxx.xxx.xxx:yyyy/dblwebhook
where x is the ip address and y is the port number
i want api
you need to check with your host what is your bot's ip address and port
k @vapid cape Thanks!
can ya'll her me
ah okay
Yes
C:\bot\events\ready.js:19
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
^
TypeError: Cannot read property 'Id' of undefined
at Timeout._onTimeout (C:\bot\events\ready.js:19:52)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)```
client.shards isnt defined
client.shards isnt defined
@median badger how do you define it?
are you sharding?
are you sharding?
@median badger yes
how to do send a request to check if a user voted on js
so I'm trying set up the webhook and for example if my server ip was 111.111.111.11 and the port was 4284 how would I state that in the web hooks option?
http://111.111.111.111:4284/
how to do send a request to check if a user voted on js
@hollow talon with node fetch
Oh, thanks! People tell me to put a /dblapi or smth at the end
wehook = webhook
but by default, yeah
Ok
I assume you are not editing the webhookPath option
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!`);
});``` so in this if the port was `4284` I would change the Port to `4284` and the Auth to the Auth I changed on the bot's page right?
So confusing or I'm just stupid 🤔
Both guesses are correct, if you mean the "Authorization" field with "Auth"
Yes
mhm, then you got it right
Oh, thx!
Wait, why does my server say Webhook running at http://000.000.000.00:4284/dblwebhook 🤔
the 0.0.0.0 just means "running on all IPs" aka you can access it globally and locally
Oh
kk thx!
So with this piece of code if I'm correct, it should console.log the users id and send a mention to them in a channel.
console.log(`User with ID ${vote.user} just voted!`);
const channel = client.channels.cache.get('744930900441038999');
channel.send(`<@${vote.user}> just voted for flat!`);
});```
Make sure the port 4284 is open and forwarded to the correct machine
and that firewall isn't blocking any requests
wdym Open?
Open to incoming traffic
Do you need your DBL token to be able to let your bot see the votes?
And announce that user ahas voted
Webhooks
But
How can I make a vote command?
I'm using JS
Or
Can I put the user in a db (user who voted) then check if he voted then delete the db and give him (items)
Sure, you can
a webhook is just a listener for HTTP requests
a function will be executed where you can use your database and store the user's ID
Yes where do I put that
With dblapi.js, you can use dbl.webhook.on('vote', data => stuff here)
Oh but that's in the webhooks but thanks a lot
Oh, you wanted to use the API?
I just wanna make a vote command
What is it supposed to do?
Give you an item if you voted
Eh, I'd suggest using the API but you could be ratelimited pretty quickly if your bot is big
Well, webhooks 
With dblapi.js, you can use
dbl.webhook.on('vote', data => stuff here)
@sullen nymph I'll follow that
Or can I get ratelimited
webhooks don't have ratelimits as it's you listening to requests instead
so unless you implement ratelimits into your webhook, it's okay
Btw what would the user be called
"the user"?
Or can I put message
Like
Uh
dbl.webhook.on('vote', message => stuff here)
Can I do this?
nah, there's a JSON returned where user key is an ID of the user who voted
mhm
So for the db imma use quick.db because not something big
db.add(vote_${data.user}, 1)
Would it be like that
I just don't wanna make mistakes
Sorry if I'm annoying
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
How to get the DBL token?
Spice up your Discord experience with our diverse range of Discord bots
or on your bot's Edit page near the very bottom of the page

@sullen nymph sorry to ping, how do I get the webhookAuth and webhookServer
webhookAuth is the Authorization field's value you set
It's a "password" in quotes, since you create it yourself
Ah so I type the password
like a password you would enter when creating a new account on social media platforms
Should it be private? (I guess so)
Preferably
And for the server?
xd
It's an optional express server (or something else, I'm not a JS dev)
aye no problem
I already put the code (https://top.gg/api/docs#jslib) but it still does not show the number of servers, what can I do? Any other code to put or how
And also install the api
Spice up your Discord experience with our diverse range of Discord bots
I'm getting this error @sullen nymph
What does your code look like?
you need a port or a server option
check the official example on the github/npm listing @astral plaza
Thanks
A question for discord.py users who are using dblpy.
Do you consider replacing instances similar to "Client/Bot" in the dblpy documentation with simply "Client object" an unnecessary/confusing change?
For example,
An instance of a discord.py Bot or Client object.``` being replaced with
``` bot:
An instance of a discord.py Client object.```
how do i get a webhook?
@restive otter what language
I come from Indonesia, I am not fluent in English. sorry
I use google translate to ask questions on this server
I mean programming Lang
I use eris
I already put the code (https://top.gg/api/docs#jslib) but it still does not show the number of servers, what can I do? Any other code to put or how
And also install the api
Spice up your Discord experience with our diverse range of Discord bots
^^^ I can only help you when you give us the code
Any errors?
@rapid kettle nop
code?
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});
})
yes
Then it should work
ehhhmm dont work
I host my bot in heroku, and it does not give the "console log" when it gives the ping and neither when it receives the files (the bot works perfectly)
Did you deploy the newest code?
yes
!help
-botcommands @white forge
@white forge
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
Do I need to set up a web server to use webhooks, or can I just open the specified port, and point my webhook URL to the external API of my server?
DBL Python library...
It doesn't have a class DBLClient - this is copied and pasted directly from the examples with no modification at all
@sullen nymph
Do you have any folders or files named dbl
Nope
I just pip installed dblpy
No issues importing it
But apparently it doesn't work
pip show dblpy
Also your docs are incorrect, you have to put self as an argument to async def on_guild_post (docs didn't have that)
Ok will do
aye those need to be updated
I suggest referring to the GitHub repo for now 
Using the javascript library I assume that setting the client parameter will post automatically on process startup?
You'd also need fhe listener decorator
Weird
Ok I'll look at the github
Are you sure you aren't confusing your Python versions?
Using the javascript library I assume that setting the client parameter will post automatically on process startup?
@dawn topaz I don't exactly remember, but it will start posting server count automatically every 30 minutes
Then I'm going to make a safe bet and say it probably does do a post on startup 👀
Seems like something it would do
haven't worked with dblapi.js
because earlier my dev version posted its 1 server 1 shard stats to the site and I was freaking out :L
I've went through dblapi, it posts on bot ready and then per 30 min @dawn topaz
hm thanks for the info👌
that parameter was giving me a headache by having the dev version post its stats :/
-api @restive otter
@restive otter
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
And please refrain from posting slurs.
does someone know how to create a server invite with a discord.js bot?
This user has no bots
-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
@lament cedar https://discord.js.org/#/docs/main/master/class/GuildChannel?scrollTo=createInvite
@restive otter thanks :)
Hello,
I want to make if user vote my bot then he will get coins. how can i make this?
And if you are hosting locally you would need to have port forwarding on your router
because it requires a web server
And if you are hosting locally you would need to have port forwarding on your router
how
I suggest getting a vps if you dont know what you're doing
what is DBL Api Key ?
how do i know if someone votes on my server
like the user
who votes on my server
so for example someone votes on my server, i want it so it would notify me and tell me who voted.
what is DBL Api Key ?
@restive otter discord bot list, idk
tf
why quote with ping if you can't help
so for example someone votes on my server, i want it so it would notify me and tell me who voted.
@verbal basin dbl.on smth
Also @verbal basin you can't vote servers
@restive otter you now can vote for servers I don’t know if there is an API for it yet tho
There isn't
this is dbl token right?
Correct
Hi
xd I know but when I put that code plus the token of my bot does not work
how do i make my bot can be seen by other people on discord bot web site ?
I am stuck here =/
https://gyazo.com/99b7c97cebebc8990292a88e68393bd9
It explains it’s self, you need to add a description of your bot
the problem is idk what to put anymore
ye
OK
@heady musk login to the website on your account that the bot is on and click the "edit" button on the bot page
then ...
I cant help you with more than that as I dont know the api very well
you can ask for more help here and wait for someone to answer
What library do you use for your bot?
discord.js
You can use dblapi.js and find a few examples at https://top.gg/api/docs#jslib
https://SERVER-IP:SERVER-PORT/path
from where i can get it ?
From your bot host
You can put whatever port you want as long as it’s open on your server
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!`);
});
http://${hook.hostname}:${hook.port}${hook.path}
this link when it is sent in the console
I should put this link in the " edit bot "
correct?
It won’t be http://0.0.0.0:5000/dblwebhook
0.0.0.0 is just a thing for all accessible IPs to that server
so what shall i do ?
so you need to get the server’s public IP
Yes as long as all the numbers in the ip are mot 0
how do i get the " server.public.ip.here "
is it a VPS?
you can’t setup webhooks on glitch
because you don’t get a static / dedicated IP
how can i get the ip
it should be on the server panel
ok thanks very match
-botcommands @nova stratus
@nova stratus
Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.
So, a little bit of a "survey" for dblpy users here.
I'm considering switching from webhook_x arguments to a simple webhook keyword-only argument and adding a Webhook class that will accept path, port, and auth properties.
Do you consider this a valid breaking change, or do you want to be able to use either?
Brehhh
Sounds really good shiv @sullen nymph
even if I don't use dbl.py I'll answer: make both usable so users don't have to switch from one system to another and new users can more easily setup it with the new one, if that makes sense
Backward compatibility gang :^)
const client = new Discord.Client({
disableEveryone: true,
disabledEvents: ["TYPING_START"]
});
//Botlist API Code
const DBL = require("dblapi.js");
const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'password' }, client);
This gives me that error:
[dblapi.js autopost] The provided client is not supported. Please add an issue or pull request to the github repo https://github.com/top-gg/dblapi.js
But I dont know whats wrong?
prob. ready event
ready event yeah
Thanks, the error message is gone. Will test it now on my vps 👍
Sorry, I was wrong, the error message is still there @true talon. I just overread it.
Its now in my ready event. I am sharding my bot. Is this relevant?
I know that this worked before:
const dbl = new DBL('token', client);
But then I would not have a webhook. Still it says the client is not supported. Even tho it is the same client as in the previous working code.
const client = new Discord.Client({ disableEveryone: true, disabledEvents: ["TYPING_START"] }); //Botlist API Code const DBL = require("dblapi.js"); const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'password' }, client);This gives me that error:
[dblapi.js autopost] The provided client is not supported. Please add an issue or pull request to the github repo https://github.com/top-gg/dblapi.js
But I dont know whats wrong?
Maybe someone else has an idea?
-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
true
mod only
ok
for obvious reasons
how do I set bot status with the api
```console.log(somthing);
client.user.setActivity(`Serving ${client.guilds.cache.size} servers`);
});```
```console.log(
somthing);client.user.setActivity(`Serving ${client.guilds.cache.size} servers`);});```
@icy hazel ik that but how do I set this
that cant happen
wdym
well ppl can vote for it
and I can set the servers and use api
and I can find it when I am not logged in
Sooo I think it is verifed
this is bot https://top.gg/bot/731303466072408145
so there is no way for the bot owner to set it
how do u have no roles
i didnt get my bot verified
it still
stuck at waiting 4 verification lol
For 2 WEEKS actually i have to wait 4
I waited for a few months
.
how do I set bot status with the api
@cerulean heath ?
i can see it
@wanton marten I need to set the status not see my bot dont u set the status on the website with the api
no it pulls the status of your bot from discord is your bot showing online or is it even up
it shows as online
Hello!
When someone votes for my bot, it works, but how can I get the username and tag?
For example, I am: losh531#0001
Anyone?
Fetch it from your client's users
A question for #development
so with tonkku gone who's going to be taking care of dblapi.js? i've had a pr which he was reviewing but now its obv gone blank
I'll take a look at it on Monday but I'm not familiar with that codebase

I'm sure we'll figure something out for that soon
sweet, thanks Xetera!

Somebody help me!
What is this?
@restive otter whats that program
Also dbl key in the api section
@restive otter
this?
Yeah
@restive otter
[object Promise] ?
Thats code
but that’s DBLAPI
Await
Hey,
I want to make if someone vote my bot on Top.gg Then he will get reward!
How can i do this?

const app = express();
const bodyParser = require('body-parser');
const { topgg_tok, web_auth } = require('../config');
const DBL = require('dblapi.js');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const port = 3333;
const server = require('http').createServer(app);
module.exports = {
exe: async (kay) => {
const dbl = new DBL(topgg_tok, { webhookPort: port, webhookAuth: web_auth, webhookPath: '/topgg/webhook', webhookServer: server }, kay);
dbl.on('posted', () => {
console.log('Top.gg recieved guild count');
});
dbl.on('error', e => {
console.log(`Top.gg Oopsie! ${e}`);
});
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
app.post('/topgg/webhook', (req, res) => {
const body = req.body;
const headers = req.headers;
if (headers && headers.authorization === web_auth) {
res.status(200).send();
console.log('##########recieved webhook');
// work //
});
}
else {
res.status(403).send();
}
});
server.listen(port, () => {
console.log('Listening to webhooks on server');
});
},
};``` can someone help me with this its not recieving webhooks when i press test
@river bone dblapi.js automatically adds the route, don't do the app.post its probably stopping at tht before it can get to dbl or something?
ok let me try
const app = express();
const { topgg_tok, web_auth } = require('../config');
const DBL = require('dblapi.js');
const port = 3333;
const server = require('http').createServer(app);
module.exports = {
exe: async (client) => {
const dbl = new DBL(topgg_tok, { webhookPort: port, webhookAuth: web_auth, webhookPath: '/topgg/webhook', webhookServer: server }, client);
dbl.on('posted', () => {
console.log('Top.gg recieved guild count');
});
dbl.on('error', e => {
console.log(`Top.gg Oopsie! ${e}`);
});
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
server.listen(port, () => {
console.log('Listening to webhook on server');
});
},
};```
still got nothing
well now you've removed the entire server.listen @river bone ?
uh
i suggest adding a like
app.get('/', (req, res) => {
res.json({ hello: 'world' })
})```
for the time being to make sure your http can actually be reached
aight 😂
after you add the .get try to just go to in your browser and make sure you get a response
if you don't then it's a web server issue
right so try and go to http://<ip>:333/ and make sure u get the hello world



