#topgg-api

1 messages · Page 64 of 1

hoary timber
#

Kk

#

Currently make a own java wrapper that should be better than the official one...

#

For the api

arctic arch
#

@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

restive otter
#

Do I have to have a webhook to know when somebody has just voted for my bot?

sullen nymph
#

Well that's the only way to get votes in real time

restive otter
#

Where can I get the webhook port and password?

sullen nymph
#

Password is set by you and... same for the port chadthonk

restive otter
sullen nymph
#

Webhook being a server running somewhere in this case

restive otter
#

oh, would an Express server work?

sullen nymph
#

Should

#

dblapi.js provides a webhook /shrug

restive otter
#

when I test the webhook, I just get this alert but nothing else to say it was successful or unsuccessful, is this normal?

sullen nymph
#

Make sure your port is open and forwarded

analog iris
#

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

fleet pebble
#

while that may mean youre doing something wrong

restive otter
#

@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...`);
});
weak dock
#

fuck

narrow zenith
muted oar
#

@restive otter Stop spoon feeding my guy

sullen nymph
gilded lake
#
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
restive otter
gilded lake
#

Can you help me ?

narrow geyser
#

@gilded lake

#

sorry misclick

gilded lake
#

yes ?

#

you can't help me ? 😦

narrow geyser
#

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

gilded lake
#

ok so password is my DiscordBotList password ? (I am not english, so I may not understand you very well)

#

@narrow geyser

narrow geyser
#

Yea basically

gilded lake
#
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 ?
narrow geyser
#

I mean you can try, idkr

restive otter
#

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

runic grove
restive otter
#

const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);

#

so this ?

restive otter
#

Hi guys

azure plover
#

Hello

restive otter
topaz wyvern
#

huh

gilded lake
#

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 ?

sullen nymph
#

You need a webserver running, not a Discord webhook

gilded lake
#

how I can find that?

sullen nymph
#

Code one yourself. What's your bot written in?

gilded lake
#

js

#

Using discord.js

sullen nymph
#

dblapi.js has a built-in webhook or you could use express

gilded lake
#

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

ionic flame
#

i dont even recieve ready event's log

#

using same thing as listed on docs with express

gilded lake
#

@ionic flame The dbl api docs is so weird

azure plover
#

They are really weird

#

They're like the picture books of API docs

gilded lake
#

And even for the Port, should I use the Host Port, or my SFTP Port or just a random number ?

runic grove
#

any unused port

gilded lake
#

@runic grove so a random number is ok?

restive otter
#

is it possible to create a custom ActivityType ?

#

or can you only use
PLAYING
STREAMING
LISTENING
WATCHING

sullen nymph
#
  1. Wrong channel
  2. Only the ones Discord provides
restive otter
#

oh my bad, ty

gilded lake
#

When I test my webhook, what should happen?

sullen nymph
#

POST request will be sent to the URL you entered in your bot's Edit section

gilded lake
#

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?

sullen nymph
#

0.0.0.0 needs to be replaced with your IPv4 address

gilded lake
#

I can find it where I host my bot ?

sullen nymph
#

Yes, you can

gilded lake
#

Thank you !

sullen nymph
#

You'll get the POST request to the URL, handle it from there

gilded lake
#

So if I put my URL on google chrome, I should get the POST ? ( I am sorry if I don't understand very well)

sullen nymph
#

You handle all requests in your code

#

Visiting the URL in your browser will only send a GET request to the URL

gilded lake
#

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?
sullen nymph
#

Seems fine to me

gilded lake
#

I can only vote every 12h, I test it tomorrow, hope the best. Thank you for your help

sullen nymph
#

testing is supposed to work with vote event too

gilded lake
#

How I can test vote event ? 😮

sullen nymph
#

Test button in the webhook part in the Edit section

gilded lake
#

Let's test that

#

Nothing happened. No embed set 😦 Can I send you my code uncensored ? I really need help

ionic flame
gilded lake
#

@ionic flame Is this working for you?

ionic flame
#

nope, infact ready event is also not emitted

gilded lake
#

welcome to the group

exotic crag
#

is it normal ?

#

when i want to remind everyday to vote

dawn fjord
#

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.

restive otter
#

@ionic flame make sure your port are open

#

Oh glitch

#

nvm

sudden depot
#

yep ports are big issue tho

open ermine
#

hi

umbral ice
#

bye

worthy marlin
#

-Play kk

ionic flame
#

@restive otter ports are open ig, because express app works

gilded lake
#
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
spiral steeple
#

http comes with node

#

you would need to install express though

humble bison
#

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

gilded lake
#

@humble bison I just read the Docs

#

I need a listener to reward people for voting

#

I stuggle so hard

teal lava
#

I've seen tutorials do that. I am not sure what's the purpose when you can just express

runic grove
#

maybe to expose properties/methods of both a server provided by 'http' and 'express'?

restive otter
#

how i'can create api for login whit account?

#

in my website

spiral steeple
#

this channel is for the dbl api. Use #development for assistance on OAuth2

azure plover
#

Lmao

restive otter
#

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

sullen nymph
#

Webhook

hoary minnow
#

how do you get the timestamp for an upvote? (d.py)

#

I've got everything else I need just not the timestamp

sullen nymph
#

No timestamps unless you are using a webhook and saving the time

hoary minnow
#

alright that's easy enough. how do i set up the webhook?

chrome canyon
#

im not sure the python library has them

worn quail
#

it doesnt

sullen nymph
#

At the time of upvote, on_dbl_vote provided by dblpy will be emitted where you can use datetime.datetime.now()

hoary minnow
#

oh that's good then. saves me needing to use a third party lib

sullen nymph
#

Just make sure you set up the webhook. The README on Github should be somewhat helpful

hoary minnow
#

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?

sullen nymph
#

Ehh

#

Give me a minute

#

The data you get in get_bot_upvotes is different from the one you get in on_dbl_vote

hoary minnow
#

oh yeah I see. alrighty i understand now. thanks for the help partynom

hoary minnow
#

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

ornate badger
#

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.

sullen nymph
#

@hoary minnow Can you be sure it's forwarded?

hoary minnow
sullen nymph
hoary minnow
#

pretty much

sullen nymph
#

Welp, that's where I'm honestly out of clues

#

Google might help however, sorry

hoary minnow
#

nah it's totally okay. i can post my code if it would be of any value

sullen nymph
#

Not really sure if that would help, but worth a try

hoary minnow
sullen nymph
#

Looks fine to me really

ornate badger
#

Hello?

ornate badger
#

Need some help. How do I know if my server is on the list?

restive otter
#

@ornate badger

#

If you doesn't have the logo "not published" on the server it's good

daring cove
#

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

dense basalt
#

If you're using the DBL API it should start directly

daring cove
#

ok..

#

ok no, i use the api example and nothing appear

hoary minnow
#

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

hoary minnow
#

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".

daring cove
#

@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)

daring cove
#

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

chrome canyon
#

well ig you're not supposed to copy and paste code

#

but like actually understand it

daring cove
#

i understand it but

swift torrent
#

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 ?

chrome canyon
#

how would they get the token of your discord app

swift torrent
#

For me the libraries don't work so xd

chrome canyon
#

oy

swift torrent
#

qdqdsq

chrome canyon
#

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

hearty dagger
#

I know python

#

@swift torrent what's ur error

swift torrent
#

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'
hearty dagger
#

did it work before

#

are you running it with the right version of python

#

have you installed the package

swift torrent
#

It's work before I install dbl
I use Python 35 32
I use pip for install dblpy and discord==0.16.12

hearty dagger
#

ah

swift torrent
#

I just check ican't also import dbl qsdqsdd

hearty dagger
swift torrent
#

oh :/

hearty dagger
#

You are on a deprecated version

swift torrent
#

yeah I know

#

But I hate the newest xd

hearty dagger
#

Why

#

It is better

swift torrent
#

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

hearty dagger
#

Yeah you will

swift torrent
#

I don't want xd

hearty dagger
#

Well then dblpy won't work for you

#

You'll have to make the api requests manually

swift torrent
#

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 :/

hearty dagger
#

You need to make a POST request to /bots/{bot.id?}/stats endpoint

#

with your token in the auth header

swift torrent
#

Ok I think I know how to do this, will try
Thanks for you help!

hearty dagger
#

The relevant docs are here

#

scroll to the bottom

swift torrent
#

yeah I will try (i don't really know how to use this but I will check on the net)

chrome canyon
#

@swift torrent the issue is

#

next discord api change

#

is just a ticking time bomb for your bot

swift torrent
#

😭 well for the moment that's work so I just wait when the api change ¯_(ツ)_/¯

chrome canyon
#

why not rewrite now

#

instead of being under pressure

restive otter
#

Which api change O_O

#

Oh the dbl api ? GWmythsBlobGlare

sullen nymph
#

Discord API

restive otter
#

LOL

#

Omg what's it gonna change ;o

sullen nymph
#

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

worn quail
#

wait do d.py async is gonna be completely unusable?

#

cri

gilded lake
#

Is it possible that every port are already use ?

spiral steeple
#

well let's see do you have about 50k servers running?

restive otter
#

is it possible to use dbl without posting server count ?

sullen nymph
#

What lib

restive otter
#

dblapi.js

sullen nymph
#

Don't provide the d.js client to the DBL client constructor and it won't post server count

restive otter
#

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

dense basalt
#

Well, It will keep using the old server count you provided

restive otter
#

it seems to update it though ?

sullen nymph
#

How come

restive otter
#

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

dense basalt
#

Are you sure you aren't providing the client constructor anywhere else in your code

restive otter
#

hmm

dense basalt
#

Since it shouldn't be able to update without it

restive otter
#

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 ?

dense basalt
#

Are you providing the client constructor or not

restive otter
#

not to my knowledge

dense basalt
#

You said you were using a test bot

restive otter
dense basalt
#

Aren't you providing it there?

restive otter
#

this is everything i'm using the library for

dense basalt
#

Weird, since you're not providing the client constructor anywhere it shouldn't be able to update

#

@sullen nymph we need your big brain

sullen nymph
#

Are you sure you don't have a loop somewhere that does that

restive otter
#

when you say provide the client constructor

#

it would look something like

#

const dbl = new DBL(key, client);

#

right ?

dense basalt
#

Yes

restive otter
#

yeah, then im 100% sure

dense basalt
#

Or whatever your client is variabled at

#

Some people use bot or app

restive otter
#

hmm lemme try removing everything else

#

and just have that

#

just to be 101% sure

dense basalt
#

Just const dbl = new DBL("key");

restive otter
#

yes

dense basalt
#

Are you sure you saved the code and restarted the process

restive otter
#

hold on

#

i think i have it narrowed down ?

#

this code apparently is the difference between it posting server count and not

dense basalt
#

It shouldn't

restive otter
#

maybe

#

but when i comment it out

#

it doesn't post my server count

#

try yourself

dense basalt
#

I use a webserver

scenic sable
sullen nymph
#

You have to use a webserver that will be running either on your PC or a separate server

scenic sable
#

I gave the correct webhook link

sullen nymph
#

DBL does not post to Discord webhooks

scenic sable
#

ok

restive otter
#

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).

gentle dew
#

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
restive otter
#

@gentle dew Thank you for answering my question, I will try that later.

gentle dew
#

np

restive otter
#

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

humble bison
#

wrong channel @restive otter

restive otter
#

what channel then ?

#

@humble bison

#

it is a problem with dsicord

#

discord api

humble bison
restive otter
#

it is not realted to code

humble bison
#

this is for dbl's api

restive otter
#

related

#

lol

humble bison
#

go to development

sullen nymph
restive otter
#

welp

#

how long delay is expected from the .hasvoted function ?

#

it does not work

#

when i tries it

#

tried

restive otter
#

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

buoyant sandal
#

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

sullen nymph
#

I forgot to push the changelog

#

It is DBLClientnow

#

for less confusion in errors

buoyant sandal
#

thanks, I'll try that

sullen nymph
buoyant sandal
#

it worked, thanks!

sullen nymph
#

👌

#

yw

waxen lantern
#

Where can use commands

#

RIP

#

:(

worn quail
#

Not here.

#

Bots are unusable in this server until further notice

chrome canyon
#

just get certified duh

prisma hemlock
#

Is there a method in the java library to send online status to discordbots.org?

#

Cus it keeps showing ??? On my bot

chrome canyon
#

has to be on this server

#

for online status

prisma hemlock
#

damn

#

Do I have to resubmit the bot to have it readded here?

chrome canyon
#

just ask a mod yeet

sharp badger
#

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'```
sullen nymph
#

