#topgg-api
1 messages · Page 40 of 1
why not just introduce heavier ratelimits instead of auth tonk
and can you actually answer me
do you have me blocked
yes but IP bans arent effective so we're going deeper, because you need a bot for a token...
oh i get it
stricter ratelimits arent too helpful
bot owners only 
also @arctic arch another question, can we publish a bot that will take cryptos as payment for services, but it will also have some free features / vote features
then again now people will just scrape instead of using the api
that like won't change anything 
@sonic jacinth off topic for #topgg-api
@raven zinc I dont see why that would happen?
tonk
for the same reason they use the api in the first place?
umm, nothing changes for the people that are using webhook to get their votes, correct?
because this api sucks so im making my own one 
is that allowed
is no scraping actually in the rules
Tonkku will adding the auth token change anything related to ratelimits?
same
How about that certifacation program, eh?
ew it’s the dbm guy
ew luna
@dreamy agate yeah those aren't api requests
@dreamy agate correct
@plain timber it wont
Spookku
So will it change anything at all for us?
us who?
Before I give my judgement
If a bot token is refreshed, does the Discord websocket server automatically disconnect any bots using that token?
And if authorization headers are used for endpoints, would this mean a RESTful API would be added as a secondary option apart from using websockets?
coz he dumb
The announcement is for the dbl api
Why would they announce something about the discord api here
I mean, it would make sense to
This isn’t an official discord server @safe spade
Yeah I'm already in that
well ask there
Probably doesn't help that I'm still waking up so yeah just disregard my previous messages
hmm
I'm guessing the rates were too much to handle huh 😉
when you say a valid authorization token is that something we already have from when we started our bots on the list?
yes
ok cool thanks T
oof token as in discord token or you guys are generating tokens for us to also store in our bots
im betting on #2
k thanks lol
I was going to say. I don’t think they would want us to give them our token
I don’t think we’d want them to want that
yeah major security issue
auth token basically just means they 100% confirm every api call is done by your bot and your bot only
yeah were calls coming from other bots and flooding the server
no not flooding the server
drowning the api in requests
@arctic arch wdym by authorization token
the token you get from our api docs
ay yo @arctic arch u betta not do that or me and my mandem will fok u right up ye we'll shank ya
Aye... what if you don’t use the discordbotlist api @arctic arch
bruv
what
u use it all the time just by visiting site ye
Whaaa
What do you even mean
There is a downloadable api which shows your server number thingy on @abstract moth @cyan ruin
i thought they meant that
The npm api budd
yo i'm a sick dev ye i use foking node-superfetch
That doesn’t make any sense but okay
Oh well nvm there is the website api too
MAHHHH shh

anyhow what do we do with the token
Auth header?

Hmmm?
do you use the official module or do you using something like snekfetch
OwO
i see
I have no idea what you wven talking about really sorryyy
I don’t even use it really
take a quick nap xD
if you dont use the api or just post server counts, you can safely ignore the announcement
nothing will change for you
That’s what i was asking “what if you don’t even use the api”
You know what'd be fun? Certification.
Can someone run me through using dblpy to check who Upvotes my Bot (discord.py)?
Please I really need a quick guide on it...
Thanks..
DM me if so 😄
Yeah how about we just write you your whole bot?
this API change is fine and i have no objections
does the announcement incloud webhooks
only the REST API
so, /bots and /users are going to require a DBL token to use?
and you have to have a whitelisted bot on the site to get a token, correct?
correct
what's the main reason behind it?
I guess they got to many requests.
because why would you want to call the API if your bot has no assiciation with dbl, i.e. being on the site
@tidal burrow scraping
Usually scraping means getting data from a non-api page
yeah thats what scraping is, just dont know a better word for api scraping
thing is even tho you make the api token locked you still can api scrape it
and even if you limit it to like idk 1 request a minute at this endpoints its only taking ~10 request to get all data
and if you completely remove it you can still scrape from the html site if you know how to parse it

we can track down malicious scrapers and ban them
cloudflare should have protection against html scraping, if it doesn't im gonna be angery
anyway its more effort to scrape the html
you can't 100% block html scraping anyway
how do you wanna see the difference between a normal user and a bot?
if i slow my request speed to like 1 request / 2s down you won't be able to block it
and html scraping is still easy af in most langs
idk what cloudflare does but apparently it works so idk

