so im trying to connect the dblapi with my bot but i get this error: http://prntscr.com/nr6akr
how can i fix this?
#topgg-api
1 messages · Page 58 of 1
nevermind i figured it out
i thought i already defined Discord but i guess i deleted it
dude
i said "nevermind i figured it out"
so dont say dude
i realized what i did wrong
so my bot has been running for about 5 hours now and it hasnt posted the stats to dbl, so im assuming theres something wrong in the code but i dont know what
heres what i have so far: http://prntscr.com/nr85va
Does your client actually log in
(and why did you just call the client dc that name doesn't give any information at all
)
Yes that is indeed the first thing that comes to mind when seeing dc
Hello ! My widget does not update, but, on my bot page, there is 6 votes
But on the widget, only 2
Do you know why ?
Dont download the image
It cant just be a static image on a page, it should be the link
It wont update in things like discord automatically because of user cache
I do not download the image
Just the link
In my embed
But yes, probably user cache
What did you see in #commands ? By typing lofi info
Goodbye
Says 8 for me
I need to fix this code
message.author.send(client.guilds.array()[5].channels.array()[0].createInvite().code)
// ASYNC:
const invite = await client.guilds.get("GUILD_ID_HERE").channels.first().createInvite();
message.author.send(invite.code);
// OTHER WAY:
client.guilds.get("GUILD_ID_HERE").channels.first().createInvite()
.then(invite => {
message.author.send(invite.code)
});
Check dbl docs
The port can be any open port, usually 1024-49151, just something not used tho. The auth can be anything you want
Hey !
I'm trying to get the votes for my bot, however, it returns 301 and not 9, do you know why?
Here is my code :
console.log((await message.client.dbl.getVotes()).length) // 301
And now it's 1000
And now it's 301
@fierce haven use let bot = await dbl.getBot(client.user.id) then
bot.monthlyPoints (or just points if you want all time votes)
Okay thanks you
I'm starting my bot by using Heroku, but I'm getting an error when I post bot statistics to DBL, can you help? https://connection-failed.is-bad.com/6dh45nN.png
I need help, how to get dbl api token?
add your bot first
@restive otter, Then go to the link. https://discordbots.org/api/docs#mybots
-un
How can I make a ID card with canvas
id card?
likely a caching issue
what
Who can my bot write in Web?
That question made no sense
but it has 4 stars
lmao
@daring cove do you mean embeded messages?
Yes
lmao
Thanks
np
- Move to #development
- That still tells me nothing
- Well fuck
Ok
I think posting stats should return a complete bot object. Because what I need to do right now is post my stats and then at the same time I have dynamic votes that I store so after I post I also have to get again and get that number of votes, it’d be easier for anyone if it’s all throw in one request and one response
You can put that in yourself if you want to
If you mean directly from the api, you'd probably make a request on github
Yea I mean with the actual api it just gives the full bot object. As far as I can tell on POSTing stats it doesn’t even return the new data
Also the actual rest isn’t on github so
So I see some odd errors in my log, and they seem to be related to the api:
Note the "domain=.discordbots.org;" in the middle of the first screenshot
Anyone has any idea what this means?
Oh, and also "dblapi.js". Duh. I guess that's a much more obvious giveaway.
....
@arctic arch sorry for the ping but are you aware of this bug? it seems to only appear "at random" when posting the server count every 30 min
if its bug or not im not sure, but it's something
yes
ah so u know this ^^
@wraith flax so I can not do anything on my side? Or, rather, should I care?
You can't do anything about a website/server being down unless you are the owner. Unless it's really important, you don't really need to bother
yt*invite
Well, that's what I meant: I don't know if it's something important or not.
How to write web server (what functions i need) to use webhooks? I know some basics of flask
GitHub
Flask script mainly to handle POST requests from discordbots.org - shivaco/DBL-python-webhook
thanks
I should remove the mongo stuff from that thing but I hope you get the gist
so i dont need that mongo stuff?
because i want to run it on pythonanywhere.com
oh btw this is better for me
GitHub
An aiohttp webserver made for usage in discord.py bot cogs to keep track of upvoters. - shivaco/DBL-python-async-webserver
because i want to give people rewards when they vote
I mean, if you want to use another database, go ahead
F
You're not forced to
I should someday actually remove mongo from there to make it more customizable tbh
You can just remove anything related to pymongo in that code and you are good

