#topgg-api

1 messages · Page 62 of 1

ruby yarrow
#

Also is there a way to test it without waiting 12 hours to vote?

ornate abyss
#

hmm i deleted and reinstalled dblpy and still keeps saying 0.1.6

hot portal
#

Property 'webhook' does not exist on type 'DBLAPI'.

45 this.dbl.webhook.on('ready', hook => {

#

it simply doesnt work 😭 @arctic arch

arctic arch
#

typescript huh?

#

are you sure you actually have the latest version in your project

hot portal
#

yeah my whole structure is like that.

ornate abyss
#

ah had to restart my bot if anyone was curious if i fixed it :)

hot portal
#

yes 2.3.0

arctic arch
#

because that sounds like there is no webhooks on the version you are in at all

hot portal
#

im looking at the typings : DBLWebhook class on line 26. ill

arctic arch
#

maybe thats typescript's way to say its undefined

#

make sure you have specified the port or server in the options

hot portal
#

i event tried over riding the undefined.

#

yeah i did that.

arctic arch
#

just

#

I need to be sure

#

post version from node_modules/dblapi.js/package.json

hot portal
#

you guys arent exporting DBLWebhook

spiral steeple
#

uh

ornate abyss
#

get_bot_upvotes() returns this <coroutine object Client.get_bot_upvotes at 0x09383300> ?

arctic arch
#

dependencies be empty
how does it still have snekfetch

hot portal
#

yeah it didnt bring that issue any more.

ornate abyss
sullen nymph
#

@ruby yarrow if on_dbl_test works, on_dbl_vote does too

#

Everything dblpy Client has is async

#

so await it @ornate abyss

ornate abyss
#

huh

#

oh i see thx

sullen nymph
wanton gust
#

z

sudden flare
#

is there any way to force-update the cache of votes?

#

when I check if a user has voted or not, its delayed to give a positive response

plain timber
#

@sudden flare if you want instant updates then you need to use webhooks

sudden flare
#

oh ok, thank you

restive otter
#

Someone mind explaining how I would get votes in python?

Users can currently vote every 24 hours for each bot. The /votes endpoint for your bot (the one you use via getVotes) only indexes the last 1000 votes. Please implement the webhook instead if you plan to process over 1000 votes.

Makes no sense because https://discordbots.org/bot/526202417570643968/votes doesn't return votes...

sullen nymph
#

/votes returns votes for the past 12 hrs

plain timber
#

@restive otter you need /api/

restive otter
#

https://discordbots.org/bot/526202417570643968/api/votes still doesn't work

plain timber
#

...

#

/api/bots/id/votes

restive otter
#

ah

plain timber
#

Did u read the docs bloblul

restive otter
#

that was in the docs/

plain timber
#

Yes

restive otter
#

¯_(ツ)_/¯

restive otter
#

reas

#

mk

#

Yup

#

I will reas

#

Thank you.

ornate abyss
#

:spam:

full socket
#

@grand plaza no racial slurs dude

restive otter
#

why doesn't it work : dbl.webhook.on('vote', async vote => {

chrome canyon
#

You gotta be a bit more specific

#

Because so far it works

restive otter
#

Nothing happens when I press the Test button or the user votes

chrome canyon
#

Well what's the rest of the code

restive otter
#
dbl.webhook.on('vote', async vote => {
    console.log('Voted')
});
#
const DBL = require('dblapi.js');
const dbl = new DBL(token, { webhookPort: 5000, webhookAuth: 'password' });
clever rock
#

but is the port open

#

port must be open

#

closed port = no go

restive otter
#

How to open it on hosting?

clever rock
#

depends on firewall you use

#

I personally use ufw

#

but go google how to find out what fiirewall you use or if there is one

outer carbon
#

Hello

narrow geyser
outer carbon
restive otter
#

bruh

opaque pike
#

Is it normal that with

dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});

I've this error ?

runic grove
#

no

opaque pike
#

Do you understand why ?

#

dbl is well defined...

rugged scroll
#

Hi,

i have a json file with some data.

How can i embed specific fields to a reply message?

runic grove
#

is webhook set up

opaque pike
#

I don't think... how do we do ?

plain timber
#

@opaque pike you didnt put the webhook settings on the new dbl line

#

look at the example

opaque pike
plain timber
#

yes

#

its in the example code

#

just set webhookPort and webhookAuth

opaque pike
#

Ok thank you

short flint
#

How do I use webhooks?

patent mantle
#

Is there an alternative for msg.reply so that it won't mention the user who sent the specific command?

sullen nymph
short flint
#

How do I use webhooks?

patent mantle
#

Ohh thanks

opaque pike
short flint
#

but I did not understand how to do it

restive tapir
#

Oof

sullen nymph
#

Probably just cache

restive tapir
#

i have to provide shard id :3

opaque pike
#

Sorry, just for options.webhookPort, where I can find it ? And for options.webhookAuth I don't undestand what string it talk about...

sullen nymph
#

options param in dblapi.js client

#