95% sure i would still be able to scrape it
literally copy/paste the headers browser send and you should be able to scrape, delay the request speed to a normal user speed and easy
100% avoiding scrape isn't possible
but you can make it hard enough that most give up

but i mean you said you wanna discontinue it without a token in 1 month you could still scrape it in the meantime
why do scrapers make you angery'
gotta give users a heads up tho
there was one site scraping dbl and putting it on there own shop site
why in the fresh hell would you want to do that lul
like are we talking geocities level shit?
🤔
👎
ok
wrong channel
oh sorry, can you say me the right channel?
can you guess which one it is?
haha idk #development?
winner winner chicken dinner
okay thx
const Discord = require('discord.js');
module.exports = function(req, res, bot){
if(req.headers.authorization===process.env.DBL_TOKEN){
let user = req.body.user
if(bot.users.get(user)){
let embed = new Discord.RichEmbed()
.setColor('#AABBED')
.setTitle('Thank you for voting, ' + bot.users.get(user).tag + '!')
bot.users.get(user).send(embed).catch((err)=>{});
}
}
}
I need some help, im trying to make an upvote webhook and i get one error
it says user is undefined
so i did console.log(req.body) and all i got was {}
Can some one help me?
hmm
valid authorization token?
is that just the token you're using has to be valid?
It just means you need a token to use the dbl api
For most people, nothing will change..
i have a valid auth token
anyone know why its doing this https://i.imgur.com/O6J0De0.png
reconnect your internet or reboot your pc
would that work
can someone help me?
on what
let user = req.body.user
im trying to make an webhook and user is undefined
dm me i will do it
dm me the server invite
the docs are nice
in the json responce it gives the user id
yes
did you pass body-parser
the vote has its own webhook you can use
as middleware
yes
you did this right
app.use(bodyParser.json())
application/x-www-form-urlencoded
ah
thats what the urlenconded is
nobody care
wait what does thonkuu mean to "require a valid authorization token" for every api request? doesn't the code need the token to check what account to retreive stuff from anyway?
every api request will require you to set an authorization header
@tough stream most api endpoints dont need auth tokens currently
but your npm package for the lib will be updated right...
Um can anyone help me when I am trying to get it bot on my main account servers it keeps logging me into my alt accounts and I don't know how to change it to my main
change your token @still siren
@obtuse flicker yes, it will be updated
@still siren go to discord in your browser and log out, also this isn't the channel for that
setInterval(function() {
console.log('Server count posted!', { type: "PLAYING"});
}, 1000)
})```
is this thing exist?
that will make a new interval to log "server counted posted!" and the object {type:"PLAYING"} to console each time that event fires
pretty sure thats not what you want, what are you trying to do?
oops
dbl.on('posted', () => {
setInterval(function() {
console.log('Server count posted!')
}, 1000)
})```
this
@smoky trench i want dbl to automatically
update
the server count
that will still make a new interval each time the event is posted, each second it will log that message
that wont update the server count
so how do i do that?
console.log("bot.on loaded");
console.log(`Connected in ${bot.guilds.size} servers`);
bot.user.setStatus('online')
setInterval(function() {
bot.user.setActivity(`?help | ${bot.guilds.size} Servers`, { type: "PLAYING"})
}, 1000)
});``` i do this for bot status but no idea for dbl api
The interval for changing your playing message is too high.
Set it to something like 300000ms (5 minutes)
@elder anvil thats intentionally i will use that for now
did u mean the bot statu
s
yes
or dbl api?
bot status
Um okay... you might get rate limited though
setInterval(function() {
console.log('Server count posted!')
}, 1000)
})```
but i want this dbl api
to refresh
server count automatically
Your problem there is that once the server count is posted, it says a log every 1 second
setInterval(() => {
dblClient.postStats(client.guilds.size);
}, 900000);
Rate limiting is where it stops you from sending requests to do stuff too quickly
ohh
So Discord basically says: "woah hey there, you're trying to change your playing message too quickly"
well no, its just basically what happens
it will just stop you from sending requests for a few seconds
oh now i understand
just don't make the timeout too quick
also you should add dblClient.postStats(client.guilds.size); as a seperate line in your bot's ready event
So Discord basically says: "woah hey there, you're trying to change your playing message too quickly"
wait
that was an exaduration
what is your DBLClient defined as in your code?
const DBL = require('dblapi.js'); /* <-- Run npm install dblapi.js to install this if you haven't */
const dblClient = new DBL('Your DBL token')
i run that npm
Ok good.
just make sure you have dblClient.postStats(client.guilds.size); in your ready event so your bot posts the count to DBL when your bot starts, and not after the interval time. otherwise you'll be waiting too long.
you could just include client here const dblClient = new DBL('Your DBL token', client) and the module will handle it for you
console.log("Server count posted!")
setInterval(() => {
dblClient.postStats(client.guilds.size);
}, 900000);
})```
am i right?
i think im wrong
xD
You're gonna want that interval outside of the dbl.on('posted')
dbl.on('posted', () => {
console.log("Server count posted!")
});
setInterval(() => {
dblClient.postStats(client.guilds.size);
}, 900000);
like that ^
console.log("Server count posted!")
})
setInterval(() => {
dblClient.postStats(client.guilds.size);
}, 900000);```
oh u posted it
yes
@arctic arch What is the rate limit for DBL?
60000*
ohh kk
6,000 = 6 seconds
yea its fine
awesome
thanks for helping me ❤
no problemo
?
I'm trying to connect Dbl API with my bot using python but I'm getting this error ````AtrributeError: module 'dbl' has no attribute 'Client'```
ok
@plush totem that file contains a token apparently
that file is also a copypaste of itself 4 times
also i like how the js file doesn't even have actual javascript code
@short pumice sir your token
did they just leave
yes
Whenever I try to test my webhook from my bot's edit page, it never sends a request. Whenever I post to the endpoint I'm giving it, it works. What's wrong?
I would say that if you guys are using Node.js in the backend then their hardcoded list of ssl cert providers doesn't include Let's Encrypt X3.
And therefore it would never send the request because it's unauthorized.
It would be nice if you could allow ALL providers except for maybe self-signed
(and for symantec)
Just adding let's encrypt to it doesn't solve it entirely
or find a newer list
oh wait my bad
hardcoded
😓
pretty sure letsencrypt works
No, I'm saying that whenever they post to my url, that my url is using Let's Encrypt X3 ssl, and that if they are using Node.js in their backend, which they might not be, the hardcoded list does not include Let's Encrypt X3 so their request won't go through on their end.
I use letsencrypt so
does the test webhook send client-side?
no
And no, I had to disable rejectUnauthorized on my https agent in Node.js to be able to send requests to my API because let's encrypt isn't in the hardcoded list.
Doesn't seem to work whenever I test it, but whenever I post to it manually it does.
have you saved before testing
Yes
No extra internet traffic comes to my API at all.
export async function DBLRoutes (app: Application) {
app.post('/api/dbl/webhook', (req, res) => {
const sentCode = req.get('Authorization')
if (sentCode !== code) {
res.statusCode = 401
return res.send('Unauthorized.')
}
console.log(req.body)
res.send('Done')
})
}```
press test now
Nothing
request failed with no response code
Do you need the port in the url
Yes

