#topgg-api
1 messages Β· Page 29 of 1
That's your api token
if you want to supply authorization with your webhook request
@hollow wraith you're talking about this yeah? https://please.zbot.me/lkzSIN1k.png
yeah, ive filled it in but i got all the parameters passed in the body ( im pretty sure) and that wasnt one of them
its included in the header of the request
when the webhook is triggered it sends a request to the URL you set
inside of the request to the URL is those 4 things you mentioned above, and the Authorization value as a header (if you included it)
those 4 things are included in the body, not the header
@hollow wraith yeah no worries
im a bad boy
Sexual
is it me or is the api tutorial outdated on
https://discordbots.org/api/docs#dotnetlib
https://gyazo.com/38806500ef707b68858221a1cb79bb41
because getMeAsynce() returns IDblSelfBot and not iselfbot
I'm still a nub in programing so i could be saying something dumb π
@tawny oxide Docs outdated, just use IDblSelfBot. You could also just use var. π
who updates the libs?
I made a pullrequest once lmao
Actually the libs are managed by the community. Not even the docs on the Repo of DBL-dotnet-library are up to date.
wrote a page to send userid of who upvoted your bot to discord webhook via dbl webhook, if anyone would like to use it
it's just a variable name
bad variable name
I'll recreate the library then ;)
Does dbots py library only work for rewrite?
Failed to post server count
AttributeError: '<class '__main__.Bot'>' object has no attribute 'guilds'
hmm it should work for async...
Hmm figured it out. Seems it was renamed in rewrite.
Changed it to servers rather then guilds.
changed what to servers..?
https://github.com/DiscordBotList/DBL-Python-Library/blob/master/dbl/client.py#L79 this should have handled that
DBL-Python-Library - A simple API wrapper for discordbots.org written in Python
from ```py
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
```py
logger.info('posted server count ({})'.format(len(self.bot.servers)))
In the example
I guess it was not really the library itself but the example code.
Hmm still getting this
Failed to post server count
AttributeError: '<class '__main__.Bot'>' object has no attribute 'guilds'
Okay, so my bot had a Vote Webhook. I was hosting it on Glitch.com but I moved over to self hosting it on a Raspberry Pi 3. I need help setting it back up. I believe Tonkku helped me with this a while back
This was the code that i used on the Glitch Hosting Software:
const http = require('http');
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
What do i change to make it work? π
Oh wait, no wrong code lol RIP
This is the code i got:
const DBL = require('dblapi.js');
const dbl = new DBL('Link to the Glitch Project followed by the /dblwebhook', { webhookPort: 5000, webhookAuth: 'My Auth Token' });
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!`);
});
What do I change as I have moved over from glitch to a Raspberry Pi 3
you need to have the public ip of your pi
port can be whatever
but if you're on your home network you may also have to port forward it
you can type curl ipinfo.io/ip to get your public ip
@timid osprey im back
probably canr stay for long but lemme try help
remove the try/catch clause and remove the logger.exception
kk
show me the traceback
So like this?
logger.info('attempting to post server count')
await self.dblpy.post_server_count()
await asyncio.sleep(1800)
Ignore the indents okay sec
yep
no wait
add logger.info('posted server count ({})'.format(len(self.bot.servers)))
okay sec
Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
File "asyncio\tasks.py", line 239, in _step
result = coro.send(None)
File "C:\software\discord\publicbot\cogs\dbots.py", line 24, in update_stats
await self.dblpy.post_server_count()
File "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 "dbl\http.py", line 189, in post_server_count
await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
File "dbl\http.py", line 160, in request
raise Forbidden(resp, data)
I did seem to be getting this without logger but lemme add that as well
That does seem to work I think
getting no errors
Thanks, I'ma tweak it now that I know it works.
I'ma increase it to more than 30 mins and I guess I do not really need it to warn me if it failed or not either.
@arctic arch
So, is this correct? But the problem is that when I run the bot I get an error:
const DBL = require('dblapi.js');
const dbl = new DBL(`http://${config.raspberryPiPublicIP}`, { webhookPort: 5000, webhookAuth: `${config.discordBotListServerCountToken}` });
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!`);
});
Console Output:
update your node
update then upgrade
Ight cheers
no wait
Mhm?
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
ow gosh. Problem is my right click dont work. Gonna have to type it all π π«
try shift + insert or ctrl + shift + v to paste
also
const dbl = new DBL(`the url does not go here, this is the dbl api token`, { webhookPort: 5000, webhookAuth: `this is the authorization you provided on the website bot edit page` });
Got it, don't worry lmao
Thank you for the help π
Im such a dummy. I feel like I should go back to learning the basics but. π This is correct isn't it?
const DBL = require('dblapi.js');
const dbl = new DBL(`The token when revealed that says The Token for Your Bot`, { webhookPort: 5000, webhookAuth: `WebhookAuth Token`});
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 feel like such a retard
whoa
buddy
we don't use the R word in here
@arctic arch I am now confused as to what to put onto the Website Webhook URL...
I gotta stop tagging lol. No more tagging from now
http://publicip:port/dblwebhook
Does it have to be /:port or can it not just be publicip:port
@restive otter no
I have gotten that, but still nothing
Port is before the path
thank discord
I literally have that set as the URL but I test it and nothing happens
is the port open
Wait, wtf. It is working now. And I tried it again. I am making it log to the Pi's Console but it doesnt seem to be logging to the console for me.
Hold up
You use raspberry pi for hosting? Oh
Yes
Wait I realised it was running from Glitch Still. RIP. But the Pi still will not let it work
Umm try to debug this, try sending a demo post from another PC on the network
Pretty sure everything is setup correctly
This is the code I copied down from Glitch.com of my project. Which I have now deleted:
const DBL = require('dblapi.js');
const dbl = new DBL(config.discordBotListServerCountToken, { webhookPort: 3000, webhookAuth: 'Webhook Auth' });
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!`);
client.channels.get(config.voteChannelID).send({embed: { color: green, title: `:arrow_up: | Upvote`, description: `**<@${vote.user}> Just upvoted Gamer! Thank you!** :tada:`}}).catch(console.error);
client.users.get(vote.user).send({embed: {color: green, title: `:arrow_up: | Upvote`, description: `**Thank you so much for upvoting Gamer! It helps me out a lot!** :tada:`}}).catch(console.error);
});
When clicking the test button on the dbl edit page, nothing still comes up
Even with the port still at 5000 or 3000
No errors?
Nope
Can you send output?
Nothing gets output to the console at all
Oh
First try on local network
How lmao. I am not good with networks
Use on PC net view
From cmd
Get local IP address of the pi, and send post request with snekfetch or smth
do I need to save the webhook in bot edit in order to test it?
yes
so that's the reason the test didn't arrive 
gonna close the issue real quick
nvm still waiting for the test after saving
this?
The webhook I mean
I am making a tutorial and I really hope to publish it asap
Alright, thanks.
basically a webhook is a server that when a vote happens DBL server forwards info about the vote to the server
https://wastebin.party/ronojohomu.js here is an example of a webhook on Express
Where's the console in glitch.com?
it's not api related though
I get unclosed client session.
Unclosed client session
client_session: <aiohttp.client.ClientSession object at
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 = ''
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')
await self.dblpy.post_server_count()
print("Attempting to post server count")
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
just a quick question but i dont get this line.
// Update stats sharded indexShard shardCount shards
await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });
Is there anyone that would explain this a bit to me :?
ok so... indexShard is the shard you are posting from, shardCount is how many shards, and shards is a array of numbers that says how many servers are on each shard
@tawny oxide did this help ^?
Also please next time send full error message, it's easier to debug that way
have you tried turning it off and on again
@sullen nymph reinstall dblpy
is any of ur files called dbl?
^ also
whats the recommended interval for updating s. count?
30mins i think, honestly there isn't really any reason to do it often unless your growth is huge
i myself do it hourly
@calm torrent Yep.
@edgy nexus Well, fixed that by manually using aiohttp. Thanks for advice, though. :p
if your file is called dbl, it'll be used instead of the dbl you imported.. which will cause issues
if your bot grows pretty fast then around 10 mins should be good but normal bots 30 mins is nice
whats the use even
I am getting this error: Unhandled promise rejection (rejection id: 4): Error: 403 This host is not accessible. When attempting to retrieve upvotes for my bot. I have no idea why this is happening or how to fix this.
What method are you using.. i think the getvote methods are both depreciated, getvoterids works, but not as advertised
I'm using snekfetch.
let { body } = await snekfetch.get(`https://discordbots.org/api/bots/${bot.user.id}/`);
looks like it's an issue with your host/machine
(DIscordGo) Hi, I need help. Can someone tell me how do I check response time for my bot?
DM me
#development @abstract jacinth
Okay, in the API documentation it references a shard_id with the following text.
"The zero-indexed id of the shard posting. Makes server_count set the shard specific server count"
I'm using the semi-experimental internal-sharding branch of discord.js and in the #312614469819826177, it showed you could get the shard id by doing bot.shard.id.
That method in the example is impossible for the internal-sharding, as the guilds have the shard id's assigned to them, not the client client.shard returns null, so my question is... is shard_id required if you're posting shard stats?
no, it's not required. You can set the total server count with the shard count
shard_id is used if you run posting on each shard separately and want the website to sum them up for you
ah 
Hmm, it appears my stats posting might not be correct π
await post(`https://discordbots.org/api/bots/${this.client.user.id}/stats`)
.set("Authorization", process.env.DBLTOKEN)
.send({ server_count: this.client.guilds.size, shard_count: this.client.ws.shards.length });
@calm torrent Ah. I got your question wrong. Nope, none of my files were called... oh wait... 
My bad. π
someone help
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::5000
at Server.setupListenHandle [as _listen2] (net.js:1346:14)
at listenInCluster (net.js:1387:12)
at Server.listen (net.js:1475:7)
at DBLWebhook._startWebhook (/home/pi/Desktop/jb2/node_modules/dblapi.js/src/webhook.js:25:18)
at new DBLWebhook (/home/pi/Desktop/jb2/node_modules/dblapi.js/src/webhook.js:20:10)
at new DBLAPI (/home/pi/Desktop/jb2/node_modules/dblapi.js/src/index.js:51:22)
at exports.run (/home/pi/Desktop/jb2/events/ready.js:10:13)
at Client.emit (events.js:185:15)
at WebSocketConnection.triggerReady (/home/pi/Desktop/jb2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:114:17)
at WebSocketConnection.checkIfReady (/home/pi/Desktop/jb2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:130:61)
Emitted 'error' event at:
at emitErrorNT (net.js:1366:8)
at process._tickCallback (internal/process/next_tick.js:178:19)
i switched command handlers and this happend
The port 5000 is in use by something