dbl.DBLClient now

sharp badger
#

It worked! thnx

sullen nymph
#

👌

sharp badger
#

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 ```
sullen nymph
#

Send full function that line is under

sharp badger
#
    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) ```
sullen nymph
#

Why use type annotations

sharp badger
#

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.

sullen nymph
#

Not that

#

The : int

sharp badger
#

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.

sullen nymph
sharp badger
#

Okay, now it works.

#

thnx

sullen nymph
#

Yw

halcyon valve
sullen nymph
#

Which is outdated as shit yes

sharp badger
#

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

sullen nymph
#

Essentially just wait

feral escarp
#

!members

sullen nymph
#

Commands outside of this server

restive otter
#

any1 else have problems with .hasvoted not updating after someone actually vote ?

#

or at least very slowly

dense basalt
#

Are you using a webhook or just code in your bot

restive otter
#

weird thing is, it updates after i rehost the bot

#

just code

dense basalt
#

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

restive otter
#

ahh okay, would've been nice if the documentation had a warning about that

#

had the impression it wouldn't have made a difference

restive otter
#

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

stuck ingot
#

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

azure plover
#

Lol

stuck ingot
#

?

restive otter
#

Lol

stuck ingot
#

what

stuck ingot
#

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

restive otter
#

What's the error message