Is there any way to check when the User has voted, so he can get a reward?
Webhooks
Can we pull a user's vote history at all?
you should use webhooks and store the data
but there are a few api endpoints for votes
:v
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
What goes in the (webhookServer: server) option?
Docs say http.Server
oh
@worn quail the IP is not configurable through options in Client
Reee
This doesnt seem to run?:
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!`);
});
does the ready run?
mhm
im here.
Alright, what do you have in the webhook path
or can it be called from another location.
it should be http://ip:port/path
For my webhook path i have like a Web hook URL from discord?
No, discord webhooks dont work
it has to go to your http server that dblapi set's up
on dbl or the console
So basically put that in the edit page in webhook options but change 0.0.0.0 to the ip of the server it's running on
idk how you host
Ah glitch is special
Ye
Im not entirely sure, but if you search glitch in this channel you'll find it
probably
My Glitch Hosting port is different
@spiral steeple What does the Test Button in the Webhook options preform?
Sends test request to your webhook
Yeh
What should the Port be for the webhook if you use glitch? I searched back and a lot of people on this channel said 3000 but when I use that I get a “3000 already in use” error
Hi
submit it again
Ok
how do you get your current vote count for this month? (node.js)
using dblapi.js or not?
Can anyone help me? I have added the API Libary and the code for the API to my bot, but it still won‘t show the server count.
I don‘t get any errors. The bot is running on discord.py. I added the code into the main bot file. I changed the API key, but I can‘t see the bot count thing appearing on my bot‘s list page. @arctic arch
self is this
@topaz falcon reset that token, you just shared it publicly
also @sullen nymph
@arctic arch
So what exactly do I have to change here?
(I changed the token).
I understand self to this. But all self to this?
ignore the self is this message
the person I responded to removed their message
Oh.. so what do I have to do
and I don't do python so I pinged shivaco to maybe help you
Alright.
@arctic arch yeah using dblapi.js
@topaz falcon i see
u need to cog it
DiscordBotsOrgAPI is redundant if its running latest discord.py version
not redundant as whole function, but u need to add a perimeter to it
GitHub
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
Examples there are up to date
@arctic arch that looks like the example from DBL docs :p
Also looks like you got your error handler to ignore errors, might wanna fix that
im having some difficulty coding my bot
Wrong channel
Sorry, where do I go
#development and post about the actual problem, just saying "im having difficulties" doesnt say anything
Okay, I'm sorry
How can I check if the User has voted to send him a reward? (JDA)
for example:
if(user.completedVote) {
sendReward;
}
Read the docs for our Java library
yeah, I done this. But there is no example for this. There is only the method how to check if he has voted.
So, if the user runs a VoteCMD and the bot says you have already voted or you can vote and When the user gets a reward every time the bot says you have already voted, the user can "cheat" him the reward
you know? @dawn fjord
You can use the API to check if a user has voted
i dont think we understand what you want @solid solstice, you know that you can check if the user has voted, so what do you want to check?
I want that the user gets a reward when he has voted
So when he run a VoteCMD the bot checks if he has voted or not
if not, he sends a link
if he has voted, the bot reply you have already voted
GitHub
An API wrapper for https://discordbots.org/api/docs that works in Java - DiscordBotList/DBL-Java-Library
but when now, I give him a reward, when the bot replies you have already voted, he can get unlimited coins if he vote once, and do this command every second
ok so you would need to store that they have already voted
yes, I think so
no
is this all i need to get the thing to work```
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(Oops! ${e});
})```
yeah that should auto post
you dont even need the optional stuff, thatll just spam your console
How do I make a dblpy request to check whether a user has upvoted d bot?
I think you need get_upvote_info
Does it return info of who upvoted d bot in a list?
Like wdym by ‛Info about who upvoted your bot.’
Returns all users who upvoted your bot
Disregard that
I should fix the docs and make it make any sense
Because client.get_upvote_info actually returns a list of dict objects with user info
how do you get your current vote count for this month? (node.js - dblapi.js)
Yeah?
@calm zodiac ```js
let bot = await dbl.getBot(client.user.id)
bot.monthlyPoints
and how can i log it?
console.log(bot.monthlyPoints)?
thanks can you german?
No I cant german
Oh
I can ^^
He has write dbl is not defined what can i do?
@restive otter Developer
@worn quail @plain timber
Not really
Thanks
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token');```
And how do i create the Webhook?
I have a question @plain timber
Well i get this error whenever posting guild count, using .py tho
await self.dblpy.post_server_count()
AttributeError: 'Client' object has no attribute 'post_server_count'```
i am using the example from the DBL website itself
mention me if someone replies.
Is the a vote api?
@plain timber
discordbot.org vote api
no its guild count

its the api for posting guild count
post_server_count has been changed to post_guild_count in latest updates

@restive otter stop pinging me, read the docs
what do i read in webhook port
For the dplapi vote webhook, what’s the port for glitch?
process.ENV.PORT
is there a tutorial for using webhooks with glitch
im new to this whole webhook thing
and im like
struggling
Just run the script on your computer
so say i run it via a vps
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');
});```
and use this example, my webhookurl would be the ip to my server and then port 5000?
yes
http://<serverIp>:5000/dblwebhook/
Yup, also confused on this
{ webhookPort: 5000, webhookAuth: 'password' });```
running on heroku btw
Hello
like whats webhookport?
Port is 5000 by default I think
The IP is the address of the bot being run on
That's why using a laptop is better
Where does the like ip and stuff go
trying to get who voted and stuff, and to use it as a command so the server ip and stuff would change
Read the api docs
Idk what lang you use
I am not messing with votes tbh
I'll just do a voting feature from my bot's webpage itself

JS
K then I cant help
rip
how do I get normal date and time, instead of using Date.now()
Never mind got the answer
How to create webhook?
a webhook is just your local server accepting http connections
@normal willow That's not a question for #topgg-api , please keep questions like that to #development
@wraith nymph Wrong channel, wrong server to advertise in, please delete (also nobody cares about a channel that someone links without any context)
@craggy sentinel 342973820291776512 ads
👌
Where can I find how to get my server count displayed?
on the site of course, lel
nm found it
my NEW question is when I npm install dblapi.js
is it going to modify existing files? When I installed sqlite it modified existing files, my bot was offline for hours and it was a major headache
?
what do you need me to clarify
does anyone know how to get the guild owner name/tag in discord.js?
bc message.guild.owner is sending undefined
but only on this server
#development, your bot probably doesn't have the user cached
@vague mountain installing packages cant modify your bot files
it installs inside its node_modules/dblapi.js folder
when i installed sqlite it overwrote some of my js node files though
just making sure this package won't do the same
that shouldnt be possible
you just used npm install sqlite or whatever?
yep
ok thanks man
yw
how to create this webhooku
@coarse siren what language?
@coarse siren i mean what programming language
english and turkish
2 language
mixed
:d
@plain timber
I think we'll talk by tagging
javascript
as i said half my english
I think we'll talk by tagging
@plain timber
run it on start
Hello, anyone can help me with vote webhook in Java ?
do i have to do more than it says in the docs for the webhooks? it spits this in the console
Webhook running at http://undefined:undefinedundefined
how do I check how many upvotes my bot has?
@last cedar it shouldn't be saying that, can you send the code?
Shit I meant @proper atlas sorry
@last cedar what language
Lol I just have the normal code but setup with my event manager
Send it
Aight
I’ll be one min gotta do it from my phone
node.js
And @restive otter you will need to set up a webserver (for example http://sparkjava.com) and accept the POST request from DBL, you can see info about the request here https://discordbots.org/api/docs#webhooks
@last cedar ok so once you have set up dblapi.js (look at docs https://discordbots.org/api/docs#jslib), you can do ```js
let bot = dbl.getBot(client.user.id)
Then you can use `bot.monthlyPoints` (or `bot.points` for all-time votes) wherever you want to show the amount of votes
Have to do it in pictures Bc my phone won’t let me copy
- Combine dbl and wdbl
- The webhook code has to actually be in the dbl.webhook.on event
Like the wdbl stuff?
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!`);
});
You can't just take the console.logs out
oh i see
They will only work inside the dbl.webhook.on functions
Also what code are you trying to run when they vote 🤔
That needs to go in the on vote part
But you didn't send any
wait me?
@safe remnant two places: bot edit page or that page ^
Ok thanks
GitHub
A new (unofficial) discord bot list api, handles webhooks and every https call to discordbots.org. This github may contain unstable updates, the npm will be the stable release - steven4547466/new-d...
Does this work?
and how good is it compared to the official one?
it doesnt have anything that the official one doesnt have i think
Does the official one have anything this one doesn't have?
ok
Lol that's the first time someone posted that here
But as far as I know it does everything the official one does.
And some
It was a personal project as well, I just published it because why not
But it does have votelocking for people that dont want to set that up themselves, even tho I highly hate votelocking
does webhook testing have a cooldown
Is there an API ref doc with actual endpoints listed?
I'm after the votes endpoint and I've seen others mention it but cannot find the API ref doc
how do i test votes
Ive tried to use the webhook thing to get vote updates to my bot, it doesnt seem to be working...
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!`);
});
I copied this but it doenst seem to work
Maybe use this one I found on Github then
GitHub
Simple webhook vote handler for Discord Bot List https://discordbots.org/ - Deivu/Haruna
I know
You're not understanding what this is
Receiving voting events requires you to have a webserver (website), with a domain etc
Then you need to launch something like that, that will be able to handle the incoming requests
then you can log em to discord channel if you know how to connect your bot to the website
so i clone that repo into my bot folder?
you lost me
@cosmic summit okay i cloned it, how would i connect them, what file is it i need to connect ect
spoonfeeding is bad
just asking for help in something that is completly new to me
Honestly no clue how to help you from here
I have no idea how your bot is like n stuff
I just dont know how to setup this thing you sent me and how to connect it to the bot...
it says in the to add a config and i filled int he info
Trying something else now
what is the url that i need to enter? @craggy sentinel
forget it im just not going to use the api
I use my own personal api 
@sinful rampart its your own URL that points to a server that recieves a webhook
also message edits dont ping
i found this message while randomly going through channels lol
webhook url is your server ip + port + /vote/
ty
Question. I've tried to get my url ip and bit the /vote/ at the end
But nothing happened
Tbh I dont need the api but it would be nice
But I can get the values from a json from somewhere
andmakemyownapi
how did you do it
the url
it should be the directly where the server
K..
try accessing the port
where the api is hosted
it should show the haruna api ver
then something is wrong
in your setup
thats the basic of checking if the port is open
Its fine
and if it setup correctly
your c hoice
that api is soley created for those who want a fast api for voting handling
Meh
I'll likely use it eventually but I can just tie in some stuff from other api(s) I have created
But yeah it would be fastest
I'm not gonna be able to do anything now anyways
too tiRed
I know its fast because I query to that api per message event xD
o dam
api key only available to verified bots, right?
yes
ight
👀
How do I set up the webhook , my console is saying 0.0.0.0:5000 but that dont work nor my ip and port .
Replace 0.0.0.0 with your public ip
Ye i tried but when i test it / also do a vote. It dont do anything , It is told to console.log it but it aint.
Make sure your ports are open
i'm running an http server for dbl webhook
i use an reserve http tunnel
last day the webhook has worked fine
and today no requests are getting here
what i'm i doing wrong ?
hey how can i get my webhook token
What webhook token are we talking? Is it related to DBL?
@sullen nymph the webhook token of a channel i created
https://discordapp.com/api/webhooks/webhook_id/webhook_token
in channels settings
hi
Good evening, a person is how to make a voting system with discordbots.org in channel ping me for help please
(with api) ?
^
you can explain to me because I do not understand very well on the web
(I am french)
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!`);
client.users.get(vote.user).send("**Thank you very much for voting!**\nAs a reward, you have recieved 1 point.");//gets user and sends them a dm
client.channels.get({channelIDhere}).send(`\`\`\`css\nUser with ID ${vote.user} just voted!\`\`\``);
});
app.get('/', (req, res) => {
// ...
});
server.listen(5000, () => {
console.log('Listening');
});```
like literally just throw that in ur bot code
and that happens is
when a user votes
it will send them a message, and log it in a channel
pretty straightfoward
and then on ur bot edit page, just change the webhook url to wherever your hosting the bot's ip or url ex. http://127.0.0.1:5000/dblwebhook and the webhookauth to a password that u choose
Wait is that actually the example lol
i added like 5 lines
client.users.get(vote.user).send("**Thank you very much for voting!**\nAs a reward, you have recieved 1 point.");//gets user and sends them a dm
client.channels.get({channelIDhere}).send(`\`\`\`css\nUser with ID ${vote.user} just voted!\`\`\``);```
was literally all i added
lol
can someone help me with voting event, its litteraly not recieving any voting data
console.log("Someone voted")
})
even this code isnt working
js
its not giving any errors its not doing anything
i even tried making it async funcion
dbl.webhook.on('vote', async (vote) => {
console.log("someone voted idk who this is just a test")
});
help
@pearl ibex did you set up the webhook in your bot edit page
and you're sure the port is exposed
@plain timber yes dbl.webhook.on('ready') works but vote doesnt
Which is the weird thing
nope its not weird
ready happens when its just ready to listen to the port
it doesnt mean it will work on vote because it fired ready
dbl webhook dont know if that port is open or not
imagine this logic
imagine a road blocked by a wall
Actually true
do you think a car can go through it?
Webhook was on 0.0.0.0:5000 port
It shouldve been like that?
open it before it will work
google is the saivor who saves everyone lmao
start from small details to bigger details
how am i gona get my bot auth password?
You mean your dbl auth key ?
This place has an API? Jeez i need this
view channel topic
Jeez thanks, mod
Is there any way to emit the vote weebhok event?
@pearl ibex you can choose your own auth password
yeah i realized that
Yes
You use .emit
You can emit any event, even on the bot
dbl.webhook.emit(...) I believe would be the default
Thank you, i wasn't sure if i could use it in this specific case
I'm eating a lot of faeces trying to get my vote detection to work
like what should I input in options.webhookServer
nvm I was using glitch
I"m an idiot
have to use port 3000
but anyone know how does the test work
@fleet raven you need to save the info, then test
the webhook url should be https://PROJECTNAME.glitch.me/dblwebhook
Webhook stopped working for us, is there an issue?
Edit: Its just slow
how
@plain timber I'm using my only glitch port for sth else already 😛
anyways, the webhook path has to be where the voting script is, right?
Yeah
Can confirm Webhook is slow / not working at all
nvm. it's just slow
took 3 minutes to update
@arctic arch what's going on?
@fleet raven then remove webhookPort and set webhookServer to the express listener
(Can we not use that kind of emotes here)
^
Just kicked the webhook server, should be running smoothly again now?
911, I would like to report someone kicking webhook servers
Lol
can someone help me with the webhook in the js api ?
@restive otter https://discordbots.org/api/docs#jslib
hi
Hi im wonder if they is a command so i can change the prices
Iv joined wrong group sorry lol
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('KEY', { 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');
});
Hello, I'm using this code right now to get the votes but it does not work. I think it comes from the URL that I did not put but I do not know what to put ...
Hi, for no reason, i have this error: https://cdn.discordapp.com/attachments/581538543885877258/585536976023978001/unknown.png
This error is caused by me or another things ?
Any 500 error is server side
So i can't resolve this ?
Negative
Okey thx c:
how can i make the website say that the bot is online?
If the status on your bot page is "???", your bot has been kicked from this server for breaking the bot rules described in #rules-and-info. Search #mod-logs for your bot to find out the exact reason
ok but my bot did not get approved yet..
If the bot page exists but the bot is not in this server, the status will be "???"
ew
im trying to sign into discord bots but it is only showing one avatar to authorize and its not mine, how do i put mine in?
nvm
wdym
why can't bots acces Member.profile()?
For privacy reasons
makes sense
Is there any simple way to check if an user voted, something like /bots/bot-id/user-id?
https://discordbots.org/api/docs#jslib @night cedar
And nice pfp 
Hey can someone help explain to me how sharding works exactly and how I can utilize it
For using sharding you need to have a certain number of server
You don't need sharding untill you hit like 1,5k servers
^
somehow i can struggle with sharding, but this api just fucks me up
But i like overkill 
ah, one server per shard overkill like
That's a bit too much overkill
I'd like to see the server bill if someone tries that
but basically with sharding is it like you run let's say 3 servers and then you split the bot's load across those 3 servers
so each server is in charge of a 1/3 of the guilds?
you dont need multiple servers
yeah so that's what i'm confused about
how would you use sharding
also i'm at around 700 servers with one of my bots so i'm just wanting to future proof possibly
well basically you just need to make multiple connections to discord
you could run each one on a different process but its easier to just run them all on one process
what lib do you use?
Discordgo and Discord4J
oh, im not sure what types of sharding those support
might want to ask in their support servers
ok but answer me this
theoretically
if i wanted to
could I run 54 instances of my bot each on it's own CPU thread and each with 2GB of ram
If i wanted to
not that I would
but could I
yeah you could
you can run each one on a different server theoretically
but it might also depend on the lib and whether it supports it
Discordgo doesn't support it natively but it's a really bare bones framework
there are some libs for it that add sharding support
discord.js has support for both internal (single-process) and external (multi-process) sharding
0-1m
ye it updates
but i can't grab it {"error":null,"statusCode":401,"success":false}
and not sure what i'm doing wrong
@restive otter for ze token is &token= right nvm saw in docs
what is all the info of a bot that i can get from dbl.getBot(botID)
i do believe it is this
ah aight, was in the js lib section
\
dbl.getStats('580810346252468254').points isnt grabbing the upvotes?
is that not how you get upvotes?
@proper atlas
- Points is in getBot not getStats
- The methods return a promise
let bot = await dbl.getBot(client.user.id)
bot.points
Also points is total votes, monthlyPoints is votes for the month
when a user votes for my bot how would I send them a pm letting them know their rewards in discord.js
@shrewd ginkgo use webhooks <
https://discordbots.org/api/docs#jslib>
ahh okay thanks a lot
@plain timber thank you!
Yw
do the Widgets work in embeds?
The latter
You have to setup a server which takes requests from DBL and handle them
🤔 🤔
read the documentation
dbl.hasVoted(msg.author.id).then(voted => {
Throws Error
TypeError: dbl.hasVoted() is not a function
I have no idea what i'm doing wrong.
Where did you define dbl
@spiral steeple
const dblapi = require('new-dblapi')
const dbl = new dblapi(process.env.DBLTOKEN, client)
It needs to be in the same file if it isnt global
This is in the same file. bot.js
checkVote(id) Checks a users vote. Returns true or galse. 
API says .hasVoted() ?
Yeah? The API on your website however doesn't say that.
Spot the difference
Lol
I didnt even see that
Fcking my own lib 
Galse
Wow
When was the last time I updated that
Answer: now. If you want better help you should really just use the official lib 
Then everyone here can help you and not just the few people that use mine
Error: connect ENOBUFS 104.25.196.27:443 - Local (undefined:undefined)
Error: connect ENOBUFS 162.159.129.233:443 - Local (undefined:undefined)
at internalConnect (net.js:932:16)
at defaultTriggerAsyncIdScope (internal/async_hooks.js:294:19)
at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1081:9)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)
Uncaught Promise Rejection:
Error: connect ENOBUFS 162.159.129.233:443 - Local (undefined:undefined)
{ Error: 504 Gateway Time-out
at IncomingMessage.res.on (C:\Users\Desktop\node_modules\dblapi.js\src\index.js:118:25)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
raw:
anyone know how to fix this
just recently started to get it
Error: 504 Gateway Time-out
you cannot fix 500 level errors. these are server errors
you can catch the errors and then do whatever with it
new dbl api feels like it is based of from haruna
but with exception it doesnt run with the bot's process
well anywaays use the official dbl wrapper if you want to use the dbl .hasVoted()
@misty geode 500 errors arent from webhooks, its from something else
you can get a 500 if you are making a request to dbl
webhooks are the opposite so you cant get a 500 on that
@clever rock Except it's a full api wrapper, but it's bote lock system is basically identical
idk how much of it is the same, but I remember it was quite close
I wasnt looking at it when I was making it, just a vague memory
at least you made it with eris support 
lol eris
I was told it just worked with eris
by someone who used it
I dont know the first thing about eris 
I was originally planning to make the votewebhook in java due to how simple to run Java programs but who knows what future holds
specially with fast embedded dbs
yeah I rewrote that server handler and release 2.0.0
ye they were pretty similar
k what is haruna lol
Saya's vote handler? idk what it does now
I thought it just did the webhook earlier
Your commit on that was in February, idk exactly when you changed it from that to sweep tho
I wonder if the sweep code is the same as the for loop internally
answer: yes
how would i get the bot owner tags instead of the ids
bc i assume <@${bot.owners}> would do something like <@343180696556404736 353782817777385472>
nvm i think i got it
is the api supposed to return '' instead of null for github and stuff is there isn't one?
I was getting tons of 401 errors from dblapi.js for months without knowing what was going on, as the token was the same in my code and website. I reset the token, replaced it and turns out i wasnt posting about 100 servers oof
could i get some help this error message aint givin me much to go off of (node:2820) UnhandledPromiseRejectionWarning: Error: 404 Not Found at IncomingMessage.res.on (E:\Canine\node_modules\dblapi.js\src\index.js:118:25) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1125:12) at process._tickCallback (internal/process/next_tick.js:63:19) (node:2820) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2820) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i assume its something within this (https://hastebin.com/tuvubodeyo.js) as it only triggers when i do C:info bot [BOT]
404 not found is everything you need to know
^
There something I'm doing wrong?
Also it restarted itself like 20 times last night
Due to me being spammed
Memory leak warning
Meh
is the webhook thing working?
i tested mine with ifttt and it worked but i get nothing with the test
this one
nevermind
had to press save
O
npm i ytdl-core
?
@peak brook npm i ytdl-core in the console
thx
Np
but now it says server is not defined
What does your code look like @peak brook
if (!servers[message.guild.id]) servers[message.guild.id] = {
^
ReferenceError: servers is not defined
do you have a servers object? where is servers defined?
i have a feeling that you are copy pasting code
How bot Play#4329 ??
So using a webhook will that reward users as soon as they vote, or do they need to call a command etc. (not experienced at all with webhooks) - Thanks in advance 
looks like wrong chnnale
but discord.js is a library
i thoug
oh
well there are stuffs about normal code in here aswell
apparetly this is issue
Guys! How the webhooks works in this website?? I don't understand! The webhooks are not showing!
tell us more details about your implementation
I'm using other library! So i tried with webhooks! But they aren't working! The webhook it's not showing up in the server!
what url did you use
My webhook url
a discord webhook url?
yes
did you read the alert that popped up when you clicked save
you're supposed to set up a webserver that can receive requests containing the vote data
we do not post the data in a discord webhook format
you can program your bot to send messages
How?
How to get int of votes with python dbl lib?
int of votes?
Try using this instead https://dblpy.readthedocs.io/en/latest/api.html#dbl.Client.get_bot_info
Look for the points property
/bots/id/votes isn't kinda reliable imo
So yeah, if get_bot_info doesn't do the job either, rip
so what should i use
@shut sun try what I suggested in my last message
okey thanks
No problem
/bots/id/votes only has the most recent votes and does not you wont see double weekend votes twice
Ah
So what would be the best and esiest way to reward someone as soon as theh voted?
Webhook right?
I found out that using the /bots/id/check?usdid is kinda slow for some reason
It takes like a good 30/50sec to update over ze bot
Well i have never used one, so i ll try my best
And do i need to do anything to get double votes over the weekend, or is that by default, and checking it would be just for an extra reward etc?
see documentation for the webhooks
@arctic arch sorry for ping, but i'm struggeling for a good time already to get server count on the website
And i'm just not able to
so to get the servers on, i only need
"server_count": "var"
}````
yes
hello
what's in this section
I think it sends a discord server the name of the person who voted for the boat.
but how it works
please help
?
:/ hey
it doesnt send in a discord server afaik
it links to the webhook documentation
read it 
yawn
come on but boring to read
you need to make an HTTP server and discordbotlist will send requests to it
read the documentation to see how the requests are crafted
you need to make an http server
that is publicly accessible
do you use nodejs? @copper flame
yes
run this
npm install dblapi.js
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!`);
});
this will print a message to the console with a link starting with http://
just copy the whole thing and paste it to your bot edit page
I'm installing dolap.js but it still gives an error
by the way i threw it into server.js
dblapi.js
Does this mean that it was uploaded
how will i fix it
const DBL = require('dblapi.js');
^
SyntaxError: Identifier 'DBL' has already been declared
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
const DBL = require('dblapi.js');
^
SyntaxError: Identifier 'DBL' has already been declared
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
read what it says there
can you read
Did you see
i did, and tried my best to explain how to fix it
const DBL = require('dblapi.js'); **<<<<<<bad code** 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!`); });
don't have dbl and DBL
thats not the problem
javascript is case sensitive
the problem is
that he has defined DBL already in another part of the code
we dont see
^
Hi! In the weebhook part, what should I put?
``const DBL = require('dblapi.js');
const dbl = new DBL('', { webhookPort: 5000, webhookAuth: '1234' }, client);
// Optional events
dbl.on('posted', () => {
console.log('Sunucu sayısı gönderildi!');
})
dbl.on('error', e => {
console.log(Olamaz bir hata! ${e});
})``there's only one like that
@spiral steeple path? Not dblwebhook?
😭 please i am bored
that was being dumb
http://ip:port/path
Wtf
why is it adding a /
http://ip:port/path
:o
i think i solved the problem