which is a map (JSON, I don't remember what it is in js)

runic grove
#

object?

sullen nymph
#

You specify the port yourself and webhookAuth is the text you set in Authorization field on your bot's Edit page

opaque pike
restive tapir
#

Hello, i posted my server count to the API which is 2925 and also with shard ids, and the website still showing only 1013.
The code i'm using is dbl.postStats(await client.fetchGuildSize(), client.shard.ids[0], client.shard.count);
The value of those 3 params are in screenshot. Also the return from dbl API is {}
Perhaps it's a bug :3 If it isn't please tell me where the mistake is.

sullen nymph
#

How many guilds overall?

restive tapir
#

2925

sullen nymph
#

What's your bot?

restive tapir
#

@restive otter

sullen nymph
#

Huh

restive tapir
#

Did you mean the bot link?

sullen nymph
#

Nah, that's fine

#

My cache was showing 5k guilds but yeah, I don't see what causes that

restive tapir
#

Does it show 5k on your browser?

sullen nymph
#

Only because of cache /shrug

#

incognito shows 1013

restive tapir
#

What shall i do now?

sullen nymph
#

Not quite sure ngl

opaque pike
restive tapir
#

Can you forward regarding this bug(?) to the developer?

sullen nymph
#

I'm not quite sure what shardId param is used for

restive tapir
#

It said it's the id of the shard and that's what i provide there in second param.

plain timber
#

The shardid is so you only send the server count for the current shard

#

And it'll add them all up

#

And if you want to report a bug do it on the GitHub

sullen nymph
#

https://discordbots.org/api/bots/BOTID/stats for your bot returns {"server_count":5850,"shards":[null,2925,2925],"shard_count":3}

restive tapir
#

Oops

#

I'm making sure that it's a bug or not

sullen nymph
#

You're fine since your question is related to dblapi.js

restive tapir
#

oh, i see now

opaque pike
#

thank you

restive tapir
#

It adds up KL1Facepalm
i will try to change the code and see the results

sullen nymph
#

1978 guild count after updating lul

restive otter
#

@arctic arch

#

motterfucker

#

wtf @restive otter

opaque pike
#

it's just a hater

arctic arch
#

ok

restive tapir
#

Got it working. Thank you salute

hexed glade
#

What can I use for webhooks with java. I feel that it is not possible with the java library.

distant trellis
#
hexed glade
#

Wow ty 😃

distant trellis
#

I'd pay most attention to the first link, which is most likely what you'd use. Example 5 and 7 from the examples link might give you a better understanding as well

hexed glade
#

Okay ty PandaJuice

plain timber
#

@distant trellis @hexed glade those seem to be links for discord webhooks, which are not related to DBL webhooks

distant trellis
#

Oh right, we're in the api channel

hexed glade
#

I need to create a listener to the dbl webhook right?

distant trellis
#

It has examples and all

plain timber
#

And accept the post request from dbl

hexed glade
#

Oh yeah

#

It remembers something

#

Perfect kklove @plain timber

plain timber
#

Yw

hexed glade
#

Is it normal that I have a very long delay?

#

With java: 1-3min
With nodejs: 1s

#

And with java, I get "null" body

narrow geyser
#

That isn't normal

restive otter
#

I'm updating server counter every 30 mins but my bot is shown as offline since the beginning of getting verified. what should I do?

restive otter
#

If any discord.py dev's can help with getting things to happen when an event happens, please DM me.
Current Code

import dbl
import discord
from discord.ext import commands

import asyncio
import logging


class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
        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)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(DiscordBotsOrgAPI(bot))
sullen nymph
#

Are you sure the webhook is actually accepting requests?

#

test button calls on_dbl_test
vote button calls on_dbl_vote

restive otter
#

@sullen nymph how can I test if the webhook is accepting requests?

#

Really new to webhooks and stuff...sorry

sullen nymph
#

Make sure your IP is right and your port is open and forwarded. Test button on your bot's Edit page

restive otter
#

allright

#

Is there a non webhook way to do this?

sullen nymph
#

And, just in case, http://your_ip:your_port/your_webhook_path
Non-webhook? get_user_vote but includes ratelimits and delays

restive otter
#

Question, this bit of code would work right?

import dbl
import discord
from discord.ext import commands

import asyncio
import logging


class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token)
        #self.updating = self.bot.loop.create_task(self.update_stats())

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        logger.info('Received an upvote')
        print(data)


def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(DiscordBotsOrgAPI(bot))
#

For just receving votes, forget about posting server count.

sullen nymph
#

Looks good, yep

restive otter
#

Allright Thanks!

#

So the only downside to this method is that the upvotes will be delayed by around 1-5 minutes right?

sullen nymph
#

Yeah and ratelimits if you implement it in a command

restive otter
#

alright thanks

restive otter
#

Code

import dbl
import discord
from discord.ext import commands
import asyncio



class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token)
        #self.updating = self.bot.loop.create_task(self.update_stats())

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)


def setup(bot):
    bot.add_cog(DiscordBotsOrgAPI(bot))

I've doubled checked that the token works but nothing is getting printed.

worn quail
#

Did you vote

restive otter
#

yea

plain timber
#

@restive otter did u set the webhook settings in the bot edit page?

restive otter
#

Why do we need a webhook for

import dbl
import discord
from discord.ext import commands
import asyncio



class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token)
        #self.updating = self.bot.loop.create_task(self.update_stats())

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)


def setup(bot):
    bot.add_cog(DiscordBotsOrgAPI(bot))
sullen nymph
#

You're not using the webhook but adding an event for it

restive otter
#

So what do I set the webhook to?

#

so confused

sullen nymph
#

The example on github repo should help.
Specify at least webhook_port, the rest of webhook stuff will be set by default

restive otter
#

So I use this code

import dbl
import discord
from discord.ext import commands

import asyncio
import logging


class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
        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)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(DiscordBotsOrgAPI(bot))

And then for the webhook on dbl I put mypublicip:5000/dblwehook?

sullen nymph
#

http://ip:port/path

restive otter
#

is any port forwarding require on the router side of things or no?

sullen nymph
#

Yep

restive otter
#

k

opaque pike
sullen nymph
#

Replace 0.0.0.0 with your IPv4 address

opaque pike
#

But where I replace ?

sullen nymph
#

When putting your webhook URL in on the website

opaque pike
#

But it's already done...

short flint
#

How do I get authorization to use webhooks?

opaque pike
#

It's you who must set the permission by editing your bot at the bottom

restive otter
#

😝

#

😂

#

I'm updating server counter every 30 mins but my bot is shown as offline since the beginning of getting verified. what should I do?

sullen nymph
#

Is its status "???"

restive otter
#

Yes

#

@sullen nymph

sullen nymph
#

That means it was kicked from here

restive otter
#

Can you explain because it hasn't

#

Off the site

#

It's been up on the site since it's verification

narrow zenith
#

you need to have it be reinvited @restive otter

restive otter
#

As in register for verification again?

worn quail
#

-bots 439632807770325012 noembed

abstract mothBOT
#

Slime Shield Hero#0021's bots:
@clever hemlock

worn quail
#

It's not here @restive otter.

Ask a mod to reinvite it, and check the reason it was kicked.

restive otter
#

Ok thank you

restive otter
#

My bot's been getting ratelimited all day.
It goes

