#topgg-api

1 messages · Page 66 of 1

mild oyster
#

I'm a fucking idiot, forget about my question lmao

worn quail
#

Redo your token

#

403 is what happens when you dont have the right token

#

Obv

spiral steeple
#

He did say he figured it out

astral bolt
daring lynx
#

Is this the channel you can get help on?

worn quail
boreal bridge
#

@daring lynx unless you need help with the API

untold marten
#

@mild oyster official dbl api not working

#

I'll send you my

untold marten
#
from DiscordBotListAPI import API #import module

dbl = API(bot, 'dbl_token') #bot replace with your client

await dbl.post_guilds() #post guild count
#

@mild oyster

sullen nymph
#

Not sure how that fixes the 403 problem

untold marten
#

I tried use official dbl py api it gives me it

sullen nymph
#

What's your dblpy version

untold marten
#

Newest

#

I installed through pip

sullen nymph
#

Please tell me the exact version you have

#

pip show dblpy

untold marten
sullen nymph
#
>>> import dbl
>>> 'DBLClient' in dir(dbl)
True
#

Just ran pip install -U dblpy

untold marten
sullen nymph
#

Aha

#

cogs.dbl

#

The file is basically importing itself

untold marten
sullen nymph
#

You are importing dbl in file named dbl 🤔

untold marten
#

Ug
Hh

#

Uhh

#

:OmegaLUL:

#

But official api doesn't have on_vote event

#

We will make it

#

Based on webhooks

sullen nymph
#

dblpy has on_dbl_vote and on_dbl_test events

untold marten
#

Mmm

sullen nymph
#

Also, API wrapper is not "API"

untold marten
#

Mmm

worn kiln
#

hi

#

please

#

i have that

#
(node:2214) UnhandledPromiseRejectionWarning: Vote locking is turned off.

#

how to turn it on ?

arctic arch
#

that doesnt look like it's coming from the official library, so please move to #development

worn kiln
#

It come from the « new-dblapi »

stray vessel
#

My code is in JavaScript and every time I run the code this happens

#

exit status 1

#

Can someone tell me what it means

worn quail
#

that's not how imports work

#

in js

stray vessel
#

So what does that mean?

#

My cousin says he thinks it can't find the server

worn quail
#

its internal

#

its a string

#

remove the ;

#

'

stray vessel
#

ok

#

that didn't work

restive otter
#

@stray vessel for js you import by example:
const discord = require("discord.js");

stray vessel
#

ok

restive otter
#

Then you’ll use the discord object

#

🙂

#

The way you were trying is python btw xD

hearty lintel
restive otter
#

10-4, my apologies

dry trail
#

self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
Where do I get the /dblwebhook?

#

Thank you

sullen nymph
#

You set it yourself 🤔

dry trail
#

Set it myself?

#

Is it the url of the webhook or I'm supposed to get it somewhere from dbl site?

sullen nymph
#

It goes to the webhook URL, aka http://yourip:port/{webhook_auth}

#

Depends ig

#

If that domain handled DBL requests, I mean why not

#

and if you're sure it exists

dry trail
#

I think it is

#

But for some reason, though ngrok receives data from dbl

#

but it keeps raising 302 Found

#

They say it's not client side, but I think I'm doing something wrong here

#

Thanks anyway

dry trail
#

Hi

#

self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
Is this correct?

#

Because nothing happens when I click the test button

sullen nymph
#

Do you have the on_dbl_test event?

dry trail
#