8000 is the port my api runs on
Yes but can you use nginx or Apache and stuff like that
I can literally copy and paste that url into postman and it works
No, my API is run with node.js
And since apache runs on 80, I can't make it run on 80. Anyways, not my point. The port shouldn't be causing the problem.
(443)
I think
hold on
it might be invalid because of the port?
Error: unable to verify the first certificate
while mine works
yeah
when I remove the port the cert is valid
also
you route your port 8000 via apache's 80
that's why apache exists
Either way, I'm wondering why the port invalidates it.
Node's handler might be fucked
while browsers have them more advanced
could be worth looking into filing an issue to the node repo
Yeah maybe
Because an ssl cert covers all ports
Well redirecting ports wouldn't do much in this case, because you're still on port 8000

Okay I'm obviously not very good with apache, so if you know something that I don't it would be much appreciated
<VirtualHost *:443>
DocumentRoot /var/www/html
ServerName www.macho.ninja
SSLEngine on
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias macho.ninja
SSLCertificateFile /etc/letsencrypt/live/www.macho.ninja/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.macho.ninja/privkey.pem
ProxyPass "/api" "https://www.macho.ninja:8000/api"
ProxyPassReverse "/api" "https://www.macho.ninja:8000/api"
</VirtualHost>```
epic
I think you should proxy those to localhost
Nope, didn't work
got more info tho?
AH01144: No protocol handler was valid for the URL /api. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
@primal owl <VirtualHost *:80> ServerName URL ProxyPreserveHost on ProxyPass / http://localhost:PORT/ </VirtualHost> This should work
<Location "/api/">
ProxyPass "https://localhost:8000/api/"
</Location>```
I am using this. It is inside of my virtualhost thing
I did it
Finally, it worked.
Thanks tons @arctic arch
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass "/api/" "https://localhost:8000/api/"```
for anyone else that has my problem i guess
is it possible for me to make my bot
to send user that upvote my bot
to my channel
not into console
console.log(`User with ID ${vote.user} just voted!`);
});```
i got this rn
Yes, just run any code there where the console.log is
@plain timber like htis? dbl.webhook.on('vote', vote => { console.log(`User with ID ${vote.user} just voted!`); dblClient.channels.get("498051419648163851").send(`User with ID ${vote.user} just voted!`) });
tonkku help me
Yeah assuming dblClient is your client
what ${hook.hostname}${hook.port}{hook.path} this thing mean?
Why when I point to https://discordbots.org/api/votes it returns me an error 404?
because there's nothing there?
The /votes endpoint for your bot (the one you use via getVotes) only indexes the last 1000 votes. 🤔
Do I miss something?
what ${hook.hostname}${hook.port}{hook.path} this thing mean?
it's self explanatory
that is the string where the webhook hostname, port and path is provided
duh
actually depends on what you're doing exactly
looks like that's automatically generated by dblapi.js so i don't think you need to change that at all
that's just confirmation that the webhook is listening, right @arctic arch ?
yeah its just information for your eyes
ez
webhookPort: 5000, webhookAuth: 'password' }); what should i replace the password with how can i get the webhookauth
just generate some random password only you know ¯_(ツ)_/¯
ok
console.log(`User with ID ${vote.user} just voted!`);
dblClient.channels.get("498051419648163851").send(`User with ID ${vote.user} just voted!`)
});``` am i right?
fucc
do i have to update the .net lib now?
oh wait
I can just yell at people to use AuthDblApi

?
I use dbl.js (https://www.npmjs.com/package/dbl.js) and dblapi.js (https://www.npmjs.com/package/dblapi.js) and my bot is online, but on the dbl website it always shows ??? (as status) what can i do
and how do it get here?
@restive otter you've made your bot leave this server. You can ask a mod to invite it back
huh, how did i made that?
why dosent it post the server amount to the public only when im logged in???
there's no such thing as posting to public or not, it's most likelly a bug then?
what are you using to post it to the website
#Importing libraries
import discord
from discord.ext import commands
import dbl
import time
import random
import pickle
import re
import aiohttp
import asyncio
import logging
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'HIDDEN NOW' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token)
self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while True:
logger.info('attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
print("updated")
await asyncio.sleep(300)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
Dear ppl, I have python and I copy pasted the example.
I have my bot running for 2 days with it now.
But it doesn't update.
Is there something else I have to do? Except copy paste the example to update the server count (it now is NA)
Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
Traceback (most recent call last):
File "/Users/Zl109819/Documents/PythonBot/Bot.py", line 167, in update_stats
await self.dblpy.post_server_count()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/client.py", line 100, in post_server_count
await self.http.post_server_count(self.bot_id, self.guild_count(), shard_count, shard_no)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/http.py", line 189, in post_server_count
await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dbl/http.py", line 160, in request
raise Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}"
How to solve this
@fringe epoch 403 is usually wrong token
I did
The dbl token
Well you can check, I just regen one
self.token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1ODQwNDkyMDk3MDk2OTA5OCIsImJvdCI6dHJ1ZSwiaWF0IjoxNTM4NzM5ODkxfQ.lAMK4Vh_T5xPDNQzrjZ8D3JtnK9ixcjPhER2eHvsv2w' # set this to your DBL token
you did regen that didn't you
is the id of the bot the same as the id of the bot the token is for
@shut ibex if it was bot token they'd get 401 unauthorized
Of course I said I would regen it
not related to #topgg-api, go to #development
oh
Hİ
@rough wharf
Hi guys
Help with Webhooks at https://discordbots.org
@arctic arch "is the id of the bot the same as the id of the bot the token is for" yes it is, it is a other program but it uses the same token so the same Discord bot + id in fact. Sorry for the late answer.
.NET api is up to date again on nuget
hi
When i try to send my shard total to the dbl site it errors with Im using discord.js TypeError: Cannot read property 'total' of undefined
setInterval(() => {
dbl.postStats(bot.guilds.size, bot.shards.total);
}, 1800000);
})``` and when i add the ID part it breaks.
if i add bot.shards.Id it fully breaks
are you sharding?
i guess we should ask first
Yes
well i am.
https://gyazo.com/645e39a219b53370d7791b65f275b64c this is the full error
what version do you have
Of?
discord.js@11.4.0
its shard not shards
dbl docs are probably outdated a bit
oh they are
it worked so idk

