#topgg-api
1 messages ยท Page 35 of 1
Yeah
isn't that a new feature in development kinda branch
I'm modyfing the API rn
No
It's here from like 3 months
or something
So idk what to post as shard id
Cause I'm not able to get bot's shard as it's acting like normal non-sharded bot
(Easier to maintain)
:/
H... help ?
@worthy ferry You don't have to post shard ID's if you have the total available
oH OK
You can just post server_count with the total value
You can also add shard_count with your amount of shards
But that's not really neccesary
I mean for the team
Oh, you can make a PR I reckon
PR I reckon? my brain doesn't work today
Pull Request
ooooo
dblapi.js - An official module for interacting with the discordbots.org API
If you make a PR here the team can review your changes
@snow fiber the dblapi, how can you display an extra footer on the vote webhook, when the double weekend is active?
@restive otter just check if isWeekend is true
No
then wut
You're using webhooks right
yes
isWeekend is a field sent in the webhook body
Just like user and bot
How are you getting the user id
vote.user
Then check vote.isWeekend
ok
Did you try it?
PR submitted :3
Did something in the API changed?
I get an error in maven, that it can't get the DBL-api
(tag me pls since I muted the guild)
I really need help.
I can't make a change to my bot, because it looks like that something in the API has changed... Altough the API-page shows still the same stuff that I currently use
what language?
I tested around and can confirm, that something isn't right with the dependency for the API, because after commenting all apearence of the API out, does ot work now
Java @arctic arch
a new version was released, docs arent up to date yet
So. What are the new methods then?
https://github.com/DiscordBotList/DBL-Java-Library
this readme should be up to date
DBL-Java-Library - An API wrapper for https://discordbots.org/api/docs that works in Java
ok.
What's the reason behind using the botID too now?
Ahhh I see
To no longer have it in setStats
Is there any way, to get update-notifications for the API @arctic arch
Other than through GitHub, by watching it, because that could just spam my e-mail....
idk
5|nsfw | at _response.transport.request.then (/home/tutorapide/nsfw/node_modules/snekfetch/src/index.js:182:21)
5|nsfw | at <anonymous>
5|nsfw | at process._tickDomainCallback (internal/process/next_tick.js:228:7)
5|nsfw | request: undefined,
5|nsfw | body: { error: 'Unauthorized' },
5|nsfw | raw: <Buffer 7b 22 65 72 72 6f 72 22 3a 22 55 6e 61 75 74 68 6f 72 69 7a 65 64 22 7d>,
5|nsfw | ok: false,
5|nsfw | headers:
5|nsfw | { date: 'Thu, 26 Jul 2018 19:14:52 GMT',
5|nsfw | 'content-type': 'application/json; charset=utf-8',
5|nsfw | 'content-length': '24',
5|nsfw | connection: 'close',
5|nsfw | 'set-cookie':
5|nsfw | [ '__cfduid=d35020e1628e45d140a462cf72355fdc51532632492; expires=Fri, 26-Jul-19 19:14:52 GMT; path=/; domain=.discordbots.org; HttpOnly; Secure' ],
5|nsfw | 'x-powered-by': 'Express',
5|nsfw | 'access-control-allow-origin': '*',
5|nsfw | 'access-control-allow-headers': 'Authorization',
5|nsfw | etag: 'W/"18-XPDV80vbMk4yY1/PADG4jYM4rSI"',
5|nsfw | 'x-cacheable': 'NO',
5|nsfw | 'x-varnish': '954990863',
5|nsfw | age: '0',
5|nsfw | via: '1.1 varnish-v4',
5|nsfw | 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
5|nsfw | 'x-content-type-options': 'nosniff',
5|nsfw | 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
5|nsfw | server: 'cloudflare',
5|nsfw | 'cf-ray': '440931160b2ea84b-CDG' },
5|nsfw | statusCode: 401,
5|nsfw | statusText: 'Unauthorized' }
``` Help me .
My code post guild
snekfetch.post(`https://discordbots.org/api/bots/stats`,{
headers: { Authorization: 'token' }
})
.send({ server_count: client.guilds.size})
.catch(err => console.log(`'[Discordbots.org] Impossible d\'Update!'`, err));```
'token' is your actual DBL token, right?
I put a token to hide my token sorry my english i am french
i can translate im french and english
does anyone here know anything about skyslik cloud?
i would like to know how to use the api to have a code who send a webhook message when i got an upvote
can someone help ?
.hasVoted(id) in the docs says 24 hours but since the new update that people can vote every 12 hours, has it changed to just check in the last 12 hours now or is it still last 24 hours?
@hoary timber you do bring up a good point
i dont think there is any way to do it, really
but that is def something that should be looekd into
@inner venture What point?
there should be some way for lib users to get notified when new vers come out
New feature for @abstract moth ? ๐คท
I personally wish, that Discord would change, that bots are also labeled in VC.... But that's nothing for here tho
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!`);
});``` `const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });` what should i put in the port?
@sturdy scaffold Any port that isnt in use
i dont have a port
dont have one
doesnt work tho
Look at that
:p
ok thanks
that didnt work const DBL = require('dblapi.js'); const dbl = new DBL('token', { webhookPort: 5000 }); 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!`); });
didnt consolelog
did you read the page I sent you
yep
You have it set to 5000 in that code
does the token go in strings?
Yes
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Object._errnoException (util.js:1041:11)
at _exceptionWithHostPort (util.js:1064:20)
at Server.setupListenHandle [as _listen2] (net.js:1322:14)
at listenInCluster (net.js:1370:12)
at Server.listen (net.js:1466:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:27:12)
at DBLAPI (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/index.js:42:13)
at Module._compile (module.js:573:30)```
@inner venture i set the port to 3000 and this happened
find out whats using port 3000 then man
wtf is a 'port'
Its a door
This is the API help channel, not the basic networking terminology help channel
because youre using a garbage host
no you dont
Yes, you do
console.log(votes)
});``` will this send all the voters?
It will send the last 1000 votes
ok
const dbl = new DBL('token', bot);
dbl.getVotes().then(votes => {
console.log(votes)
});``` why does this not send my bots voters?
Did you replace the 'token' and bot with your actual token and Client instance or whatever it is?
Yep 
yh
And is bot not non-existent?
wdym?
Do you have bot declared/defined?
yes
const server = http.createServer(app);
const dbl = new DBL('token', { 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');
});``` i have this but when i vote it doesnt console.log
if im using express what should i put here?
@plain timber yea it worked
@gilded summit because checking isWeekend manually it needs () according to the api docs
You were using webhooks. IsWeekend is a property in that context.
const server = http.createServer(app);
const dbl = new DBL('token', { 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');
});``` why when i vote does it not do anything?
also what do i put here if im using express?
You need to put the URL and port of your Express server running.
where do i put the port?
Literally in the box you've screenshotted. So, if my webhook is running on 1.0.00.11 with the port 3000, I'd set it as http://1.0.00.11:3000 exactly.
whats 1.0.00.11?
an ip
so i put my ip?
You put the IP or URL of your Express server.
how do i get them?
Well, the IP would be the IP address of the machine your using, and the port would be 5000 for you.
Yes
http://anchor.glitch.me/ @humble bison would this be my web hook ?
its so hard to do
very confusing
can someone show me an example using express please
ive been trying all night
There's an example on the API documentation.
that doesnt work
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');
});``` what do i put in ```js
app.get('/', (req, res) => {
// ...
});```?
cba
We aren't going to spoonfeed you.
then make it more clear
The API is pretty simple, just experiment with it for a bit and work it out.
There is a test button under the webhook section of your bot.
You don't even need to use that. You can curl it just as well.
const DBL = require('dblapi.js');
const dbl = new DBL('token', { webhookPort: 3000, webhookAuth: 'password' }, bot);
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!`);
});``` so this should work?
@humble bison
Try it?
Use the test webhook button.
doesnt work
maybe remove the /dblwebhook
nope
wait a sec
k
try going to you glitch site
what u see
events.js:182
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Object._errnoException (util.js:1041:11)
at _exceptionWithHostPort (util.js:1064:20)
at Server.setupListenHandle [as _listen2] (net.js:1322:14)
at listenInCluster (net.js:1370:12)
at Server.listen (net.js:1466:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:27:12)
at DBLAPI (/rbd/pnpm-volume/f8110243-3aa1-4889-82fb-766dc6afd160/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/index.js:69:22)
at Client.<anonymous> (/app/index.js:72:13)
at emitNone (events.js:110:20)``` im gettings this error @loud gulch
uhh
it stopped
you are already using port 3000
what should i put in the URL box?
what do you have now
how do i check?
look at your code
3000
and the one for express server
3000
meh try it
well all i can say is try changing the webhook port
and in the url box change 3000 to what port you put
well if you dont put one im sure you use the port of the express server
i really want this to work
https://anchor.glitch.me/dblwebhook says Cannot GET /dblwebhook
OMFG
IT WORKED
โค @loud gulch
๐
Can anyone tell me why this is just returning the voted part?
Im getting 401 Unauthorized what does it mean ยฏ_(ใ)_/ยฏ
sure, but where did you put the token in the request? @novel cape
const dbl = new DBL('Token', client);```
hmm then you must have the wrong token 
maybe try to regenerate the token and make sure that there aren't any trailing spaces
How do I make so users have to have voted for the bot to use specific commands?
@sturdy scaffold wana help me setup the webhook?
@misty geode Are you also on glitch
discord.js
It should be straight forward if you follow the example on here
so i can use my own site?
Yeah
@inner venture Webhook running with path /dblwebhook SQL CONNECTED Bot has started, with 7 users, in 4 channels of 1 guilds.
so i need to add that path to the link?
ye
tbh, i couldnt get webhooks working with dblapi.js so i just set it up with express, it was easy
just check for a POST request
if you managed to get express working how did you not manage to set a few variables ๐
lol now im getting same error as @sturdy scaffold
cannot get?
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1355:14)
at listenInCluster (net.js:1396:12)
at Server.listen (net.js:1480:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/server.js:24:13)
at Module._compile (module.js:652:30)```
yeah something's already using the port
nah
Just read into the glitch docs a bit
@misty geode
can you try removing the port from the webhook url you set in DBL
and then setting the port in your program to 3000
okay
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1355:14)
at listenInCluster (net.js:1396:12)
at Server.listen (net.js:1480:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/9edfe881-972d-4120-a555-e4687147d290/node_modules/.registry.npmjs.org/dblapi.js/2.2.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/server.js:24:13)
at Module._compile (module.js:652:30)```
same error
what's using port 3000 then
the express server
yes
glitch is weird
k so i made the server listen on 5000
when i hit test nothing shows on the page
btw token is there
a little popup window is suppoed to appear
wouldnt be surprised if its getting lbocked
iblocked? you mean ipblocked?
o
but seriously man
glitch routes port 80 to whatever port is in the PORT environment variable
that value should be 3000
Changing it doesnt do anything
It's just glitch letting you knwo what port you should be listening on
so i should try 80?
No
anyways i might just use my shit
glitch takes incoming requests on port 80 and routes them to port 3000
ye
So youd need to listen on port 3000 but glitch is dumb anyways
For webhooks?
yes
ah i can use localhost to no?
huh?
host my app on my server
well yeah
wok
i changed my bots token now it doesnt work
const DBL = require('dblapi.js');
const server = http.createServer(app);
const dbl = new DBL('token', { webhookServer: server });
dbl.webhook.on('ready', async hook => {
console.log(`on`)
})
dbl.webhook.on('vote', async vote => {
console.log('test')
const user = bot.users.get(vote.user)
const votes = await db.fetch(`votes_${user.id}`)
if (votes === null) db.set(`votes_${user.id}`, 0)
db.add(`votes_${user.id}`, 1)
const voters = await db.fetch(`votes_${user.id}`)
const voted = new Discord.RichEmbed()
.setColor(color)
.setAuthor(user.tag, user.avatarURL)
.setFooter(`User has voted ${voters} time(s)`)
bot.channels.get('472190839477633034').send(voted);
});
app.get('/', async (req, res) => {
res.sendStatus(200);
});
server.listen(5000, async () => {
console.log('Listening');
});```
i changed my bots token now it doesnt work
help pls ty
im using herokuapp.com
@sturdy scaffold use the new token..?
i have

this api is ๐ฉ
sometimes
all the time
did you put a auth
no
do so
did you put auth just on the website
no
i think its api
its works sometime
k i got it working
i used the same code as you
your token is wrong
@misty geode could you send your code?
Why does it seem to work for everyone except you two
^
if i do test it works on glitch but then it wont work on my server
localhost:5000
\
@inner venture fix it for me pls
@misty geode did you put the port
no
well put it 
Just because you dont understand it doesnt mean its garbage
your saying the api is trash because you dont understand it 
what you screenshotted is standard stuff
what do i do?
Use one of the API libs man
dblapi.js
i am
can i use localhost as url?
??
no thats not how that works rev
localhost would make it call DBL's own servers
ok look
yea ill port forward it
yup
or something like that
ill test it right now
'Authentication is performed with the Authorization HTTP header in the format Authorization: TOKEN'
how do i authorise?
with the Authorization HTTP header in the format Authorization: TOKEN
helpful
well that literally tells you how to authorize
dont use big words
Use google to understand big words
big words?
which word is too big for you, literally?
literally
Authorization HTTP header whats this?
getting offtopic, anyhow, just google what http headers are
An HTTP header with the name Authorization
the library you're making the request with lets you set headers
do i have to authorise ?
Yes
http://Authorization: mytoken .com?
k i successfully port forwarded
?
its a header
whats a header?
a fairly googleable term
understand it like what it means
we're not here to teach you basic http concepts
sorry im not on my computer 24/7
Neither am I
thats what they all say
In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header are sometimes called the payload or body.
It is vital that header composition follows a cl...
there
Listen I learned this when I was 11 yrs old
It is ok
i can hel
p
help
dm me
how is that an example?
He said search a header, it will tell you
obviously
webhookAuth: 'anchor',
webhookServer: server
});``` is it this?
where in my code?
I don't know why you'r even worried about this, considering that the library youre using handles this for you
i used same code as yours
it works
ss your site edit page
and code
ill help u
also send ur token for testing then change it
i can try to run ur token to see if it works
ok
send request
i have
done
ok
hit test
defo the API
You guys realize the token isn't related to the webhook auth right?
ยฏ_(ใ)_/ยฏ
what?
The tokens you were pasting in chat before
Those arent related to webhooks
const dbl = new DBL('i put the token here', { webhookServer: server });
Did you set anything for webhookAuth?
no
Did you set something for the webhook auth on the site?
no
Can you try doing that?
in this box
put something
anything
and then put that EXACT same thing
under the webhookAuth field
k
like shown here
would this work?
done
webhookServer: server,
webhookAuth: 'password'
});```
still doesnt work
my token doesnt work
remove /dblwebhook
doesnt work
why remove the path which is a part of it
do you know what you are doing @arctic arch ?
like can you make my shit work?
https://glitch.com/edit/#!/plum-town?path=server.js:1:0
can you open this?
yes
heh
im using express
what do i put here app.get('/', (req, res) => { // ... });
whatever you want
res.whatever
k
http://plum-town.glitch.me/
I put res.send('memes')
holy fuck
ty sm
โค
it works
// response.sendStatus(200);
// });
// app.listen(process.env.PORT);
// setInterval(() => {
// http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
// }, 280000);``` had to remove this tho
your problem was EADDRINUSE?
I updated plum-town with that code
ok thanks
cheers โค
yes
sounds like port being closed to me
is your url correct
/dblwebhook?
yes
that included
i can send u my ip for testing
but not here
xD
OKAYYY
it took some time
but it worked
yess
idk what was wrong i used the same damn code
LOL
anyways thx
Uhm the getVotes() function gets your bot votes right?
yes
same
but i have only 32 votes
i guess its 24h votes
yup its 1000 recent from all bots
not your bot
๐ฆ
what
yup
do you have any proof
dbl.getVotes().then(votes => {
console.log(votes)
});
gets all the bots hosted recent 1000
not my bot list
i thought that command gets "your" bot vote list
Wat
So lost where is that
Not even gonna say anything
๐ค
Thya shit wasn't there for me
id-less endpoint is broke rn
token
๐ค
:smartguypointingatbrain:
lmao
Have to get kids gets confusing
Having*
Ids*
Lol
Hahahahah
What did I just say
Have to get kids gets confusing
Fucking phone auto correct these days
This is broken btw
It doesn't get your bot votes
Its get all of the recent votes people have done
did you rage because it wasn't working
That and cause I have to go to my university
angrily presses power button
Hasvote is 24h only
Having lifetime would be better to save ids that have voted
Then load them for ref
But its useless tbh
So 1000 is good I guess
through the webhook ^^
no
no
I just use current time
Yea maybe 5sec
(i dont think)
Woahhh
its can take a couple seconds due to caching
๐
its not like super important that you get second accuracy
yeah
Lol
worst case scenario, someone gets their vote priveledges a second late
but i think there is a request on git for adding the timestamp
the timestamp would dev be needed if dbl added retries
ye
read the api docs
how do i get votes from the api? I am new to bot making so im really confused
@pearl mauve what language
@pearl mauve Take a look at this https://discordbots.org/api/docs#jslib
i got this
bot.on('ready', () => {
setInterval(() => {
dbl.postStats(bot.guilds.size);
}, 1800000);
});
and when the timer is over it kills my bot
If you supply your client to the builder of the dbl API, it'll handle posting it for you
how can i see how many votes my bot has through the API?
@ripe linden https://discordbots.org/api/bots/ID then check the points (for all votes) or monthlyPoints (for votes in month) fields
@toxic acorn try catching the error
I need help about discordbots.org
And what's the problem
I need help on setting up webhooks for the bot https://discordbots.org/api/docs#webhooks
Coz u know when I edit my bot it doesnt accept the discord channel webhooks. It wants bot's. So im oretty confiused
yeah you need to host a web server that can receive those webhooks in your bot
I have a server where I can host anything np about that. But how do I use it?
what kind of server
VPS
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/?view=aspnetcore-2.1&tabs=aspnetcore2x
would this help
Discover the web servers Kestrel and HTTP.sys for ASP.NET Core. Learn how to choose a server and when to use a reverse proxy server.
Okay thanks man. Much appreciate. Alternatively is there a way I can get my total vote count through my bot.
Or or or fire an event when the bot is voted
you can get the total vote count from the api with https://discordbots.org/api/bots/yourbotsidhere
coz i try this DiscordBotListHandler.GetVotersAsync(30)).Count
and the webhooks are what you need for an event when someone votes
But it gives the total ppl who voted count and not the total vote count (coz of double voting)
Also whats the difference "monthlyPoints":338,"points":347,. Sorry for question bombing
points = total
monthlyPoints = this month
Oooooooo
Nice
ty very very very much
๐
never knew they were different
Should GetVotersAsync(30) not give the monthlyPoints ๐ค
Why are they different?
is that 30 a days parameter
that was removed
Hmmm. Nuget updated? ๐
not necessarely
that has nothing to do with our api?
I have a problem with the account signed in for discord bots. The other day I went on my alternate account, Dj Synths, to something for a server that my main account (this one) wasnt on. I never went on discord bots. I go on discord bots today and its signed in on Dj Synths instead of this account. How do you switch accounts for discord bots?
(Sorry for long paragraph. Hopefully I dont get in trouble for it)
It says Banner, not background
http://bit.ly/2LA40b0
It is my background
http://bit.ly/2mSB2oh
Also no banner image is there. http://bit.ly/2mTpeC9
user profiles are due for a rewrite
how would i get when a user has voted. What Date and Time till they can vote again
idk if the api even gives that info
it should
@tardy mauve API does not return when the user has voted. Only true or false. If you need this info you will have to use webhook
hi can i know how to get a webhook url for DBL vote
<@&304313580025544704> can i know how to get a webhook url for DBL vote
well no one respond
then wait some more?
Is it hard to be patient?
The ones that know will answer when they have time, mentioning the moderators is not only pointless but annoying
You can make your own timer count down from the time the user has voted
are webhooks broken?
How do you use the API to tell when someone has upvoted for your bot?
You can (assuming d.js) put the post link in your onguildcreate event
or you can just have an interval for every ~30 minutes (less api spammy)
you dont need to use the webhooks
Webhooks are POST requests to a website endpoint.
Is there a event that happens every time a user upvotes?
Cause i would like to do something every time a user upvotes on discordbots.org on a specific bot
Python
@candid knot You can accomplish that through webhooks ^^
So that JSlib you told me to install would work on python?
And i use Aiohttp, can you give me a example on how to do something every time a user upvotes with Aiohttp?
@inner venture
You did ^^ so i assumed you were talking about that link
And yeah, i thought so. i got confused
the JS lib has support for DBL's webhooks
but i was referring to DBL's webhook system in general
I dont believe the python lib has support for them rn
so you'd have to implement it on your side
What do you mean by that, implementing it into DBL for python?
Or are you saying just doing it another way
Im saying
the python dbl lib
doesnt have an easy function where you can just say
whenever i get a vote, do {this}
you have to manually handle setting up a webserver to receive the post requests that DBL will send yuo
Ah
#development @lucid pond
does the api when user votes. Does it return users pfp image, id, and so on?
using the webhook?
Returns the user id
so im guessing i can prob check bots all votes then compare that id?
and get the data from there
Just check the guilds for a user with the id. If they aren't in any of the guilds then maybe do that. However using the bot votes endpoint isn't a good idea.
?
Once you reach 1000 votes it doesn't work anymore.
Yes. Loop through the guilds checking if the member property contains the user id. Then get that GuildMember object and the user property should have it.
Could also do that.
๐
so im guessing users who vote gets saved to the site db hence why i cant search random person not associated with the site?
Oh you are using DBL API. I recommend using Discord's user endpoint.
Ah
kinda useless to do that. i only want users who voted id
then get there info
but yea
i might do it with discord api
https://images.danktronics.org/images/3nf4U20cpjWYNH3pUDi5swbAPxCPGVIy9u9ebDfX.png Discord offers this. Can search up any user.
It gives you JSON by default lol
it takes me to profile
@light crag, it's much better to just get the user from your bot so your not ratelimited by the API.
even the people in the DAPI server suggested that to me.
no lmao

GET https://discordapp.com/api/v6/users/296044953576931328
thx
as an example
np
This isn't the right channel for this anyways, so move to #development to continue.
i assumed that as discordbots does that
xD
yea my bad it got side tracked to here
but it was originally api related
All good :D
@humble bison I suggested that before the endpoint.
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');
});
this code doesnt work for me
my friend voted and nothing came up on logs
Where are you hosting?
glitch
screenshot your edit page
for webhook
k test button is working
but actual vote is not working
anyone can help?
yes
yes
i used discord api then search userid
oh
then used the data from there to build embed
ah
dbl.webhook.on('vote', vote => {
client.channels.get("466595482425229322").send(`<@${vote.user}> Has Just Voted !")
that does not work
..
is there anything wrong with it?
he user must me in your discord
not really but
it wont give a proper mention
also whats the error?
.send(`<@${vote.user}> Has Just Voted !")` should be `.send('<@' + `${vote.user}` + "> Has Just Voted !")
ill try
```client.channels.get("466595482425229322").send('<@' + ${vote.user} + >Has Just Voted ! \n Rewards : Role : **Voter** \n Currency : **20,000** Coins!).then(() => message.guild.member(vote.user).addRole("Voter"))
i made that
Webhook running with path /dblwebhook
Listening