runic grove
#

define doesnt work

stuck ingot
#

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

restive otter
#

Are you aware of your dbl token

stuck ingot
#

yea

restive otter
#

Use .getVotes()

#

And get user.id from the most recent vote

runic grove
#

its literally as simple as using the .hasVoted function Thonk

stuck ingot
#

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)

runic grove
#

use webhooks

restive otter
#

@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

stuck ingot
#

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

restive otter
#

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

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

runic grove
#

it wouldnt take long at all

runic hearth
#

What is isWeekend?

restive otter
#

If its the weekend

polar mirage
#

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 IrisWink

runic hearth
#

OwO

#

That's great. Thanks

modern stump
#

Is this the place to get help with the discordbots website thing?

sullen nymph
#

Yeah

modern stump
#

I need sone help with it

sullen nymph
#

What's it

modern stump
#

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

modern stump
#

Ty

limber hawk
#

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'

sullen nymph
#

dbl.DBLClient

limber hawk
#

oh it changed?

#

imma try

sullen nymph
#

Yeah, for less confusion in errors

limber hawk
#

thanks

sullen nymph
limber hawk
#

api reference is outdated

#

in python category at least

sullen nymph
#

The... oh, I see

devout iris
#

How do I get my bot to send a private message to those who voted for him @nimble fossil ?