@sullen nymph Sorry for the ping. Yes I do.

    @commands.Cog.listener()
    async def on_dbl_test(self, d):
        print(d)
        return
        user = self.bot.get_user(d['user'])```
#

I've found someone's suggestion in this chat to forward the port 5000

sullen nymph
#

Are you sure the URL you are entering is correct? GWchadThinkeyes

#

Because I am out of clues other than to poke random solutions

dry trail
#

I searched google "What's my ip?" and used the result

#

Is that ok?

#

It's http://xxx.xx.xx.xx:5000/dblwebhook

sullen nymph
#

Eh ig that should do it

#

Is your firewall blocking any requests? Is your port open and are you forwarding to that port?

dry trail
#

The owner of my place's router is not here so I'd try to forward it later

#

Thanks for the suggestion

sullen nymph
#

👍

#

That seems to be the issue

dry trail
#

We'll see

#

Thanks fufu

worn kiln
#

hi

#

i have

#
const api = new DiscordBotListAPI({ port: 8080, path: '/some_insanely_secret_path' });

#

wich path should i put in "/some_insanely_secret_path"

runic grove
#

basically whatever

worn kiln
#

if i haven't webhook ?

runic grove
#

then dont put anything there

worn kiln
#

just

const api = new DiscordBotListAPI()
#

?

#

and my dbl token ?

#
const dbl = new DBL("", {port: 5000, auth: "Auth", path:"/vote/"})
const Dbl = new DBL("",bot)
const api = new DiscordBotListAPI("",bot);


dbl.on('vote', (vote) => console.log("J'ai recu un vote :\n" + vote))
Dbl.on('vote', (vote) => console.log("J'ai recu un vote de Dbl:\n" + vote))
api.on('vote', (user, bot) => console.log(`vote by ${user} for bot ${bot}`));

dbl.on('upvote', (vote) => console.log("J'ai recu un upvote :\n" + vote))
Dbl.on('upvote', (vote) => console.log("J'ai recu un upvote de Dbl:\n" + vote))
api.on('upvote', (user, bot) => console.log(`Upvote by ${user} for bot ${bot}`));
#

i try all this methods

#

nothing work

dense basalt
#

hot api

alpine pineBOT
dense basalt
restive otter
#

s!ajuda

restive otter
#

is there a way to get raw message content in discord.py? I can't find a way

#

it would help if I could get default emojis as their in colons counterpart

#

like how 🖐 is :hand_splayed:

stone elm
#

are there any problems with the API, or do the key reset like every few months?

worn quail
#

the api may still be having trouble

#

its possible

soft jackal
scenic star
#

where should i use dbl api and can i find any examples about it

boreal bridge
scenic star
scenic escarp
#

p!help

glass stag
#

=m p nyong manis

#

P!help

runic grove
lime plover
#

.

alpine pineBOT
#

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

restive otter
#

ok

restive otter
#

how long does it take for the vote to be registered in the bot.

worn quail
#

At most 5min

restive otter
#

Should this work

worn quail
#

should what work

restive otter
#

.

worn quail
#

dotpost

#

reeee

boreal bridge
#

dad dotpost @restive otter

alpine pineBOT
#

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

formal path
#

why dad

restive otter
#

Dad help

#

Nope

#

Wait why am I nicked....

#

lol

dense basalt
#

hot api

alpine pineBOT
dense basalt
#

@restive otter ^

restive otter
#

Sorry

rocky rain
#

How do I access the API?

restive otter
#

Also I had a question...

rocky rain
restive otter
#

About the api.

rocky rain
boreal bridge
#

dad ask2ask

alpine pineBOT
#

Dont ask to ask
Just ask your question
it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

boreal bridge
#

@restive otter ^

restive otter
#

How do I get api status widget

restive otter
#

Problem: Where does one put the API in a Python code that includes many cogs and files?

#

To be specific, How do i add it to my bot, in a new file/cog or in an existing file that starts the bot?

grizzled moat
#

!join

#

!play

restive otter
#

I just made it a new cog and now i get this error?

#

AttributeError: module 'dbl' has no attribute 'Client'

runic grove
#

its DBLClient or something

restive otter
#

Ah,

amber dune
#

dbl nicetry @grizzled moat

alpine pineBOT
#

Hey, any bots that have common prefixes are now blocked from reading any channel. Nice try spamming your dms though.

runic grove
#

..is this related to the api

#

did you read the channel topic

restive otter
#

@runic grove yes, it is about the API

#

and all i get after adding my dbl token is that attribute error when i use the given code with it

runic grove
#

not your question

#

messages were deleted

#

sorry

restive otter
#

ooh ok. aorry

#

sorry*

latent trench
#

i deleted them

#

realised it was a god damn stupid question

#

sorry that it made you confused

wise onyx
#

is DiscordBotListAPI.Builder().botId() something that you get once your bot is verified?

autumn timber
#

how to use the widgets?

restive otter
#

p!y

arctic arch
#

that is not what this channel is about

amber dune
#

@void hawk pls read the channel topic

rugged crater
#

hello

#

I don't understand very well the api

frank laurel
void hawk
#

@amber dune ok..

rugged crater
#

error:
Cannot read property 'on' of undefined

My code:

dbl.hook.on('vote', vote => {
  hook.sendMessage('Thanks for your vote!' + vote.user)
});
rugged crater
#

discord.js v11.4.2

restive otter
#

hi

dense basalt
#

hot api @restive otter

alpine pineBOT
void kite
#

Hey

#

I need help to setup my bot on dbl

#

I'm using discord.py and i'd like to add the webhook

sullen nymph
#

Are you using dblpy?

void kite
#

yes

sullen nymph
void kite
#

i'll try

#

@sullen nymph I did it but i'm not sure about the webhook path

sullen nymph
#

What's up?

void kite
#

http://yumenetwork.net:27017/webhook

#

that's my url

sullen nymph
#

webhook_path arg in DBLClient instance will have value'webhook' then

void kite
#

ok then i was right

#

but why don't i get the test

sullen nymph
#

Try it without port Thonk

void kite
#

hum

#

i'm running my bot with docker

sullen nymph
#

Hold up, are you sure dblpy is running under that IP?

void kite
#

i mean

#

it's my vps

#

😮

sullen nymph
#

Try playing around with the URL

void kite
#

i've xhanged the url to the ip of my vps

#

it's not working

#
  • why my bot isn't showed as connected ?
restive otter
#

I'm confused on how to start my "vote command" or setting up this dbl thingy

I tried this part below on the image.

I did:
Installing dblapi.js
replacing yourDBLTokenHere with process.env.DBL ( my dbl token )
replacing webhookPort 5000 with 27017 ( MongoDB Compass ).

#

When I run the command, it console.logs the link with its port but when I click it, it doesn't show anything in browser.

worn quail
#

The webhook port is a web server

#

A webhook in web development is a method of augmenting or altering the behavior of a web page, or web application, with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with t...

little iron
worn quail
#

You cannot yet use the api

#

and you need to use the DBL api I believe

restive otter
#

@worn quail port of the mongodb web server is 27017

worn quail
#

that's not what I'm meaning. Is it a public webserver?

restive otter
#

I'm confused.....

worn quail
#

Localhost isnt public

restive otter
#

ah

worn quail
#

a webserver uses a public IP

restive otter
#

can I connect to local or does it have to be public

worn quail
#

and a webhook functions similarly

#

it can be connected

restive otter
#

so did I do it correct?

worn quail
#

I think

#

I never mess with web servers much since I just directly access the dbl api

restive otter
#

uh

#

this is is so complicated .-.

#

Can I have help with giving the server number over to show

#

aka api server thing

restive otter
#

I have a local host.

#

When I run my webhook command, it turns:

sullen nymph
#

Replace 0.0.0.0 with your external IP

restive otter
#

kk

#

v4?

sullen nymph
#

Should be

restive otter
#

MYIP is my ipv4

sullen nymph
#

@restive otter dblapi.js autoposts server count every 30 minutes if you provide your Client to its client

restive otter
#

When I click it, nothing happens

#

When I run the command again, it says it already exists

sullen nymph
#

Send a POST request to it

#

aka try putting that URL on the bot's edit page in webhook URL field, save it and test

restive otter
#

how do i do that @sullen nymph

sullen nymph
#

rtd

restive otter
#

wat

sullen nymph
#

Discord webhook are not supported

#

Read the docs

restive otter
#

no need to call me a retard

sullen nymph
restive otter
#

nvm

#

@sullen nymph how :_:

sullen nymph
runic grove
#

rtd = read the docs i assume

sullen nymph
#

Yes

restive otter
#

that doesnt help me

#

i looked at then then came here

sullen nymph
#

Open and look at it

restive otter
#

I tested it & clicked the link again after I restarted

#

nothing happened

#

hello

#

who can help me with youtube api/

alpine pineBOT
restive otter
#

How would I do the next step?

shut shore
#

Hello Everyone

restive otter
#

Instead of webhooks

#

can I just use a database?

#

I want to use mongodb

#

every time someone votes, it stores in mongodb

sullen nymph
#

you won't be able to receive a vote without a webhook

restive otter
#

but I have made the webhook

#

above

#

& added to bots website

#

containing my IP & the mongodb port of localhost

sullen nymph
#

Ehh you'd need to handle requests in your code

restive otter
#

that means.....?

sullen nymph
#

You don't get your requests sent to mongo directly

#

You'll need to handle the data-saving part by yourself in your code

restive otter
#

ahhh

#

Before I create the thing containing the user & vote amount, would this be correct though?

I tried the link and it does not open

runic grove
#

why are you trying to open a mongoose and a webhook connection on the same port

restive otter
#

to send the informations ot mongodb database so I can store

#

or is this wrong..?

runic grove
#

try changing your webhook port to something else

sullen nymph
#

have two connections on different ports, you got mongoose connection already, use that

runic grove
#

i dont think having 2 connections on the same port is a good idea

restive otter
#

so should I use the mongoose or the webhook port?

sullen nymph
#

Make webhook port something else

#

Then use the webhook port

restive otter
#

I'll make it 5000

hearty crater
#

Who should I inform about incorrect code example for the python client? on https://discordbots.org/api/docs#pylib

showing to use dbl.Client when it should be dbl.DBLClient

restive otter
#

The link does not work when clicking it, I already generated a webhook in my server.

For some reason, it still does not work.

I don't get what I'm doing wrong.....

#

webhook port is 5000

#

IP is in code & bot website with the port

#

I connected mongoose localhost with 27017 in that code which means that after webhook port 5000 works, the vote.user gets added to database & is saved there.

#

Nothing happens when clicking.

#

What am I doing wrong at this point.....?

inner venture
#

@restive otter errr did you just put a discord webhook in that field

restive otter
#

which field?

#

discordbots webhook field?

inner venture
#

Yeah

restive otter
#

no?

#

look above

inner venture
#

I did but hardly any of it makes sense lol

restive otter
#

uuh?

#

Well as I said, I don't get it.... I tried to reproduce every step

restive otter
#

;-;

clever rock
#

are you hosting from home?

#

if so do you know how to check your router wan ip?

#

if you know, check your router wan ip, and check if it matches the whats my ip result and google

restive otter
#

How have a API For memes?

dense basalt
#

hot api @restive otter

alpine pineBOT
lusty lava
#

=p Virgoun bukti

scarlet cobalt
#

One message removed from a suspended account.

real frost
#

regarding the hasVoted boolean in the api;
Does it only return true for a time period? 12 hrs? Or does it return true indefinitely as long as they have voted once?

sullen nymph
#

The former and yes, 12 hours

real frost
#

Damn they made it easy

#

Thank you!

sullen nymph
#

If you want to make a vote-locked command, I would suggest using webhooks to hit ratelimits less :p

real frost
#

Was about to set up a whole SQL table just to store last voted times.

#

What are the rate limits on the dbl api?

sullen nymph
#

60/60s as API docs say

real frost
#

60/min, sorry. I was on the github page, not the site

sullen nymph
real frost
#

So I still probably need to store the data myself with a webhook FeelsBadMan

rugged crater
#

Hello, I would like that my bot thank all the people who vote for him, for that I followed this doc:
https://discordbots.org/api/docs#jslib
but I can not find anything, it does not work, someone could enlighten me on how to do?

acoustic bone
#

alright this sounds real botty but how would i create a webhook?

#

i wanna just see when someone votes and announce it in my server

worn quail
acoustic bone
#

i still kinda dont get it

#

thats just a definition

sullen nymph
#

Webhook is just a server running under some IP and port that accepts requests on the go

worn quail
#

^

acoustic bone
#

so i have to have a port open in order to see when someone votes for my bot?

sullen nymph
#

Your DBL library probably has a built-in webhook system

#

Pretty much

worn quail
wise onyx
#

are webhooks supported in the java library?

worn quail
#

The reason I sent the link

sullen nymph
#

Not sure the Java library has webhooks

#

You'd have to host one yourself

runic grove
#

you could just make your own

wise onyx
#

I have a website hosted, but when I put in the url and press test, it doesn't call the php file it's linked to

#

is that what the webhook is supposed to do?

runic grove
#

it sends a post request iirc

wise onyx
#

I did a simple test where it's just a php file that mails my email some random text to confirm it got called

runic grove
wise onyx
#

whenever I open it from my web browser, it works

#

webhook doesnt do anything

runic grove
#

because it doesnt "open"

#

it sends a post request

#

not the typical get request a browser would when the link is visited

wise onyx
#

so it is getting called, just not in the same way my browser calls it?

#

so if I make it add the vote to a database now it would work?

runic grove
#

read the documentation for more info. ive never used php and i have no idea how it works

wise onyx
#

well thanks anyway, I'll try making it throw the data into a database quick and see if it does something

halcyon zinc
#
            await axios({
                url: `https://discordbots.org/api/bots/${mentionedMember.user.id}`,
                method: 'get',
            })