Attempting to post server count
Posted server count (39)
Task exception was never retrieved
future: <Task finished coro=<Client.__loop() done, defined at C:\anishapps\python3.7\lib\site-packages\discordlists\client.py:127> exception=Ratelimited("The request to the API endpoint was ratelimited.\nMore data may be available in the 'ratelimit' attribute.")>
Traceback (most recent call last):
  File "C:\anishapps\python3.7\lib\site-packages\discordlists\client.py", line 133, in __loop
    await self.post_count()
  File "C:\anishapps\python3.7\lib\site-packages\discordlists\client.py", line 119, in post_count
    return await self.base.post_guild_count(self.bot.user.id, self.guild_count)
  File "C:\anishapps\python3.7\lib\site-packages\discordlists\baseclient.py", line 213, in post_guild_count
    return await self.__post("count", self.__guild_count_body(bot_id, guild_count))
  File "C:\anishapps\python3.7\lib\site-packages\discordlists\baseclient.py", line 120, in __post
    return await self.__handle_response(resp)
  File "C:\anishapps\python3.7\lib\site-packages\discordlists\baseclient.py", line 91, in __handle_response
    raise Ratelimited(json)
discordlists.exceptions.Ratelimited: The request to the API endpoint was ratelimited.
More data may be available in the 'ratelimit' attribute.

But this has been going on all day...and DBL is showing I have 27 servers when I have 39.

Bot URL: https://discordbots.org/bot/526202417570643968

worn quail
#

Cache

full socket
#

@restive otter are you sure that's the official dblpy library?

worn quail
#

Delay how long your bot sends to dbl

#

Its not

#

@restive otter pip install dblpy

restive otter
#

Did that while back.

#

It was updating all of yesterday fine.

plain timber
#

@restive otter 403 means wrong token

restive otter
#

there;s a 403 in there?

#

isn't it a ratelimit error

plain timber
#

Oh weird I thought it said 403

#

How often are you sending it 🤔

sullen nymph
#

401 is wrong token

chrome canyon
#

@restive otter 429 is rate limit

restive otter
#

no duh

#

the error says you've been ratelimited

#

😃

chrome canyon
#

Then there's no 403

#

Lol

#

Rate limit is 429

arctic arch
#

why are you talking about response codes when there are none

#

just stay on topic

#

and help

#

ffs

chrome canyon
#

Tonkku eat a chill pill.

worn quail
arctic arch
#

idk why its so hard

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

craggy sentinel
#

ty

frosty tree
#
```send me
plain timber
#

what

#

read the channel topic please

frosty tree
#

My bot needs a Google API to connect to Google

#

Please help me

#

@plain timber

plain timber
#

and there is no google api

frosty tree
#

Sorry sir..

worn quail
#

google api doesnt exist @frosty tree

plain timber
#

i said that

worn quail
#

Since Google has over 100-200 third party api(s) to connect to their platforms

#

Aaaaand dm

obsidian tide
#

I'm new to dbl api.

#

I want to learn how to make it instantly run an action after someone votes

humble bison
#

use the webhooks

obsidian tide
#

What webhook though?

humble bison
#

read the docs

obsidian tide
#

I am

#

How do u get a webhook?

humble bison
#

you set it up

obsidian tide
#

How? I want to know how to

humble bison
#

it's just a http server, set one up locally and set dbl to post to it on votes, then get the data and do stuff

obsidian tide
#

Just make a webhook from a channel?

humble bison
#

no not a discord webhook

#

read the docs fml

plain timber
#

dblapi.js can handle it for you

#

but it has nothing to do with discord webhooks

obsidian tide
#

I installed the npm already

#

K thx @humble bison I'll try that

#

How do u create a webhook?

dense basalt
#

Your server -> server settings -> webhook -> create webhook

humble bison
#

that's a discord webhook

#

they don't work with dbl's api

dense basalt
#

They do, you can set up a Discord webhook and link it to DBL

obsidian tide
#

But how?

#

Wat

spiral steeple
#

wot

obsidian tide
#

How?

spiral steeple
#

no you cant

dense basalt
#

You would have to create some other stuff yourself

#

But you can

obsidian tide
#

How do u setup a webhook?

humble bison
#

rtfd

obsidian tide
#

(I'm dumb)

dense basalt
plain timber
#

please

#

it has code

flint lava
#

Hello, I’m having trouble with the api. I thought to get actual help from a member of staff because I have asked multiple times in the support channel and every time it didn’t work.

The problem is that the vote bit doesn’t seem to work, i took the code off the api website and everything but the vote bit works. Please help!

Here’s my code:

  console.log('Server count has been sent to Discord Bot List!');
  });

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
});

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
}); 
dbl.webhook.on('vote', vote => {
  let voteembed = new Discord.RichEmbed()
    .setColor(0x0000FF)
    .setThumbnail("https://cdn.discordapp.com/avatars/560942447488794628/57a6cc87eafda490610284c6982a8918.png?size=2048")
    .setTitle(`New Vote`)
    .setDescription(`${vote.user.username} has just voted! Thanks!`)
    .setTimestamp()
    votechannel.send(voteembed);
  console.log(`User with ID ${vote.user} just voted for Cryptonox!`)
});
#

The webhook and the server count works

plain timber
#

@flint lava did you set the webhook settings in your bot page?

#

have you tested it with postman?

flint lava
#

As the webhook setting

#

@plain timber

plain timber
#

k, try doing the post request in postman

#

?

flint lava
#

How do I do the request?

#

On postman

plain timber
#

make a POST to the url

#

and set the json body like DBL would send

#
{
    "bot": "12345",
    "user": "509456861196713985",
    "type": "test",
    "isWeekend": "true"
}```
#

and set the Authorization header to your webhookAuth

flint lava
#

Right I’ve just logged in

#

Where do I go?

plain timber
#

create a request

flint lava
#

Where’s that?

#

Where do I create a request?

plain timber
#

uh what

#

what do you see?

flint lava
#

My workspaces

plain timber
#

open a new tab

flint lava
#

Ok

#

Done

plain timber
#

fill it out like i showed

restive otter
#

hmm

trim venture
#

Why I can't post my guild/shard count?