uh
i just ran my shard
and i had 4 shards with 7 guilds and 1 shard with 6 guilds

I got issue with the server count on the web site. It only displays servercount from the latest shard which update the value (in python, I give shardcount and shardno to the function post_server_count but it seems it does not care about it).
hello can anybody please explain to me how to use the api as all my bots have N/A on them
What's the best way to post shard stuff using internal sharding?
And @grizzled agate what language
discord.js @plain timber
@grizzled agate https://discordbots.org/api/docs#jslib
quick question about the API
if i send something for ex shards in one request
then i send something like server count in another request
will the second overwrite the first one or will it keep the data from both
i think keep both
so you're sending {server_count:1337} and then {shards:[420, 69]}?
yeah would that work
well
actually i was gonna send server_count then shard_count
im using internal sharding so i can just get client.guilds.size and client.ws.shards.length
the latter request replaces server_count with the sum of all shards
what about shard_count
you need server_count in a request with shard_count
yes
if i use dblapi.js should I use the poststats function and set shardid to null?
yes
k looks like it works 👍🏾
I am confused when I am trying to setup the api for my bot what do I put in the client section of const dbl = new DBL("dbl token", client)
nvm
getBot(id).then(bot => console.log(bot.certifiedBot))
Owo ty
With node-fetch I do .certifiedBot but it isn’t working
show code
Open modules and show code pls
is the webhook down?
it doesn't register either votes or test requests for me anymore
and the bot was running for 4 days now
👀
just tried and seems like its aswell for other bots
@arctic arch 
fixed
thank you 
does it resume the votes we got but not recieved via webhook aswell Tonkku?
doesn't seem like so