why i get a 401 error when i try this, but i can get on there with Chrome

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

inner venture
#

@halcyon zinc because your request in chrome is authorized

#

but you're not providing any form of authorization in that request

lofty bluff
#

Hi, how can I get the IDs of the people who voted for my bot in the last month? So that I can give them access to some commands

worn quail
#

bots/*/voted/?check=userid I think

vale sonnet
#

can someone show me the diffrent widget ui's?

spiral steeple
#

@worn quail that's last 12 hours

#

@lofty bluff webhooks and databases

sullen nymph
#

hotasapi @ember saddle

alpine pineBOT
halcyon zinc
#

@inner venture thx

south pike
#

Trying to get the api working so I can post my guild count to my bot, I copied this example from the docs and replaced the placeholders with my bot's info but it doesn't seem to be doing anything. Excuse my ignorance but can someone point me in the right direction?

class DiscordBotsOrgAPI(commands.Cog):
    """Handles interactions with the top.gg 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())

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

To add on I also have all the imports in the example as well

sullen nymph
#

dbl.DBLClient

worn quail
#

O

#

They finally updated the api

sullen nymph
#

not the docs

restive otter
#

Question, for the webhook our password can be anything we want?

and another question, how can we set/view the port?

sullen nymph
#

"view" a port? I'm sorry?

jagged meadow
#

@someone

#

@radiant terrace

dense basalt
#

hot api @jagged meadow

alpine pineBOT
worn quail
solar mountain
#

can anyone tell me basicly what is api, how to use it on discord.jc, why do i need it and stuff like that

edgy nebula
#

why it is showing this in my bot?

cunning umbra
#

you dblapi.js

sour garden
#

Are you posting your stats to the api

edgy nebula
#

no

cunning umbra
#

npm i dblapi.js

#

in your bot file

sour garden
#

It doesn't happen automatixally lol

edgy nebula
#

oh ok

#

thanks

#

i will try that dbl api

cunning umbra
#

ok

#

after go to

sour garden
#

POST to https://discordbots.org/api/bots/<your_bot_id>/stats with JSON {"server_count":<your_server_count>}

#

I think that's the correct endpoint

cunning umbra
#

let him/her read the docs

#

lol

restive otter
#

Try not to feed beginners

solar mountain
#

Can anyone basicly tell me what is API?

inner venture
#

It really depends

#

at a basic level, its just some way to interact with some external service

#

in the case of dbl, its how you can interact with DBL to post your server count and other stuff in a way that a program can understand

#

with dbl, these interactions are done through HTTP requests

restive otter
#

How do i find my api for servers?

spiral steeple
#

Does this have to do with the dbl api?

narrow zenith
#

@restive otter ^

south pike
#
# importing the requests library
import json
import requests

# defining the api-endpoint
API_ENDPOINT = "https://top.gg/api/bots/533383387763965982/stats"

# your API key here
TOKEN = "insertmytokenhere"

# data to be sent to api
data = {'server_count': 100}
data_json = json.dumps(data)
payload = {'json_payload':data_json}
headers = {"Authorization": TOKEN}

# sending post request and saving response as response object
r = requests.post(url = API_ENDPOINT, data = data, headers=headers)

# extracting response textp
pastebin_url = r.text
print("The pastebin URL is:%s"%pastebin_url)

Am I doing something wrong here? Can't seem to get this to post been trying to trouble shoot for a good hour.

#

Response is Error: Unauthorized but the Token is right I have checked it twice.

sullen nymph
#

What's the response code? 401 or 403?

restive otter
#

ur suppose to supply content type headers, instead of serializing the json and using data= use the json kwarg

south pike
#

401

restive otter
#

what i mean is its most likely expecting Content-Type: application/json

sullen nymph
#

Works just fine

south pike
#

That means there's something wrong with my token then right?

sullen nymph
#

That code should work just fine, try regenerating the token

south pike
#

Yeah, I regenerated it and it gave me code 200, that means its good right?

restive otter
#

yes

south pike
#

perfect thanks guys

#

Yep it worked.

sullen nymph
restive otter
#

question

#

how do i set up a webhook url

dawn fjord
#

]]moreinfo

alpine pineBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

dawn fjord
#

Also, please try before just asking

real frost
#

Is there any reason the vote api would only work while the bot is running on my local PC?
As soon as I push my changes to my production server, the API stops returning data regarding voting.

#

Maybe some sort of whitelist IP dbl has?

sullen nymph
#

Not that I know of

real frost
#

The hasVoted boolean returns nothing at all on my production server

#

Quite annoying

#

Like I said, works fine on my local PC

spiral steeple
#

Are you using dblapi.js

#

Well not js

#

Whatever your using

#

I just default to that mmulu

narrow zenith
#

well i did happen to find out that i had to reset my api token due to the new website migration

real frost
#

I'm using the java API but ye.

vernal coral
#

how do I send the shard amount ? I'm using JDA (Java)

real frost
#

I'm creating the api object like this in my main class

    public static DiscordBotListAPI api = new DiscordBotListAPI.Builder()
            .token(Config.apiToken)
            .botId(Config.botId)
            .build();```

Then Im calling it to update the stats on guildJoinEvents with no problems.
The issue is calling it to check votes.
```java
        Bot.api.hasVoted(user.getId()).whenComplete((hasVoted, ev) -> {
            if(hasVoted)
                DoSomethingHere();
        });```
#

Resetting my token did not work either

#

Thanks for the suggestion though

spiral steeple
#

Ah, I would offer to help if I knew anything about the java library for dbl mmLol but my knowledge of java is limited to a one year course in school last year

clever rock
#

why not try to make the request yourself?

#

I didnt use the library for java in dbl, but I do the request myself and it works

real frost
#

I may just need to try webhooks I guess.

spiral steeple
#

Those are the better option in the long run aswell.

real frost
#

Anyone have experience using webhooks in Java?

amber dune
#

@real frost yep, there are some example 40 line webservers in java where you can trigger functions when you receive a post request to a certain endpoint and/or port

#

the search term is http web server

#

that will get you the simple stuff needed for dbl webhooks

real frost
#

I was looking into using okhttp, is that the way to go to integrate with y'alls api?

amber dune
#

i guess so

real frost
#

the library for vote checking stopped working on me >.>

amber dune
#

yea the library is mega gay

real frost
#

but for some reason, setting stats works fine?

amber dune
#

yea lol

#

I just have a webserver running in the same jar file alongside the bot

#

in the main method it starts up the webserver then the bot lol

real frost
#

seems unnecessarily heavy, no?

amber dune
#

eh

#

it doesnt affect my resources all that much

real frost
#

Do you mind posting an example?

polar mortar
#

Does anyone how to find out how many users your bot is listening to on .py

boreal bridge
polar mortar
#

Ok thanks

sonic zealot
#
dbl.webhook.on("vote", async vote => {
  console.log(`User with ID ${vote.user} just voted!`);
  let voter = bot.channels.get('627797390556004352')
  let membvo = await bot.fetchUser(vote.user)
  let embed = new Discord.RichEmbed()
  .setColor("GREEN")
  .addField("**Received Vote**", "Let us thank "+membvo+" for voting for Project Genesis!");
  voter.send(embed)
});

anything wrong with the code?

#

someone help plz

hearty lintel
#

whats the error

sonic zealot
#

no error

#

it doesn't send a message to the channel

hearty lintel
#

are u getting logs?

clever rock
#

why not await voter.send()

#

see if that logs anything

#

if not then im afaik its your port

rapid cloak
#

@sonic zealot abajo no será
vote.send (embed)

restive otter
#

comment créer un bot svp

echo loom
#

@restive otter dm

runic grove
#

mumble rappers irl

#

also wrong channel

amber dune
abstract mothBOT
#

🤐 Muted proteção do Servidors#8674 (@north breach)

fresh sequoia
#

When I do the following in terminal:
$ curl -H "Authorization: MY_AUTH_HERE" "https://www.artybot.ga/dbl/wh?user=1343&type=test"
I get the expected response:
No-one should be looking at this :/
And the data is received and processed. However, when I use the test button for my bot, no data is processed. I have checked that the settings are correct, and have removed checking of the Authorization header (though it still errors if there isn't one), but still no luck. I checked logs on the server, and it seems that requests from DBL don't even include an Authorization header. My website uses Cloudflare but I don't think that should be a problem and it works when I test it... Any help would be appreciated.

#

Ah I fixed it to accept POST requests 🤦, but I'm still not getting anything...

hearty lintel
#

make sure its a post and parsing body to json content etc.

south pike
#

Hey, can anyone help me out please? I have been getting these errors ever since I created a function to post my server count every 30 minutes, not sure why it's happening.

Here is my code (the function is being called in on_ready):

async def guild_count_update():
    """Updates server count on Discord Bot List/TOP.GG every 30 minutes"""
    try:
        API_ENDPOINT = "https://top.gg/api/bots/{}/stats".format(client.user.id)
        data = {'server_count': len(client.guilds)}
        headers = {"Authorization": TOKEN}
        requests.post(url = API_ENDPOINT, data = data, headers=headers)
        logging.info('Successfully posted guild count to DBL, {} servers.'.format(len(client.guilds)))
    except Exception as e:
        logging.exception('Failed to post guild count to DBL - Error: {}'.format(e))
    await asyncio.sleep(1800)
#

Here are the exceptions I'm getting, it seems to be crashing the bot but my auto-restart script is bringing it back up (or it's doing itself one or the other):

WARNING:discord.gateway:Shard ID None has stopped responding to the gateway. Closing and restarting.
WARNING:discord.gateway:Heartbeat blocked for more than 5 seconds.
WARNING:discord.gateway:Heartbeat blocked for more than 10 seconds.
ERROR:discord.client:Attempting a reconnect in 1.66s
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/discord/gateway.py", line 468, in poll_event
    msg = await self.recv()
  File "/usr/local/lib/python3.6/dist-packages/websockets/protocol.py", line 350, in recv
    yield from self.ensure_open()
  File "/usr/local/lib/python3.6/dist-packages/websockets/protocol.py", line 501, in ensure_open
    self.close_code, self.close_reason) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1000 (OK), no reason

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 457, in connect
    await self._connect()
  File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 421, in _connect
    await self.ws.poll_event()
  File "/usr/local/lib/python3.6/dist-packages/discord/gateway.py", line 476, in poll_event
    raise ConnectionClosed(exc, shard_id=self.shard_id) from exc
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1000 (OK), no reason
worn quail
#

That's not the DBL api

#

What version are you using

#

Since I have a similar exception, and I just pass whenever it happens, and in the aiohttp library, disable auto disconnection. (Yes that's a bad idea, i know)

#

But it has since fixed it

south pike
#

I don't use the aiohttp library I'm using requests for posting to apis

#

should I switch to that?

worn quail
#

absolutely

south pike
#

Ah ok, will do, but what's the issue with using requests over aiohttp? Does requests not work properly on discord.py?

#

Okay thanks.

worn quail
#

I think .disconnect in aiohttp stops the bot, due to a certian error

sullen nymph
#

@south pike requests is blocking, aiohttp is async. You always want to make sure to use async wherever you can so that your bot doesn't stay in idle for more than X minutes and then crash.
The error code meanwhile, iirc, means that either you lost connection or that's just old library version giving you crap

south pike
#

Yeah I think it’s the old library didn’t get those until I added the requests stuff in yesterday

#

Thanks for the help guys

worn quail
#

yeah old d.py gives me big angery

sullen nymph
#

Hmm mmulu

worn quail
#

yes I'm going to rewrite stop messing with me ok?

#

(Jk ily shiv)

humble bison
#

when the webhook responds, if it doesn't provide the right auth is it to be ignored or should you send back a reply like 403

sullen nymph
#

Is that a question?
You mean the webhook for DBL?

humble bison
#

yes and yes

#

i'm in the api channel so obviously

sullen nymph
#

Ignore tbh

#

sending back a reply won't really change much

slate saddle
#

For a sharded bot should I pass the client object of every shard to a new botlist api instance or can i simply instantiate it once in the manager file and pass the shardingmanager?

carmine nebula
#

hi i have big problems with editing my server information page

worn quail
#

what is it

carmine nebula
#

first i wanted to update the page

#

but deleted it by mistake

#

i mean the page not the server

worn quail
#

that's on you

#

I don't think it can be restored

#

Cc @amber dune

carmine nebula
#

but i cant do a new one

#

i want to re create

amber dune
#

i dont believe we can

carmine nebula
worn quail
#

Now that's a concern

#

oh that's internal

carmine nebula
#

No i dont want to restore

amber dune
#

oh cool

carmine nebula
#

i want to do A NEW SITE

amber dune
#

I'll contact an admin about this @carmine nebula

carmine nebula
#

thank you

#

and the server i should go to is moved

#

Discord Server List (MOVED) can you link a new one?

runic grove
#

this is the new one

carmine nebula
#

ahh

runic grove
#

and wrong channel anyways

carmine nebula
#

where should i ask then

#

sry no idea only completly confused

worn quail
#

General

#

This channel is for the DBL api (webhooks, server count, etc.)

carmine nebula
#

okay sorry

slate saddle
#

Just updated my bot to use sharding and the bot page looks like its only taking the server count from one shard. Do I have to manually update server counts when I shard?

inner venture
#

@slate saddle you're posting one shards guild count as the entire bots guild count

#

you just need to specify the shard id +total while posting it so dbl knows its only part of the total bots guild count

slate saddle
#

I’m not actually manually posting anything, I’m simply passing the client object to the constructor of dbl in each shard @inner venture

#

Could it be related to me running djs master? They replaced client.shard.id with client.shard.ids

inner venture
#

i dunno, i dont write js 🤷

restive otter
#

@slate saddle nice name 😂 😂 😂

rugged roost
#

!play ballin

amber dune
#

dbl nicetry @rugged roost

alpine pineBOT
#

Hey, any bots that have common prefixes are now blocked from reading any channel. Nice try spamming your dms though.

white sun
#

Hello

restive otter
#

@carmine nebula no discordbots site redirect in top.gg ^^

tender pine
#

you should probably update the python example in your api documentation to use the new and preferred way in discord.py to do regular tasks: @tasks.loop(minutes=30.0)

sullen nymph
#

It's been redirected to admins and they're aware

tender pine
#

thanks 👍

sullen nymph
tender pine
#

also, when looking at the example on github, that will not work.

#

you need to self.update_stats.start() in the init

#

and preferrably

def cog_unload(self):
        self.update_stats.cancel()
sullen nymph
#

huh? When was that changed? 02think

#

the .start thing

tender pine
#

1.2 or something

#

or more likely it was there since 1.1.. i have never used it without start()

sullen nymph
#

Weird

#

It works for me just fine without that

#

Oh wait, you mean the tasks extension

#

I'll need to try that out myself

edgy vapor
#

how do i add my bot

coral python
#

g

tawny heron
#

why do i keep getting this error? (node:4) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized

sullen nymph
#

No token was specified at the time of request

#

If it was, try regenerating it

tawny heron
#

wah?

restive otter
#

i need help

#

for a bot

#

@tawny heron

#

can help

#

can some one help me

tawny heron
#

with?

restive otter
#

server count on bot

latent trench
#

how do you install the api? i try as listed and i get a lot of warnings, the warnings say that i need peer dependencies, i install them, but get more warnings saying i need these peer dependencies too, basically an ""infinite"" loop of "install this", how do i install the api without the warnings?

dense basalt
#

You are not required to install peers

runic grove
#

you dont need peer dependencies

dense basalt
#

Ha beat you to it

#

slowpoke

latent trench
#

bruh, did i install the wrong thing?

dense basalt
#

No

latent trench
#

lemme try that again real quick

dense basalt
#

It does work without peers

runic grove
#

npm screams at you for all missing peer deps

#

if d.js has missing peer deps, npm is mad

latent trench
#

^

restive otter
#

algun bot para trabajr el oro?

restive otter
#

Hey

daring cove
#

@sullen nymph pls

latent trench
#

did you read the log or what it says?

daring cove
#

yes

#

no attribute

latent trench
#

ok

daring cove
#

but why on mac it has it?

sullen nymph
#

I hope you read the changelog

daring cove
#

and no errors

sullen nymph
#

I hope you are THOROUGHLY sure your versions match up

daring cove
#

oh

#

rip

#

okeh

#

thanks

restive otter
#

Can someone help me with the API?

dire abyss
#

youre not supposed to be selfbotting xD

restive otter
#

xd

#

need it at ISelfBot me = await DblApi.GetMeAsync();

restive mantle
#

Hello everyone, I created my webhook for a channel and when I put the link in my bot's info and test it, nothing gets sent to the channel. What could I be doing wrong?

restive otter
#

You don't do anything wrong @restive mantle , the webhook doesn't send messages on its own.

restive mantle
#

@restive otter can you help me set this up?

restive otter
#

Ofcourse,

#

what language you use?

restive mantle
#

python

restive otter
restive mantle
#

I'm trying to do the exact same thing but it doesn't work for me :/

restive otter
#

What part doesn't work?

restive mantle
#

the on_dbl_test(data)

#

when I hit test on the website, it doesn't print out anything

#

I have:

dblpy = dbl.DBLClient(bot, token)

@bot.event
async def on_dbl_test(data):
    print(data)

@bot.command()
async def upvotes(ctx):
    uv = await dblpy.get_bot_upvotes()
    print(uv)```
#

the command o!upvotes works, but whenever I try and test the dbl_test thing, it doesn't do anything.

sullen nymph
#

You need to use the built-in webhook system

#

Specifying webhook_port will run one under that port but it has to be open and forwarded

restive otter
#

const DBL = require('dblapi.js');
const dbl = new DBL(`${config.DblApiKey}`, { webhookPort: `${config.webhookport}`, webhookAuth: `${config.auth}` });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook: http://${hook.hostname}:${config.webhookport}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`L'utilisateur ${vote.user} vient juste de voter pour le bot!`);
  client.channels.find('id',`ID_CHANNEL`).send(`L'utilisateur ${vote.user} vient juste de voter pour le bot!`);
});```
(console: Webhook: http://0.0.0.0:3001/dblwebhook)

Why doesn't it work?
restive mantle
#

Damn, this sound so difficult :/

restive otter
#

:/

sullen nymph
#

Is webhookPort supposed to be a string

restive otter
#

Mmmh

boreal bridge
#

@restive otter because 0.0.0.0 means its listening on your external ip

restive mantle
#

Just made a webhook for another site and worked without any coding 😕

boreal bridge
#

that isnt what you should enter on the site

restive otter
#

const DBL = require('dblapi.js');
const dbl = new DBL(`${config.DblApiKey}`, { webhookPort: 3000, webhookAuth: `${config.auth}` });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook: http://${hook.hostname}:3000${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`L'utilisateur ${vote.user} vient juste de voter pour le bot!`);
  client.channels.find('id',`ID_CHANNEL`).send(`L'utilisateur ${vote.user} vient juste de voter pour le bot!`);
});```
?
#

Oh

#

How to solve that i don't understand...

sullen nymph
#

Well it's not much coding here
You just need to make sure that the port you are trying to use is open

restive otter
#

Yes he is open

boreal bridge
#

instead of 0.0.0.0 use the ip of the system that your bot is running on

restive mantle
#

I dont even know which port to use 😂

restive otter
#

Oh okay

sullen nymph
#

Something that is not in use rn :p

restive otter
#

@boreal bridge but how?

#

This is automatic i can't :/

boreal bridge
#

what

restive otter
#

Change that

#

0.0.0.0

boreal bridge
#

you do not need to change that

#

on the webhook settings on the website

restive otter
#

He is in my bot page

boreal bridge
#

utilize the ip of the system that your bot is running on

#

imstead of 0.0.0.0

restive otter
#

Mmmh

restive mantle
#

rip my webhook 😂

boreal bridge
#

bad

restive otter
#

?

boreal bridge
#

yes

restive otter
#

Oh okay

#

Thank you

halcyon zinc
#

i need to sent the server count like:

 headers: {
            authorization: '<authorization key>'
        },
        data: {
            server_count: bot.guilds.size
        }

🤔

scarlet cobalt
#

One message removed from a suspended account.

halcyon zinc
#

discord.js

sullen nymph
#

The data JSON is supposed to be sent as request body

restive otter
#

Why can't I use the API to send a GET request through code

#

I get Exception: The remote server returned an error: (401) Unauthorized.

#

While I can just run it through my browser and it works fine

sullen nymph
#

Are you sure you are sending your token for authorization

restive otter
#

Do you need auth for GET?

sullen nymph
#

Yep

restive otter
#

Ahhhhh

#

alright thanks lol

sullen nymph
#

You need auth for any requests

restive otter
#

🙂

astral river
#

How do I do to change the name of my bot ?

#

I changed it in my discord developper but the name is still the same

restive otter
#

client.DefaultRequestHeaders.Add("Authorization:", authorization); returns Exception: The header name format is invalid.

#

Anyone up to help?

#

@astral river You sure you hit Submit?

#
"Authorization:", "bot token"```
#

Oh

#

That's what I do

sullen nymph
#

Authorization, not Authorization:

restive otter
#

Thanks! 🙂

#

you use what to do the queries?

#

HttpClient 😉

#

D'acc

obsidian tide
#

How do u make a lib?

#

Guessing GET and POST etc

#

Wrong channel.

astral river
#

Do I have to download other module than npm i-- discord.js and npm i-- sfs ?

sonic sphinx
#

npm i [module]

worn quail
#

@astral river to change a bot's name, no. If you wanna use things like canvas, then yes

humble bison
#

this is the api channel

restive otter
#

server count is not getting updated on top.gg why?

#

i even have them setup in my bot

#

its not getting updated at all

restive otter
#

@restive otter how do you update it?

#

on startup, by command, or with a timer?

restive otter
#
const DBL = require("dblapi.js")
const dbl = new DBL('Token');

// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})

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

@restive otter using this

restive otter
#

And when do you run that?

#

@restive otter

#

And you're aware that // Optional events dbl.on('posted', () => { console.log('Server count posted!'); }) doesn't post it, its just the event that checks when its posted.

#

when i restart bot and it auto updates guild

#

ohh

#

oof

#

xdddd

#

That's why its an Optional event 😉

#

idk how to make it update guild per minute oof

#

you can just run it when it joins / leaves a guild

#

ok

#
setInterval(() => {
    dbl.postStats(client.guilds.size);
    console.log(`Posted! server count ${client.guilds.size}`)
}, 1800000);
#

will this work if i put on on_ready?

#

@restive otter

#

let me check the javascript api

#

Yep, that posts the count 😄

#

k

#

make sure you do use your token, xd.

#

instead of Token haha

neat sierra
#

hello

#

i have problem installing packages with "npm" command

#

whenever i open it it prompt to other cmd prompt and do nothing

#

how i fix it

#

i see everything

#

node.js is in path

#

everything is all right

#

but can;t install anything

willow ruin
#

Are webhooks working atm?

#

Yeah, they work, but why so huge delay between vote and webhook?

neat sierra
#

aaaa are u telling to me?

willow ruin
#

to all who can reveal some info about issue

neat sierra
#

oh

#

ok

scarlet cobalt
#

One message removed from a suspended account.

neat sierra
#

see the video

scarlet cobalt
#

One message removed from a suspended account.

neat sierra
#

ok

#

wait

#

i teell you

#

the problem is node.js is complety installed on my computer but the npm command is not working whenever i try to install any package it prompts to another window

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

neat sierra
#

oh

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

neat sierra
#

ufff the bug

#

how i fix it

wintry wraith
#

?

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

neat sierra
#

oh sorry

scarlet cobalt
#

One message removed from a suspended account.

neat sierra
#

i have like 4 drives

restive otter
#

guys, who here use linux?

arctic arch
#

is this api related

#

if it is just ask your question

#

otherwise move to general or off-topic

restive otter
#

@restive otter I do.

restive otter
#

thnks

karmic hound
#

Will the API be getting moved to top.gg at some point or can we just keep reporting to dbl site?

boreal bridge
#

@karmic hound afaik for now it will stay on dbl site for consistency

restive otter
#

Everything about the API has been moved to top.gg

#

Preuve:

arctic arch
restive otter
#

I'm logged...

#

I use discord on browser..

arctic arch
#

if you make the request using an api token it will work

restive otter
#

Okay

hearty lintel
#

I think it’s because he’s probably logged in on top.gg so the discordbots.org endpoints won’t have auth btw @arctic arch

arctic arch
#

thats what I just explained

hearty lintel
#

Feck

serene oracle
#

I can't get my vote event

dbl.webhook.on("vote" exc.
narrow zenith
#

Because it’s not the full code

restive otter
#

@serene oracle example

#

But use glitch for votes this is best

serene oracle
#

@restive otter I can't see this link

#

@narrow zenith Ofc this is not the full code, I just want to know the correct syntax

restive otter
#

Oh wait

serene oracle
#

I will check it out, thanks!

#

Will the link expire or I can check it sometime?

restive otter
#

No

#

He can't expire

#

For stay online the glitch

serene oracle
#

Yea I know, I mean if your project will set to private

restive otter
#

No he is public

#

^^

#

You can use the remix options for make you own project for security et make it private

craggy grove
#

Is it required to use a webhook in order to tell when someone votes for your bot in the last 12 hours?

#

I’ve been reading about them but I’m still a bit confused on how to go about setting up a webhook. Does anyone have a useful resource I could read to check out how to set up a webhook?

#

Any help would be appreciated 😄

hearty lintel
#

You can use one of the official libraries to easily set it up

craggy grove
#

By official library you mean the JavaScript library on the top.gg site, right?

hearty lintel
#

yeah

#

dblapi.js

craggy grove
#

Ah ok, so the webhook will automatically be set up provided I use that library?

hearty lintel
#

yeah

craggy grove
#

Awesome, will the example code on the page work if I give it a valid token?

hearty lintel
#

for the most part

#

u have to do the setup urself

craggy grove
#

Gotcha, thanks my dude 🙏

#

That’s also part of my issue too, though

#

Like, where do I get the webhookPort and webhookAuth from? I’m assuming the example code has dummy values for those

sullen nymph
#

You set them yourself

craggy grove
#

I’m just struggling to see where I can set up a webhook correctly

#

Ok, so when I edit my bot’s page, under API options, under Webhook, I have to give a URL and authorization. What should be going into those fields and where can I get/set up those values?

worn quail
#

Url is your webhook url, the password is whatever password is used in the webhook

craggy grove
#

Where do I get the webhook url? Is that an external thing I have to set up?

worn quail
#

Yes

craggy grove
#

Do you know where to set this up? Sorry lol I’ve never worked with this stuff before and I want to learn how

worn quail
frank ravine
#

anyone else having weird problems with adding reactions through bots specifically

#

some bots can and some cant

amber dune
#

dbl api @frank ravine

alpine pineBOT
amber dune
frank ravine
#

Ok sorry !

errant wasp
#

Not sure if this is the proper place but the Python documentation needs to be updated. (https://top.gg/api/docs#pylib)
Lowercase the -R on install from source and change dbl.Client to dbl.DBLClient

karmic veldt
#
bot.shard.fetchClientValues('guilds.size')
    .then(results => {
      bot.user.setActivity(`-help | ${results.reduce((prev, val) => prev + val, 0)} guilds`);
      data.postStats(`${results.reduce((prev, val) => prev + val, 0)}`, bot.shard.id, bot.shard.count)
    })```
#

This is pushing more guilds than the bot has

#

Anyone have any idea why?

#

Its pushing the right number of guilds to the setActivity

#

But not to DBL

spiral steeple
#

@errant wasp that's been known about for a while

#

They literally just don't care

sullen nymph
#

@errant wasp If you suggest dblpy to someone, please ask them to read the Github repo instead 02lul

errant wasp
#

Well, I mean if you're working on a bot these issues are easy to solve since they require basic knowledge anyways

sullen nymph
#

Well yeah but not all people read changelogs or the docs apparently

restive otter
#

You aren't wrong

eternal moat
#

What does an example webhook URL look like?

#

i.e. how is the authorization sent? is it just in a query string? example: https://domain.com/webhookCheck?Authorization=xxxxxx

spiral steeple
#

Most look like http://ip:port/path

#

Depends on if you have a domain and dns for it

#

The authorization is a header as well

eternal moat
#

Yeah I do, I'm getting an invalid signature

#

ah ok

arctic arch
eternal moat
#

Presumably the key of the header is 'Authorization' and the value is the authorization value set in the edit page?

arctic arch
#

yes

eternal moat
#

Hm ok ty

restive otter
#

heyy

#

how can i post my bot's server count on dbl?

hearty lintel
restive otter
#

@restive otter <dbl>.postStats(guildcount, ?shardcount)

restive otter
#

get an error on <dbl>

#

you could dm me btw

restive otter
#

@restive otter

worn quail
#

@XxMirayxX21#3561 you dont use <dbl>

#

@restive otter

#

you use your dbl client

#

Eg DiscordBotList.postStats(guildcount, shardcount)

thorn lake
#

What timezone does the monthly vote reset happen? midnight utc?

worn quail
#

around that I believe

sullen nymph
#

Yes

thorn lake
#

thanks

restive otter
#

@restive otter oliypls

#

<dbl> is ur dbl client

#

so what you defined ur dbl client

#

why do ppl fall for that i dont understand

restive otter
#

Ohhh mine is dbl. btw ik how to fix that now

restive otter
worn quail
scarlet cobalt
#

One message removed from a suspended account.

rare thicket
#

@scarlet cobalt

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

scarlet cobalt
#

One message removed from a suspended account.

tawny heron
#

Why is my api telling me that no DBL token has been provided altho i have provided it with a token?

scarlet cobalt
#

One message removed from a suspended account.

tawny heron
#

uhhh

#

its gonna be a mess

#

but sure

#

multiple files ya know

#
const Discord = require('discord.js');
const client = new Discord.Client({ disableEveryone: true, disabledEvents: ['TYPING_START'] });
const DBL = require("dblapi.js");
const dbl = new DBL(process.env.DBLTOKEN, client);```
#
event.execute(client, dbl);```
#
async execute(client, dbl) {```
#
dbl.postStats(client.guilds.size);```
#

DBLTOKEN=<token copied from top.gg -> edit -> scroll down -> show token

boreal seal
#

async execute(client, dbl) { ?

tawny heron
#

executes the other file

#

event.execute executes that

strange swallow
#

You might also want to specify message caching settings.

tawny heron
#

it works ok?

#

but the it does say that invalid token

halcyon zinc
#

Webhook running at http://0.0.0.0:5000/dblwebhook
is that normal 🤔

tawny heron
#

nice ip lol

sullen nymph
#

Yes, you replace 0.0.0.0 with your external IP

grim dew
#

okay I got a short question

#
Traceback (most recent call last):
  File "C:/Users/nope/Desktop/Programmierung/QBot Beta/beta.py", line 407, in <module>
    setup(bot)
  File "C:/Users/nope/Desktop/Programmierung/QBot Beta/beta.py", line 404, in setup
    discord_bot.add_cog(DiscordBotsOrgAPI(discord_bot))
  File "C:/Users/nope/Desktop/Programmierung/QBot Beta/beta.py", line 66, in __init__
    self.dblpy = dbl.Client(self.bot, self.token)
AttributeError: module 'dbl' has no attribute 'Client'```
#

its python btw

sullen nymph
#

boi it's dbl.DBLClient

grim dew
#

oi

#

and it starts automatically?

#

or do I have to do anything else?

sullen nymph
#

what starts automatically? Server posting?

grim dew
#

yeah it does

#

nevermind

restive otter
#

:D?

sullen nymph
#

Did you read the topic of this channel?

astral river
#

Sorry ^^’

worn quail
#

@sullen nymph is that a neko pfp

craggy grove
#

how can i automate vote rewards? i just want to automatically reward users for voting for my bot

sullen nymph
#

Webhook

craggy grove
#

i know you need webhooks, but ive googled a bunch and i dont know where to start

sullen nymph
#

There might be one provided by your DBL library if you use one

craggy grove
#

im using the javascript library, is that one of them?

sullen nymph
#

dblapi.js has built-in webhook

craggy grove
#

oh shoot

#

sorry, im really new to webhooks so its all a blur for me

#

but do you know what information i have to provide it myself, and where to get that information?

#

i see you need a port number, auth, password

#

how do i give it the correct information, and where do i get it from?

#

any help is appreciated 😄

sullen nymph
#

Everything is customized
You'll have to make sure the port will be forwarded and open and no firewall is going to be blocking any traffic for that port
Auth is set by you on the bot's Edit page. DBL will send the Authorization header with your auth value

craggy grove
#

ohhhhhhh

#

okay, i see now

#

so to summarize, i would need to make sure im not blocking top.gg from sending data, and customize the authorization so the value i put on the site matches my code?

#

and thats it?

sullen nymph
#

Pretty much

craggy grove
#

awesome, thanks man!

sullen nymph
craggy grove
#

i think i got the right setup, how can i test it?

sullen nymph
#

Save the settings on bot's Edit page

#

You should also notice the Test button

craggy grove
#

oh ok lmfao thanks again

restive otter
#

in "messageUpdate" events, does "message" still work or do you have to speciy oldMessage/newMessage ?

hollow rose
#

I'm posting only server_count which is 43,143 but on the website it appears 24,636, any clue why that might be the case?

worn quail
#

Cache