Forbidden: Forbidden (status code: 403)
Traceback (most recent call last):
  File "/Users/nemetharon/Desktop/FightMan01_bot/1.2.3/bot.py", line 254, in update_stats
    await self.dblpy.post_guild_count()
  File "/usr/local/lib/python3.6/site-packages/dbl/client.py", line 130, in post_guild_count
    await self.http.post_guild_count(self.bot_id, self.guild_count(), shard_count, shard_no)
  File "/usr/local/lib/python3.6/site-packages/dbl/http.py", line 168, in post_guild_count
    await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
  File "/usr/local/lib/python3.6/site-packages/dbl/http.py", line 142, in request
    raise Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403)```
plain timber
#

@trim venture wrong token

trim venture
#

I regenerated it, still not works.

sullen nymph
#

dblpy version?

trim venture
#

0.3.1

sullen nymph
#

I can see two things that could be causing that:

  1. The dblpy version of yours that is detectdd by Python isn't 0.3.1
  2. The bot your code is running on isn't on DBL
  3. I believe I raise 401 when it's invalid token
trim venture
#

The bot is on dbl

#

@short bronze

sullen nymph
#

Output dbl.__version__ to make sure it's up to date MegaThonk

#

It must be sending the request before bot gets ready

trim venture
sullen nymph
#

Huh

trim venture
#

Wait!! Heroku posted it!

sullen nymph
#

Great news at least 02lul

trim venture
#

Yeah, but my mac can't post it somehow 🤷

#

And one more question.
I have 1 shard.
I thought that the post_guild_count will post it.

#

How can I post the shard count?

sullen nymph
#

post_guild_count(shard_amount: int, whatever_shard_you_post_from: int)

trim venture
#

ok, thx 😁

sullen nymph
gusty gyro
#

I need a little help adding the API. Would I make a new folder in my main directory? Or add it to the init script or bot file?

sullen nymph
#

Elaborate please

gusty gyro
#

I don't know where the this goes. const Discord = require("discord.js"); const client = new Discord.Client(); const DBL = require("dblapi.js"); const dbl = new DBL('Your discordbots.org token', client); // Optional events dbl.on('posted', () => { console.log('Server count posted!'); }) dbl.on('error', e => { console.log(`Oops! ${e}`); })

runic grove
#

you dont just paste it like that

#

its an example code

gusty gyro
#

I figured I would need to add the token

#

But what else is needed?

plain timber
#

You need to know how it works

#

Don't just paste it in

#

And why is that all one line

fading lynx
#

spoonfeed

vagrant barn
#

stupid question but still learning.
setting up the api webhook for voting, is the URL suppose to point to where the bot is hosted?

fathom eagle
#

Fuck that username is a throwback

plain timber
#

@vagrant barn yes, if the webhook path is /dblwebhook (default for dblapi.js) then the url is normally http://IP:PORT/dblwebhook

vagrant barn
#

awesome, thanks

low prawn
#

@fathom eagle @papa#0001 dumb username

fathom eagle
#

I agree with you

#

ayy that's better

restive otter
#

Is the bot discord id the bot's discord id?

vernal coral
#

yes, what else

worn quail
dense basalt
gusty gyro
#

my bot was denied for api time??? ``` await this.client.user.setStatus("online");

const statusArray = [
  (client) => client.user.setActivity(`${this.client.guilds.size} servers | ?help`, { type: "WATCHING" }),
  (client) => client.user.setActivity(`${this.client.channels.size} channels | ?help`, { type: "WATCHING" }),
  (client) => client.user.setActivity(`${this.client.users.size} users | ?help`, { type: "WATCHING" })
];