deft nexus
#

I don't understand how to get the password for authorization for webhooks, may someone help?

spiral steeple
#

you set it

deft nexus
#

so i put random text?

spiral steeple
#

it can be anything you want.

deft nexus
#

alright thanks

sudden depot
#

@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

grand blade
runic pewter
#

for what u using webhook?

thick adder
#

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;
        });
    }
};
arctic arch
#

you're on the right track but your hasVoted function isn't async

#

it's also redundant

#

can also be rewritten as

const voted = await dbl.hasVoted("95579865788456960")
if (voted) console.log("Tonkku has voted!!!")
thick adder
#

okay

#

thank you!

restive otter
#

@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

rugged sierra
#

Would be faster to have a own Server running that accepts vote

chrome canyon
#

wdym

rugged sierra
#

If you don't want the delay until a vote is registered use webhooks

chrome canyon
#

yes

#

but like

#

the point of hasVoted is so you don't need to store all votes

#

especially since they expire after 12h

rugged sierra
#

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

spiral steeple
#

@chrome canyon using hasVoted on command is a very bad idea

#

I've seen so many people rate limited

chrome canyon
#

fair enough

thick adder
#

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!");
sudden rampart
#

yes

#

because it returns a promise

thick adder
#

i think boolean

#

lol

chrome canyon
#

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:

