#topgg-api
1 messages Β· Page 49 of 1
http://prntscr.com/mahc50 i keep getting this errors and then my bot reboots π¦
@grizzled agate A. you should check permissions
B. you should catch errors anyway to prevent restarting
Read the error next time
If i use the api links: https://discordbots.org/api/bots/check?userId=
what id i need to add there?
is this also need an Authorization?
When sending my serverstats to discordbots.org via the post request, do i have to send individual shard stats or can i sum them up internally?
@calm zealot there are 3 ways of sending stats with shards
- Send the server count and shard count from one instance
- Send array of servers per shard from one instance
- Send server count, shard count, and shard id from all instances
i see. the most preferable way for me would be 1. retrieving the servercount from the Discord.ShardingManager object , in app.js so to say.
do i have the servercount info in the sharding objects, i cant find it?
Manager.shards.forEach(shard => console.log(shard.id)); // i want shard.servers.size
@plain timber the array is server count per shard
[shard0count, shard1count, shard2count, ...]
I dont believe a shard has a guilds.size automatically
thats why I told you broadcastEval in #development
sure, i am just trying to figure out options. if i do method 3. i dont need broadcastEvals though?
dbl.getBots is not working
Could someone help :<
mb
@arctic arch A way in which the bot checks if the user has voted recently or not?
js
hasVoted using the dblapi.js module https://discordbots.org/api/docs#jslib
I see thanks
How to get dbl token
Thx
How to log vote ?
Just username has voted
const dbl = new DBL("token", bot);```
I do that
2nd example
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });``` Umm where do i find my password
you choose it
Do i have to put it somewhere on the website or can i just put it in
@vernal adder you need to put it in your bot's edit page
Ah, Okay Thanks
Do you have a list of possible IP ranges from where the webhook triggers can come in?
Good evening
I'm using discord.py (Python Lib) and i'm trying to get users who voted my bot using webhook to give them rewards. I've set up the Webhook on my /bot/{bot.id}/edit page and after this i'm completly lost, i don't know what to do. I know how to create Webhook with discord.py and send messages using it but, i don't know how to configure the discordBots list webhook, can someone bring me some help please ?
Ty β₯
Start a http server and listen for POST requests and check for Authorization header
Then pass that http server address to the DBL webhook field
@sand hazel Wuw, i never did that, is it free ?
Can you please drop me a good tutorial about that or something because it's totally new for me π
(I tried to Google it but didnt find anything descent)
Just google python http server
Thank you π
would it be possible to make a multi- file system with js lib
wondering before i attempt
nevermind its definitely better to just have a single file
wrong channel
also yes its possible and no having a single file is the dumbest thing you can do
i mean only for the dbl api stuff
Meh, tony seperates all events and everything i believe, not that theres anything wrong with that either
like for now i just include this in my main file to seperate dbl and djs
d.run;```
dbl.js is file name
Is it possible for the DBL API to be used in PHP? As in, server count, shard count, etc?
As long as your lang can make HTTP requests it is possible
Alright, thanks
is this correct? not sure if i can so it the same way i can in d.js
console.log(`Loading a total of ${DBLevtFiles.length} DBL events.`);
DBLevtFiles.forEach(file => {
const eventName = file.split(".")[0];
console.log(`Loading Event: ${eventName}`);
const event = require(`./dblevents/${file}`);
dbl.on(eventName, event.bind(null, dbl));
});
dbl events 
hello, i know the question has been asked a lot of times but i still can't figure out how to send a message that says "user has voted" :x for more information, i use discord js and i host my bot on a vps ubuntu 16.04, if someone wants to help me without trashtalk or insulting me it will be very nice, thank you in advance (ps: i'm French π₯ so my English is not very very good :p)
The DBL JS library has a built in webhook server in which you can pass additional args to start, then you just listen for events to send that message to certain channel
Okay, but how do i specify a public ip for the webhook ?
Your public ip is your vps's public ip
Webhook is just a http server in which dbl sends post requests to
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'what is password ?' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${VPS IP}:${port ? 5000 ?}${the url webhook on desired channel ?}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
I leave 5,000 ? where i find the password ? i set it ? and, url is https://vps_ip:5000(what is a path of webhook ?(in channel ?)) i want details to better understand, i've been looking for two days without results 
You can use whatever port you want, you set the auth password, you can use whatever path
the path is set to dblwebhook if you use the dblapi
in node_modules ? ;--;
Didn't knew you change it (without creating the webserver yourself) however if you use the dblapi the default is
https://publicIP:port/dblwebhook
There's a test button your bot page...
And you can mock requests to your http endpoint
what
i can define any port ?
You can use any valid/unused port within 2^16-1
okay ty
good everything looks good, but it only displays the person's id, how I can make it display his nickname or even mention it please (vote.user.username doesn't work)

solved thx
x)
var logsvote = bot.channels.find("id", "id_of_channel");
var tt = bot.users.get(vote.user).tag
logsvote.send(`<@${vote.user}>/${tt} has voted`);
You'll get a cannot read tag of undefined if your bot doesn't share a server with the voting user then
Yeah, that's why I put the nickname next to it
@median remnant The bot can't get the nickname if the user has 0 common server with the people
dbl.webhook.on('ready', hook => {
^
TypeError: Cannot read property 'on' of undefined```
Anyone help?
you dont have the required options for the webhook
i do now :p
For the webhook do you need a port forwarded IP address ?
When I initiate it the ip shows as 0.00.0:5000
the port must be accessible for outside connections
Ahh k
replace 0.0.0.0 with your public ip
why all of a sudden does my post stats not work
What do you mean?
Quick question, anyone having issues with voting on DBL? Seems to have stopped working for me over night =/ (been working fine for months, haha)
bruh.mp3
Where's the auth?
how can i give
Authorization header
@sand hazel can you explain a little more explanatory?
thanks
My bot is stuck in a loop of logging in, sending one api request, being disconnected and logging in again. It's able to respond to one discord command each time and discord.py isn't reporting any errors to the console. Does anyone know what that's about?
Note: the bot functions fine if I use any token other than @sly loom's
Try regenerating your token @devout dew
There's been no changes with the voting webhooks recently, right? (still confused why voting stopped working for my bot, haha)
there shouldnt have been
Hmm, out of ideas now haha
I'll leave it for today and see what else I can try tomorrow
i have a suggestion, reading a bots current status, idle , dnd, offline, online, in the bot object
@inner fox can that be done without losing all my servers?
Hmm, alright
Why do I get this error looking at botinfo
https://i.imgur.com/q39WWrc.png
Using DBL's API
Never had this issue before
Unauthorized means the your authorization is incorrect i believe
Botinfo doesn't need authorization though?
and my other bot I haven't touched in a long time works perfectly fine
To access our API you need to authorize yourself
Authorization is always required when doing requests, is it not?
No?
Then I'm afraid i cannot help you
@restive otter @spiral steeple yes authorization is needed for all requests
@simple ibex have you looked at the docs
Aight
Wait, what?
I have another bot that's missing from this list that is working and it's deleted my token.
Nevermind, this isn't an issue. I was mistaken.
How do I trigger when members vote?
what i want:
for example
vote-log channel:
Mrtol has voted 25.01.2019 12:45
xx has voted 25.01.2019 12:25
webhooks
how example give please?
is already on docs
@restive otter what language
turkish
??
lmao
What coding language
Haha
hm?
You will need to set up a webserver
Spark Framework - Create web applications in Java rapidly. Spark is a micro web framework that lets you focus on writing your code, not boilerplate code.
Accept the post request from DBL
Or you could just use js and the dblapi.js module
I guess I can't but thanks
wew, stick with java
How to get Authorization in webhooks?
@restive otter it's sent as a header in the post request
Does the api rate limit on IP or Auth KKey
If youre thinking about using multiple auth keys to bypass rate limiting...
Nah thats not it
I got two bots im adding code for it. Just need to know if I need to split the rate limit to accomidate both of them on one server
API has only 2 events without using webhooks (error and posted)?
those events are there for the autoposting feature when you include your client
plz valide my bot
don't ask us to review your bot
and don't ask questions that aren't API related here
what are you trying to set it to
i try
is undefined
no error
is undefined all
@plain timber
you know
i create a command dbl.js
can you send your code
it's like, fundamental, to attach the code
nope
code dbl.js is a private π
this is a code
from my dbl.js
shard id is undefined
...........
wow, can't tell
or origin of definition or anything
10/10
@plain timber help this poor soul to f8x his c0de
if you dont send the actual posting code we cant help you
also can you use real english and spaces between words
????????
Is not from DBL
DBL not posting our code :v
is showed an tutorial ;v
I using Footer for my funny
how dear Website Moderators
@simple ibex if you dont show us your entire code, we wont know what the problem is
I believe he's using the get request
@simple ibex i dont think shard_id is in the bot object
yes, keep showing screenshots
send the text
lmao
let id = msg.mentions.members.first().user.id;
let avatar = msg.mentions.members.first().user.displayAvatarURL;
let dblBots = await dbl.getBot(id)
if(dblBots.server_count === undefined) dblBots.server_count = 'None'
let embed = new Discord.RichEmbed()
.setAuthor(`Stats of ${dblBots.username}#${dblBots.discriminator}`, 'https://images-ext-2.discordapp.net/external/NUQ1frynEtUDB_-ByRw_NBdTl0sVeNacGQogqRLZ77Y/https/cdn.discordapp.com/emojis/393548363879940108.gif')
.setThumbnail(avatar)
.setColor('RANDOM')
.setDescription(` \`\`\`${dblBots.shortdesc}\`\`\` \n \n**Monthly Votes:** ${dblBots.monthlyPoints} \n**Total Votes:** ${dblBots.points} \n**Lib:** ${dblBots.lib} \n**Prefix:** ${dblBots.prefix} \n**Tags:** ${dblBots.tags.join(', ')} \n**Certified:** ${colorMaping[dblBots.certifiedBot]} \n**Posted Guild Count:** ${dblBots.server_count} \n**Posted Shard Count:** ${dblBots.shard_id} \n \n[Discord Bot List Page](https://discordbots.org/bot/${dblBots.id}) | [Invite](${dblBots.invite}) | [Support Server](https://discord.gg/${dblBots.support}) | [Github Repository](${dblBots.github}) | [Website](${dblBots.website})`)
.setFooter('Credits DBL | Powered By: Discord Bot List', 'https://images-ext-2.discordapp.net/external/1eA2X2zC7-8RAkK8d-VRE_jCyeXxe1MvLPqNDDVKorM/https/cdn.discordapp.com/emojis/376811626197811200.png')
msg.channel.send(embed);```
.......
thi is my code
lmao
Why would we want to?
@inner venture ye it doesn't in the doc, but the actual request do
let brain = null?
nothing :p
......
but anyway i dont know much javascript
Oh nope
the get request doesnt send a shard id
;v
you post with shard id but you dont get it back as a shard id
ouh
π
use shard_count
^
the ? after shard_count in the documentation means it could be undefined
@simple ibex you're looking at the wrong section
because you can get the server_count
server_count is the amount of servers or guilds the bot is in
shard_count is the amount of shards the bot is running
i can't posted shard
i guess medalbot doesnt post a shard count?
ouh yeah
ok dear
i will try it!
there all
is undefined
i using shard_count
@plain timber
you know
how to fixed
or @arctic arch | Team DBL
??????
can you stop spamming
ok
as I said, not every bot has a shard_count
you can check if it's undefined and do something about it
like remove that line completely
@arctic arch https://i.imgur.com/mtFTaLR.png are these additional fields supposed be documented
which ones
monthPoints, donatebotguildid, server_count, guilds, shards
docs are super outdated
It's not part of the bot object in the resources
servercount and shards idk what my thoughts were
I think those weren't even supposed to show up in there
just stats
also the go lib link needs to be updated still
and the py docs link
but I dont wanna remove them now and break people's stuff
guilds should be documented
and the py example needs to be updated or removed, it's been causing the forbidden error for py users
did you guys not know api docs are really outdated 
ππΎ
everyone else does
of course I do
anyone whenever
open source the doc so we can update it ππΎ
Yes
yes
i suggested that
the whole docs need a rewrite for that
let there be a rewrite ππΎ
well I updated the bot object
py and go while you at it 
also mobile compatibility kthx
well
the docs link is outdated
change it to https://dblpy.rtfd.io
rn its http://dblpy.readthedocs.io/en/v0.1.3/ which is a 404
hey all
In here
How to return if member's bot is not in here/dbl and send to channel Bot not registered on DBL
Hi, with this line written on the API page for C#, which bit does the server count and which does the shard count?
await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });
I did mess around with it to try and figure it out but no luck
My bot is online but in the site it shows offline
It can take a short while until the bot is shown as online. Try refreshing
caching is the reason it does that
catching?
Π±Π»
The site still shows that the bot is off lol
@topaz glacier is the bot in this server?
The online status of my bot is ???, im using D.JS and the api. Do i need to do something special to have the online status correct?
my friend Cole#7575 is in here with bot developer and he posted the bot multiple months ago, IDK if the bot is actually in here
Ping it, easiest way to see if its here.
It's not.
Hi, with this line written on the API page for C#, which bit does the server count and which does the shard count?
await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });
I did mess around with it to try and figure it out but no luck
24 = current shard id
50 = shard count
array = each shard guild count
hey what is the easiest way to download the api because i want to use python but i use a windows computer and have git bash but don't know how to download pip
@topaz glacier is the bot in this server
the bot must be in this server to show status
@light crag if I do
await me.UpdateStatsAsync(2, 2, new[] { _client.Guilds.Count, 0 });
all it does is display the amount of servers the bot is in, but if I use the default one await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 }); then it does display the shards as well?
sorry for tag btw
The C# library is pretty confusing in terms of updating stats
Might as well make your own class for it
so like
await me.UpdateStatsAsync(new DBLStatsObject({
ShardCount = 2,
GuildCount = _client.Guilds.Count
}))
Make the DBLStatsObject (or whatever name) which uses the JsonProperty attribute. [JsonProperty("server_count")] (for GuildCount) and [JsonProperty("shard_count")](for ShardCount)
then the library can make the request with your custom object
@summer pine
cheers, I'll try this now :)
I am getting this error:
Argument 1: cannot convert from 'Bump_Bot.DBLStatsObject' to 'int' for this line
await me.UpdateStatsAsync(new DBLStatsObject()
also I had to change that line a bit from what you wrote
@light crag
{
[JsonProperty("server_count")]
public int GuildCount { get; set; }
[JsonProperty("shard_count")]
public int ShardCount { get; set; }
}```
``` AuthDiscordBotListApi DblApi = new AuthDiscordBotListApi(511167075801235478, "token");
IDblSelfBot me = await DblApi.GetMeAsync();
await me.UpdateStatsAsync(new DBLStatsObject()
{
ShardCount = 2,
GuildCount = _client.Guilds.Count
});```
oof exposed token
Better reset it then
will do
Oh it might be calling the wrong method. I am pretty sure UpdateStatsAsync(object <object>) is protected
I'll fork this library and improve the method
Yea, editing doesnt help cuz of #265156361791209475
why does retrieving stats for a bot requires authorization?
guys how to posted shard count im using d.js create command dbl info
All interaction with the api requires auth
fml >_<
@summer pine made a PR for it. Look in pull requests for the github repository
It's to prevent abuse. And to ensure that when calling it users have a bot listed on the site