var pick = 0;
setInterval(() => {
  statusArray[pick](this.client);
  pick += 1;
  if (pick === 3) pick = 0;
}, 40000);```
plain timber
#

@gusty gyro read the channel topic

gusty gyro
#

i know as im wondering why its declined if it isnt abuse???

#

5\60

runic grove
#

read the channel topic lol

gusty gyro
#

im aware

#

i got this info from staff here. sounds like they need to read the api for denying bots that arent abusing the limit????

shut ibex
#

This channel is for dbl api

#

Not discord api

gusty gyro
#

how do u get support here?

#

trying to speak with staff

#

only reason i commented here

plain timber
#

Either DM the mod who declined it or ping them in #general

restive otter
sullen nymph
#

Not paste a Discord webhook link

#

Create a webserver that will send a message through Discord webhook on request and make DBL send request to your webserver

restive otter
#

dblapi.js failing to send stats

#

wait nvm

#

i had to update

craggy grove
#

How can I check if someone has voted for my bot in the last 12 hours? I’ve tried googling and such but I can’t really find much. I know checking who voted in the last 24 hours is documented, but what about 12?

shut ibex
#

use webhooks

full socket
#

I guess the only way this is possible is to use webhooks and store the time users voted yourself

shut ibex
#

Store User Vote and time in DB and check with the bot if its greater than or less than 12 hours

craggy grove
#

I see

#

Thanks!

plain timber
#

@craggy grove the docs are wrong, everything that says 24 hours is actually 12 hours

craggy grove
#

Are you serious lmao

#

Thank you so much

plain timber
#

yw

#

and yeah theyre outdated cuz u used to be able to vote every 12 hrs

#

and ig nobody updated them

spiral steeple
#

The docs need some serious updates

daring cove
#

Which doc

#

Py, js....

plain timber
#

the dbl docs

#

on the site

slate zealot
#

Hi

plain scaffold
#

Hai

ruby yarrow
#

Need some help understanding how to setup using dbl

#

Using the python example what do I define as "bot"?

worn quail
#

Your client

#

Eg

#

discord.Client

ruby yarrow
#

So just discord.client() no bot tokens?

worn quail
#

I dont think the bot token by itself will work

ruby yarrow
#

"Client object has no attribute add cog"

worn quail
#

What version are you using

#

For discord

ruby yarrow
#

1.0.1

#

And api is 0.3.1

#

Hmm actually
discord==1.0.1
Discord.py==1.2.3

restive otter
#

this is for help with the discord api

restive otter
#

oh hi

ruby yarrow
#

No this is for this api

restive otter
#

sorry i know a cool guy named anish in my school

ruby yarrow
#

@restive otter just trying to set up this api, the docs don't help much

sullen nymph
#

For dblpy Client, there's no add_cog.
For discord.py commands.Bot, then we're talking.

ruby yarrow
#

I'm using the example in the docs

sullen nymph
#

And the example uses commands.Bot

ruby yarrow
#

Setup(bot)
Bot.add_cog

sullen nymph
#

Yes

#

I'm literally saying "That example discord.py commands.Bot, not discord.Client"

ruby yarrow
#

I don't follow

#

For the bot variable then?

sullen nymph
#

your bot variable is supposed to be an instance of commands.Bot that discord.py provides
OR
adapt the code to discord.py Client

ruby yarrow
#

So I run
setup(my bot instance)

sullen nymph
#

If you use cogs

ruby yarrow
#

I don't have experience with cogs but that's how the example is

#

So I can just rewrite the example without cogs? With dbl.client(bot, token) ?

sullen nymph
ruby yarrow
#

Hmm let me try

#

Still stuck on this

#

Just trying to do anything with dbl.py client

wheat elk
#

Guys, I don't know how to use that dbl webhooks

#

I'm hosting the bot on glitch, by the way

narrow zenith
tropic hill
#

does the online status get pushed when the bot logs in or when the server count is pushed

narrow geyser
#

When your bot logs on (with caching)

bronze arch
#

how would I be able to test another webhook, so that my current webhook isn't impacted? I can't seem to actually change it without saving it, which would affect my current bot

sullen nymph
#

@bronze arch you could try sending a request to it yourself

timber orbit
#

does anyone have any resources to get started with the voting webhooks using JS besides the official API page? I tried to make a webserver and link the webhook to that but when i use Postman to test it I get a 400 error

clever rock
#

Unfortunately thats only the example for JS, although there is an unofficial one that is as simple as download, configure and run @timber orbit

timber orbit
#

Alright, I’ll give that a look, thank you

ruby yarrow
#

Is there an example for python?

chilly sundial
#

it's ok :>

sudden dagger
#

how do i send the bot token in the POST?

#

it returns unauthorized currently because i haven't given it the bot's auth

#

and so, how do i do that

runic grove
#

you need to send it in an Authorization header iirc

sudden dagger
#

uh what

sullen nymph
sudden dagger
#

my bigger problem is i have no idea how to send headers

#

and i can't copy the whole damn token

runic grove
#

what are you using for the request

#

as in what library

sudden dagger
#

coro-http integrated in luvit(?)

runic grove
#

look up the documentation of the library on how to send headers

sudden dagger
#

smart choice

#

can't find the documentation for some reason

#

noice

chilly sundial
sudden dagger
#

hUh

#

{"error":"Unauthorized"}

chilly sundial
#

Huhuhuh

chilly sundial
dense basalt
chilly sundial
#

._.

dense basalt
#

Are you reading

worn quail
#

can you read the tiny thing after it?

#

You arent authorized to use whatever you are doingm

#

If its dblapi it's the wrong token

#

Idk how yall getting 401s but I'm fine

chilly sundial
#

The token isn't wrong ._.

sullen nymph
#

DBL says yes it is wrong

chilly sundial
#

There is nothing after it ._.

#

Oof :c

sullen nymph
#

Re-copy, make sure you don't remove/add anything to the token

chilly sundial
#

The token had changed, it's ok :>

#

thx :D

lethal fox
#

Hey. I have a question. How can I make my bot send message when someone votes for it?

vestal relic
#

Hey, so I'm trying to get the webhook thing working, but whenever I send a test, nothing happens

#

@lethal fox you need to configure the webhook

#

Anyways, as for my issue

#

Here's the code

sullen nymph
#

Make sure port is open and forwarded

vestal relic
#

The port is good, since I host a website here

sullen nymph
#

Also vote isn't equal to test

vestal relic
#

yes

#

i know that

#
  if (vote.type == 'test')
    return console.log('test successful')
  let message;

  try {
    let fetchedUser = client.users.fetch(vote.user);
    message = `${fetchedUser.tag} just upvoted!`;
  } catch(e) {
    message = `${vote.user} upvoted`
  }
  client.channels.get(config.logging).send(message);
  console.log(`User with ID ${vote.user} just voted!`);
});
#

Notice where it checks the vote type

pallid slate
#

js?

vestal relic
#

yes

sullen nymph
#

Oh cool dblapi.js sends both under the same event

vestal relic
#

Its most likely something wrong with my code

#

cause the normal website is fine

sullen nymph
#

Double check your URL ig

#

everything else looks fine

vestal relic
#

Hm, I guess the error could be two things

#
  1. I redeclair the dbl thing
#

when I already declaired it before in client

#
  1. The ready event does indeed get fired
#

but it returns a weird URL, hold on

#

Webhook running at http://0.0.0.0:0/dblwebhook

#

If it is, I could probably merge the two files

sullen nymph
#

Worth a try

lethal fox
#

I have a question. To update a server's number I need to use api right?

sullen nymph
#

On the website yes

lethal fox
#

Do I need to do more with API than copying it to my code?

sullen nymph
#

Get your bot approved

lethal fox
#

And that's all, right?

#

Can I modify it to check if someone voted on bot?

sullen nymph
#

Sure, dblapi.js and dblpy provide a webhook, not too sure about other libs

restive otter
#

I tried to send a message to the voted user but it doesn't work.

vestal relic
#

I think we're having the same problem

#

can I see your code?

restive otter
#

My code:

dbl.webhook.on("vote", vote => { 

console.log('User with ID ' + vote.user + ' voted!'); 

const user = client.users.get(vote.user); // This will get the User Object from the Client#users Collection

 if(user) { // This checks if the Bot knows who the User is. 

user.send('Thank you for voting!'); // DM the User "Thank you for voting!"

 } });
spiral steeple
#

Is it all on one line or something?

restive otter
#

No It is weird when I copy it down

#

Her

#

My code:

dbl.webhook.on("vote", vote => { 

console.log('User with ID ' + vote.user + ' voted!'); 

const user = client.users.get(vote.user); // This will get the User Object from the Client#users Collection

 if(user) { // This checks if the Bot knows who the User is. 

user.send('Thank you for voting!'); // DM the User "Thank you for voting!"

 } });
#

Can anyone help me with this?

#

I tried to send a message to the voted user but it doesn't work.

vestal relic
#

Yes, we saw your first message

#

Have you seen if the webhook works in the first place?

restive otter
#

It works

vestal relic
#

Do you get "User with ID blabla voted!"

#

og

#

oh*

#

maybe that user disabled DMs

restive otter
#

But I didn't get the logs

vestal relic
#

then the webhook in itself doesn't work

restive otter
#

How could I fix that

vestal relic
#

send us your entire code

restive otter
#

I am getting my code up on computer

#
const DBL = require('dblapi.js');

const dbl = new DBL('api key', {webhookPort: 5001, webhookAuth: 'password', webhookPath: '/absolutezero'}, client);

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 + ' voted!');

    const user = client.users.get(vote.user); // This will get the User Object from the Client#users Collection 

 if(vote){// This checks if the Bot knows who the User is. 
    user.send('Thank you for voting!'); // DM the User "Thank you for voting!" 
   } });

  dbl.on('posted', () => {
  console.log('Server count posted!');
});
dbl.on('error', e => {
  console.log(`Oops! ${e}`);
});
#

here

vestal relic
#

is the ready event correct?

restive otter
#

I think so

vestal relic
#

What does it say?

restive otter
spiral steeple
#

that's good

#

scroll all the way down, put that in and replace 0.0.0.0 with your server's ip and make up an authorization key

restive otter
#

Oh ok

spiral steeple
#

@vestal relic have the correct ip?

vestal relic
#

Yeah, I think I found the error

#

1|Yamamura | GET /dblwebhook 404 7.123 ms - 5556

#

The webhook URL itself works

spiral steeple
#

Did you set the authorization?

vestal relic
#

but > 404

#

yeah

spiral steeple
#

It's the same as your config.DBLPass

vestal relic
#

this.dbl = new DBL(config.DBLtoken, { webhookPort: this.express.get('port'), webhookAuth: config.DBLPass, webhookServer: this.server, statsInterval: 7200000 }, this);

#

yeah, it is

spiral steeple
#

404 is not found

#

is the port open?

vestal relic
#

Yeah, the website itself works

runic grove
#

if the port wasnt open the request probably wouldnt go through

spiral steeple
#

true

#

you're running a website on the same port?

vestal relic
#

Yes

spiral steeple
#

Im not sure

vestal relic
#

Hm, maybe its because of the 404 thing I set up?

#
  //The 404 Route (ALWAYS keep this as the last route)
  app.get('*', function(req, res) {
    res.status(404).render('pages/404')
  });```