Pf smh
@silent perch took my bots source code
@latent flume
Mans locked me out of the server it's running on
@vital thistle go to a different channel
oh mb
webhooks broken again?
@elfin solstice do you think they will do it like Google push notification 
mmm ok im here now
i have that @plain timber all i wanna know id must i use the whole code or just some part of it
Just read it slowly... @grizzled agate
48 tabs, that's lotta porn my boi
Lol 48 is nothing [and no it's not porn]
i did use that @plain timber
And?
DUDE THAT HAS YOUR API TOKEN
ok but isnt it supposed to be there ?
where do I find my discordbot.org token ? I am at my bots .
it not letting me click generate.
go here and click your bot https://discordbots.org/api/docs#mybots
ye it is not letting me press generate token
try removing the / at the end
@arctic arch webhooks broken rn?
they're working

@arctic arch sorry for the ping just want to ask must i place the api in my index.js or ready.js as i have both and also i have created a dblapi.js also for it and still it doesnt want to show 😢
Oops! Error: 401 Unauthorized
Wtf
http://prntscr.com/l4xhak @arctic arch
@grizzled agate snekfetch is outdated tho
ok any otherway for me to use them ? @grand plaza
i did try dblapi also and still not same with superagent
thats why im asking do i need to place them in my index.js or ready.js or dblapi.js
what do you meen with request ?
It's a package on npm
ok link maby please
thank you will try that now and hopefully it will work 😦
or you can use the base node.js http bus driver
Although that's harder than using than the libs most of the time
I only use that when I really want to have as little deps as possible
@grizzled agate Try logging something at the top of that file to make sure the code is running
what do you meen @plain timber ?
sorry for the late reply was having fun with clan in pubg xD
What is the variable for the bot owner’s ID ?
Quick question if I am making a get request what do I put before this to get the request?
/bots/{bot.id}
Thanks
@grizzled agate at the top of the file put something like console.log('DBL script running!') and start your bot, if it doesnt log that it means its not running that file and you need to make sure you're running it
how do i get get upvotes count on botlist?
what language
tnx
yw
in the bot object, points is total votes and monthlyPoints is votes in the current month @brisk torrent
i found it
k
const request = require('node-superfetch');
try {
const { body } = await request.get(`https://discordbots.org/api/bots/${bot.user.id}/check?userId=${message.author.id}`);
console.log(body);
} catch (err) {
console.error(err);
}
``` Would this get a user voting in the last 24 hours?
Error: 401 Unauthorized
``` More of what i am asking is how do you Authorize this
using yoru api token
but like how would I add it in @restive otter would I add ?access_token=MY TOKEN HERE
you don't
auth header
cuz thats not how the api works
@restive otter What does the header need to be named? or does it not matter
@summer osprey https://discordbots.org/api/docs#reference
Thank you
Curious to see if anyone would know where I could find API for minecraft that would access the chat for servers
Cool
@ornate vapor this channel is for the DBL API only. also, why would that exist? that makes no sense...
@ornate vapor just use rcon
How Can I send Votes To My Server Without Webhooks
send or receive?
you can't send without webhook
@paper briar #memes-and-media pls sir k thx
?
this is for the discordbots.org api my good sirs
that is a low budget meme my good sirs
sa
http://prntscr.com/l5g1ur hello why do i get this error ?
http://prntscr.com/l5hefq thats what i have with the code
yeah but why ?
i dont need to explain that
i wont come and ask if i knew 😦
ok not sure what i must put there 😢 but will look it up
pls learn how to js
are votes required to use webook
yea ignore me i was being retarded
sa
I'm trying to connect Dbl API with my bot using python but I'm getting this error ````AtrributeError: module 'dbl' has no attribute 'Client'```
it's about the api 
maybe const dbl = require(“what ever the name of this package is called”)
no
and you have to write npm i dbl on node.js command
using official api
it would be
const DBL = require('dblapi /* iirc */');
const dbl = new DBL('token', client)```
using js ofc
ok
yt*help
Hey help
Ok
I don’t understand
i think they're trying to figure out how to unlock several commands on dbl vote
How do I show that on how many servers my bot is? Google Translate
@restive otter
https://discordbots.org/api/docs#pylib
https://github.com/DiscordBotList/DBL-Python-Library
https://dblpy.rtfd.io/
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
hey, um my server count is not updating.
the server count posts every 5 minutes, but recently it's been stuck at 21 servers, when it should be 25.
lol
show code
@mighty glacier Don't name your class or file dbl
@vernal isle I figured that out yesterday
@midnight oriole
oi , . ,
help-me???
help me to get a server counter without dbl
Magic
g
Is possible to do the vote thing using the api instead of the webhook?
exactly, I want to do it with the api instead of doing all that webhook stuff
just wanted to know if it is possible
webhook stuff is for events, like adding a reward to someone when they vote. you'll want to use the api if you're checking if they can use a command, etc
ok, then I must do the webhook, cause I want to send bot money on vote
okay, what language are you using?
you'll be able to use a lib that handles setting up webhooks for you
javascript
specifically this https://owo.whats-th.is/42c69e.png
yes, but I leave port and password 5000 and "password"?
You'll need to change that according to your bot's setup, you'll also need to go into your bot's page and press edit to change webhook settings
set the url to your host's ip address and then the port (whatever you pick) and then set a password to verify requests
but in url I must put the ip of the bot hosting, right?
I put vps ip and console is returning me that is running on 0.0.0.0:5000
any help?
Why would you even be asking this in this channel, this is help with DBL's libraries not your Vps
haha yes
How do i use the member counting bot?
ask in the support server
Is there a limit on how many times we can call the API?
Hopefully I don't go over the limit
make it so it does it when your bot joins a new guild
don't do it like every few seconds
Mine does it every 30 minutes
that should be fine
60 requests per minute
ok good
Why upvote is still slow to get on api
probably because of caching
cloudflare was xD
Cloudflare is neat.
Yea, they reboot sometimed
-bots @daring solar
@inland nymph
-bots @tender willow
Bots don't have bots, silly.
-bot @tender willow
I’ve got a question about the api
Do they mean the api key by token?
If no then where do I get the token from
I got the token
I get an error “unauthorized”
u gotta put the token in the headers
look at https://discordbots.org/api/docs
i did
or use a lib for it
i am using the library they gave
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token)
self.bot.loop.create_task(self.update_stats())
i am using what they provided
i added the bot's token in there
what else am i missing?
@weary ember
u should be gud
I got the token from the bot
Where I go to the bot and click edit, all the way down I got the token.
ngl it looks pretty short
Token not api key right?
u put in the dbl api key
https://discordbots.org/bot/<id>/edit go there scroll down to Api Options then the token area
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQyOTU3NzYwNjY0NDQ5ODQzMiIsImJvdCI6dHJ1ZSwiaWF0IjoxNTM5Nzc4MTc3fQ.2rwUc58yOv6pukzG4D0A0rgC7OlSWdbWPmiJIXvVfhE it should be around that long(this token is my bots old token kthx)
I have the token in
did you copy it correctly
are you sure the URL is right
what
I installed dblpy library
Yes
I’m talking about dbl api
I installed dblpy and used tee code provided in the website
Using python -m pip install dblpy
The real problem is that I am getting an error but the stats is updating on the bot’s dbl profile
Well your work is done why care about error XD
@runic ridge use aiohttp
@restive otter aiohttp vs requests
Boi i hope your against reqd
Requests
aiohttp is asynchronous since that requests aren't @runic ridge
@arctic arch webhooks are down again i think, no votes, test request are comming through to my bot and i also tested on other bots
👀
might only be extremly delayed
users reported they got there message like 10 minutes too late
^ can confirm
should be fixed
thanks
Why is every large codebase somewhat unstable.
all codebases are somewhat unstable
can anyone help me with bot development?
@restive otter 1. #development 2. first you need to code, nobody here is gonna teach you how so go online and look up tutorials and stuff, and go to #development when you have a specific question
@plain timber i wanna know which languages are used to develop Discord bots, unlike Telegram bots need Python or JSON
https://discordapp.com/developers/docs/topics/community-resources#libraries these are the discord api libs, you can look at the languages column on the right of the table
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
and #development please
thanks mate @plain timber i hope if i need help i can ask here
Ask in #development
Is support server invite and and github repo not in api anymore?
https://i.imgur.com/Qk04YkC.png
what you mean
this https://discordbots.org/api/bots/493011382539911170
As far as I remember u could grab github url and support server invite from there
you can
use the api

