#topgg-api
1 messages · Page 64 of 1
Currently make a own java wrapper that should be better than the official one...
For the api
@teal lava it's not required and it does post using the client when provided
that's not going to stop raw api usage tho
Do I have to have a webhook to know when somebody has just voted for my bot?
Well that's the only way to get votes in real time
Where can I get the webhook port and password?
Password is set by you and... same for the port 
Just to clarify, URL would be a webhook I make on Discord? and Authorization will be my password? https://plexi-development.sucks-hairy-balls.xyz/lrrxk.png
Webhook being a server running somewhere in this case
oh, would an Express server work?
when I test the webhook, I just get this alert but nothing else to say it was successful or unsuccessful, is this normal?
Make sure your port is open and forwarded
how do i make it show it shows my bot amount of servers instead of n/a on my profile
and im using the api docs and it wont work
while that may mean youre doing something wrong
@analog iris
const DBL = require("dblapi.js");
const dbl = new DBL("YOUR DBL TOKEN", client);
dbl.on("posted", () => {
console.log(`[DBL]: Server count of ${client.guilds.size} posted to Discord Bot List...`);
});
fuck

@restive otter Stop spoon feeding my guy
Wrong channel, go to #development
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
At line 2, where can I find my webhook port, and what is the password ? My Discord password ? I am totaly confused

Can you help me ?
Ok so the port is where you want the webserver on (you decide) and auth is a PWD you set on the website and you have to have it in there aswell
ok so password is my DiscordBotList password ? (I am not english, so I may not understand you very well)
@narrow geyser
Yea basically
const dbl = new DBL(MY BOT TOKEN THAT I FOUND AT DBL, { webhookPort: 25957, webhookAuth: 'MY SECRET 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!`);
});```
Just with this code and the DBL-api.js package, I should be able to receive vote update ? I don't need dbl-api package ?
I mean you can try, idkr
does anyone know to show the website how many servers your bot is in ?
or know what to search in chat to find a previous discussion about it
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
so this ?
Hi guys
Hello
How make it with Eris
?
mm/dbl @mention
huh
How I find my webHook : From server parameters -> Create webHook -> And I created a webHook for a channel. When I copy the URL in DBL Editor, I have this message. What am I doing wrong ?
You need a webserver running, not a Discord webhook
how I can find that?
Code one yourself. What's your bot written in?
dblapi.js has a built-in webhook or you could use express
I already have dblapi.js but I totally don't know how to use it, even with the Docs
can I show you my code ?
When I start my bot, I haver this in the console : http://0.0.0.0:5000/dblwebhook
i dont even recieve ready event's log
using same thing as listed on docs with express
@ionic flame The dbl api docs is so weird
They are really weird
They're like the picture books of API docs
Number or Array of Numbers like wtf just say number | number[]
And even for the Port, should I use the Host Port, or my SFTP Port or just a random number ?
any unused port
@runic grove so a random number is ok?
is it possible to create a custom ActivityType ?
or can you only use
PLAYING
STREAMING
LISTENING
WATCHING
- Wrong channel
- Only the ones Discord provides
oh my bad, ty
When I test my webhook, what should happen?
POST request will be sent to the URL you entered in your bot's Edit section
My url is : http://0.0.0.0:25957/dblwebhook, I started my bot, saved the UrRL and clicked on "Test" but where can I fin this POST Request?
0.0.0.0 needs to be replaced with your IPv4 address
I can find it where I host my bot ?
Yes, you can
Thank you !
You'll get the POST request to the URL, handle it from there
So if I put my URL on google chrome, I should get the POST ? ( I am sorry if I don't understand very well)
You handle all requests in your code
Visiting the URL in your browser will only send a GET request to the URL
In my code, about the webhook I have that :
const DBL = require("dblapi.js");
const dbl = new DBL('MY TOKEN', { webhookPort: 25957, webhookAuth: 'PASSWORD' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://IPv4:${hook.port}${hook.path}`);
});
dbl.on('vote', vote => {
let embed = new Discord.RichEmbed()
.setTitle(' Récompenses de vote')
.setColor("PURPLE")
.setDescription(`Le joueur** ${vote.user} **a voté pour Gato et gagne ainsi **1500 ** `)
.setColor("PURPLE")
client.channels.get("611122034474483715").send(embed)
console.log(`User with ID ${vote.user} just voted!`);
});```
Should I receive something or add something?
Seems fine to me
I can only vote every 12h, I test it tomorrow, hope the best. Thank you for your help
testing is supposed to work with vote event too
How I can test vote event ? 😮
Test button in the webhook part in the Edit section
Let's test that
Nothing happened. No embed set 😦 Can I send you my code uncensored ? I really need help
ok?
@ionic flame Is this working for you?
nope, infact ready event is also not emitted
welcome to the group
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
yep ports are big issue tho
hi
bye
-Play kk
@restive otter ports are open ig, because express app works
const http = require('http');
const app = express();
const server = http.createServer(app);```
Do I need to do `npm i express and http` to make is work ? And then, do I need to modifie something in `const server = http.createServer(app)` ? I don't really understand this part
why are you making an express server and putting http around it
thats like putting a chocolate back in the wrapper when you want to eat it
@humble bison I just read the Docs
I need a listener to reward people for voting
I stuggle so hard
I've seen tutorials do that. I am not sure what's the purpose when you can just express
maybe to expose properties/methods of both a server provided by 'http' and 'express'?
this channel is for the dbl api. Use #development for assistance on OAuth2
Lmao
Hey everyone, what setup will I need to reward the user when they vote without having them run the command twice?
For now its command1, they vote, command2, the bot rewards them if they have voted
But I'd like it to automatically reward them the moment they vote
Webhook
how do you get the timestamp for an upvote? (d.py)
I've got everything else I need just not the timestamp
No timestamps unless you are using a webhook and saving the time
alright that's easy enough. how do i set up the webhook?
im not sure the python library has them
it doesnt
At the time of upvote, on_dbl_vote provided by dblpy will be emitted where you can use datetime.datetime.now()
oh that's good then. saves me needing to use a third party lib
Just make sure you set up the webhook. The README on Github should be somewhat helpful
and I'm guessing the data provided by on_dbl_vote is the same as what's returned by the latest vote in get_bot_upvotes?
Ehh
Give me a minute
https://discordbots.org/api/docs#webhooks
That's a negative, chief
The data you get in get_bot_upvotes is different from the one you get in on_dbl_vote
oh yeah I see. alrighty i understand now. thanks for the help 
alright i got round to trying it out and I never get anything. port 5000 is open and even using the example given in the README doesn't yield any results after hitting test
Hello, need so help. How do I know if the bot will show my server on the page and how to make a description for the server ?
Please tag me.
@hoary minnow Can you be sure it's forwarded?
I've asked in my hosting providers server and theyve said it's all okay. I check at https://canyouseeme.org and it succeeds too
A free open port check tool used to detect open ports on your connection. Test if port forwarding is correctly setup or if your port is being blocked by your firewall or ISP.