Can't be respon WIth Define | shard_count |
How come all these people always have Minecraft avatars
Ok will do in the morning, cheers :)
You can do it on your website?
no, since it requires authorization
You just have to pass your token in the Authorization header
yeah, I don't feel like making that request using JS now π
You can encrypt it tho
Make the front-end request an API endpoint to your server which returns the stats
yap ^
@spiral steeple how would you encrypt it btw?
js obfuscator?
those can be reverted in minutes (they are not encryption too)
not sure if this is the place to ask, but how would i make it so everyone is able to see all the servers my bot is in on the website?
ah thanks
- it was deleted 2) Sorry
@arctic arch Lol my bot is not in the server
@topaz glacier dont mention admins
and wrong channel
check #mod-logs to see if/why it was kicked
if you have fixed the issue tell a mod in #general
if i send a request to the api to update my bot's server count every 10 seconds, will i be ratelimited?
@potent comet you probably shouldn't do that, people may not want the names of their servers to be public
@humble bison i don't do it every 10 seconds because i want quick updates, its mainly because its in a function with another thing that runs every 10 seconds and it would be convenient not to have to put it in a separate function. i just wondered if it would work without getting rate limited
You won't be rate limited w/ 10 seconds
Why was the bot kicked from here?
thx Fishy
but anyway, i now made it do 10 minutes
because also each of the 4 shards were doing it every 10 seconds, now only shard 0 does it every 10 minutes
Ok ok I understood why u kicked it I fixed the problem The bot reacted without a prefix sorry about that
Now it is fixed
@arctic arch
is webhook the only way to send a message when someone votes?
it's up to you how you want to send the message, but the dbl webhook doesn't mean discord webhook
iirc should be fine
@topaz glacier there's a search bar, also I already told you to not ping admins... If you fixed it ping a mod in #general since this doesn't belong in api
Oh sorry ok
C:\Users\Lachlan\Desktop\Bots\AllRounderBot\index.js:194
dbl.webhook.on('ready', hook => {
^
TypeError: Cannot read property 'on' of undefined
at Object.<anonymous> (C:\Users\Lachlan\Desktop\Bots\AllRounderBot\index.js:194:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
PS C:\Users\Lachlan\Desktop\Bots\AllRounderBot>```
help?
do i need to create a webhook on my server or...
@soft geode you need to include the DBL webhook settings in the "new dbl" line. DBL webhooks are not related to discord webhooks.
Well you didn't share your actual code, so I can't help you going off of an error.
@soft geode did you look at the docs
you should use a different port rather than 0 - i think port 0 is valid but some OS refuse incoming connections to port 0 and not sure but even some ISP dont forward port 0 requests since there is a potential exploid reading OS infos with it
i run my webhook on my actual server, which is on port 80
you can't actually bind to port 0
binding to 0 just means "give me any free port, no matter which one"
because that's localhost
@soft geode That's not localhost, but like a wildcard address or unspecified
In the context of servers, 0.0.0.0, can mean all IPv4 addresses on the machine
ensure it's reachable, try it from your browser
0.0.0.0 == replace me with one of your public ips
@soft geode did you set the webhook settings in your bot's edit page
What do u mean
You need to set the webhook url and authorization header in the edit page in DBL @soft geode
What would I see URL as @plain timber
http://ip:port/dblwebhook
Can I ask what lib you are using?
JavaScript
Good, idk how to use it with any other ones lol
thats not a lib
Well
wait
yes...
Alright, do you have your webhook set up on your dbl bot page?
.... I don't even know how
glitch
Alright
sooo?
kk
Now, I may get some stuff wrong with this, so forgive me if I do
ok
Honsetly it might be better to wait for someone that uses glitch to respond, but I'll try anyways 
Bruh glitch is only to write the code
I asked how you hosted it...
Wym hosted?

Glitch has a console
Yea
Then its hosted on glitch
but its different
but I believe its just https://xxxxxxxxx.glitch.me/dblwebhook
change the xxxxxx part to your project's name
Head over to your bots page on dbl
Ok I am on my bot page
Oh I see webhookΒΈ
Paste the link I gave you with the xxxxxx part replaced with your project name
Do you have the dblapi module?
yes
Alright, do you have it setup to receive them yet, or does that still need to be set up
How do I setup that?
If you go on https://discordbots.org/api/docs#jslib theres an example code on how to receive upvotes
I already went there but I don't see i which context I can use it
I think glitch uses 3000 for the port though
so you'll need to change that
or actually, I know people use process.env.PORT I'm not sure if thats automatically there or not
hhhmmm
I did that
but in the console, it tells me that: Webhook running at http://0.0.0.0:3000/dblwebhook
I guess I have to change the ip
oh ok
but like I said thats where glitch is different
If you hit test
just what happens
on the dbl site
I'd expect nothing
nothing
Alright, try adding :3000 after the .me part of your url so it looks like https://xxxxxxxxx.glitch.me:3000/webhook
Idk if that will work, but it's worth a try
/dblwebhook or just webhook?
kk
then hit save and then test it again
still nothing...
You got the dbltoken and your auth right, correct?
get rid of the :3000 part I talked about earlier
done
and you do have the dbl.webhook.on('vote' ...) event?
no..
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});```
I've got this ^^
well you need the vote event too
Thats probably why it didnt work 
You restarted it so it actually uses the changes?
ye
Alright as long as you hit save after you removed the :3000 part, it should work
I think
:+1:
ok
Yes, worked I clear the messages and it just send:User with ID 420321095334363137 just voted
Great, now you can do whatever with the vote that it passes
Oh at the place of console.log, do you think I can do message.channel.send?
Yea
What
M
Is there any way to give players a reward for voting for my bot?
Yeah?
Like, how would I tell that a user has voted
webhook?
Oh
$help
His webhooks work? There arenβt any docs for your API...
how does your webhooks/api work*
read the docs
What are you using?
Python
π
Do they even have python docs that work
Idk
It just told me to go here and set the link
And check to see if itβs the same pass I set
Like wtf
And then the links to the full docs donβt work
Im a JavaScript person so
Yeah idk
Maybe I could look at the other languagesβ docs
HOLY CRAP
thatβs like
An actual doc... for python itβs just.. yeah here is some crap sample code.. yeah yw
...
Great help from mods too
Hes not a mod
?
Check his roles
mods are red
Heβs the fricken dev of the library
π€¦
Even worse
Wot
fishy is the Go library dev
Hes a lib dev
Ohhh
he makes the dbl-go library

But still
Still not a mod
Idk they looked similar
In color
Ima have to contact somebody about this tho cuz... there are like 0 docs for the api
For python
your supposed to implement it yourself
the docs are there to explain how it works, not to spoonfeed you the code for it
@rain niche for webhooks you will need to set up a webserver to receive requests
So why are you trying to work with it?
You would know if you read docs 
It lets you set the server and shard counts, and get information on bots and users
You can also check what users have voted for a bot and if the weekend multiplier is in effect
i cant read the effing docs m8
Why
thats the problem\
then learn to
there are nONE
Do u not know English
...
ok watch
Wdym there are none
^
there even in the channel topic
all i get
That's not the docs
an example that shows me basicly nothing
That's an example for the python lib
..
The python lib docs are at https://dblpy.rtfd.io
But you can look at the other pages to find the docs for the http API itself
ahhhhh ok
in the python lib example
it says
read the full docs at //...
but the link is broken
yeah... this is quite stupid... just to get here like omg
i contacted a couple mods and they basicly said
"yeah idk m8"
"gl"
...
You could just use your own server and listener too, cant you?
And Fishy good luck in that game 
@spiral steeple Yeah you can and I won
:+1:
hey how do you authenticate
using client
nvm
wait... the get_upvote_info keyargs don't do anything...
i said days=1
and onlyids=True
and it still returns a full list of users, and every vote ever
....
im about done with this.
this whole thing is broken
Pretty sure someone said python lib is outdated
Days and onlyids are no longer working, as there are no longer valid fields in the api
reference the resources section of the api doc for a somewhat updated request/response
...
Pretty much every lib except the py one is updated
Yw
@rain niche you can just use a http request library (aiohttp) and make requests to the api itself
instead of using dblpy
why do you guys still point ppl to this libraray
i just spent 2 hours coding something based on something that doesnt work
Because it partially works
And is the only lib available if you don't want to do it yourself
how would i send http requests to the api..
Wew, so uh, do you know what http request is
i just dont know how i would get the same functionality as get_upvote_info()...
you want to check if someone has voted?
Yes
@rain niche sorry for the late response but look at https://discordbots.org/api/docs#bots
So, how would I implement that with aiohttp?
@plain timber
Thanks for the help btw
I donβt need fully working code for a vote check, I just need a basic way to revive that
uh it should have a way to do a GET request
so just GET https://discordbots.org/api/bots/BOTID/check?userId=USERID
yw
does module has a function for that?
F
your code did an oopsie
for https://github.com/DiscordBotList/DBL-Java-Library
is the version 2.0.1? bc its not loading in maven for me
An API wrapper for https://discordbots.org/api/docs that works in Java - DiscordBotList/DBL-Java-Library
nm i got it forgot the repo
i been looking so long for a working Api for anime characters
can anyone HMU with one?
@fallow sequoia kitsu.io has an api
i'm not sure if it'd do though
A place where APIs are kept.
looks like they have a character api
thanks
Thank you π
np
Excellent @humble bison that has worked perfectly.
π
How often does it post the server count?
1800000 ms apparently for the default
So I don't need to put it in the guildCreate and guildDelete event? will the ready event be fine?
It's okay I just realised my error lol don't worry.
if you just include your client object in the new DBL it should just auto post for you
I think
Wait no
try to get votes from api but returns this??? list of people who voted: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
here is code ```js
//Code credits to Tony ThatTonybo#0001 thanks much for help alot :)
const config = require("../config.json")
const p = require("phin")
module.exports.run = async (bot, message) => {
if(message.author.id !== "388489346208104464") return message.reply("for r2d2 only")
const {
body: r
} = await p({
url: https://discordbots.org/api/bots/${config.botID}/votes,
headers: {
'Authorization': config.dblapiKey,
'Content-Type': 'application/json'
},
});
if (!r.length) return message.channel.send("nobody has voted yet");
message.channel.send("list of people who voted: " + r.map(user => ${user.username + user.discriminator}).join(", "))
}
module.exports.help ={
name:"checkvote"
}```
wtf
what is wrong on code?
Uh I can't really see any issues
But you don't have the bot dev role 
Your bot hasn't been approved? That might be why
no i left server and came back
It should have given you the role though iirc
idk
yes
how to get bot
https://discordapp.com/oauth2/authorize?&client_id=CLIENTID&scope=bot&permissions=8
Replace CLIENTID with your bots client ID
Which you can find on the app page for it
but dosent show me a server
If you dont have the right perms in the server you wanna add it to then it wont show up
wat
Hey! Using Discord.net, but can't find a lot of informations about HasVotedAsync(), does it check for past 24h? thx
if(msg.content === prefix + "test")
{
dbl.hasVoted("487515609815580672").then(voted => {
if (voted) return msg.channel.send(`LEL its a TEST`);
else{
msg.channel.send(`Pls Vote`);
}
});
}
i have make this Code But its not Work Pls help
My inglish is not so good
oh
it may be a 1 tho
How did you copy it
ctrl c
its in a photo
no?

yea I can see that now
what lib are you using @craggy apex
dblapi.js
if(msg.content === prefix + "test")
{
dbl.hasVoted(msg.author.id).then(voted => {
if (voted) return msg.channel.send(`thanks for vote`);
else{
msg.channel.send(`Vote on Discordbots.org`);
}
});
}
i have see hasVoted funksion Here https://discordbots.org/api/docs#jslib
don't use return
ok
is there a way to tell how many times your bots page was visted?
js tracking prob, only for cert
oof π¦
Yeah
I need help with webhooks
const dbl = new DBL(dblToken, { webhookPort: 5000, 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!`);
});```
I'm doing this so far, how can I test if the vote webhook is working without having to vote?
Test button, construct your own payload, it's just a http endpoint
You can mock it however you want
I pressed the test button, and nothing happened..
Visit the endpoint yourself to make sure it's reachable
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});```
This works
wrong channel
But the vote webhook doesn't
Sorry
@steel hawk yeah go to the endpoint yourself
also @steel hawk make sure the vote webhook is set in your bots edit page
Wdym go to the endpoint myself?
It's literally a http server, visit it in your browser
I did
Is it up?
nothing there
Is it reachable?
nop
I'm gonna be honest with you, I don't understand half the words ur saying
What endpoint did you visit
hey guys.. not sure if someone can help me
I hit 'test' for webhook
then the votes on my bot seemed to have disappeared
@steel hawk You are suppose to replace it with one of the ipv4 address
going to need more context
Which one of the ipv4 addresses?
The public one?
@radiant lynx votes reset at the end/beginning of every month
@plain timber oooh I see, gotcha thanks π
@sand hazel Any that work (I really have no idea how to do this)
So, if I'm hosting my bot on a VPS
Would I just replace 0.0.0.0 with the ip of the vps?
Yeah
@steel hawk it's a post request, u can't look at it in a browser
Browsers normally do get requests
then replace that url in dbl settings
set up the bot to receive vote confirmation message
how to do that?
You have to create an HTTP server and listen for POST request
Then you have to pass the link of your server to your DBL edit page
If it's a localhost it should look like that :
http::/localhost:8000/dblwebhook
8000 is the port, replace it with the port you've chosen
link to your webhook server, on dbl edit page will be the public ip of where your bot is hosted
@hollow wraith
?
How to post server count to bot's page? I tried all the examples but all is not working
@hollow wraith
never done it
@restive otter Which language are you using ?
@latent pasture js
Erf, got the example in Python but not in JS, but it should not be really different :
dblToken = 'YOUR_DBL_TOKEN'
headers = {'Authorization' : dblToken}
url = 'https://discordbots.org/api/bots/' + {bot.id} + '/stats' # Looks like : https://discordbots.org/api/bots/125781235411256784/stats
payload = {"server_count" : len(client.guilds)} # len(client.guilds) returns the number of servers the bot is on
async with aiohttp.ClientSession() as aioClient: # Here we do a POST request to the url that we specified above
await aioClient.post(url, data=payload, headers=headers)```
are you not able to use a discord webhook for voting?
Hey I have my bot split into 6 shards and 2 Clients. One Client is handling shards [0,1,2,3] and the other one is runnign on a different server handling shards [4,5]. How should I post server count to the api, because the first Client only gets server count for it's 4 shards and the other one for it's 2 shards.
I tried using shard_id parameter passing shard_id=0 for one and shard_id=4 for the other client. However it doesn't work π
btw using discord.py v1.0.0 AutoShardedBot
am I doing something wrong? e.g. does it maybe only work when I post stats for each shard individually? The problem is that I cannot get each shard's server_count but only for each Client
@crude sandal if you use shard id then the server counts need to add up to the total