i already made one and the support and github fields arent showing up anymore
thats a rip
not sure
quick fix™
yeah its just support and github
I don’t understand the api docs
Where is a good place to learn how to construct a bot?
I’ve looked at Discord.NET docs but is the lib official?
@crude pumice you need to google coding tutorials and learn a coding language, then pick a lib and learn it. Nobody here will teach you how to code, but if you have any specific question go to #development as this is only for the DBL api.
and yes discord.net is a certified lib (https://discordapp.com/developers/docs/topics/community-resources#libraries)
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
there are also libs for python and java and many other languages
*help
Is there an API for discord.py rewrite?
@terse nebula you mean this? https://discordpy.readthedocs.io/en/rewrite/api.html
yus.
i'll take that as a no then.
If he or she votes on the bot, he can use a command ! How can I do it?
@arctic arch
Does the Java API work for the vote webhook?
@ocean patrol you'll need to set up a webserver system, i've heard Spark is good
@plain timber the appropriate channel is #development actually
its not help with bot dev tho
development is not only for bot dev
true
hi
Anybody have issues with Dank Memer bot joining a voice channel?
Is it okay to use UptimeRobot to check if the "online" keyword exists on the discordbots page to see if my bot is online?
I have no idea if I can set authorization headers in UptimeRobot so it can access the api every 5 minutes.
i dont think uptimerobot can look for the text on a page
cant you make it check your server?
@plain timber maybe, but i have multiple bots on one server
so itd be good to isolate each
like how u do with widgetbot (love your bot 😉)
hey @inner venture Not sure who to ask about this but https://discordbots.org/api/docs#mybots the generate/regenerate token buttons dont seem to work on ms edge. They work fine on chrome though
@arctic arch
seems to be due to the table:
<table class="exampleTable api_key_viewer" style="transition:0.2s; opacity: 1;">
that wraps around it
Why would you expect websites to work properly in edge
Because it's "so much faster than Chrome or Firefox!"
xD
hye, in the request api JSON to gent bot info, how can i get a shard count from the bot?
i has see in the docs already but in JSON theres nothing
post a github issue @restive otter
there have been a few things missing recently since i think there were some api changes
so if something doesnt match the docs make an issue and it should get fixed
Where the github can i post the issue?
no u
Then for now, can't get the shard count from the bot anymore?
yes you can
this is pokecord
it just depends on if they have posted shard count
hence the ? (marking that it might not always exist)
in the website my bot have 2 shard total but in JSON request i can't see anything
if you have d.js
client.users.get(vote.user).username
Did webhooks break again
:/