spiral steeple
#

I dont use express

vestal relic
#

What do you use then?

spiral steeple
#

I dont make websites

vestal relic
#

oh

runic grove
#

try commenting it out?

spiral steeple
#

I set up servers with node http(s) and fastify

vestal relic
#

Still get a 404

spiral steeple
#

oh

#

the dbl webhook is post requests

#

wait

#

I have big confusion

#

you wouldnt be able to do a GET on it anyways, would you?

sullen nymph
#

It should return 405 automatically if you made it listen to GET requests

vestal relic
#

I have no idea what is going on anymore

spiral steeple
#

dbl sends a POST request to your webhook

#

with the user and some other stuff

vestal relic
#

Hm

#

1|Yamamura | GET /dblwebhook 404 2.119 ms - 149

#

The test webhook just sends a get request

#

not a post

#

I'm logging this using morgan

arctic arch
#

why are you getting get requests

vestal relic
#

¯_(ツ)_/¯

sullen nymph
#

I've been getting them too for no apparent reason

arctic arch
#

anyway I don't think morgan would log the post request

vestal relic
#

Hm, can someone try sending a POST request to my website?

#

lets see if its the logger's fault or if its truely sending a GET request

#

Per rule 4, I can't link to the site

#

so DM me for a link I guess

sullen nymph
#

You linked it earlier LUL

vestal relic
#

oh, I did?

#

oops

#

1|Yamamura | POST / 404 3.900 ms - 140

arctic arch
#

I mean the post request to the webhook

vestal relic
#

oh

arctic arch
#

it wouldn't get to express since the library takes it

sullen nymph
#

Your dblwebhook path returned 403 for me 👀

arctic arch
#

seems to be working

#

since you didn't have a valid authorization

restive otter
#

What will happen if I test my webhooks?

sullen nymph
#

A test request will be sent to your webhook URL that you specify on your bot's Edit page

restive otter
#

Oh ok

#

But I didn't get the request. Will in be in the console?

vestal relic
#

Hm, I don't get it either

arctic arch
#

make sure to save then test

vestal relic
#

ok

#

oh hey, it finally worked. I was just dumb all along

#

I thought test applied for what was currently in the fields, not what was in the DB

#

thank you so much for helping me Furuhashi, Tonkku and Tarpergon

oblique crater
#

[discord.js]
So, I am trying to make my bot PM the owner of the server upon joining, but how would I get the owner of the server

sullen nymph
oblique crater
#

did not see the ... at the top

#

I apologize

fast panther
#

For webhooks, can I use a service like IFTTT or would I have to set up a web server and run it through that? Or is there something built into the dblapi that makes this easy? I’m a little inexperienced with webhooks so I do apologize

vestal relic
#

Do you have a bot already?

fast panther
#

Yes

vestal relic
#

why not set it up there?

fast panther
#

My bot is running on my raspberry pi, wouldn’t I need to set up a web server or something on it though?

#

I guess what I’m asking is I’m confused on what to use for a url

fast panther
#

Or would I use express? I feel like there’s a better option than that though

fast panther
#

Nvm, I realize now that I need a web server

restive otter
#

Hi guys! Quick question, if I'm "enabling" webhook options, will I stay able to use the request method at the same time?

runic grove
#

yes

restive otter
#

perfect, thanks

tulip thistle
#

hello, I am having trouble setting up the webhook for my bot

hot portal
#

@tulip thistle what language?

restive otter
#

:blobdance:

tulip thistle
#

@hot portal javascript

#

discordjs

sharp badger
narrow geyser
hot portal
tulip thistle
#

mm its ok I need to work on something else at the moment

hot portal
#
const DBL = require('dblapi.js');
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!`);
});
tulip thistle
#

I did have a quick look, but thanks for that

hot portal
#

i configured my bots so much im using ts instead of js. makes development quicker and easier

fast panther
#

Alright so I have a simple web server setup, the ready message to console is all set, and I replaced 0.0.0.0 with the IP address but webhook still does not seem to be functioning. I’m not sure where the data is sent via pressing the test button so I have no idea if I’m even receiving data. Anyone got any ideas?

fast panther
#

Do I need to set up a way for it to receive post requests?

#

Can someone direct me toward resources of accomplishing this

past basin
#

php is ur solution

#

@fast panther

fast panther
#

I’ve never worked with php before

#

Guess I gotta go learn a new language

jovial sorrel
#

Does this check if the user ever voted in their lifetime, or if the user voted in the past 12 hours?

#

for the dblpy library

sullen nymph
#

12 hours

#

Should probably add that to docs at some point

jovial sorrel
#

Alright, thanks!

sullen nymph
spiral steeple
#

24 hours now*

#

docs are outdated asf

#

wait

#

no

jovial sorrel
#

Can't you re-vote each 12 hours though?

spiral steeple
#

Im wrong

#

12

#

lol

#

dont listen to me

jovial sorrel
#

:P

rugged sierra
#

can the dbl api stop erroring so much? its annoying in my error monitoring

chrome canyon
#

Use it correctly

rugged sierra
#

I'm getting 5XX Errors so eyes_shake

chrome canyon
#

So?

#

Malformed request can lead to 500 too

#

As the server doesn't know how to process it

rugged sierra
#

okay I'm getting 503's and you telling me its my fault?

chrome canyon
#

Yes that's how I roll mmLol

rugged sierra
#

and I'm literally doing nothing besides posting stats with the official package written by Tonkku

chrome canyon
#

Smh

rugged sierra
#

503 Service Unavailable

Use it correctly

chrome canyon
#

You said errors

#

Then 500 instead of 5xx

#

So shush

rugged sierra
#

I get 500 and 503 sometimes so shush

chrome canyon
rugged sierra
#

and if the request is malformed then the status code should be 400 and not 500

chrome canyon
#

Bad server setup leads to 500 quite often

#

I'm not accusing dbl of not checking request sanity but it happens zoomeyes

rugged sierra
#

what brings us back to

can the dbl api stop erroring so much?
kthx

chrome canyon
#

Answer is no kthx

restive otter
#

through api is how I get the people who voted for the bot?

worn quail
#

why tho

#

stop

mystic hatch
#

Ok

worn quail
#

why here anyways

royal storm
#

How do I update my server count?

dense basalt
#

Are you already sending your server count to DBL?

royal storm
#

I'm not really sure

#

Does this count?

  console.log('Server count posted!');
})```
dense basalt
#