thick adder
#

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!");
};```
restive otter
#

Why not just use the example provided in the documentation

#

/edit

chrome canyon
#

@thick adder looks good

#

:)

thick adder
#

okay

chrome canyon
#

might wanna use const

#

instead of let

#

since the variable is constant

amber dune
#

@stray vessel

  1. Wrong channel. Use #development
  2. DBL is not a place to spoon feed code. We expect you to make an effort and actually work through the problem.
  3. Read the error message.
  4. 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.
  5. You leaked your token facepalm Reset it.
worn quail
chrome canyon
#

gotem there chief

azure plover
#

Out of curiosity, are mods allowed to reset a bot’s token upon request from the owner?

#

Or like when they see fit

restive otter
#

D!help

azure plover
#

No

signal comet
#

(node:5640) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
what is this thing???

#

bot is works well but thats always showns

restive otter
#

@signal comet do ctrl+h

#

put setGame in the first box and setActivity to the the second

#

Then click enter

signal comet
#

do ctrl+h in qwhere?

restive otter
#

in your index

#

@signal comet

signal comet
#

what index.

restive otter
#

of your bot

signal comet
#

im have these

restive otter
#

bot.js

signal comet
#

ok

restive otter
#

Or events

#

ready if you have one

signal comet
#

thx

restive otter
#

Ping me if it's not working/working @signal comet

sullen nymph
signal comet
#

im think im stupid.

jovial geode
#

sa

#

oh ım sorry

#

ı will say hi

signal comet
#

doing ctrl+h in everything 😦

#

bc nothing appears

sullen nymph
signal comet
#

ok.

sullen nymph
#

@jovial geode wrong channel for casual chatting

jovial geode
#

@sullen nymph k

restive otter
#
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

#

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

restive otter
#

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!

clever rock
#

if you want to do https, just use something like apache or nginx then do reverse proxy

arctic arch
#

@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)

restive otter
#

it works now, thanks people!

slender void
#

is there any reason the api should be returning 500 errors?

restive otter
#

500 errors are pretty self-explanatory

#

5xx means not your fault

umbral ice
#

500 Errors... RIP the console

restive otter
#

Is there a ban-fetch api for the vote-required commands?

restive otter
#

ban fetch?

azure plover
#

^

strange summit
#

I assume I need the API to get the number of servers listed on the website

worn quail
#

Its outdated, but they work

restive otter
#

Hello, where i can put the code ?

worn quail
#

what code

restive otter
#

For the server count

worn quail
#

Oh

restive otter
#

But i dont understand the documentation 😶

worn quail
#

then understand it

restive otter
#

@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
eternal charm
#

Please can someone help me with setting webhooks up?

#

What's a webhoiokAuth and how do I get it?

#

@restive otter

sullen nymph
#

You set it up yourself

eternal charm
#

Where?

sullen nymph
#

It's literally a password you create yourself and then use later

eternal charm
#

I got this:

#

What do I put in webhookServer

sullen nymph
#

Mind not exposing your token

eternal charm
#

That's the DBL token.

sullen nymph
#

And why post it in a public channel

#

I suggest you regenerate it instantly

eternal charm
#

Ok

sullen nymph
#

webhookServer meanwhile isn't that necessary

eternal charm
#

Ok

#

How do I send a message when someone votes?

sullen nymph
#

On vote (using webhook), get a channel you want to post to and send a message there

eternal charm
#

Kk

#

How do I get the username of a user that votedd instead of the ID?

sullen nymph
#

Get the user from cache

eternal charm
#

Kk

rugged sierra
#

fetching the user would lead to less errors, just saying

restive otter
#

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?

sullen nymph
#

@rugged sierra API ratelimits

rugged sierra
#

mix it

sullen nymph
#

@restive otter you can store the timestamp when someone voted for the bot and then delete the data after 12 hours

rugged sierra
#

and tbh, I doubt he will receive that many votes mmLul

sullen nymph
restive otter
#

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

rugged sierra
#

I don't think he meant a sleep function

restive otter
#

No, but that's what I mean ;p

#

It's something I thought of, but obv can't be trusted all the time

grand salmon
#

Hello

sullen nymph
#

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

rugged sierra
restive otter
#

But how does that task work if you have to like reboot your bot within the 12h

sullen nymph
#

Since the bot reboots, my tasks run again

restive otter
#

But then it can take more than 12h for the vote to 'expire' right?

rugged sierra
#

you can just calculate the rest time

restive otter
rugged sierra
#

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

sullen nymph
#

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

sudden rampart
#

i just store timestamps to a database on vote

#

and check the difference

sullen nymph
#

/shrug that works too

sudden rampart
#

no need to wait 12h then delete, just leave it there

restive otter
#

I see 6_ThinkingHyper

thick adder
#

i don't know whats wrong..

dawn fjord
#

We cache webpages

#

The number on the site isn't always accurate

thick adder
#

ahh okay

coarse wagon
#

;-;

#

gl

restive otter
#

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?

restive otter
#

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

arctic arch
#

the status code is a 404 so the path is likely wrong

restive otter
#

wtf...

#

if I use the direct ip address

#

it works

#

why???

sullen nymph
#

Not really recommending posting your IP address

restive otter
#

thank you

#

it's my server's ip

#

but still thank you, you're right!

#

oh my god

#

it's finally fixed

#

😍

dusky finch
#

I need help

worn quail
#

With?

dusky finch
#

With adding the api of DBL. To my bot code. So users can see the amount of servers. Is there a documention?

chrome canyon
#

yes

#

@dusky finch

dusky finch
#

Okie

#

So how

#

I uhhhh

worn quail
dusky finch
#

So @worn quail

#

Do I need to make a new event file this

#

?

worn quail
#

No

#

you can put it into your code

dusky finch
#

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

soft jackal
#

How i do the .get votes on JS i can't

rugged sierra
#

I dunno bout the library, but I'm pretty sure getVotes is async

soft jackal
#

ok i go check

sullen nymph
#

getVotes returns votes data, not some random number fyi

soft jackal
#

i need to put an await

sullen nymph
#

That returned data is an array of JSON objects

soft jackal
rugged sierra
#

Yes, votes will now be an array of objects

soft jackal
#

he counts 13 but in the website counts 4

rugged sierra
#

votes is an array of objects

#

use .length to get the actual vote count

soft jackal
#

ok thx

#

but continues in the website appears 4 but in the bot command appears 13

#

i dont know if is an error..

rugged sierra
soft jackal
#

But anyway thx @rugged sierra

#

and @sullen nymph

sullen nymph
#

Doesn't getVotes return total votes

rugged sierra
#

You don't have to ping the people who helped you xD

soft jackal
#

sry xD

sullen nymph
#

The votes on your bot page are monthly

soft jackal
#

oh ok

spiral steeple
tropic hill
#

how do you set your bot's online status?

runic grove
#

you dont

tropic hill
#

okay.... then how do bots appear online

sullen nymph
#

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

tropic hill
#

then can somebody invite my bot here? its prizm

sullen nymph
#

It's been kicked for a reason. Search your bot's ID in #mod-logs to find out why

tropic hill
#

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

sullen nymph
#

Huh

tropic hill
#

never sent a message, so i assume that it never joined

eager schooner
#

hola

restive otter
#

How do I get a bot code

worn quail
#

You make it

amber dune
#

@worn quail when are you going to redeem all of these good boy points you're gaining mmulu

worn quail
#

ima save them

amber dune
#

save them up for when staff apps open omegalul

worn quail
#

Perhaps

#

maybe cert

amber dune
#

nah cert is a lost cause

#

dont bother

worn quail
#

Perhaps

restive otter
#

why is cert a lost cause

runic grove
#

applications are closed and barely reviewed ig

restive otter
#

ah ok

restive otter
#

My bot votes 430 but bot showing 14 :( .

barren flint
#

How do I get the dbl API token?

#

Nvm, I got it

#

Read the docs :p

wooden bloom
#

@restive otter right and im president but nobody cares

restive otter
#

:/

sullen nymph
#

@restive otter are you looking at monthly votes
@wooden bloom can you not

restive otter
#

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

Lightshot

Captured with Lightshot

#

Firstly refresh

#

i tried it

#

Then, try change token.

sudden rampart
#

iirc it's a 1 hour ip ban

restive otter
#

but why ;/

#

I changed it for another reason, but before that, it was already giving and still is

sudden rampart
#

because you spammed the api

restive otter
#

"spammed?"

#

spam?

#

i didn't do that

sudden rampart
#

you hit the ratelimit

#

so you were doing a ton of requests

#

or something like getting upvoters every message for example

restive otter
#

what should i do to solve this

#

I don't know, sorry dude.

sudden rampart
#

to get unblocked, you wait or change ip

#

to not get blocked again, fix your code

restive otter
#

there are some commands you need to vote for

#

D.

rugged sierra
#

yes, if you check it a lot of time, you should save the votes, because dbl has ratelimits

spiral steeple
#

Use a webhook

#

never make the user commands call to the api every command

timid nexus
#

@spiral steeple never call to the api*

spiral steeple
#

Basically

warm tangle
#

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

placid knot
#

That's not really the right channel

little harbor
#

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?

warm tangle
#

Like I go to my profile and it says nothing

#

Like it's blank

little harbor
#

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

placid knot
#

Nah I think he added the servers bot and the server doesn't show up on dbl

#

Like dsl actually

little harbor
#

oHh

azure plover
#

This isn't a testing channel thx

worn quail
#

why delet

#

that or the API

#

why is stuff getting deleted wut

cloud ferry
#

Is DBL-Python-Library posting the shard count?

sullen nymph
#

Not unless you define it

cerulean crane
#

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

clever rock
#

are you using the dbl lib?

cerulean crane
#

Yes, I did npm install dblapi.js

#

I use discord bot maker from steam btw

clever rock
#

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

cerulean crane
#

what do you mean with its better you insert the code manually by your self

clever rock
#

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

cerulean crane
#

nope, I don't know js

clever rock
#

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

cerulean crane
#

Could you try?

clever rock
#

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

cerulean crane
#

uhm

#

Yep I dont understand

#

const dbl = new DBL('Your discordbots.org token', client);

#

that is my api key right?

clever rock
#

yes

cerulean crane
#

okay

#

I get an error now

cerulean crane
#

How do I get an update in my server when someone voted on my bot?

clever rock
#

use webhooks

#

if you host at home, you need to learn portforwarding on your router

cerulean crane
#

I have a webhook but how do I get messages when someone voted?

clever rock
#

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

cerulean crane
#

Is there a script for?

clever rock
#

dblapi.js have webhook

#

but it needs an open port

#

where it can send post requests to

cerulean crane
#

I dont understand

clever rock
#

DBL -> sends data to your ip address on a port -> handle it on your code

cerulean crane
#

Yes but I dont know how I do that

clever rock
#

read the webhook guide of dbl apii

cerulean crane
#

ok

#

I read it but I still dont understand how I let the bot send a message when someone voted

clever rock
#

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

restive otter
#
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

polar mirage
#

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

thin gulch
#

Do DBL webhooks resend if my bot is down for whatever reason?

worn quail
#

No

barren flint
#

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?

#

I managed to work out the invite and the vote buttons :p

#

But idk the rest

sullen nymph
barren flint
#

Thanks!

#

And the tags and the bot name heading?

#

I suppose .bot-tags a? :p

#

Ill try that anyway xD

#

Thanks again

sullen nymph
barren flint
#

Oh ok, sorry

rancid knot
#

I am sorry but i dont understand what is a shard ?

sullen nymph
#

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

rancid knot
#

O thank you

high cradle
#

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?

worn quail
#

Dbl Is dying

#

cc @amber dune

amber dune
#

@high cradle we are working on getting an admin to work on it

high cradle
#

Alright! Good luck getting it fixed 🤞

brisk scroll
#

da fuq went on here

spice cypress
#

error is self explanatory

#

too many requests

brisk scroll
#

Though set Internal is at 15 mins 🤔

#

Must've been a typo but I'm sure

barren flint
#

@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...

amber dune
#

@barren flint working on it

plucky viper
#

I need help with the webhook

barren flint
#

K cool 👍

rain grove
#

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

rugged sierra
#

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

restive otter
#

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

rugged sierra
#

did you add your url on the dbl dashboard?

restive otter
#

Yep

#

I also checked the authorization

rugged sierra
#

port not blocked?

restive otter
#

Yep its not blocked

rugged sierra
#

what is the webhook server running on?

restive otter
#

On what port ?

#

5000

#

Its the default one

rugged sierra
#

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

restive otter
#

I already have that part od thr code but it doesnt emit

rain grove
#

Thanks @rugged sierra

rugged sierra
#

@restive otter how did u define dbl?

plucky viper
#
const DBL = require('dblapi.js');
const dbl = new DBL('xxx',{
  webhookPort: 5000,
  webhookAuth: 'xxx'
});
restive otter
#

@rugged sierra wal is an owner as well ⏫

rugged sierra
#

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~~

restive otter
#

But thats the one dbl recommeneds

rugged sierra
#

ye cuzz the admin wrote it lol

restive otter
#

Lol

rugged sierra
#

Tonkku is the owner, ofc he will recommend his package

restive otter
#

The thing is that 2 minths ago when i tested it it worked

#

But now we run into probpems

plucky viper
#

we'll use other libraries

#

oh, never mind. The API documentation only showed one

rugged sierra
#

I have 2 of those on my server, they work pretty good I would say

plucky viper
#

aight, thank you

cerulean crane
#

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

rugged sierra
#

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

arctic arch
#

discord bot maker uses discord.js

worn quail
#

so you should be able to

spiral steeple
#

you'll need to actually do some coding tho

rugged sierra
#

what I only know click click wdym \s

worn quail
#

lol

restive otter
rugged sierra
#

Well, do you post one?

restive otter
#

I dont understand 🤔

rugged sierra
#

You need to tell the website how many guilds ur bot has, are you telling the website that?

paper sonnet
#

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?

worn quail
#

being worked on

paper sonnet
#

Thank you.

cerulean crane
#

Does anyone knows how to send servercount to website with Discord Bot Maker?

tranquil quartz
#

There is a mod

#

You can use it

cerulean crane
#

I tried doing that but it doesn't work.

#

Can I dm you?

primal pecan
#

Hello 👋

#

I've a problem with the website

#

it display only one shard guildscount

#

<@&265158261945270273>

rugged sierra
amber dune
#

@primal pecan dont ping website admins for an issue that can be solved on your end

worn quail
#

@amber dune know what would be cool? Being able to call the servers/shards in long/short desc

spiral steeple
#

What?

void hawk
#

._.

restive otter
#

Will regenerating my api token force the site to update my server count? Been stuck for like 1 week now

cerulean crane
#

How long does it take for the website to post my servercount when sent?

restive otter
#

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

clever rock
#

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

dusky finch
#

How do I post my shard count on dbl?

worn quail
#

@cerulean crane less than 5m unless dbl is dying

cerulean crane
#

Then it doesn't work for me...

restive otter
#

i'm not using discord bot maker though

rugged sierra
#

he/she wasnt talking to you though

cerulean crane
#

Is it possible to store the time when I can vote again on a bot?

#

Ping me please

worn quail
#

@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

cerulean crane
#

I don't understand

worn quail
#

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

rugged sierra
#

He uses Discord Bot maker PikachuDance

balmy hamlet
#

lmao

limber moth
#

bot music when

brisk scroll
#

learn js instead of dbm

#

I wonder how much dbm made off of users already thonkku

cerulean crane
#

Yes I use dbm, does it matter? My bot got in 170 servers in 24 hours

#

beat that

brisk scroll
#

-bots 595337776853942309

abstract mothBOT
brisk scroll
#

Not even here

sullen nymph
#

No competition here ty

brisk scroll
#

^

#

I said learn js since dbm's features can get quite limited

#

especially if you're using outside libraries

spiral steeple
#

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

brisk scroll
#

It doesn't @spiral steeple

shy plank
#

how to u get a dbl token?

spiral steeple
brisk scroll
#

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

brisk scroll
#

for the bot widget, does .png not update

spiral steeple
#

It does

#

But you need to do some cache stuff

brisk scroll
#

oh

lusty swift
#

7d r fty gt f0-9*47¨

restive otter
#

Hi? @lusty swift

#

You need help?

rugged sierra
#

Yes, I think he needs an ambulance

worn quail