#topgg-api
1 messages ยท Page 32 of 1
No problem!
If it says there is an update should I update?
Can I get a "13" role?
Why do almost all the Moderators have an under 13 role?
Is it like a joke thing?
Actually I'm offtrack now, sorry.
OwO if you are really under 13 you can ask the mods for that role, you can get access to the cool kids club
And updates if you mean npm updates then its up to you but for the api it should automatically install the latest one
Oof?
Try running as root/sudo, as suggested
glitch?
Idk?
how do you not know 
That's what I need help with.
glitch, what are you on? thatโs a vps
vps?
nvm
Sorry, I'm just a person that managed to somehow make a bot.
ยฏ_(ใ)_/ยฏ
try npm i -g npm
also npm installed so why?
Already did.
npm updates @restive otter
kk
ugh don't show your token publicly
Are you referring to the token for dblapi.js?
Yes.
Oh for that one you use the token from DBL, its found on the website where you added the bot
Go to your bot's own page and after you have logged in, the token can be found on the edit page
Idk
Have you even made a discord bot @slate flame ?
?
It's kinda yes or no.
Hey um, can someone like test by upvoting my bot?
Thanks
Webhooks are optional if your bot is pretty small (only in a few servers), but it will become required when your bot exceeds 1000 votes per month
There's a test button on your bot's edit page
Ok.
At the bottom
oof
Should this be in anything, or just at the top of the script?
const DBL = require('dblapi.js');
const dbl = new DBL(PRIVATE, { 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!`);
});
You will need to put the url in the bot edit page for it to work
What url?
And since it is running a webhook server, you will have to port forward it/allow connections to that port for it to work as well
ยฏ_(ใ)_/ยฏ
The url which shows when your bot starts
Ok.
Bear in mind that the first part should have your port forwarded IP
something like this http://<my-ip>:5000/ etc
You'll have to forward it for it to work
The webhook starts a server, and DBL has to have access to that server in order to send you the votes
Any features I can have with API without port-fowarding?
You can retrieve your bots votes, check if a user has voted for the day
That's what I've wanted to do this whole time.
As well as to post your server counts
So can I have commands for users who have voted without having to port-foward?
Ok only difference between webhooks and no webhooks is that when someone votes, DBL will inform your bot if you have webhooks, otherwise you will have to check yourself if the user has votes
Yeah definitely
Is there like a tutorial or do I just have to guess how to do this?
What's this about?
It means your bot is missing permission for a certain action, most likely being unable to send messages or do something in a channel
Yeah you can use this function, .hasVoted(id) to check if a user has voted for the day
So lets say I go,
client.on('message', message => {
if (message.author === client.user) return;
if (message.content.startsWith(prefix + 'meme')) {
if author.hasVoted(id) {
message.channel.send('meme');
}
});```
Will that work?
It has to be the DBL object
i like how 1 if is not the same as the others
Like in your case I guess its dbl.hasVoted(id)
Ok.
if(if !== if) {if()} else {if()}
So this?
client.on('message', message => {
if (message.author === client.user) return;
if (message.content.startsWith(prefix + 'meme')) {
if dbl.hasVoted(id) {
message.channel.send('meme');
}
});
Unexpected token dbl?
You're supposed to put your token that you got from the website there, replacing the 'Your discordbots.org token"
does if even work without () ?
k thanks
Aight for this lets move to #development, since your API issues have been solved
I think Google has a search API but it ain't free
Duckduckwho
duckducksh00t
#general or #memes-and-media ๐
Google has a search api and if you ahev your own domain you can have up to 100 searches a day for free
after that it's not free anymore
I never fully understood. Do I need to require http or express and listen on them for the vote webhooks, or I just need an open port?
Hm
dbl has a built in http server
Is there a preference for posting server count with or without shard count?
@grand bramble
There is a good npm lib for scraping google, bing and Yahoo. Extremely easy to use
Called "images-scraper"
@rugged sierra but that's for images
And I need a full text search engine, not just one word
I tried duckduckgo but it only has one word search, I need full text ๐

I think by #topgg-api this channel is meant to be about the discordbots.org API
if you want help with google API and other stuff like that try keep it in #development
Could it be that webhooks sometimes don't send the post request?
I have a user who voted twice and the webhook doesn't seem to be toggled
@arctic arch could answer that
Okay for Tonkku: I have a discord webhook where the DBL one points to. It is a PHP script and works alright
But sometimes people say that they voted, show me screenshots of the 'try again in 24h' but my webhook to discord was never triggered
It looks like this
Is it paid hosting? Or free
paid lol it's my own VPS
Only thing that makes sense is connection issues, do you have any incoming connections at the times people are saying their votes didnt go through?
Hey
๐
There are cases of the webhook actually malfunctioning
I wish we had implementation like other platforms like Github, it retries payloads after intervals, and logs failed attempts
Is there an event getting triggered once someone voted ?
if you have a webhook set up, yes
@hollow wraith my log files don't show them up
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
``` When I tried to use this, it doesnt work :/
please helpl me
i tried to do the url
give context
what doesn't work
I didnt get User with ID ${vote.user} just voted! part in the terminal
like someone upvoted for my bot but I never got a response from my bot
You have dbl defined properly.. etc?
I did though
const dbl = new DBL('private', { webhookPort: 5000, webhookAuth: '42859358945' }, client);
?
rite?
Running on your local machine? You may need to set up portforwarding in your router
im running though glitch xD
Whats the webhook auth..., client);
?
Is that new?
im not sure
Can u remove it for now, make sure auth matches.. and is saved on dbl correctly
Then try a test
still got nothing
0.0.0.0 is not the public ip,
Im not familiar with glitch. But there is some way to connect to it.. you need the ip address
Simple google search would probably lead u in the right direction
Yeah, something along those lines
From what i read.. glitch changes your applications ip address?
If thats true.. this system wouldnt work for you
thats mean i need a new host :/
Or another way to get webhooks
There are some very simple php webhook tutorials on youtube
for glitch you need to use port 3000
and your ip is project-name.glitch.me
@last cedar ^^
and uncle drop the php, php is dead lmao
dont just point people using language A to specifically language B (that they most likely have no experience in) tutorials, everything can be done with multiple languages
Well if his ip changes.. which is what i read.. than your way wouldnt have worked if he had to specify lol. And i direct people to the php, because u dont need experience, its literally like 5 lines of
if you push someone learning language A to a completely different language B, they're quickly going to get overwhelmed and give up
dont be that guy
I helped him the easiest way i knew how. If they require further help. Then ill help them there
Would be decent if you guys updated your docs and wrote webhook listeners in other languages
Discordbotlistjs
I write dblapi.js (JavaScript)
You'll need to ask Nik, Francis and veld to write webhook listeners for the Java, Python and C# libraries respectively
๐ค
Does one have to send the DBL's password key thing over the wire
I feel like HMAC signature for the body approach would be more suitable
hmm
the current system does its job keeping simplicity
however a v2 of webhooks might happen later with signatures and an option to use the current system
Yeah it's simple I agree, but just for good practice ๐
it's like sending private key over and over
Can some1 give me an example how to setup the webhook for java
you could use spark
by using the api i have to use a tasktimer - so i guess webhook will be easier
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.
is that only a java thing or..
also unrelated to webhooks but don't use Timer/TimerTask
why
what would u recommend to use instead ?
let's move to #development
@sudden rampart if i understand it right - i have to make a get-request on the webhook url right ?
if someone for example voted then dbl will send a message to the webhook i have added in the website
is tat right ?
dbl sends a post to your server
so, using the spark library i sent above
post("/the-path-you-want-for-your-webhooks", (req, res)->{
var body = new JSONObject(res.body());
switch(body.getString("type")) {
case "upvote": handleUpvote(body); break;
case "test": System.out.println("Test webhook received: " + body); break;
}
return null;
});
public static void handleUpvote(JSONObject body) {
String userId = body.getString("user");
String botId = body.getString("bot")
String query = body.optString("query", null);
doStuffWith(botId, userId, query);
}```
java 10
oh
local variable type inference
still didnt check java 10 out
@sudden rampart one last question pls <3
the path ... do i add there the link of the webhook url ? i dont get it rly
if you run it, spark will start at port 4567
thats right
then, supposing you used post("/upvote", ...)
you'd put in the bot page the link as http://your.ip.goes.here:4567/upvote
what is the port for local machine?
the port you chose?
well i follow your steps but if i click on TEST nothing happening even tho i am waiting like 1 minute
post("/upvote", (req, res)->{
JSONObject body = new JSONObject(res.body());
switch(body.getString("type")) {
case "upvote": handleUpvote(body);
break;
case "test": System.out.println("Test webhook received: " + body);
break;
default:
System.out.println(body.getString("type"));
}
return null;
});
public static void handleUpvote(JSONObject body) {
String userId = body.getString("user");
String botId = body.getString("bot");
String query = body.optString("query", null);
getAPI().getGuildById("XXXXXXXXXX").getTextChannelById("XXXXXXXXXXXX").sendMessage("<@"+ userId + ">\n\n" + query).queue();
}
are you running it on your computer?
if yes, did you open the port in your router?
oh good point - lemme check
sry for distracting u with such noobish problems ๐
not working on vps
you can edit the source file if you want to also have a webserver on glitch (since it only gives one port)
is webhook only capable of getting updates when someone voted? you cannot use it to request an array of last voters
that's what the REST API is for
what would an example body look like on the webhooks?
like this?
{"bot": 362420439659708416, "user": 169275259026014208, "type": "upvote", "query?": ""}```
yes but the IDs are strings and the query one is just query, no ?
oh
darnit they're strings
ok thanks
it has a ? here on the query, not sure if its an issue or not
either im dumb or the test button isnt working
could someone help me please
? means optional
ah
sorry im new to all this stuff
stayed up all night last night trying to figure it out
have you saved before testing, is your host able to receive http requests?
yes and yeah im pretty sure, ive tried with ARC but i cant get it to work on the test button
works when i do it on arc
whats the url you've set
are you listening for get or post requests
this is how im running it in arc:
it works there so i think i am
if you want i can paste my 3-4am php code here
yeah ive tried so many different things at this point i have no idea what to do
if anyone's there i'd still like some help please
just an update: i removed the authorization stuff and it worked again, it seems that it doesnt pass it in the test
your check may be wrong or the password on the site is wrong
oh well it works ยฏ_(ใ)_/ยฏ
Uncle, when I tried to put 3000 for webhookport, it showed an error
I have no clue where to put this but is it ok to make it where a user needs to vote for the bot to use 1 command. Just this 1 command will be locked until they vote. All the rest are usable without voting
(I swear I read its ok somewhere but can't find it...)
Thank's... I just found it.. https://discordbots.org/api/docs#votes
๐
Idk thats what tonkku said. Use your url for your app as the ip and port 3000 for glitch
you likely have something already running on port 3000
๐ค
wdym i have something already running on port 3000
im confused :/
Uncle, like this? https://fallenthetaco.glitch.me/dblwebhook?
could you show us the error so we can actually help you
what kind of error?
wait
im changing the port in glitch rn
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/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/webhook.js:27:12)
at DBLAPI (/rbd/pnpm-volume/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/index.js:69:22)
Address in use
wdym address is in use ๐ค
Something is already using port 3000
๐ค
Web server.. or something
๐ค let me check.....
alright i think its working
it was the app.listen(process.env.PORT)
And the verdict?
the console cant seem to record a test :/
Auth code in JS matches auth code on dbl?
it still doesnt work :/
Ok, what does your code look like now
its massive xD
I have a lot of code before I added the webhook thing
const dbl = new DBL('private', { webhookPort: 3000, webhookAuth: 'password' }, client);
dbl.on('posted', () => {
console.log('Server count posted!');
});
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with path ${hook.path}`);
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!`);
});
that^
but it doesnt work :/
doesnt show User with ID ${vote.user} just voted!
why do you have two console logs there
just checking the thing xD
it really doesnt effect anything
@restive otter needs help with the upvote updates xD
lol
i don't get why people name their bots after themselves
try your url with http instead of https
you're sure the project id is that?
you have another server running?
no.....
that OK doesn't usually show up
Fallen, try removing client when youre setting dbl
ok what is this app
And im assuming.. 'private' is actually your dbl token
note that you don't make a new app, you use your existing app
discord wont let me authorize bots
how do i fix that?
oops
Bots don't respond outside those channels
--setgame motherfuckers better stop bullying AngerKingz
I gotta say
very interesting
If I didn't set a Webhook Auth, do I need to define it in the constructor?
no
Thanks
?sendembed
"threatened" sounds too extreme ๐
Ikr
it might be because of token
const dbl = new DBL(config.token2, client);
well idk 
XD
any one?
jk im stupid
i used the bot token and not the db token
didnt see it
XD
:p
state your problem
When i install dblpy
DBLPY needs aiohttp-1.0.5
maybe you need requests?
python3 -m pip install requests
wait
it dosent works ๐ฆ
Rekt. Would need to teamview probably.. although ive never done it.. but i think i understand
oh no don't use requests with async operations available
also you need to revert to an older version of aiohttp or try the rewrite version d.py @restive otter
@proud sphinx Thanks ๐
What's Wrong With This?
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
await self.bot.is_ready()
while not bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count())
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).name, e))
await asyncio.sleep(1800)
logger.info('Posted server count ({})'.format(self.dblpy.guild_count())
look at the )
logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) is the correct way
you forgot to close one parentheses
ur welcome ๐
How can i make it so when someone votes on my bot i get a message?
webhook
ok so you know how your server runs at an address(ip)
you type in the name of the public up address
ok so the same name as i use for when i connect to the server?
with :5000/dblwebhook at the end and
Yes
Example:
myserver.ok.me
123.212.131.1
With :5000/dblwebhook suffixed to the end
you mean suffixed
Yes, the ipv4
so
....compute.amazonaws.com:5000/dblwebhook
assuming ... is something yeah
const dbl = new DBL(my token, { webhookPort: 5000, webhookAuth: 'my password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://:compute.amazonaws.com:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
the last thing on url would auto fill in or?
so thats correct?
ik
and webhookAuth with what you put in the password field in your bot's edit page
yea
Yeah that should be all then
if i have multiple bots running on the same server. This wont fuck with the others right?
It shouldn't
But if you have other bots and want to use webhooks you have to run it on a different port
(For each)
good
yea i dont think i will do that so i guess im fine
but const dbl = new DBL('Your discordbots.org token', client);
im using also the post server things
if i do const dbl = new DBL('Your discordbots.org token', client, { webhookPort: 5000, webhookAuth: 'password' }); it wont error right or?
k
The output to console has no effect on the webhook address, thats just to make you feel warm inside when the listener is ready. Where its crucial is in the dbl webhook url input on the bot page
^
TypeError: Cannot read property 'on' of undefined
at Object.<anonymous> (/home/ubuntu/bot/DAindex.js:69:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
error: Forever detected script exited with code: 1
what did i do wrong?
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});```
nvm not working
what did i do wrong i swapped the client and settings
but that didnt fix it
Webhook running at http://0.0.0.0:5000/dblwebhook
how do i make it so it goes to the right server and not 0.0.0.0
@arctic arch
replace 0.0.0.0 with your public ip
Kiju
In your console, it doesnt matter what it says, as long as you have your correct public ip in the dbl bot page
wut
why dosent it work then
@hollow wraith
i put the url in the thing
and i used the public DNS (IPV4)
Your public ip isnt exactly 0.0.0.0.. it would be the IPv4
as the link
Not dns
Youre using something called aws right?
So there is a website for your bot tho?
Well a link*?
no now i tried with the ip number things
And from what im reading.. have you set up the port for inbound traffic in Security Group?
idk
Security Group under your Amazon Web Service Console
hmm
ok @hollow wraith what do i do here+
?
@hollow wraith how do i allowed the traffic that comes from discord bots?
You just need to allow traffic on the port you specify for your webhooks
5000 or whatever
ok but how do i make it so its only discord bots?
Source probably
Ive never used aws
Just searched google
Dont think you need to specify really though
k
You can enter a token on the site to be send with the webhook payload
Then just check it on the receiving side
where
and is this the source that i need to add http://0.0.0.0:5000/dblwebhook
@sand hazel
If you put that into dbl. It will not work
then it's whatever your public ip is
Ok, that should be fine as long as the webhook address you put into dbl points to your bot
Just save that. As is
ok now i got these 2 https://gyazo.com/98ef4cbee23cf161ea61f96f86606f2b
Ah.. no
The source would be the ip to DBL webhook sender
Best to just do Any
Or something
What are your options in the source drop down
Well do anywhere and if it generates something.. just save it and hope it works lol
yea and i have bad luck XD
Well we need to get to the point where youre trying to send test upvotes. And making sure the link is correct to aws
yea i just tested and it didnt work
i used this code type on the discord bots website IPv4 Public IP
@arctic arch @azure pollen could one of you guys help me with this cause im lost ๐
with what
getting the webhook to work
@arctic arch
so whats the problem right now
i dont know if i used the url og did the right security setting
show me your current setup
yes
we even have a pylib 
I have this
import dbl
import discord
from discord.ext import commands
import aiohttp
import asyncio
import logging
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'TOKEN' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token, loop=bot.loop)
self.updating = bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
await self.bot.is_ready()
while not bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
print ('DiscordBotsOrgAPI is loaded')
It's correct?
big surprise
xd
...
@restive otter did you put in ur DBL token?
im still having trouble with the upvote thing :/
@plain timber yes
hm, did it log anythung?
can you add to
https://discordbots.org/api/bots/441762003992838155/votes
a field like canVote
so u know if a user is able to vote again or not
i mean i can save it myself once a user voted
but would be cool to have it in the api too
Execute it every 30 minutes
?
Im confused..
idk what to do
Someone tell me what to do with my code for server-count
@arctic arch I need help.
Ive installed
Installed what?
npm install dblapi.js
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(Oops! ${e});
})
What do I do with this
Ive put my api token for my bot in the thing...
What do I do with that code?
dbl.post?
What do you mean with "What do I do with it?"???
To what?
that code doesn't post it
and how?
Howwwww?
IM SOOO LOST
why are you lost?
async def get_upvote_info(**kwargs):
onlyids = kwargs.get('onlyids', False)
days = kwargs.get('days', 31)
## print (await http.get_upvote_info(onlyids, days))
return await http.get_upvote_info(onlyids, days)
eee
#312614469819826177 search your langauge @naive ether
Idk what Im doing..................................................................................
I have
Ive done it
Ive done my api key for my bot
What part of it do you not understand?
Everything you need is in there?
now what do I do with the code?
You post it to DBL
How though?
jesus fucking christ
#312614469819826177 ctrl + f
js
or javascript or whatever
look at like tonkku's example
paste
No, if you've done that there's nothing else to do
Forster
Im just dead...
Yea.
People say post it to DBL.
my code with the api token in a bit of the code
Ive done that, but how do I paste it to DBL?
am I dumb?
Yes the docs show how to
They arent for me?
Literally the second section shows you how to post them
I hope this fixed your issue
btw
whenever you press the link
this link
^^ is what you get
is the correct link
yea
I know. I'm just saying, :p
any idea on how to use the get_upvote_info ?
yea I know
but
I'm a noob
anddd
I tried different ways
still didn't get it to work
async def get_upvote_info(**kwargs):
onlyids = kwargs.get('onlyids', False)
days = kwargs.get('days', 31)
## print (await http.get_upvote_info(onlyids, days))
return await http.get_upvote_info(onlyids, days)
didn't work
so I tried putting @unkempt gatet.command()
didn't work
DBL-Java-Library - An API wrapper for https://discordbots.org/api/docs that works in Java
which version is this ?
there is no version badge
or do i take the version from the build.gradle ?
in this case 1.0
@prisma pendant I don't do python, so I'm going to guess get_upvote_info({onlyids: true, days: 29})
ยฏ_(ใ)_/ยฏ
Is here someone using https://github.com/DiscordBotList/DBL-Java-Library
DBL-Java-Library - An API wrapper for https://discordbots.org/api/docs that works in Java
aint working 
okay guys
I think I got it to work
but
i did:
votes = await get_upvote_info(onlyids = True, days = 1)
print (votes)
and it's returning the usernames as well as the avatar
Parameters:
**onlyids (bool[Optional]) โ Whether to return an array of simple user objects or an array of user ids. Defaults to False
**days (int[Optional]) โ Limits the votes to ones done within the amount of days you specify. Defaults to 31
Returns:
votes โ Info about who upvoted your bot.
Return type:
dict
._.
umm wait what
I did False
and I did True
they both return the same thing
{'username': 'Grandlad', 'discriminator': '1542', 'id': '242325428696514560', 'avatar': '256662e2aec1e07a761b44d64e1f027a'}, {'username': 'Mason Phantom (YWN)', 'discriminator': '0284', 'id': '171359861966110720', 'avatar': 'd30c97a7d70c1d4094179469de918960'}, {'username': 'DJPCaprio', 'discriminator': '4448', 'id': '264542868033634305', 'avatar': '8bdf453b26e89adaf933b600a6cfe60d'}, {'username': 'Prusso', 'discriminator': '8629', 'id': '251351879408287744', 'avatar': 'd25ddc4afdb93382e2e4b26b0321fdb2'}, {'username': 'mortalites', 'discriminator': '4498', 'id': '250442052142235648', 'avatar': '23471d85c136babb64cc9fadd0de8326'}, {'username': 'โตโ', 'discriminator': '8275', 'id': '250019914889428995', 'avatar': 'dcb097303bc2ebd64056cd73103300e6'}, {'username': 'renedaking', 'discriminator': '2208', 'id': '234713782163603456', 'avatar': '548caab79188b04225c7706a77cc7904'}, {'username': 'mortalites', 'discriminator': '4498', 'id': '250442052142235648', 'avatar': '23471d85c136babb64cc9fadd0de8326'}, {'username': 'The Engineer of Two Cities', 'discriminator': '1815', 'id': '208371728177561605', 'avatar': '28ecb6e9fae05665a72b190ae48c338d'}, {'username': 'fusiondshadow', 'discriminator': '1345', 'id': '204356529472667648', 'avatar': 'b758e2006b190c16bceb886f51438a38'}, {'username': 'DJPCaprio', 'discriminator': '4448', 'id': '264542868033634305', 'avatar': '8bdf453b26e89adaf933b600a6cfe60d'}, {'username': 'Silver of Quick', 'discriminator': '1951', 'id': '262682004410204160', 'avatar': '94416e79e96e8e709d036769dc4a8d38'}, {'username': 'Prusso', 'discriminator': '8629', 'id': '251351879408287744',
._.
then remove it from website temporally since its not working
or add a short notification in github
@plain timber no
I can't vview the websites API page on Windows Vista which is currently what I am stuck with. The page is just blank
get a better pc 
I do, my best one crashed again ๐คท
my advice would be to reload the page
tried that lol this is all it shows
wtf is that windows pc xd
๐คฆ iv'e already said above
maybe try a different browser
opera
Error: 409 Conflict
at _response.transport.request.then (/home/davexdme/prod/node_modules/dblapi.js/node_modules/snekfetch/src/index.js:193:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
what do this error mean lol
what are you doing ๐
what's api
Use Google
Is there any logs bot?
Wrong channel for that question
I don't know what you talking
Ask in #memes-and-media or #general
how do i get the server count to show up using javascript and the api (please ping i have to mod my server)
I'm still confused about the upvote command:
@bot.command(pass_context = True)
async def redeem(ctx):
votes = await dblpy.get_upvote_info(onlyids = True,days = 1)
print (votes)
It's returning all the votes (from the last 31 days)
How do I lock it to 1 day, & so its only ID's because its currently returning everything (username, avatar, id, etc.)
why is the upvote information limited to 1000 upvotes per month at dbl-python-library?
how do i get the server count to show up using JavaScript and the api (please ping i have to mod my server)
@polar creek https://discordbots.org/api/docs#jslib
i did that it said something about creating a client
@prisma pendant that feature was removed and the library likely hasn't been updated
@polar creek what said
the log
on the edit page of my bot on dbl, the webhook url can be an ip too, right?
yea
example http://123.123.123.123:1234/hook
okay
i'm just confused. i set up a server thingy (i'm new to the whole web dev stuff) using web.py and it responds when I go to 127.0.0.1:8080 in my browser and prints it in the console, everything's good
but it doesn't work from outside the network
neither when i try to visit my public ip (+ the port) in a browser or when I use the test function on the edit page of the dbl entry for my bot :/
i've disabled all firewalls i found and even set my computer to exposed host
nothing works
that's the code
import web
from threading import Thread
urls = ("/.*", "Votes")
app = web.application(urls, globals())
class Votes:
def __init__(self, bot):
self.bot = bot
def POST(self):
data = web.data()
print('ding!')
print(request.form)
return 'Hello'
def setup(bot):
t = Thread(target=start_listener)
t.start()
__votes_bot=Votes(bot)
bot.add_cog(__votes_bot)
def start_listener():
app.run()```
@arctic arch what does this mean MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added. Use emitter.setMaxListeners() to increase limit
@olive pecan have you opened the port from your router's configuration?
@polar creek that means you have multiple ready events added for some reason
yep
the port isn't occupied by other apps either
and it's also not the threading thing, it also doesn't work without threading
and unfortunately i don't have a vserver yet to test with
https://www.yougetsignal.com/tools/open-ports/
what does this say
The port forwarding tester is a utility used to identify your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall.
it says it's closed
dammit
why
it's opened, wtf
and i know that port mapping works, i've opened a port for a minecraft server i sometimes host and it works
that tool say that also the port i use for hosting the minecraft server is closed
weird
the server's not on tho?
no, it isn't
its gonna say its closed if a server is not listening for it
oh, okay
i'm gonna turn on the server and see what it says
oh
yeah, now it says it's opened
YASS
i got it working
atleast it prints an error when I use the test function on DBL
the problem was that the bot used 127.0.0.1 instead of my local ip
i even got it working with flask, perfect
post("/webhook", (req, res)->{
System.out.println("TESTTTTTTTT");
JSONObject body = new JSONObject(res.body());
switch(body.getString("type")) {
case "upvote": handleUpvote(body);
break;
case "test": System.out.println("Test webhook received: " + body);
break;
default:
System.out.println(body.getString("type"));
}
return null;
});
may some1 can tell me my webhook aint working ?
i have enabled all ports also
when i click on test nothing happens

did you save before testing
Eyo Tonkku, I think webhooks are down atm.
fixed
ty โค
Is the api/bots/check endpoint ratelimited as well ??
everything is ratelimited
ok, thanks for the info.
webhooks are de....oh.
tfw i was editing my nginx config and test hooks dont arrive
fixed againโข
ty
alright they arrived ๐
you're probably running a different version
what u mean
i just updated it
cant be
oh lol
mobaxterm -.-
wondered how it can be possible ๐
you have to post it yourself using the api
its all in the documentation
@loud gulch either webhooks - preferred
or the API - usable for under 1k votes
you can request if a user has voted by their id
thats what i want to do
but that only checks in the last 24 hours
using the lib - DBL.hasVoted(I'd)
@sick prairie bots can't send messages here
oh shoot
this channel is only for discussing the DBL API
i forgot
lol
api displaying wrong server count
on the site says 19 but my bot is on 28
@ me when someone know how to fix ๐
@toxic acorn are you updating the serer count
ye
is there a mistake on my side or is the test function for webhooks on the bot's edit site returning "500 Internal Server Error"?
hm
probably the wrong channel - but how do i get my widget to work on gitbook?
it won't embed at all ;-;
@humble bison  will embed the image
didn't work for me but i'll try it again
i dont know how to do markdown in the new version of gitbook but in the legacy version of gitbook you could just edit the markdown directly https://stuff.zira.pw/files/1530664819334.png
Got it! You need to ctrl+v, but hold shift with it @ocean marlin.
Does the API here return votes total or for the past 24hours?
Someone gives me API nsfw
@charred lynx this channel is for the Discord Bots List API, use #development for that.
Ah glad you got it
Why isn't the webhook test not sending anything?
I tested my php script for webhooks by visiting it and it works
dbl does a post not a get, are you aware of that?
yeah
I'm dumping post data
here's the script I'm using just to test and be aware of what I'll be receiving:
<?php
file_put_contents("post.txt", print_r($_POST, true), FILE_APPEND);
but I receive nothing
it doesnt get logged onto the file
but when I visit it I get an empty array (because I didnt send post data)
which should mean that it works
and that dbl just hasn't sent the test yet
I'm getting issues with not getting anything too
Sometimes I get votes, others are missed
well that worked
How does this work? I'm useless sorry
wait
IS the token generated by some kind of generic algorithm?
Because my dbl token is exactly the same to my token from another bot list

nice token
it would be a shame if someone stole it
bruteforce 
let's get ratelimited esketit
I wanna say you dont have to get ratelimited but I'm not gonna directly say it
module?
dblapi.js
I putted ^1.0.0 and this installed 1.2.3
What the version I should put to download?
^2.1.0
ok
will try
Do I need to create a webhook
or the code create automatically?
@arctic arch
you need either webhookPort or webhookServer in your options to use webhooks
that's the recommended way but you can use dbl.getVotes, it just has some restrictions
So I can create a database where I put the current votes of each one and check when they do the command if they have current+1 right? @arctic arch
probably
@arctic arch Thx for your time!
/bots/:id/check seems less-than ideal because it doesn't tell during which period that vote is valid
So you have no real way of distinguishing one vote from another
providing the timestamp at which the vote occurred is a good idea
Is it just me, or are webhooks not working?
they work perfectly fine for me
fuck you
Must be a bug, I'm also noticing my stats not changing in my bar
Ye
Try sending it as a raw request with a JSON body instead when using postman, works for me when doing it that way
Pretty sure you are supposed to post json and not put it in the header so yeah