Yes

#

Then, it should update automatically

#

irrc

royal storm
#

Oh, what is this btw?

    console.log(stats) // {"server_count":2,"shards":[]}
});```
sullen nymph
#

Stats of a bot that you specify in the function params

#

The stats need to be posted by owner of that bot

royal storm
#

Alright, thanks!

vague jolt
#
client.on('klasaReady', () => {
  client.user.setPresence({ activity: { name: 'for giveaways', type: "WATCHING" }});
  const dbl = new DBL('nou', client);
  console.log('Posting server count')
  // Optional events
  dbl.on('posted', () => {
    console.log('Server count posted!');
  })

  dbl.on('error', e => {
   console.log(`Oops! ${e}`);
  })
})```
#

using klasa

#

not working

#

console.log('Posting server count') is working

#

posted and error both are not triggered

#

fixed

restive otter
#
DiscordBotListAPI api = new DiscordBotListAPI.Builder()
                .token("TOKEN")
                .botId("ID")
                .build();
        api.setStats(jda.getGuilds().size());

It throws ClassNotFoundException, why?
Class imported: import org.discordbots.api.client.DiscordBotListAPI;

tough grotto
#

What is this channel for? I don't know what an API is

#

I do also want to learn how to make bots for discord so I'm going to try understanding ever

dense basalt
#

For help with the Discord Bot List API

#

e.g. posting your server count to the site and gaining bot/voter information

#

If you need help with general coding like making commands, I suggest you to start with choosing a coding language, and then looking for guides online in that specific coding language

#

and then when you have questions, you can ask them in #development

#

@tough grotto

tough grotto
#

Ok thanks @dense basalt

dense basalt
restive otter
#

🦐:shrimp:

sullen nymph
jovial sorrel
#

On dblpy, I'm not sure why my on_dbl_vote is not working. There's no error being outputted. Since it's each 12 hours, I'm not sure how to test it either.

sullen nymph
#

on_dbl_test exists

#

Try playing with port opening/forwarding

#

The port being the one you specify in dblpy's Client with webhook_port kwarg

jovial sorrel
#

Is there a default port?

sullen nymph
#

Negative

#

You choose it

jovial sorrel
#

Alrighty

restive otter
#

Alright.

minor storm
#

Wtf do I do because idk if I put the code or invite it’s like asking for both

craggy garnet
#

Just the code

#

It doesn’t really matter tho

minor storm
#

Thank you

ornate abyss
#

did something change?

#

'Client' object has no attribute 'post_guild_count'

sullen nymph
#

Your dblpy version changed

ornate abyss
#

hmm

#

how to check the version?

sullen nymph
#

dbl.__version__

#

Or pip show dblpy

ornate abyss
#

ah

#

its still the same latest Version: 0.3.1

#

nvm

#

thx

sullen nymph
#

Might rename dblpy Client to something else since some errors make it hard for all of us to live

ornate abyss
#

yeah

craggy garnet
#

can someone show the script for sending server stats for a bot. sorry forgot

fickle junco
#

js?

restive otter
#

no spoonfeed

fickle junco
restive otter
#

Oh he mean that?

fickle junco
#

idk maybe

#

i wish the java lib had webhook support :/

quartz sail
grand salmon
#

what does this mean

sullen nymph
#

Try again

grand salmon
#

oh ok

quartz sail
#

can someone help me? xD

runic grove
#

just post your question

quartz sail
#

@runic grove look up

runic grove
#

oh

quartz sail
#