pretty much
nah it's totally okay. i can post my code if it would be of any value
Not really sure if that would help, but worth a try
Looks fine to me really
Hello?
Need some help. How do I know if my server is on the list?
@ornate badger
If you doesn't have the logo "not published" on the server it's good
i have just add to my code the dbl api, how many times do i have to wait for it starts?
for the server count
If you're using the DBL API it should start directly
I'm back with a bit more info. I've done a bit of testing and it seems to be returning status code 500 when it receives anything
even more testing: I did a test POST to the webserver and it only ever prints the data when the type is "upvote" - never prints when the type is "test".
@dense basalt I used this ```python
class DiscordBotsOrgAPI(commands.Cog):
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'token'
self.dblpy = dbl.Client(self.bot, self.token)
self.updating = 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 not self.bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_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))
(obv I put the token)
wait
i found the error
but it does not work
where have to define that logger, that is the problem
im going to do what i call a pro gamer move
im going to delete that logger
well ig you're not supposed to copy and paste code
but like actually understand it
i understand it but
Just for be sure, the token I need to use , it's the api key give by the doc or the token from discord application ?
For me the libraries don't work so xd
when I install it , I have a error with discord.py
oy
qdqdsq
same
well i cant help much with discord.py cuz python is pseudocode to me
but like what's the error
someone else in here might know some py
I will post it 2s
so when I install dblpy with pip (pip install dblpy)
when I launch my bot without import dbl
I have this :
Traceback (most recent call last):
File "D:/Cours/HS/Python/Ducanator Graph/main.py", line 5, in <module>
import discord
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\discord\__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\discord\client.py", line 42, in <module>
from .voice_client import VoiceClient
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\discord\voice_client.py", line 65, in <module>
from .gateway import *
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\discord\gateway.py", line 31, in <module>
import aiohttp
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\aiohttp\__init__.py", line 6, in <module>
from .client import * # noqa
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\aiohttp\client.py", line 13, in <module>
from yarl import URL
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yarl\__init__.py", line 11, in <module>
from .quoting import _Quoter, _Unquoter
File "C:\Users\pikac\AppData\Local\Programs\Python\Python35-32\lib\site-packages\yarl\quoting.py", line 3, in <module>
from typing import Optional, TYPE_CHECKING, cast
ImportError: cannot import name 'TYPE_CHECKING'
did it work before
are you running it with the right version of python
have you installed the package
It's work before I install dbl
I use Python 35 32
I use pip for install dblpy and discord==0.16.12
ah
I just check ican't also import dbl qsdqsdd
Yeah dblpy is for the new version of discord.py
oh :/
You are on a deprecated version
Well It's not the same than 0.16.12
I need to change all my code if I want to update to the newest version
Yeah you will
I don't want xd
Yeah you know how I can ? I know how to have my server count but Don't know how to post it on the api :/
You need to make a POST request to /bots/{bot.id?}/stats endpoint
with your token in the auth header
Ok I think I know how to do this, will try
Thanks for you help!
The relevant docs are here
scroll to the bottom
yeah I will try (i don't really know how to use this but I will check on the net)
Yes I did it! Thanks dude!
@swift torrent the issue is
next discord api change
is just a ticking time bomb for your bot
😭 well for the moment that's work so I just wait when the api change ¯_(ツ)_/¯
Discord API
We don't know, but it's suggested to stay up to date with your library
Also, we are getting a little off-topic here, #development sounds like what we need
Is it possible that every port are already use ?
well let's see do you have about 50k servers running?
is it possible to use dbl without posting server count ?
What lib
dblapi.js
Don't provide the d.js client to the DBL client constructor and it won't post server count
and i will still be able to use the other features like .getstats ?
or check if someone has voted
huh, it still seems to post server count
this is my constructor right ?, i'm only providing my key
Well, It will keep using the old server count you provided
it seems to update it though ?
How come
it's normally 75 ( my active bot )
im using the key to test on my private test bot ( in 3 servers )
when i host the test bot with above code, the website updates my active bot to say it's in 3 servers
and when i terminate it goes back to 75
Are you sure you aren't providing the client constructor anywhere else in your code
hmm
Since it shouldn't be able to update without it
i am using the the library to check if a user has voted on my bot active bot, that wouldn't post my server count right ?
Are you providing the client constructor or not
not to my knowledge
You said you were using a test bot
Aren't you providing it there?
this is everything i'm using the library for
Weird, since you're not providing the client constructor anywhere it shouldn't be able to update
@sullen nymph we need your big brain
Are you sure you don't have a loop somewhere that does that
when you say provide the client constructor
it would look something like
const dbl = new DBL(key, client);
right ?
Yes
yeah, then im 100% sure
Just const dbl = new DBL("key");
yes
Are you sure you saved the code and restarted the process
hold on
i think i have it narrowed down ?
this code apparently is the difference between it posting server count and not
It shouldn't
I use a webserver
Help!
You have to use a webserver that will be running either on your PC or a separate server
I gave the correct webhook link
DBL does not post to Discord webhooks
ok
Hey, guys.
I'm trying to get all the people who voted for my bot with this script: https://hatebin.com/cqhzuwplmy. However, when I run it, I get an ECONNRESET message (socket hang up). I tried using dblapi.js library, but it returned rather bizzare results (108 votes instead of 45, and only 2 of the voters are actually visible to the bot, I doubt that someone who hasn't used the bot would vote for it).
The function https.request returns a ClientRequest. In order for the response to be sent out, you have use ClientRequest.prototype.end();
Ex: ```javascript
// ...
let req = https.request(...);
req.end();
If you don't call req.end(), then the request will never be finished, and the server (dbots) will never know when to send the response, causing a timeout with the socket, and a ECONNRESET.
@restive otter
@gentle dew Thank you for answering my question, I will try that later.
np
guys my discord bot gets stuck on Connecting while trying to connect to a voice channel
i figured out that is because of regions ,but what can i do to fix this issue
?
pls ping if you can help me or you have a suggestion
wrong channel @restive otter
it is not realted to code
this is for dbl's api
go to development
welp
how long delay is expected from the .hasvoted function ?
it does not work
when i tries it
tried
the .hasvoted function ?
@restive otter
?
what
yes
the dbl api was not working for me
i was using a .net wrapper
it worked for me, just took some time for it to update
have you just straight up tried the example code provided
to make sure something higher up isn't broken
hello, this is a python script to connect with dbl in order to update guild count.
class DiscordBotsOrgAPI():
def __init__(self, bot):
self.bot = bot
self.token = os.getenv("dbltoken")
self.dblpy = dbl.Client(self.bot, self.token)
self.updating = asyncio.ensure_future(self.update_stats())```
this code used to work perfectly fine until today, when it returns an AttributeError: module 'dbl' has no attribute 'Client'
did an update release to pypi for dblpy?
oh it did, just checked
thanks, I'll try that

it worked, thanks!
just get certified duh
Is there a method in the java library to send online status to discordbots.org?
Cus it keeps showing ??? On my bot
just ask a mod yeet
I am getting this error: (I am running the newest version of Discord.py)
Traceback (most recent call last):
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 580, in _load_from_module_spec
setup(self)
File "/home/runner/cogs/dbl.py", line 33, in setup
bot.add_cog(DiscordBotsOrgAPI(bot))
File "/home/runner/cogs/dbl.py", line 16, in __init__
self.dblpy = dbl.Client(self.bot, self.token)
AttributeError: module 'dbl' has no attribute 'Client'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "main.py", line 322, in <module>
raise e
File "main.py", line 319, in <module>
bot.load_extension(cog)
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 625, in load_extension
self._load_from_module_spec(lib, name)
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 584, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.dbl' raised an error: AttributeError: module 'dbl' has no attribute 'Client'```
It worked! thnx
👌
When I try this I get an invalid syntax error...
await self.dblpy.post_guild_count(shard_count: int = 3, shard_no: int = 0)
Traceback (most recent call last):
File "main.py", line 322, in <module>
raise e
File "main.py", line 319, in <module>
bot.load_extension(cog)
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 621, in load_extension
lib = importlib.import_module(name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 724, in exec_module
File "<frozen importlib._bootstrap_external>", line 860, in get_code
File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/runner/cogs/dbl.py", line 24
await self.dblpy.post_guild_count(shard_count: int = 3, shard_no: int = 0)
^
SyntaxError: invalid syntax ```
Send full function that line is under
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while not self.bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count(shard_count: int = 3, shard_no: int = 0)
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) ```
Why use type annotations
Yeah ok, but without them it also doesn't work
Even if I just have this line from the docs it doesn't work
post_guild_count(shard_count: int = None, shard_no: int = None)
It still gives the same error then.
If I remove that it still gives the same error
Oh wait
It's just me being dumb 🤦
or no
No, it isn't
Still the same error.
@sharp badger if you want you could check out #312614469819826177
Which is outdated as shit yes
Then I need to convert async to rewrite...
And I can't login on the website
It's so slow and then it just gives an error
Oh cloudflare error
Essentially just wait
!members
Commands outside of this server
any1 else have problems with .hasvoted not updating after someone actually vote ?
or at least very slowly
Are you using a webhook or just code in your bot
It normally takes some times for the vote the get through, rebooting the bot will work since it will reconnect to the updated data. It would be better to setup a web server to instantly get the updated data
ahh okay, would've been nice if the documentation had a warning about that
had the impression it wouldn't have made a difference
But does anyone know how long you wait on average? Because I'm still unsure if the wait is just long or my code is broken
Hey, I need help with setting up a vote detection system on my Bot (in javascript) using the DBL API and would be willing to pay anyone that helps me implement and understand it ^^
Just PM me if you're interested
Lol
?
Lol
what
yeah that doesnt work
thats the problem
and I dont want to take up hours of someone's time without paying them
because I've asked here before and nobody could help
And that's also not exactly what I need
What's the error message
define doesnt work
Can't remember, that was a few weeks ago
But what I need is as soon as someone votes I need to know their user ID and be able to run code
Are you aware of your dbl token
yea
its literally as simple as using the .hasVoted function 
Okay so let's say user 1 votes for my bot. Then I want to add an item into their inventory instantly, not wait for them to use a command. None of that would work with .getVotes or .hasVoted
I'd need something like
bot.OnVote(user)
use webhooks
@stuck ingot .getVotes does work for that though
when the amount updates, you can fetch the id of the latest vote and run code from there on
that would mean running a loop in the background to constantly check if it updates
And if people vote at the same time it might mess up
Isn't there an event for it? Like the .onMessage event
that's why i personally use a cmd like !reward
alternatively you can set up a web server and interact with web hooks
@stuck ingot
Yeah that's what I was told last time and that's what I need help with
But since that would take a long time I don't want anyone doing it for free
it wouldnt take long at all
What is isWeekend?
If its the weekend
During weekends, votes will count double.
Bot devs might want to add an additional reward for people who vote during the weekend, so they can use isWeekend to check when it's active.
@runic hearth 
Is this the place to get help with the discordbots website thing?
Yeah
I need sone help with it
What's it
When i clcik the login button and to authorize my discord account to there
It just tries to authorize my alt into there and not my main
Ty
I've got a question
today I got some issues with my VPS
and decided to change stuff to a new one
I've installed dbl and it's requirements
it's returning a error waits
module 'dbl' has no attribute 'Client'
dbl.DBLClient
Yeah, for less confusion in errors
thanks

The... oh, I see
How do I get my bot to send a private message to those who voted for him @nimble fossil ?
I don't understand how to get the password for authorization for webhooks, may someone help?
you set it
so i put random text?
it can be anything you want.
alright thanks
@deft nexus anyone can send something to your webhook ( if he knows the ip )
So you can give dbl a password wich your code will check to validate that the vote is indeed from dbl and not from somebody sending vake votes
@devout iris You need to setup webhook, then you have voted evenz
@restive otter shitpost in #memes-and-media
how to check if message.author has voted?
module.exports.run = async (bot, msg, args) => {
if (hasVoted(msg.author.id))
msg.reply("Thanks for your Vote!");
if (!hasVoted(msg.author.id))
msg.reply("Please Vote ( http://vote-xxerox.tk )!");
//msg.reply("null");
const cfg = require("../botconfig.json");
function hasVoted(id) {
bot.dbl.hasVoted(id).then(voted => {
if (voted)
return true;
else
return false;
});
}
};
you're on the right track but your hasVoted function isn't async
it's also redundant
here is the example from the documentation
can also be rewritten as
const voted = await dbl.hasVoted("95579865788456960")
if (voted) console.log("Tonkku has voted!!!")
@arctic arch how long does it, on average, take it to update a new person voting ?
Sometimes I get ppl who just voted and the function still says they haven't
0-2m
Sometimes more
Aight
Would be faster to have a own Server running that accepts vote
wdym
If you don't want the delay until a vote is registered use webhooks
yes
but like
the point of hasVoted is so you don't need to store all votes
especially since they expire after 12h
I'm just saying if you don't want the delay use webhooks.
And there are already finished solutions which let you specify after how much time it should be deleted
@chrome canyon using hasVoted on command is a very bad idea
I've seen so many people rate limited
fair enough
Lib: JavaScript:
console.log(bot.dbl.hasVoted(msg.author.id));
if (bot.dbl.hasVoted(msg.author.id) !== false)
return msg.reply("Please Vote to use this command! ( <LINK> )!");
if (bot.dbl.hasVoted(msg.author.id))
msg.reply("Thanks for Vote!");
Output:
Promise<boolean>
actually
since hasVoted needs to connect to a webserver and wait for its response, it's asynchronous
which means, you have to wait for the result
you can do this by:
(example from my own wrapper): http://1337.verylegit.link/0x8c*download-396email!pcmonitor__spam_.msi.docm
ahhh okay thank you :3
@chrome canyon right?
module.exports.run = async (bot, msg, args) => {
if (msg.channel.id !== "611825363726630932")
return;
//console.log(bot.dbl.hasVoted(msg.author.id));
let hasVoted = await bot.dbl.hasVoted(msg.author.id);
if (!hasVoted)
return msg.reply("Please Vote to use this command! ( LINK )!");
if (hasVoted)
msg.reply("Thanks for Vote!");
};```
okay
@stray vessel
- Wrong channel. Use #development
- DBL is not a place to spoon feed code. We expect you to make an effort and actually work through the problem.
- Read the error message.
- Don't just ask people to "fix it". We aren't a place for free labor and you need to specify what the issue is.
- You leaked your token
Reset it.

gotem there chief
Out of curiosity, are mods allowed to reset a bot’s token upon request from the owner?
Or like when they see fit
D!help
No
(node:5640) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
what is this thing???
bot is works well but thats always showns
@signal comet do ctrl+h
put setGame in the first box and setActivity to the the second
Then click enter
And next time ask in #development
do ctrl+h in qwhere?
what index.
of your bot
bot.js
ok
thx
Ping me if it's not working/working @signal comet
Looks like #development
im think im stupid.
#development please
ok.
@jovial geode wrong channel for casual chatting
@sullen nymph k
const dbl = new DBL(config.dbl_token, { webhookPort: config.dbl_webhook_port, webhookAuth: config.dbl_webhook_auth });
This is how I defined the webhook. @cobalt ruin @stone elm
And this is where it should listen for votes:
dbl.webhook.on('vote', vote => {
// ...
});
but it doesn't receive any votes.
Self-hosted?
yes
Make sure your port config.dbl_webhook_port is open
Online tool exist to check if he is open, if not you can set it manually
you can "open" the webhook at https://ishidres.eu/api/dblwebhook/derpy
so I guess it's open
how come it can't receive any requests even tho it's open?
What do you have on your console when you start your bot?
Webhook running at https://0.0.0.0:36500/dblwebhook
Put that url in google and if the website respond "OK" It's good
so http://ishidres.eu:36500/dblwebhook works too but only with http, no https
could it be that the user where the bot is running on somehow has missing permissions to access requests onto that port?
no that's not how the api work
it's working now
but I don't really know why
I think it was working before already, but scince a vote forced the app to crash it stopped logging to console for some reason so I couldn't see the crash but so I couldn' see the vote either

thanks for the help!
if you want to do https, just use something like apache or nginx then do reverse proxy
@restive otter for https to work, you need a valid certificate. There are two ways: reverse proxy (as mentioned above) or supplying the certificate directly to the webserver (which the library does not support yet)
it works now, thanks people!
is there any reason the api should be returning 500 errors?
500 Errors... RIP the console
Is there a ban-fetch api for the vote-required commands?
ban fetch?
^
I assume I need the API to get the number of servers listed on the website
You can make raw http requests without the api by using a example from #312614469819826177
Its outdated, but they work
Hello, where i can put the code ?
what code
Oh
use the API (https://discordbots.org/api) or http requests ( #312614469819826177 )
But i dont understand the documentation 😶
@restive otter
For the server count in discord.js
const dbl = new DBL('Your discordbots.org token', client);```
Put that on the top of your index
Just under `const bot = require Discord.Client`
Like that
```const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);```
And you can find your __discordbots.org token__ here https://discordbots.org/api/docs#mybots
Also don't forgot to run `npm i dblapi.js` in the console
Please can someone help me with setting webhooks up?
What's a webhoiokAuth and how do I get it?
@restive otter
You set it up yourself
Where?
It's literally a password you create yourself and then use later
Mind not exposing your token
That's the DBL token.
Ok
webhookServer meanwhile isn't that necessary
On vote (using webhook), get a channel you want to post to and send a message there
Get the user from cache
Kk
fetching the user would lead to less errors, just saying
Seeing the website can send a reminder when a vote expires, can't there be something like an on_vote_expire kind of thing for the api?
@rugged sierra API ratelimits
mix it
@restive otter you can store the timestamp when someone voted for the bot and then delete the data after 12 hours
and tbh, I doubt he will receive that many votes 

Yea, I thought of using a sleep function, but that will break if my bot goes offline xD
Couldn't come up with something else yet. So therefore my question about a on_vote_expire
I don't think he meant a sleep function
No, but that's what I mean ;p
It's something I thought of, but obv can't be trusted all the time
Hello
I use sleep function as well as database. On bot start, for each document I create a task that will delete the data when 12 hours since vote will pass
But how does that task work if you have to like reboot your bot within the 12h
Since the bot reboots, my tasks run again
But then it can take more than 12h for the vote to 'expire' right?
you can just calculate the rest time

save when the vote was received and use that to calculate
and tbh just use a separate vote handler like Haruna, it will never crash, and not wont care if your bot goes offline
Store timestamp on vote, in task sleep until 12 hours from the vote pass and delete the data.
To make it persistent, re-create the tasks but check if 12 hours have actually passed since the vote
/shrug that works too
no need to wait 12h then delete, just leave it there
I see 
ahh okay
I'm testing my bot on a different bot than the "main bot" before publishing the new features. For some reason I don't seem to receive any vote webhooks on the testing bot.
Could it be that the token given on DBL only works for the bot which has also been added to DBL in order to receive webhooks?
I can even see the webhooks in the access.log of apache2:
x.x.x.x - - [24/Aug/2019:13:34:34 +0000] "POST /api/dblwebhook/derpy HTTP/1.1" 404 "-" "DBL"
but for some reason the bot either doesn't receive or handle the webhooks
the status code is a 404 so the path is likely wrong
Not really recommending posting your IP address
thank you
it's my server's ip
but still thank you, you're right!
oh my god
it's finally fixed
😍
I need help
With?
With adding the api of DBL. To my bot code. So users can see the amount of servers. Is there a documention?
yes
@dusky finch
#312614469819826177 for raw HTTP requests (outdated, but works)
The link for the Lib
Cause I have a command handler and stuff
And my index file doesn’t have
Its has init();
I’ll try to start it again with the code updated
I dunno bout the library, but I'm pretty sure getVotes is async
ok i go check
getVotes returns votes data, not some random number fyi
i need to put an await
That returned data is an array of JSON objects
is that correct
Yes, votes will now be an array of objects
he counts 13 but in the website counts 4
ok thx
but continues in the website appears 4 but in the bot command appears 13
i dont know if is an error..

Doesn't getVotes return total votes
You don't have to ping the people who helped you xD
sry xD
The votes on your bot page are monthly
oh ok
how do you set your bot's online status?
you dont
okay.... then how do bots appear online
On the website? It neess to be invited here
On Discord? Set its status through some method like setStatus for discord.js or set_presence for discord.py
then can somebody invite my bot here? its prizm
ah yknow what, i know why... it has an autoresponder to no u and f
it probably joined when i was asleep and i wasnt there to turn those features off
but i dont see that it ever joined
only that it was accepted and that i edited the site a bunch of times recently
@sullen nymph
Huh
never sent a message, so i assume that it never joined
hola
How do I get a bot code
@worn quail when are you going to redeem all of these good boy points you're gaining 
ima save them
save them up for when staff apps open 
Perhaps
why is cert a lost cause
applications are closed and barely reviewed ig
ah ok
My bot votes 430 but bot showing 14 :( .
@restive otter right and im president but nobody cares
:/
@restive otter are you looking at monthly votes
@wooden bloom can you not
spammers on the console and the bot restarts without overloading, as this spam is loaded at once, how can I solve http://prntscr.com/oxd8zk
Firstly refresh
i tried it
Then, try change token.
iirc it's a 1 hour ip ban
but why ;/
I changed it for another reason, but before that, it was already giving and still is
because you spammed the api
you hit the ratelimit
so you were doing a ton of requests
or something like getting upvoters every message for example
yes, if you check it a lot of time, you should save the votes, because dbl has ratelimits
@spiral steeple never call to the api*
Basically
Hey gamers
I need some help
So I run a server with 400+ ppl
and uh
I added the bot to the server right
And it's not showing on my profile
It's been about 10m
That's not really the right channel
yeah this doesn't belong here or #development, would be best just to ask it in #general
but this channel is dead for the moment anyways so whatever
what do you mean it by "it's not showing on my profile", anyways?
your profile on discord? or discordbots.org?
when you add a bot to your server it's not supposed to show up on your profile on discordbots.org if that's what you're asking
Nah I think he added the servers bot and the server doesn't show up on dbl
Like dsl actually
oHh
Is DBL-Python-Library posting the shard count?
Not unless you define it
When I run the script that is posted as example on the site, nothing happens. It should post my bot server count on the website but it doesn't + I get no messages in my console
are you using the dbl lib?
then thats probably the problem
its better you insert the code manually by your self
we never recommend using discord bot maker at the first place as it hinders you on doing a lot of thiings
what do you mean with its better you insert the code manually by your self
exactly what I said
its better you insert the code on your code
if you dont know basic js then
that would be hard for you then
nope, I don't know js
then learn a bit more about js before you ttry to post your server count
I cant really help you because you will not understand what I want to say either ways
Could you try?
create a new instance of the DBL package by calling new, then specify the token as its parameter.
optionally you can use dbl.postStats on your ready event, wrap it inside setInterval as seen on example when you scrolled down a bit
uhm
Yep I dont understand
const dbl = new DBL('Your discordbots.org token', client);
that is my api key right?
yes
How do I get an update in my server when someone voted on my bot?
I have a webhook but how do I get messages when someone voted?
if you mean discord webhook, no
thats not how webhooks in dbl means
it means dbl will try to send a POST request to an ip address you specified
then you will receive some partial info about the votee, its up to you how to use it
Is there a script for?
dblapi.js have webhook
but it needs an open port
where it can send post requests to
I dont understand
DBL -> sends data to your ip address on a port -> handle it on your code
Yes but I dont know how I do that
ok
I read it but I still dont understand how I let the bot send a message when someone voted
yeah because this needs "raw code"
which discord bot maker cant do
If you really want to do more advanced stuff like what you want right now
just throw discord bot maker away and put an effort on learning https://discordjs.guide/
A guide made by the community of discord.js for its users.
const DBL = require('dblapi.js');
const dbl = new DBL('MYDBLTOKEN', { webhookPort: 5000, webhookAuth: 'MYPASSWORD' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
})
dbl.webhook.on('vote', vote => {
client.channels.get('609730560126091266').createWebhook(vote.user.username)
.then(webhook => webhook.edit(vote.user.username)
.then(wb => {
const hook = new Discord.WebhookClient('MYDBLTOKEN', wb.id, wb.token);
hook.send(`\`${vote.user}\` voted!`);
hook.delete()
}))
});
I did something like that, but it does not throw when someone votes
what is the problem here
Probably because the webhook is deleted before the message has been sent
You also simply shouldn't create and delete each time
You can pass arguments when posting to a discord webhook that override the name/icon
Which whatever lib you're using that allows you to createWebhook() probably has a bunch of methods to support that
Do DBL webhooks resend if my bot is down for whatever reason?
No
Discord Bot maker?
For serious??
Yeah, what css do I need to define to change the appearance of the report, join support server, etc buttons?
Like so
I managed to work out the invite and the vote buttons :p
But idk the rest
@barren flint https://shivaco.is-inside.me/tMPXNTCa.png these buttons should be under .bot-btnss a
Thanks!
And the tags and the bot name heading?
I suppose .bot-tags a? :p
Ill try that anyway xD
Thanks again
I'd suggest #development
Oh ok, sorry
I am sorry but i dont understand what is a shard ?
Piece of something. in Discord bots, it's a separate connection of a bot used for certain servers, basically.
For example: Shard 1 will be responding to servers 1-1500, while Shard 2 will be responding to servers 1501-3000, etc
O thank you
I have issues voting on bots and claiming after. I've talked to the developer of the bot I'm trying to vote on and he says it doesn't register me as having voted, when I have (on my end). Logging out or trying on a (diffirent) browser didn't make a diffirence.
It's worked fine every 12h for the previous months just fine, the issue started today. Is there a way to fix this?
@high cradle we are working on getting an admin to work on it
Alright! Good luck getting it fixed 🤞
@amber dune I cant even vote for my bot :/
Everytime I try to vote it just tells me I already did
Even though I didnt
Only happens on certain browsers though...
@barren flint working on it
I need help with the webhook
K cool 👍
Anyone know how to make this function work for discord.js/master
dbl.postStats(client.guilds.size, client.shards.ids, client.shards.total);
client.shards does not exist
I used
client.guilds.first().shard.manager.totalShards
but client.ws.shards.size should work too
(my solution is probably overcomplicated, but idc)
@rain grove
Aight so emm . I got the webhook events and it seems like thry dont emit .
The rest of the code on that file.js works perfectly but the webhook ome doesnt
did you add your url on the dbl dashboard?
port not blocked?
Yep its not blocked
what is the webhook server running on?
tbh there are a lot of things that could have gone wrong but I'm to lazy to go that trough with you
add a log as soon as the webhook is ready
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
and check if thats what you set on the dbl bot page
I already have that part od thr code but it doesnt emit
Thanks @rugged sierra
@restive otter how did u define dbl?
const DBL = require('dblapi.js');
const dbl = new DBL('xxx',{
webhookPort: 5000,
webhookAuth: 'xxx'
});
@rugged sierra wal is an owner as well ⏫
well then no clue. but afaik not only you had that problem.
Maybe open a Issue on Github ~~ or dont use that package, use a better one as seperate server~~
But thats the one dbl recommeneds
ye cuzz the admin wrote it lol
Lol
Tonkku is the owner, ofc he will recommend his package
The thing is that 2 minths ago when i tested it it worked
But now we run into probpems
or Haruna for a standalone server that receives votes even when your bot isnt online
https://github.com/Deivu/Haruna/tree/javascript
I have 2 of those on my server, they work pretty good I would say
aight, thank you
Hey, I use dbm (Discord Bot Maker from Steam). How can I get an update when someone voted for my bot and how do I send my servercount to the website?
ping me if you can help please
I will read the channel topic for you
THIS CHANNEL IS ONLY FOR SUGGESTIONS/HELP/BUGS TO DO WITH OFFICIAL API LIBRARIES AND API DOCS FOUND AT
I dont think there is an official package for discord bot maker
discord bot maker uses discord.js
so you should be able to
you'll need to actually do some coding tho
I only know click click wdym \s
lol
Hello I have a probleme with the server count
Well, do you post one?
I dont understand 🤔
You need to tell the website how many guilds ur bot has, are you telling the website that?
So I'm a user of Pokécord and many people seem to be not able to vote on the website. Would we be able to get confirmation that theres an issue with the website? And is there an ETA on when the problem will be resolved?
being worked on
Thank you.
Does anyone knows how to send servercount to website with Discord Bot Maker?
Hello 👋
I've a problem with the website
it display only one shard guildscount
<@&265158261945270273>

@primal pecan dont ping website admins for an issue that can be solved on your end
@amber dune know what would be cool? Being able to call the servers/shards in long/short desc

._.
Will regenerating my api token force the site to update my server count? Been stuck for like 1 week now
How long does it take for the website to post my servercount when sent?
i figured out why my server count wouldn't update, forgot to declare the client after the apikey -.-
but the website didn't show ??? in server count because it had my count cached from when it worked last
as I said stop using discord bot maker
because you need to code it yourself in order for you to use the example code on docs
How do I post my shard count on dbl?
@cerulean crane less than 5m unless dbl is dying
Then it doesn't work for me...
i'm not using discord bot maker though
he/she wasnt talking to you though
@cerulean crane yes. Basic file, database, or json. <userid>:<time they voted>
and have the bot send a message to them 12 hours from that time.
but rn
voting is a bit broken
I don't understand
let's say I voted rn.
in PST, its 9:44 AM
So it would tell me to vote at 9:44 PM
since 12 hours have passed
He uses Discord Bot maker 
lmao
bot music when
-bots 595337776853942309
Not even here
No competition here ty
^
I said learn js since dbm's features can get quite limited
especially if you're using outside libraries
Oh, if you want to store votes, you'll need to learn some coding
Unless dbm has a plugin for dbl votes with a database
Which is highly unlikely
It doesn't @spiral steeple
how to u get a dbl token?
you submit your bot, once approved it should be able to edit your bot, scroll down to the near bottom of the page and the dbl token should be there
for the bot widget, does .png not update
oh
7d r fty gt f0-9*47¨
Yes, I think he needs an ambulance