It seems my script only runs once and does not update after 30 mins
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 = ''
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')
await self.dblpy.post_server_count()
print("Attempting to post server count")
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
You aren't exactly making it re run anywhere as far as I can see
I don't python so what do I know
there's a while loop
It works the first time, I think it errors out as I had to remove the try catches hmm. Gonna copy the example again.
This is the original example
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 = 'dbl_token' # 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))
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
But that one gave me an error
... what error? seems like you just removed the try except
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
logger.exception('Failed to post server count\n{}: {}'.format(type(e).name, e))
I tried changing it into server cause I am in async branch
Okay fixed it, just had to change some stuff around but yeah servers do work.
someone forgot about responsive
or wrap
or copy button
any one
π
BTW, I hope they're safer than Discord ones
which are generated from ID and password
discord tokens are safe
they're not generated from password
iirc they're generated from id, number (which can be added to discord's epoch to show creation time) and hmac-256 data
v!server
Where the hell is the long description?
Oh and why the hell does it keep saying Bot requires code grant
Can someone who knows node.js to help me please?
I tried to make the webhook. I got an error: require is not defined
I searched on google, I tried to install node.js the modules, but I couldn't make it to work using node.js
my webserver is running on apache2 on a vps ubuntu 16.04.4 x64
I'm new on html, javascript and creating a webserver
what's your node version
wait are you running that with client side (browser) javascript?
node version 10
and ummm
I think no on the client side (browser)
How I do that?
what's your current setup
How are you running the code?
@terse trellis are you <script>ing
I kinda figured out how to run node.js and apache2
node.js webhook has it's own server, and you can configure apache2 to reverse proxy to the webhook
I'm still trying to configure apache2 to redirect to some ports like 8080 or for the webhook 5000
What is the latest version ?
compile 'com.github.DiscordBotList:DBL-Java-Wrapper:1.0' doesn't work
ok thx
is it ok to send the shard id and shard count as 0 if you dont have it?
I don't think shard count is required to be sent
when i try to do the check endpoint it always returns 0 for the people who have and havent voted
how do i get the api?
submit a bot read the docs
@weary ember sumbit
@shut ibex mistakes were made 
tokens generated from id and password lmfao
they are from id
Right so im sending a POST request to the stats endpoint but getting a 400:
{
"error": "Required parameter server_count or shards missing"
}``` However the body of my request **does** include the server_count: ```json
{"server_count": "17"}```
ah
needed to specify content-type header
@restive otter
beaned
is it me or is the webhook not arriving at all
Havent tried any testing today.. but no upvotes came through either
ok?
Webhonkkkk
honk? 
What do I put here for a vote system If I am hosting my bot from a Raspberry Pi 3?
apparently i need my pi's public ip, how do I get that?
I dont want to have to port forward either
you'll have to port forward
or use something like cloudflare argo tunnels
but they're paid
how to i create a feature where bots can check if you voted
@sudden rampart Okay, I almost done it, What Type am I going for?
TCP, UDC, both
and what do I put in Start Port:
and what do I put in Finish Port:
?
tcp
nvm I got round that. What do i do here?
set both to the port you want
not ssh
What then
idk, what options are there?
HTTPS?
ads
Lies
Webhook system if u cant get portforwarding figured out
yeah
show me the options @restive otter
I cant, it is a dropdown box and closes when I snip it
o wait
@sudden rampart
?
so i have this weird question, if the webhook doesnt send to http how is dblapi.js webhook working

why are webhooks like this
cause that is how they were coded β’
why I have this?
Webhook running at http://0.0.0.0:5000/dblwebhook
shouldn't be my ip there?
I can't make the webhook to work
but the post on the url is working
Just Google what's my ip
ive tested it and afaik it doesnt work on http
tf?
ye
ive tried it like 6 different times with diff ports and with my public and ipv4 address
i never get request
but when i use my website url thats https i get the response
Why would they hard-require HTTPS
I have https and ipv4
im talking about http
also if you have https and ipv4 its better to make your own server for webhooks
List<String> voterIds = api.getVoterIds("bot id");
This will just return all userIds who've voted once or more right ?
So it's not bound to time
Because i would like to do like a giveaway each month for people who've the biggest voting streak
use a webhook please
oke
this is what webhooks are for
oh
Soo
Do I need to write a webpage for using a webhook or can I use it in java ?
example url: https://domain.com/webhook
as long your port is forwarded and your server is up
webhook is basically a server that listens for changes
it doesn't have to be http or https port
User votes => dbl sends a POST request to your url with the userid of who voted => you receive the data and store it in whatever database you want
Hello, if esque send the request for my bot's certification, how long is the response time?
How is this API related
@lament moon "It's done when it's done", only one person handles certification, and he's extremely busy, so you just have to wait
its exam time so yea......
York#0001 ty
Does anyone know any way for the bot to get information about how many users are on a server and the server logo of the invitation?
#development and please specify the libs
okay
hi
How am I able to detect when someone votes for my bot? I'm using discord.py rewrite
have a webhook damn I should really work harder on the tutorial
yeah I've never used webhooks for my bot before, so it'd be a first for me
do you have a tutorial for it?
I am making one
@restive otter until you get it figured out, you can use this system i made a week or so ago.. okd by the admin to share it. Https://pokecord.net/webhooks/
It will give you a link to put into the DBL webhook url for your bot. That will go straight to your discord channel you created a webhook for.
@hollow wraith that's not what he was asking at all
unless someone explicitly asks for what your service does, you don't need to mention it
How they explicitly supposed ask for something that only a few people knows exists? People like to get their stuff going asap, this is a nice bandaid for people who struggle to get webhooks working. I never got it working, so i set up public service. I have seen tons of people get zero help other than learn to set up webhooks. Which is why i talked to a different moderator and the Website Administrator who gave me the ok to share this.
from what I understand
your service posts webhook data to a Discord channel
that is not what he asked for nor does it solve his issue
How am i able to detect upvotes....
Solved until he has time to figure out how to do it properly
who told you it was okay to share this
ok so the api is not hardcoded. But how come it doesnt work on ipv4 on my desktop but on my vps

Tonkku and blake
No ads, no bullshit lol just an easy way to get people set up for webhooks when its not something they thought about before getting their bot accepted. Ive seen tons of people come in here and ask how to get upvote notifications.. the only response they get is learn to do webhooks. Then they say thanks and most dont come back. My harmless service isnt hurting anyone, doesnt really require people to get upset that i made it for a free service that doesnt even have a sign up π
I dont think its hurting anyone but why not tell people how to do it before giving them a link
Because ive asked for help in here quite a few times and got zero help. Im fairly inclined, but i couldnt get something to work, from listening for webhooks to port forwarding.
because the three times ive seen you do it, you didnt explain a different way
not everyone wants something handed to them
They dont have to use it, but atleast they know its an option. Instead of waiting hours for a response or get the same thing repeated to them, when they have already tried it
it seems like your doing this because of something that happened to you
Sharing something that anyone can use at their leisure?
I just shared a webhook option for people. You are mainly the only person bothered by it
Which is why when i brought it up again. I said its a system he could use until he gets it figured out properly.. because i realized u had become upset over a different webhook option
would you like to explain to me this "different webhook option"
They can use the discord webhook option created by discord to recieve webhooks. Under server settings if you have permissions in a guild, you can create them for certain channels
im not upset because of that
im upset because you dont show them a different way first
before giving the link
Instead of opening ports and having their own server
Ohh.. so there is like a thing.. they have to learn how to have their own webhook server before they can do anything else
Gottt it
im not saying that they have to learn how to do it before they can do anything else
also theres no consequence for learning
But you assume everyone has time to learn it, and im out of line for offering a faster way
π
so like the easy way out
@hollow wraith For now I'd like you to only mention the service unless someone asks for instructions regarding embedding votes into a Discord channel
i see
Ok timmy
I'll get back to you on it, but it looks like it was just a misunderstanding
set an Authorization header with your token
why do certain things give Not accessible while others give forbidden 
im getting the same
and my key is valid
i just regened my token and it still doesnt work
same
unless something their side is broken
I manually did a post request and it worked but when I vote with dbl it doesn't do anything
Umm
honstly i think its their side
It works for me 
snekfetch?
Okhttp
https://hastebin.com/agocugayib.xml
I manually did a post request and it worked but when I vote with dbl it doesn't do anything
why are you posting to the api again?
what are you trying to do with the api
Make a webhook so that I can put that in a database when someone votes
you dont post to the api for the webhook
oh
you make a webserver for it
how do I add servercount to the site unsing api (discord.js)
you could either use snekfetch and post with that or use dblapi.js
which could be found at https://discordbots.org/api/docs#jslib
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
so this is servercount
?
the dblapijs lib posts every 30 minutes
@restive otter you're welcome? :)
for the webhook thing
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('asdasdasddtokehere', client);
so this is a;ll i ad
*all I add
Oh no problem. People helpin people
@restive otter yes
k
anyone know what's happening?
it's one of my new bots and i'm using dblposter
I believe 403 is an authentication issue.. double check tokens
Has the POST stats api changed?
I see in the docs /bots/id/stats
but then dblapi.js uses /api/bots/stats
without an id
i installed pydbl, and it broke my bot! asyncio issues
there was no errorlogs, i uninstalled dbl and rolled back asynchio and it works again
oh, didn't see that ? actually, thanks for that
const Eris = require("eris");
const dbl = new DBL(token,Eris);```
is this ok?
I'm not sure about that second parameter, its "client". But not sure what is client in Eris.
@hot oxide
// Initiate client and lib
const Eris = require('eris');
const client = new Eris('bot_token');
// Do DBL posting stuff
const DBL = require('dblapi.js');
const dbl = new DBL('dbl_token', client);
They are different endpoints lol
hasVoted checks last 24hrs
getVotes fetches all for the past month
Correct me if wrong.
alright, so i want to make a user recieve "coins" when voting. but im not sure how i can go about doing this. My bot is written in java and im using the java library provided. however the only way to see who voted is by getting a list of all the voters. If i want to create an event based system, to see who voted, would i have to have a cached list, and every so oftern compare it with the new list, and run the event function for each new voter?
Or should i just use a webhook instead, because i already have a web api setup, so i can easiliy add a webhook to that.
yes, if you can, use webhooks
actually, webhooks look like the best bet
and the easiest to setup with wat ive got
@austere swallow I voted myself within the past 24 hours, it should return true
It does not, unfortunately
is there a test webhook thing anywhere, so i can see what kind of message the site will send, and so i can test on pseudo users?
o right lol
does the webhook still return "unvotes"
Or is it not possible to remove your vote anymore
The type of the vote (should always be "upvote" except when using the test button it's "test")
You can't remove a vote
Hi there, i've generated my token and entered it, however when i try using it i just get back dbl.errors.Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
Just going to tell people now
i had issues using snekfetch to post/get stuff from DBL
i moved to okhttp (https://www.npmjs.com/package/okhttp) and that fixed the error of 403
not sure there is a python version.
well (only thing and) the thing that works is aiohttp
if (message.content.startsWith(prefix + "testtt")){
const { body } = await snekfetch.get(`https://discordbots.org/api/bots/430775188448083988/check?userId=${message.author.id}`)
.query({ userId: message.author.id })
.set({ Authorization: "theTken"})
console.log(body);
}```
I have voted for the bot, however, it's telling me I haven't...
What could I possibly be doing wrong?
(It shows up fine here but not in console)
Don't use query
You already did it in the url
And I don't think authorization is needed for check
yes it is
So NVM that
Oh ok
That endpoint sees if the user votes in the last 24 hours
anyone had any luck with post_server_count() yet?
What lib are you using?
the python library
dblpy
Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
That bot wasn't found
Are you retarded ?
Here is the help command list :
/help
/iamrytard
lol
-botinfo @ibot
Please include a bot mention
-botinfo @twilit hound
luca in #memes-and-media #commands #265156322012561408 or #306891333405245450 plz 
what is shard_id for
Wut
current shard...?
Everytime I reset my TOKEN for the server number thing on dbl I get this error and I have reseted it 4 times ```[dblapi.js autopost] Failed to post stats: {"error":"Unauthorized"}
did you update the token in the bot
Yes.
im getting the same error @restive otter
The endpoint is /bots/id/stats
Better link: https://discordbots.org/api/docs#bots
-botinfo @swift ice
That bot wasn't found
-botinfo @Delano Tatsumi#8248
Please include a bot mention
-help
@swift ice Luca in #testing channels please
Why has everyone been using it here recently lmao
413728456942288896
BoxBot
7194
A fun Discord bot where you can open random boxes to get random items - and then use those items to attack your friends!
b!, b1
99873
21348 Servers
@charred ocean 
What is posting the shard_id for
ik it's the current shard but why would you post it
so lUcA can add the individual shard guild amounts together 
Oof it does that 
yea
you can just post each shard and dbl will show the full amount of all
with shard_id and the other thingy
I had to manually make a server to post each shard and count then send total to dbl 
why π
π
I mean can't you just post each shard to dbl and they handle it for you? π€
^ ???
.
-botinfo @split zephyr
oh ok
<@&304313580025544704>

@elfin solstice Why did they mute my bot?
okay
@restive otter you can see the reason in #mod-logs
search by your bots name or ID
@restive otter
and please this is the wrong channel aswell, use #general or #memes-and-media next time
Why aren't there any bots in the My Bots section? I added one
it has to be approved first, plus this isn't the place for this question
ah, ok
@junior goblet I need some help with my DiscordBots webhook
@elfin solstice I need some help with my DiscordBots webhook

how do I get it to work? lmao
ok I won't ping mods
you use a small http server and then put all the information (ip and auth header) in the webhook part of your bots profile π
it should accept post requests
could I use Uptime Robot?
and if you use JS there is an integration in the Official DBL lib btw
no
you cant
Uptime Robot is something different
ah ok
Your not supposed to ping anyone at all for help
what's uptime robot?
It's what people use to ping glitch projects to "keep them alive"
Hi @elfin snow
This is for the discord bot list api, if you are looking for help with making bots, try #development or the DISCORD api server.
@sullen raptor did you get webhooks figured out?
const dbl = new DBL("TOKENNNNNN", { webhookPort: 5000, webhookAuth: 'password' });
module.exports = async (client) => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
console.log(`I am ready in ${client.guilds.size} Servers & Spying on ${client.users.size} Users`)
client.user.setActivity(`-help | ${client.guilds.size} Servers | ${client.users.size} Members`)
const games = ["Version 1.2.0", "Try -serverinfo", `-help | ${client.guilds.size} Servers | ${client.users.size} Members`]
setInterval(function(){
client.user.setActivity(`${games[~~(Math.random() * games.length)]}`, {type: "STREAMING", url: "https://www.twitch.tv/snowflake_2018"})
}, 15000 );
client.channels.get('444332803572891649').setName(`${client.guilds.size} Servers | ${client.users.size} Users`);
};```
I know hook isnt defined, but how would I add it into this?
@hollow wraith eh, not really
My bot's stats aren't showing up on its info page
Like, how many servers it's in
Here's my code:
const dbl = new DBL(client.config.dblToken, client);
setInterval(() => {
dbl.postStats(client.guilds.size, client.shard.id, client.shard.count);
}, 1800000);
Could it be because my bot doesn't have any shards yet?
probably wrong token
sure that is right?
also if you don't have shards you don't have to post them
could cause errors
why do people keep giving the client for the autoposter and then manually doing the same thing
idk how to make that any clearer
oof
const dbl = new DBL('Your discordbots.org token', client); Why does it need our bot's client passed in?
I think to get the stats to post
But I imagine it's different for different bots; isn't DBL.postStats() used for that?
Umm wait a sec I will check
oh it is
It's for automatically posting server count stats
client.config.dblToken in my code references config.json
I swear I have the right token, and I've switched to just using const dbl = new DBL(client.config.dblToken, client);
So why isn't the server count showing on my bot's page?
Could it be because I'm using the master branch of Discord.js?
bots are muted here
oof
is your client variable even the discord.js instance
How can i make cogs on a python bot?
ez
=)))
make a cogs folder
place cogs in and make sure they work
put the cogs in the cog folder first
then after that in your main bot file add this
import os #required
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
client.load_extension("cogs.{}".format(name))
minimal spoonfeeding π
#development next time kthx
k
How would I send my bot server count to an embed or somehow store it on my website?
Make an api
*effort
is there a way to easily make an api
What lang
JS has like 100000 libaraies for that
also Python
If you use C#
Well they probably have that too
If ur using js use express
Or koa
Well it depends
I personally use express
I know that
SpaceX API is made with KOA
and some other stuff too
do you get the api key after the bot is accepted or am i just missing something?
Yep, only bots that are approved appear in your "My Bots" list
ok thanks
Is there a thing thatβll trigger the code on an upvote in JavaScript?
Like
Client.on(upvote) type stuff
Nvm
Just found it
I copy pasted the web hook thing exactly
The hook.onβreadyβ works but the βvoteβ wonβt
No errors show up
U have to set up portforwarding
You need to set up a webhook which as any servers requires an open port
Hi there
How can i add BOT PREFIX= prefix
In python
And at commands to set {prefix} or idk
Wrong channel, try asking in #development
Oh sorry
how can i get channel id automacilly with my bot through this command:
!SAY-CHANNEL #general HELLO!
@undone jolt this channel is for the DBL API, all discord api questions belong in #development
Lmfao
!help
<@&265158261945270273> hi, this guy needs help and he needs everyones help all at once (he obviously needs us all to answer since he tagged us all)
@arctic arch ??????????
yes

vote??
yes??
Votehook
that isn't the dbl api, so you should go to #development fyi :p
YEs it wirks wth node, you have to know How to use it though
XD
const dbl = require(`discord-bot-list`)
const client = new dbl({
token: "Your API token",
id: "411995912781561866"
})
client.postStats("Your bot's server count, MUST be a number, not a string", (err, res) => {
if(err) {
console.error(err)
} else {
console.log(res)
}
})
Where do I put this in my bot??
@spring kiln
In the bot main file?
bot.js??
Hello???
https://discordbots.org/api/docs#jslib π also dblapi.js is official never heard of discord-bot-list
Already on that.
But I can seem to copy the whole api token.
Nvm
Just had to regenerate it.
Umm
Where do I put the code??
where do you think?
Bot.js

Wait so which api should I use?
what
the official one ? https://discordbots.org/api/docs#jslib
const dbl = require(`discord-bot-list`)
const client = new dbl({
token: "Your API Token"
id: "411995912781561866"
})
client.postStats("Your bot's server count, MUST be a number, not a string", (err, res) => {
if(err) {
console.error(err)
} else {
console.log(res)
}
})
This right?
no....
why are u using discord-bot-list
if u wanna go legit use snekfetch use dblapi.js
Ok.
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
Something like this??
then don't bother us about it, we're not here to spoonfeed you
Ik
read it and understand it or learn to understand it
That's like asking someone who speaks a language to translate everything for you, it may work for a bit, but eventually you're gonna need to learn it yourself
How to post the shard count? I am already posting the server count to the API
how do you post the server count?
if you are using js
there are some others on there
I am using python and I only need the payload key
payload key 
Found out my own, thanks anyways
@pseudo patrol nice meme
Why is my server count N/A
you need to manually post your server count to our api
How?
Like this?
you can check out our API docs here to learn more on how to implement it with your bot https://discordbots.org/api/docs
you can also use this https://discordbots.org/api/docs#jslib (if using javascript, other libs are there too)
"Servers this bot is in" is for Discord Server List
not related to your server count
How do i give my bot commands i am a noob at this π
Learn the library you work with
Lmao what a question @glossy linden
dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total);
^
TypeError: Cannot read property 'Id' of undefined
at Timeout.setInterval [as _onTimeout] (C:\Users\jacks\Desktop\Projects\X-Tron\index.js:43:51)
at ontimeout (timers.js:466:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:267:5)``` That is actually the error
Code: js setInterval(() => { dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total); }, 1);
dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total);
}, 1);``` Tetra is right
Yeah but I have everything installed
oh no
not like this
you're about to post starts once every freaking millisecond
that's gonna get you temp banned from the api real quick
Tonkku read all the chat lol
yes I saw the meme
how to see who upvoted my bot
use a webhook
^^
UMM. What should I do
My bot is in 40 servers or more How should I prove this to you?
You need 100+
^
And how am I supposed to prove it to them?
Is there a way to let the site perform some sort of action on vote, or do I need to let my bot listen to the Votes in a regular interval?
Webhooks
ok... But tbh. I don't know how I would actually check those... Maybe with a MessageRecieveEvent on the channel with the webhook?
Also is the output a normal String, or something like an embed?
I get no response in the Discord from the webhook...

I just need to make a webhook and use the link of it in the Webhook-section of the edit-page right?
Or do I need to edit something?
idk xD
it's not a discord webhook
you make a webserver to listen to POST requests
....
I already read it and it doesn't help me at all
Because I still don't know:
1.) How to setup a page/system that reads on the votes and
2.) How my bot can read the votes
because as far as I understand it, needs my bot still to read to something, to notice the changes...
what's your language
You mean of the bot or...?
yes
Use unirest
<--- Noob right here
until u get a webhook server figured out, you can use https://pokecord.net/webhooks/ to get webhooks from DBL to Discord
Im pretty sure this is what aeth said not to do
It's a nice idea but there are security flaws
@shut ibex u talking to someone else right?
Style don't work
@hollow wraith talking to u
@shut ibex why?
Aeth said not to bring it up unless they ask about your service
we go through this every time.. timmy asked me not to mention it unless someone asks about discord webhooks
aeth never said that, and a mod and the administrator said its ok
so no one needs u to say something every time when it gets mentioned once a week lol
Whenever u bring it up it looks like your shamelessly advertising ur service
everytime i bring it up, someone gets helped out.. lol nothing in it for me
doesnt really matter what your opinion on it is
If u see there it says embedding a webhook in a channel
I don't think that person wanted a webhook in a channel
Someone's triggered
yes u are, everytime i offer a free service for people until they figure out webhook servers π
Style don't work in the webpage.
just move along u dont need to comment on everything that makes u feel upset
they were asking who to get the webhook for discord to work
viola.. uncle to the rescue.. and here you are going off about the same nonsense u were on about last week
@restive otter what do u mean?
It's not no sense, its you being incapable to understand
youre being incapable to mind your own business lol.. i understand perfectly.. dont mention my services unless someone is asking about discord webhooks
now the guy has working discord webhooks for upvotes and no one is hurt
Use this to put the background and it worked now, is not it a problem on the page? https://letters-of-the-alphabet-are.xyz/1b16etlr.png
@hollow wraith
ah, someone had an issue like this a while ago do u have the site live right now?
Directly before it worked and now no longer and I do not know why
does the picture still exist on discord? u could try uploading it somewhere else, more permanent
to change the link?
yeah, there are lots of free image hosting sites, or if you have your own web host, id recommend putting it there
sure
may not resolve the issue, but it could. if not, try single quote around the url.
@hollow wraith it works, but i need help with this https://letters-of-the-alphabet-are.xyz/02WH5pqO.png https://letters-of-the-alphabet-are.xyz/KCnFRAsM.png https://letters-of-the-alphabet-are.xyz/VfefgJns.png https://letters-of-the-alphabet-are.xyz/yT5soveh.png
im not sure what that is:)
https://letters-of-the-alphabet-are.xyz/2Ok9s89O.png this @hollow wraith
what do u need help with?
how i can change the background of my bot on discord bot list?
I guess the colours don't fit well with the background?
What I want is that from previous captures I want it to go blank but I do not get it right @surreal junco
@formal nebula easy
How? ;-;
Also, why are you talking about this in #topgg-api would #development not be a better place?
so my bot page says 13 votes but the api says 14.
bot page: https://discordbots.org/bot/434066192848781343
api (widget): https://discordbots.org/api/widget/upvotes/434066192848781343.svg?noavatar=true
What does it say on your profile
Then idk
π€·
You might have added it before month reset
is the reset in the middle of the month?
its weird but not really a big deal i guess π€·
- votes reset at the beginning of each month doesnt matter how long ur bot has been on the list
- the widget and ur profile page shows total votes not monthly votes
API returns total votes and monthly votes
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere
What is my DBL token and how can i find it
@radiant summit https://discordbots.org/api/docs
I don't find
@radiant summit ^
and now, how i know url ? Documentation says :
Start by setting up your webhook URL in the edit form of your bot on this site, it can be found at https://discordbots.org/bot/:ID/edit once you have entered the URL you want the webhook to be sent to, you're all set! If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in our #topgg-api channel.
Check the pinned message by Tonkku
@radiant summit you have to set up portforwarding in your router most likely.
yo guys
i has a question
for the little upvote thingie
can i send webhooks to a discord webhook url
you would have to make your own
how would that work
what lang
discord.js
you could integrate it right? in the dbl.webhook.on(vote) or whatever, just add the webhook code for discord there?
any free port
@restive otter you could use express.js to set up your webserver, then assign a domain if you want using nginx
my vps has the ip of 172.xxx.xx.xx:1228 so i could use that as the webhook url right?
yes
do i have to assign to a domain?
no
mm, cant install express on my bot
well, more like a bunch o errors
but it still added packagaes
packages*
show the error
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm i express
wdym
can you point me where i need to go
for express?
ye
either this site: https://expressjs.com/ or there are many tutorials on youtube
ty
thereβs an example webserver in pins
relax, take a load off, connect your bot to dbl webhooks with dblapi.js, relax, take a load off, take a load off