:(

fickle junco
#

does the website show any server count

quartz sail
#

No @fickle junco

#

Only N/A

fickle junco
#

i guess double check your tokens

quartz sail
#

I don't know why

#

I already did it but I can do it again

#

No, all is right @fickle junco

sudden dagger
#

what does the POST json response the api expects look like? i tried encoding a lua table with json.encode, but i'm pretty sure it's formatted wrong

quartz sail
#

Ok

#

I have the error

narrow geyser
#

What is it?

quartz sail
#

@narrow geyser the guilds wasn't loadet

finite remnant
fickle junco
#

Have you already set up webhooks on the dbl website?

finite remnant
#

yes

#

password and webhook URL

#

I am now offline.

sudden depot
#

@finite remnant You need to portforward
using the webhook stuff is like hosting a website

finite remnant
#

@sudden depot i dont understand

zealous helm
#

Nubs

signal comet
quartz sail
#

Can someone help me?

#

Does anyone know why it could be that when I run the Vote Command and the bot on the V server is not working but when the bot is started on the IDE it works?

#

Fixed

restive otter
#

does anyone have a python example to use the webhook vote api?

sullen nymph
#
import dbl
import discord
from discord.ext import commands

import asyncio
import logging


class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token' # set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
        self.updating = self.bot.loop.create_task(self.update_stats())

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        logger.info('Received an upvote')
        print(data)

def setup(bot):
    bot.add_cog(DiscordBotsOrgAPI(bot))
fading lynx
#

Does the DBL api automatically get values from all shards? (discord.js)

polar mirage
#

If you pass your client to it and have all shards on that client

restive otter
#

@shut crest

stone elm
#

@arctic arch not sure if it was just bad luck or some api problems today, but a lot of people complained today that they've voted and they have not received their reward.
I've checked them manually via their id, and they show as voted: 0

restive otter
#

sorry

worn quail
#

I'm so dumb...

#

that would make checking users so much easier

jagged escarp
#

Hey, I'm using the .NET lib to update all my stats, but I'm a bit confused on how to update my shard count. It takes in an int array but I manually hardcode the shard count, what would the int array be for?

sudden rampart
#

guild counts for each shard

jagged escarp
#

ah okay

#

If I pass that in, do I still need to manually update the guild count, or does that take care of both

wintry kernel
#

The python server count example is a tiny bit out-dated

#

there has been a new way to do background tasks added

sullen nymph
#

Haha, nice reminder actually

#

Mind posting an issue about it on the repo?

wintry kernel
#

Sure

#

You got a link to it?

sullen nymph
wintry kernel
#

thanks

sullen nymph
wintry kernel
#

Done

daring cove
#
async def clear(ctx, amount=100)
```is api abuse more than 100?
restive otter
#

max is 100

full nova
#

so what exactly do people use the api for?

#

like verifying votes to give rewards..?

restive otter
#

Yeah, or to fetch another bots information

#

but more vote rewards

full nova
#

ok

#

thanks

knotty snow
#

does anyone know how to check if ctx channel is nsfw

#

im using python

#

but its not rewrite

sullen nymph
knotty snow
#

ight

#

thanks

sullen nymph
#

Might wanna edit the lib code at this point tho

knotty snow
#

yeah

#

its just a lot of work transferring tho lmao

sullen nymph
knotty snow
#

lazy is offline btw

sullen nymph
#

Time is money :^)

knotty snow
#

yeah

#

nvm figured it out

worn quail
#

ehe

#

What did you do?

#

@knotty snow I accessed the api directly.

#

I want my method to be well known, so im going to post it on github or sth

#

since a lot of people still use async

sullen nymph
#

(Without sending another request, might just edit the lib and add is_nsfw property to an instance of Channel)

worn quail
#

perhaps

#

but since my bot is dead and i admit that :^)

restive otter
knotty snow
#

@worn quail I just decided to bite the bullet and upgrade to rewrite

#

needed to do it at some point lol

#

will be working on it throughout the day

hearty dagger
#

Good job

#

Rewrite > async

worn quail
#

says a whitename

cold ledge
#

I was a white name before I became a mod

knotty snow
#

white name bad

#

*crab rave

knotty snow
#

@sullen nymph changing from async to rewrite was actually really easy lol

sullen nymph
knotty snow
#

yeah np

restive otter
#

is dbl (server add function) down?

worn quail
#

No

#

You need a bot to do it though

#

9h

#

Oh

#

Nvm

#

Yeah it may be down

wintry kernel
#

Rewrite is above async

#

Everyone can agree

#

Async support was dropped in most servers anyway

hearty dagger
#

Preach

hot portal
#

Well, you learn something new everyday

deep bay
#

im so confused with the discord.js api

#

do i need to change the webhookPort and webhookAuth

junior cloud
#

It's confusing me too

#

@deep bay did you manage to get it working yet?

deep bay
#

i think im getting there

junior cloud
#

I dont

#

not at all

#

xD

deep bay
#

yeah neither

#

the vote rewards are not coming through

junior cloud
#

yea

#

but its emitting the ready event, right?

deep bay
#

no

junior cloud
#

It's emitting it for me

deep bay
#

is your code in the index?

junior cloud
#

yea

deep bay
#

hmm, let me try that then, i have mine in a seperate handler

junior cloud
#

const dbl = new DBL(token, { webhookPort: 5000, webhookAuth: "chaosiscool" }, bot);
just simply did dat

#

dbl.webhook.on("ready", hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
this normally emits

humble bison
#

don't publicly post your damn webhook auth

junior cloud
#

its not my real auth

nimble heart
#

?

junior cloud
#

@deep bay did ya try it?

deep bay
#

yeah, putting it in the index emits the ready event

junior cloud
#

kk

#

but the vote won't emit, right?

deep bay
#

just gotta wait for someone to test the vote

#

yeah no the vote event wont emit

junior cloud
#

Yup

#

I don't get that api

#

¯_(ツ)_/¯

deep bay
#

sigh

#

i wonder if the webhookPort is supposed to be changed or kept the same

junior cloud
#

Im keeping it the same

deep bay
#

same

junior cloud
#

well the ready event works so

deep bay
#

yeah

junior cloud
#

it can't be my code itself since

#

console.log("ff");
I got this at the top

#

And it's not logging

deep bay
#

yeah i got a console log in there too but doesnt do anything

#

im gonna try using the error event for it

junior cloud
#

BUT

#

In the docs it says it gives post requests right

#

Which means

#

actually nothing lmao

deep bay
#

mhm, imma try this

#
dbl.on('error', e => {
    console.log(`An error has occured: ${e}`);
})```
junior cloud
#

I got that already

#

Nothing

deep bay
#

damn

junior cloud
#

should we ping some mods?

deep bay
#

i mean

#

i dont wanna get yelled at xd

junior cloud
#

ima ping vinnie, he is cool he won#t be mad

chrome canyon
#

just ping ken

junior cloud
#

who's ken

chrome canyon
#

pensive

dense basalt
#

Kyoyu#7777

chrome canyon
#

@azure pollen who's ken

junior cloud
#

Ken, might helping me and Iska?

azure pollen
#

what's the problem

deep bay
#

the api is not emitting the vote event

junior cloud
#

^

azure pollen
#

are you writing a webhook thing yourself?

junior cloud
#

But the ready event is emitting fine

azure pollen
#

^^

junior cloud
#

tries to use brain

deep bay
#

um

#

brain.exe is not responding

azure pollen
#

if you don't want help i can leave :^)

junior cloud
#

task manager crashed while trying to close brain.exe

deep bay
#

nono

azure pollen
junior cloud
#

F

deep bay
#

i would like your help, im just trying to understand what you mean

junior cloud
#

Oki

deep bay
#

sorry if im coming off as a troll

azure pollen
#

are you using webhooks or are you making api requests

junior cloud
#

Wait so, the ready event is normally emitting which means that it should work right?

#

api requests

azure pollen
#

show code

junior cloud
#

i guess