#topgg-api

1 messages Β· Page 34 of 1

median cedar
#

port forward?

arctic arch
#

open the port 5000 in your router so requests can be sent through it

severe iron
#

can someone help me with setting up the webhook thing?

median cedar
#

i'm just googling how to port forward

#

will this work once i upload it to Heroku?

#

what will I have to change to make it work on Heroku

severe iron
#

Heroku should open a port for you

sudden depot
#

Should i make a PR for dblapi.js for the weekend doubler support

arctic arch
#

I'm working on it

median cedar
#

i care much more about getting it to work on Heroku than my laptop. Does that mean that I don't need to bother with this port forwarding stuff if I only care about Heroku?

sudden depot
#

its good to learn

severe iron
#

upload it to Heroku and then start it. It will tell you the port

#

you can also type heroku open to open the webhook page

median cedar
#

thx

#

will this require a separate Heroku worker?

severe iron
#

I think so

median cedar
#

k

severe iron
#

can you help me with setting up the webhook server?

#

I have it installed on my vps, I just don't know how to use it

median cedar
arctic arch
#

what do you have installed on your vps

sudden depot
#

@arctic arch isn't it accutally better to use destructuring like

const {body} = await this._request('get', `weekend`);
return body;```
severe iron
#

@median cedar
I got this back

<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /</pre>
</body>
</html>```
arctic arch
#

why destruct tho

median cedar
#

i'm afraid i can't help you with that one, i'm new to this today πŸ˜‚

severe iron
#

are you able to send a POST request to yours?

median cedar
#

how do I find the IP of my Heroku application? it's just saying http://127.0.0.1:5000/

severe iron
#

type heroku open and it will open the webpage

#

then copy the url

restive otter
severe iron
#

probably

restive otter
#

Even though the endpoint doesn't even work

severe iron
#

it works for me

restive otter
#

Always returns 0 for me

median cedar
#

at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=smileybot-webhook.herokuapp.com request_id=a87ba71d-da5d-44c6-9a8c-d9deebd1a952 fwd="92.234.80.47" dyno= connect= service= status=503 bytes= protocol=https
what does this mean?

#

this was in the logs after typing heroku open and being confronted by an error

restive otter
median cedar
#

this is about the DBL API

restive otter
fading kraken
#

the "test" webhooks seem to arrive at my bot okay, but the real vote webhooks seem to not arrive?

#

nvm it did work

#

just delayed

sudden depot
#

@arctic arch isnt the vote cooldown 12h now

+   * Returns true if a user has voted for your bot in the last 24h.

or did i miss understand that part

arctic arch
#

thats the cooldown ye

desert minnow
#

Hey, can anyone tell me the timezone that the API uses for monthly vote-tracking? Want to make sure my bots' code is lined up

arctic arch
#

London

desert minnow
#

Thanks

desert minnow
#

Quick thing - doesn't seem like the double votes gets registered properly. When I run a get request, it doesn't take into account the double votes.

My vote count should be at 6 if it was.

Also noticed due to a discrepency between my calculated value and the value on the site - my code calculates 48 votes, while the site displays 56

arctic arch
#

how does your code calculate it

desert minnow
#

@arctic arch Throws a call to getVoters, which returns a list of users. Loop through the users, adds 1 to a total amount, and adds 1 to a hash where the key is the users' id, and the value is the users' total votes

#

Hasn't been wrong until the double vote

arctic arch
#

multiplied votes aren't in the list twice

desert minnow
#

Ah. That would explain it

#

Gonna have to do some trickery w/ the isWeekend call

honest root
#

Tonkku is everywhere ._.

restive otter
#

i need help
how to send my bot guilds size on the shard
i get error

inner venture
#

Which language are you using?

restive otter
#

discord js

#

@inner venture

inner venture
#

What's the error youre getting?

restive otter
#

see

inner venture
#

Something is already using port 5000

restive otter
#

hmm i use 4 shard

#

what can i do

fast tapir
#

Use a different port?

restive otter
#

i fix it

gray dove
#

I just tried the API and used UpdateStatsAsync and set it to my current guild count. Does it take time to reflect in the webSite ot I messed something up

#

C# api btw

restive otter
#

how can i request from the bots api with python?

#

i mean can someone give me and example of a request url?

gray dove
#

The example is here

steady pilot
#

...

restive otter
#

i don't understand it

#

i mean

#

how do i format the url?

#

that is what i meant

steady pilot
#

Google πŸ˜‚

#

Lol

gray dove
#

How long does it take to reflect the changes in the website?

restive otter
#

google does not help

gray dove
#

@uncut crystal Firstly sorry for ping but I really need help on https://discordapp.com/channels/264445053596991498/412006692125933568/469946640741171240 and not because I want to get it working but because I messed something up from the examples on the website and now it shows that my bot is in 2133 servers which is just not true. I'd really like not to get banned for doing this as it is againt the rules. So how to corrct or completely remove it? πŸ€”
Again sorry for ping.

uncut crystal
#

just send another request setting it to the proper value

gray dove
#
            await Global.MeBot.UpdateStatsAsync(21);```
#

Ive been doing this for like 10 times

#

Stll doesnt work

steady pilot
#

Has anyone made a new bot?(like just now?) Cause I wanna test it lol

uncut crystal
#

not really appropriate for this channel

#

@gray dove I'm not familiar with the C# lib API but just making the request manually will always work

steady pilot
#

...

#

Can anyone help me make a bot?

#

Oops wrong channel

#

Lol

gray dove
#

Well sadly it still shows 2133 servers desite the updates and i have this feeling that imma get rekt for this

uncut crystal
#

nah

#

2133 isn't a very extreme number + you've warned us and you're trying to fix it

#

Do you have access to curl?

gray dove
#

Nope

#

Anyways thanks for help. Ill wait for some c# dev to read this n fix. just happy that i wont get banned xD

uncut crystal
#

yeah, don't worry about that

gray dove
#

πŸ‘

honest root
#

@gray dove

  1. #development
  2. did you use authorization properly? I mean ID and API token.
  3. by breakpoint you can see exactly what's wrong with HTTP request, like "404 not found" "bad request" or "unauthorized" etc
restive otter
#

so i was wondering is voting kinda broken? I have some users that are having issues voting with the new 12 hour vote system

severe iron
#

wut

vital anvil
#

@honest root ey boi

steady pilot
#

...

vital anvil
#

so I don't quite know how to contribute (or commit to a open pull request of someone else) but the library already automatically serializes json

steady pilot
#

Hey veld

#

How r u

snow fiber
#

Keep it on topic please

vital anvil
#

hi im ok, u having questions on discordapis?

honest root
#

yo

vital anvil
#

Heya

#

lemme uh

inner venture
#

Which library?

vital anvil
#

.net

steady pilot
#

Can u help me make a bot?

inner venture
#

oh hm

#

Not here @steady pilot

steady pilot
#

My computer legit won't workπŸ˜‚

#

Boi

vital anvil
#

πŸ‘€ πŸ‘€ library developer role

steady pilot
#

Don't tag meh @inner venture

#

When Im right HERE

inner venture
#

Just wanted to make it clear who I was talking to 😊

#

@vital anvil I only make the java lib kek

steady pilot
#

-_-

vital anvil
#

I made the .net lib πŸ‘€

inner venture
#

πŸ€”

#

oh yeah you did!

#

Yeah!

#

i remember now kek

vital anvil
#

do you know how to push to a uh

#

sweatpepe pull request from someone else

#

do I fork their repo and PR there?

inner venture
#

Nay nay

vital anvil
#

oof

inner venture
#

go to the Pr and scroll all the way down

#

I had to learn how to do this today too hahah dw

vital anvil
#

hahaha

#

nobody ever contributed to my things before

honest root
#

I felt like what I have done does not looks pretty nice, but wasn't sure what to do, so you saying I have to get rid of dynamic object and use existing Deserialize?

inner venture
#

@cobalt ruin Can you give Veld the library dev role

#

because hes a library dev

honest root
#

and... me? I have contributed it.... I guess...

cobalt ruin
#

Sure thing

vital anvil
#

lorik did contribute and maintain the recent updates

#

πŸ‘ major props

honest root
#

πŸ™

vital anvil
#

but yeah

#

lemme dm you bb <3

snow fiber
#

Nice pinkish

inner venture
#

tbh i cant tell the diff between the lib dev color and teh mod color

#

With veld's small name, I mean

surreal junco
#

πŸ˜‚

snow fiber
#

You will know when you are banned

#

/s

inner venture
#

😀

snow fiber
#

Anyway we are diverging

inner venture
#

πŸ‘‹

violet crane
#

So no matter what my .hasVoted() check returns false?

inner venture
#

Which lib?

restive otter
#

i'd assume js lib

violet crane
#

js yep

dawn kernel
#

does the weekend multiplier apply to GTM or the voter's local date ?

honest root
#

I think UTC

dawn kernel
#

okay thx :)

#
if (isWeekend(gmdate())) { ```
#

something like that I gues

#
function isWeekend($date) {
    return (date('N', strtotime($date)) >= 6);
}```
sudden depot
#

I think it doesnt take Date

honest root
dawn kernel
#

oh thx

dawn kernel
#
function boolean isWeekend() {
    $r = new HttpRequest('https://discordbots.org/api/weekend', HttpRequest::METH_GET);
    try {
    $r->send();
    if ($r->getResponseCode() == 200) {
            $json = json_decode($r->getResponseBody()), true);
        return $json["is_weekend"];
        }
    } catch (HttpException $ex) {
        echo $ex;
    }   
    return false;
}```
#

like this then?

#

I'm not so good in requests in php

dawn kernel
#

oh

#

it has been added to the body request as a new value facepalm

loud gulch
#

so im trying to run my voter only command and it says i didnt vote even though i did? im using .hasVoted() function for dblapi.js

arctic arch
#

try again

austere crescent
#

I've added the DBL dependency and repository to my maven project, now I'm kind of stuck on what to do next. The instructions are really confusing

#

<dependency>
<groupId>com.github.DiscordBotList</groupId>
<artifactId>DBL-Java-Wrapper</artifactId>
<version>1.0</version>
</dependency>

loud gulch
#

still says i didnt

austere crescent
#

I need help πŸ˜‚ idk if I'm stupid or not but I tried at 4 in the morning to do it, and I wasted an hour with no progress

#

please ping me if u can help

inner venture
#

@austere crescent yo yo yo

#

The current lib is really old

#

I'm remaking it on the rewrite branch

#

Here, let me get you a dep that'll build that one for you

#

Here -- use this as the version: e592e99

#

Once there, follow the readme in the rewrite branch

austere crescent
#

Thanks heaps

desert minnow
#

@inner venture Ooh. I'm liking the changes you've done to it.

Thanks for taking a look at my changes, by the way! owo

inner venture
#

Were you the one that PR'd?

#

@desert minnow wearywoman

desert minnow
#

LUL Yep

#

Made those horrible bandaid fixes

inner venture
#

Hahaha

desert minnow
#

GWnanamiTohruPoint They served their purpose LUL

inner venture
#

Did you just build the fork?

#

and use that

desert minnow
#

I cloned the master repo and built ontop of that

#

until I got responses from the API

inner venture
#

lmfao

desert minnow
#

Never used retrofit. Seemed fun Β―_(ツ)_/Β―

inner venture
#

Yeah, it's nice for making simple api clietns

#

but any more complex than that, it's not so great

#

thats why I ended up ditching it for more control

desert minnow
#

Yeah. I've just basically switched to webhooks now. Streamlined my copy of the library to the basics

inner venture
#

Tbh

#

I kinda wanna add webhook support for the lib

#

but i kinda feel like its an overreach

#

I dont know

desert minnow
#

It'd be a pain for the enduser to setup

inner venture
#

Maybe

desert minnow
#

I've really badly cheated w/ my webhooks

#

the webhook goes to my website, which parses it and sends a message to a channel on my Discord that my bot can see, which then it sees, and parses the data.

#

It works

inner venture
#

hahahahahahahahahaha

#

oh my god

desert minnow
#

It's horrible - but it works

#

Nailed it

arctic arch
#

eww

desert minnow
#

I needed a quick and dirty way of setting up the webhooks NotLikeThis1

#

I mean - it's not horrible. When the bot goes down and comes back up, it scans through the channel and parses the votes that are there

#

So

#

Β―_(ツ)_/Β―

proud sphinx
#

Oh that's even more eww

restive otter
#

How can I request from the api with python?

full socket
#

I think someone made a python lib for this

restive otter
#

I wish

#

Only thing I need is the url format

#

Like example url

#

Oh and

#

I have another problem

#

My widget does not update

#

Tho I have the loggin setup

proud sphinx
#

There is a Python lib

restive otter
#

where is it?

#

can you show it to me?

plain timber
restive otter
#

alright

vital anvil
#

Tbh it's an interesting way of creating messaging

#

Why run a message queue if discord can be your message queue LUL

snow sky
#

i cant get the webhook part of dbl to work

inner venture
#

Whats up alek?

snow sky
#

i think i need to put the address to my webhook in the edit page bloblul

#

and im pretty sure i have everything declared correctly

#

i was typing webook instead of webhook in the events

arctic arch
#

works now?

snow sky
#

well, the bot is connecting but still no response from the servers

#

though i dont know how to use http servers

arctic arch
#

port forward and all that stuff?

inner venture
#

port 0?

snow sky
#

i did, i even tested it with my app that i made for things like this and i got an ERRREFUSED

#

no response from the webhook of course

arctic arch
#

port is 0 when the webhook is attached to an existing server

#

whatever that server is listening to is the port but I can't really tell what it is

snow sky
#

i have http.createServer(app) listening on 5000

#

i give up

arctic arch
#

that is correct

full socket
#

Wait why is he trying to listen again on the same port?

#

That would create an exception, wouldn't it?

arctic arch
#

I dont see listening twice

full socket
#

I mean, the lib listens when you first create the object according to the docs. But again he has server.listen which listens on what I assume is the same port

arctic arch
#

if you look at the options, they have attached that server to the webhook

full socket
#

Ah gotcha. My bad

restive otter
#

yes kef

full socket
#

What lang did you write your bot in?

snow sky
#

js with eris

restive otter
#

python

#

async

full socket
#

Are you using the python lib?

restive otter
#

ye

#

it loaded the module without any error so far

#

but doesn't seem to work

cyan ruin
#

it's outdated

full socket
#

Use the code here

snow sky
#

if i dont use something like express will that work too?

full socket
#

No idea honestly

snow sky
#

just puting in webhookPort: 5000, webhookPath: '/dblwebhook' into the args

full socket
#

Uh

#

Alek

#

You're running this on Windows right?

snow sky
#

planning to put this onto my linux later yeah, why

full socket
#

Try running it as admin

#

I was trying the same thing but in another lang and it only worked when I ran it as admin

restive otter
#

um

#

it didn't work

#

πŸ€”

snow sky
#

Visual Studio Code is already running as admin, and it asked me if node was allowed to run through the network

#

and i allowed it

full socket
#

No idea then

#

What does app.get do exactly?

snow sky
dreamy agate
arctic arch
#

you need admin for ports lower than 1000

snow sky
#

well i am using 5000 so idk

arctic arch
#

are you sure you set up port forwarding right

snow sky
#

it is

arctic arch
#

try requesting 127.0.0.1:5000 with postman or something

snow sky
#

i dont have postman

restive otter
#

@full socket ty got it

snow sky
#

hang on im grabbing postman

full socket
#

@restive otter no problem

snow sky
#

going to get a response from the webhook at the 127.0.0.1:5000/dblwebhook gives me

#

switching just the api gives a blank response

#

still no response from anything like the test button

#

would the api be considered a public network?

arctic arch
#

do a POST request

#

instead of GET

snow sky
#

ok

#

cannot post

arctic arch
#

did you switch away from express?

snow sky
#

i did and it left an empty response

arctic arch
#

oh

#

did you check the status code

snow sky
#

wait, cannot post was with express

arctic arch
#

a blank response with some 400 should be the webhook itself in action

snow sky
#

they all are 404

#

ok i have express commented out and node allowed to work on a public network

#

yeah, all 404 not found

arctic arch
#

that's odd

snow sky
#

OOH i got a bad request

arctic arch
#

now thats more like it

#

what does the url look like on the edit page

snow sky
#

i went through 127.0.0.1:5000/dblwebhook instead of just 127.0.0.1:5000

arctic arch
#

yeah

snow sky
#

though, instead of it actually doing anything, the website didnt do anything still

#

no vote confirmation or anything

full socket
#

A stupid question but are you sure you're using your public ip address on the website instead of your local network address?

snow sky
#

im using my public on the website

full socket
#

Because it's either that or your firewall is blocking something

snow sky
#

lemme try on my linux machine

arctic arch
#

make sure it has http://

snow sky
#

k

#

hmm, when i try and go through my public ip it doesnt even respond

full socket
#

Then it's a firewall/NAT issue

#

I think

restive otter
#

btw

snow sky
#

it would also help if i install the api to my linux machine

restive otter
#

@full socket i was trynna code a page in html

#

and it said malicious code

#

πŸ€”

#

tho there wasn't any

full socket
#

I think if you're not certified you can't use JS. Wait for Tonkku to reply though, I'm not entirely sure

snow sky
#

k i got a 400 from public netork

full socket
#

Okay that's good

restive otter
#

oh

full socket
#

I think

snow sky
#

yeah you have to be certified

restive otter
#

is it okay if i mention tonkku

full socket
#

🀷

restive otter
#

idw to get banned tho

full socket
#

I think one ping is okay

#

Multiple ones though are bad

snow sky
#

or big moderator mentions are bad too

restive otter
#

@arctic arch i was trynna code a page in html on discordbots.org for my bots description but it said malicious code and didn't let me use it, what is the possible reasons for that cause i am sure there wasn't any malicious code. Please ping me if you are able to reply anytime soon

snow sky
#

yeah you have to be cert

arctic arch
#

thats not api related

#

js is restricted to certified developers

restive otter
#

oh

#

and html?

#

ik its not api related

arctic arch
#

do you have any onclicks or anything like that in your html

#

or maybe you have meta tags

restive otter
#

yes to change the commands tab

arctic arch
#

yes that is javascript

#

which is why you get the error

restive otter
#

well it was template sadcatoo

#

well RIp

#

thanks tho

full socket
#

@snow sky any luck?

snow sky
#

I still need to sign into my other alt

white forum
#

-help

#

,help

#

help

#

/help

#

\help

arctic arch
restive otter
loud gulch
amber dune
austere crescent
#

I've been trying to do this for a while, but it's consistently not working. I've added these to my pom ```
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.DiscordBotList</groupId>
<artifactId>DBL-Java-Library</artifactId>
<version>e592e99</version>
</dependency>
</dependencies>

#

But my maven project still says this when I look at the dependencies: Incomplete result, processing indices

#

And when I try to do java DiscordBotListAPI api = new DiscordBotListAPI.Builder() .token("token") .botId("botId") .build();

#

it says create class DiscordBotListAPI

#

please ping me if you can help

fast tapir
#

@austere crescent I ended up making my own library from scratch because I couldn't get the official one working. It only works for updating server count though 🀷, but if that's what you want to do I can send it to you

amber dune
#

the library wasnt the problem

fast tapir
#

oops

amber dune
#

its just that they didn't update the number 24

fast tapir
#

wrong person 🀦

amber dune
#

exdee

fast tapir
#

@austere crescent

austere crescent
#

yes?

fast tapir
#

scroll up 5-10 messages

austere crescent
#

oh yes

#

That's all I need it for

fast tapir
#

kk I'll DM you when I have access to my dev computer

austere crescent
#

okay tysm

amber dune
#

im not sure if the botID matters

#

also im using branch 4b27930a63 instead of e592e99 if that helps

austere crescent
#

yea, it might xd

amber dune
#

also whats the exact error?

austere crescent
#

Well, when I try to create a DiscordBotListAPI object it's as if I don't even have the dependency

#

pretty much

amber dune
#

ouch

austere crescent
#

yea lol

amber dune
#

did you rebuild the project with the version i recomended?

austere crescent
#

yea

amber dune
#

still nothing?

austere crescent
#

nope

#

wait

amber dune
#

πŸ‘€

austere crescent
#

Incomplete result, still processing indices lol

#

wait there we go

#

I think it might be working

#

Finally

#

ok the import popped up

#

It's working now, thank you @amber dune

fast tapir
#

Just in case, here's my code anyway

public static boolean updateStats(int payload) {
        try {
            URL url = new URL("https://discordbots.org/api/bots/<YOUR BOT ID>/stats");
            StringBuilder postData = new StringBuilder();
            postData.append("{\n\"server_count\": " + payload + "\n}");
            byte[] postDataBytes = postData.toString().getBytes("UTF-8");
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
            conn.setRequestProperty("Authorization", dblToken);
            conn.setDoOutput(true);
            conn.getOutputStream().write(postDataBytes);
      // Everything after this is old debug stuffs
            Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));

            StringBuilder sb = new StringBuilder();
            for (int c; (c = in.read()) >= 0;)
                sb.append((char)c);
            //System.out.println(sb);
            return true;
        }
        catch(Exception e) {System.out.println(e);}
        return false;
    }
amber dune
#

no problem!

austere crescent
#

guys

#

this doesn't work

#

#1 Posts the server count for the whole bot.

int serverCount = ...; // the total amount of servers across all shards

api.setStats(serverCount);

fast tapir
#

did you try my code?

austere crescent
#

no πŸ‘€

fast tapir
#

try it πŸ˜‰

austere crescent
#

ok

fast tapir
#

no, it's the api key

amber dune
#

no

fast tapir
#

I just called them tokens in my code for some reason

amber dune
austere crescent
#

okay thanks again for helping πŸ˜‚

amber dune
#

no problem!

upbeat wharf
#

dblapi.js doesn't seem to work with the internal sharding build of d.js ;;n;;

honest root
#

hey @cobalt ruin, do you think to add TimeVoted or TimeLeft into isVoted request? it would be pretty nice for developers, to show how much time left for the new vote
P.s. I suspect that you thought about it, and most likely you do have reasons not to do so, but still wanted to ask ._.

restive otter
#

Yeah true, that's a good question :D

dreamy agate
#

At what guild count is it also displayed at the site?

elfin solstice
#

you need to post your guild count yourself

dreamy agate
#

I am, but it's currently 15, so I thoght there might be a minimum limit before it's shown on the site

elfin solstice
#

no

#

you can post even with 0 theoretically

humble bison
#

though if your bot drops to 0.. mmLol

dreamy agate
#

oof
I'm using d.py
The dbl.Client should really have it's own logger. I'm already saving the root logger so when I didn't see any errors I thought I successfully posted the guild count

dreamy agate
#

nvm, it does have logger, it's just logging only to debug so It was hard to find it

arctic arch
#

@elfin solstice actually 0 would result in an error

elfin solstice
#

oh?

#

how come

arctic arch
#

I think

#

invalid value

#

gotta be > 0

elfin solstice
#

i see

#

hmm

dreamy agate
#

Technically bots can be in 0 servers. When they are so unwanted by their owners that even they haven't invited them

arctic arch
#

rip

misty geode
sudden depot
#

in the js api sending '0' will result server count to be N/A

frank glacier
#

anyone else here getting GenericCallAdapter factory errors when trying to get votes with the java lib?

restive otter
#

Hello everyone !! can you help me please I do not understand how I can post my server account on your API

ripe linden
#

how can i send a message when a user votes?

sudden depot
#

@ripe linden use webhook to receive the vote

ripe linden
#

ok

honest root
#

I completely forgot about webhooks at the time I asked that question... b1nzyhyperban

frank glacier
#

i got a question about rewards for votes.

my bot is using a system where many commands are locked for non supporters and only available for patrons.

https://discordbots.org/api/docs#votes here u are saying that i am not allowed to lock features behind votes.

i would like to make a giveaway for my users, they would have to vote at least 5 times a month to enter. the winner will be able to use all features of the bot for a month without having to be a patron.

is that acceptable?

arctic arch
#

a small amount of votelocked commands are allowed but you may not lock most of your bot

#

that sounds acceptable to me

frank glacier
#

okay thanks

restive otter
#

Is it possible to make the bot only usable to people who voted for my bot using the api on javascript

frank glacier
#

u can use the webhooks and store every user that voted in a database

#

although i dont think its allowed to make the bot only usable by voters

restive otter
#

Is it possible to receive DBL Upvote Webhooks without having to port forward?

steady pilot
#

Idk

#

Gg

snow fiber
#

API keys are only for people who have bots added to the list

restive otter
#

Hey, Is there anything else I need to do in order to check whether or not a user voted? Such as add my server count to the dbl website?

#

Will I still need to Port Forward?

#

Hey, i just want to search for a bot using user input and get the bots info as an image that my bot can display in a server. Can anyone help me? The api docs are a little bit unclear

snow fiber
#

You can use GET /bots and use the search parameter

#

Use a limit of 1 so you get the first result

restive otter
#

Alright

#

Ok thx but how to get the little widget image?

#

Oh wait

#

You where not speaking to me Auxim?

snow fiber
#

@restive otter Use /bots/ID for that

#

@restive otter Under 1000 votes/month you can use the /check endpoint

restive otter
#

how do you install dblapi.js in heroku?

dreamy agate
#

Is there a way to make the votes webhook rerun if it gets some response?

restive otter
#

does anyone know the answer to my question?

dreamy agate
#

rooEww heroku. Why not just pay that 3$ a month for real vps

restive otter
#

cuz i dont have the moeny XD

dreamy agate
#

that's 10c a day tho

#

or something

arctic arch
restive otter
#

Auxim i use snekfetch, and i am not very good with http requests could you build an example querystring with a searchterm of any word and a limit of one bot?

#

Whats the start of the link with this endpoint? /bots/{bot.id?}/check

snow fiber
restive otter
#

Yes those

#

Okie

arctic arch
snow fiber
restive otter
#

Im guessing it would be oki

#

Run on sentence

#

Oki

snow fiber
#

You should handle getting 0 bots and stuff like that

restive otter
#

Ye

#

Prepared for anything

#

(Except my own tablets keyboard

snow fiber
#

You can just get the value of total from the JSON response

sudden depot
#

@restive otter just like u did with d.js and any other lib

restive otter
#

what?

#

but

#

i use heroku

#

and i deploy all the files

#

but still says not found

sudden depot
#

Is it in ya packages.json

restive otter
#

he

#

hey

#

where do i put

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

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

?

#

Thisis how you would do it right?

unirest.get(`https://discordbots.org/api/bots/463384270887452673/check?userId=${message.author.id}`)
  .header("Accept", "application/json")
  .end(function(result) {
    if(!result.voted === 0) return message.channel.send({embed: { color: premiumConfigRow.embedColour, title: `Queue | ${message.author.id}`, description: `[**You must upvote Gamer to get access. Click here!**](${config.upvoteLink})`}}).catch(console.error);
#

For some reason, oh wait

#

nvm

#

whats this?

#

ok my dbapi works

#

how do i do the vote to access command?

#

anyone?

#

Okay, I am also having trouble with this:

unirest.get(`https://discordbots.org/api/bots/463384270887452673/check?userId=${message.author.id}`)
  .header("Accept", "application/json")
  .end(function(result) {
    if(result.voted === 0) return message.channel.send({embed: { color: premiumConfigRow.embedColour, title: `Queue | ${message.author.id}`, description: `[**You must upvote Gamer to get access. Click here!**](${config.upvoteLink})`}}).catch(console.error);

Thats how it should be, right?
But when people use the command it allows them to use it, even if they have not upvoted.

sudden depot
#

@restive otter basic node js
hasVoted(id) returns a promise

restive otter
#

hm.m..

#

@sudden depot i really dont know how to do it

#

Okay, I am also having trouble with this:

unirest.get(`https://discordbots.org/api/bots/463384270887452673/check?userId=${message.author.id}`)
  .header("Accept", "application/json")
  .end(function(result) {
    if(result.voted === 0) return message.channel.send({embed: { color: premiumConfigRow.embedColour, title: `Queue | ${message.author.id}`, description: `[**You must upvote Gamer to get access. Click here!**](${config.upvoteLink})`}}).catch(console.error);

Thats how it should be, right?
But when people use the command it allows them to use it, even if they have not upvoted.

#

@restive otter can you show me your vote to access command for the command play?

#

Thats it

#

does it work

#

insert it into the play command. No, im trying to find a fix for it

#

when you do can you show me?

sudden depot
#

@restive otter tjere is also a lib
But can u log result.voted

restive otter
#

I dont want to log it to console. I want to message in chat if they did not upvote

sudden depot
#

Then do that

restive otter
#

Thats the problem...

sudden depot
#

I mean u could log it and look at the output but ....

restive otter
#

What am I logging? result? or result.voted?

sudden depot
#

Both

restive otter
#

Okay, in the result.body, it says unauthorized... How do I authorize?

#

Go to your bots edit page and scroll all the way down

restive otter
#

My bot just breaks. Stops working completely

steady pilot
#

Rip

#

How?

#

Any errors?

restive otter
#

No

#

But ofc im using snekfetch

#

Got any advice?

steady pilot
#

Oh

#

Rip IDK tbh

snow fiber
#

And if you console.log results?

restive otter
#

i found it with PM2 logs

sinful dune
#

when bots use /tts is it considered api abuse?

restive otter
#

what's the format for the username field when using the search query?

plain timber
#

@sinful dune this channel is only for the DBL api

restive otter
#

lol

#

like somebody called in the cleanup crew

steady pilot
#

Boi

restive otter
#

wat?

#

@steady pilot

steady pilot
#

What

restive otter
#

why Boi?

steady pilot
#

Cause

#

Why not

restive otter
#

oki then

keen citrus
#
Traceback (most recent call last):
  File "C:\Users\tasty\Desktop\owo bot\cogs\DBL.py", line 25, in update_stats
    await self.dblpy.post_server_count()
  File "C:\Users\tasty\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\client.py", line 100, in post_server_count
    await self.http.post_server_count(self.bot_id, self.guild_count(), shard_count, shard_no)
  File "C:\Users\tasty\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\http.py", line 189, in post_server_count
    await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
  File "C:\Users\tasty\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\http.py", line 160, in request
    raise Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}``` I get that error when I run my bot
elfin solstice
#

wrong token most likely

keen citrus
#

I copied the full token let me copy it again and try

#

Still says it

glass cedar
#

do you set the token before you call the post_server_count() method?

keen citrus
#
    """Handles interactions with the discordbots.org API"""

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

    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""

        while True:
            logger.info('attempting to post server count')
            try:
                await self.dblpy.post_server_count()
                logger.info('posted server count ({})'.format(len(self.bot.guilds)))
            except Exception as e:
                logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            await asyncio.sleep(1800)


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

im using that

#

from the website

supple wedge
#

!ftn Lezzim

mystic wing
#

Probably not your issue but just want to say make sure it is dbl's token not discord

keen citrus
#

It's dbls token

tired laurel
#

what version is the maven java library or the api

#

cant seem to find it anywhere

#

for*

glass cedar
#

@keen citrus ```py
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""

await self.bot.wait_until_ready()
while not self.bot.is_closed():
    logger.info('attempting to post server count')
    try:
        await self.dblpy.post_server_count()
        logger.info('posted server count ({})'.format(len(self.bot.guilds)))
    except Exception as e:
        logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
    await asyncio.sleep(1800)```
#

try that for your update_stats library

#

possibly it's trying to post with null data?

#

"forbidden" isn't the most creative of errors

#

I only added the wait_until_ready and changed while True to while not self.bot.is_closed(), by the way

tired laurel
#

got it for anyone else that may have the same question here it is

#

<dependency>
<groupId>com.github.DiscordBotList</groupId>
<artifactId>DBL-Java-Wrapper</artifactId>
<version>v1.0</version>
</dependency>

charred panther
#

Hey so I just recently started getting this error when posting to dbl.. UnhandledPromiseRejectionWarning: Error: 401 Unauthorized

By chances is my API key wrong?

#

(my server count wont update)

#

I've tried regenerating the api token and still nothing

humble bison
#

Hm.. if you've tried a new API token then dunno.

charred panther
#

Is there anything I can do? I've tried removing dblapi and reinstalling with npm install dblapi.js, regening token.. I'm not sure what to do.

plain timber
#

can you post your code?

charred panther
#
const DBL = require("dblapi.js");
const dbl = new DBL('thetokenforDBL');
//and then in a setinterval:

dbl.postStats(bot.guilds.size, bot.shard.id, bot.shard.count);```
#

I forgot to mention that I think this started when I moved onto a vps...

#

Could that somehow be a problem?

#

The full error:

0|server   | (node:31142) UnhandledPromiseRejectionWarning: Error: 401 Unauthorized
0|server   |     at IncomingMessage.res.on (/home/dark/Arcane/node_modules/dblapi.js/src/index.js:115:25)
0|server   |     at emitNone (events.js:111:20)
0|server   |     at IncomingMessage.emit (events.js:208:7)
0|server   |     at endReadableNT (_stream_readable.js:1064:12)
0|server   |     at _combinedTickCallback (internal/process/next_tick.js:138:11)
0|server   |     at process._tickCallback (internal/process/next_tick.js:180:9)
0|server   | (node:31142) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
0|server   | (node:31142) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

At this point I've reset the token 2 times now and still nothing

elfin solstice
#

Error: 401 Unauthorized means that you dont put any token in the request

charred panther
#

Would it be a problem with the token then? How would I send the token with the request..

plain timber
#

in const dbl = new DBL('thetokenforDBL') the token is wrong

charred panther
#

.... I'm not actually going to put the token here..

#

the dbl api token

plain timber
#

i mean

#

the one in ur code is wrong

#

but

#

hmm

#

well thats the only place you can set the token

charred panther
#

That's what I thought. I have no clue what's happening..

misty geode
#

const dbl = new DBL('thetokenforDBL', client)

#

@charred panther

charred panther
#

I was able to fix it by using dblapi.js@2.1.0...

misty geode
#

Okay

#

you forgot the client

#

Which is the discord

charred panther
#

ok let my try

misty geode
#

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

charred panther
#

k

misty geode
#

That's what they provide on there api docs and it worked for me

charred panther
#

same issue

misty geode
#

What's the error

charred panther
#

401 error. This is on dblapi.js@2.2.0.. on 2.1.0 there is no issue

misty geode
#

Uhm kk I guess use the one that works for you. Or wait for a mod or something

charred panther
#

Yah Idk.. as soon as I switched back it worked.

covert sun
#

I am trying to find a way to hide my DBL token from my github though the bot is hosted on Heroku...

humble bison
#

.gitignore or .env, depending on what you wanna use.

covert sun
#

ok

plain timber
#

env is better

glass cedar
#

give reasons

#

"x is better" is unhelpful

humble bison
#

env files can't be accessed by anyone other than you iirc

celest root
#

Hello. How do I access the dblpy docs?

humble bison
celest root
#

@humble bison sorry, thank you!

humble bison
plain timber
#

@humble bison it was a question about the dbl api tho...

rich wave
#

i have voting benefits but some users are saying that they lose some of their benefits randomly. does the API reset the log of who's voted for the bot at any point?

arctic arch
#

what are you using

rich wave
#

/votes endpoint

arctic arch
rich wave
#

i only have around 100 votes

frank glacier
#

ive had an easier time just setting up the webhook

rich wave
#

i think ill do that and store it in a DB

#

what maybe i do have 1000 votes

#

page only says 136

#

oh well ill use the webhook then

frank glacier
#

idk if /votes returns votes of all time

rich wave
#

i pulled votes and it was 1000 votes but the website says i have 136 votes

#

and if i click on the bot then it says i have 90

#

i assumed one number was the total and one was the weekly or whenever it resets

frank glacier
#

🎲

arctic arch
#

monthly

rich wave
#

so what are the numbers?

frank glacier
#

did u vote like 40 times for the bot urself?

#

i think ur own votes dont show on the bot page

rich wave
#

no :/

#

can you even vote for your own bot?

frank glacier
#

i think so

#

no idea what makes the difference in the numbers, but imo the webhook is way better anyways because u can react to votes instead of having to react to a command and check if that persoon really voted

rich wave
#

can i ask what library you're using, and how you've implemented webhooks? python examples seem to use flask but id prefer to try and keep it as one application

frank glacier
#

im using java (d4j) and used spring boot to setup my endpoint for the webhook

rich wave
#

oh okay, thanks

arctic arch
#

can you not have flask in the same application?

rich wave
#

probably but id need to start threading it and the audio library keeps seg faulting so i dont know how itd play

#

is a webhook just a reversed API request?

arctic arch
#

basically

rich wave
#

ok thanks

sudden depot
sudden depot
#

seems to be a issue with dblapi.js

arctic arch
#

can you send me the data you get from both

arctic arch
#

can you also DM the token you used

arctic arch
#

also does anyone else have the same issue

rich wave
#

does the webhook exclusively use https?

arctic arch
#

no, it can use http as well

rich wave
#

something was wrong but ive left it alone for 10 mins and now it seems to be working so thats good i guess

restive otter
#

@arctic arch when i get a widget from the api can i get it in PNG format?

arctic arch
#

yea

restive otter
#

how exactly?

arctic arch
#

just do .png

restive otter
#

oki!

arctic arch
#

instead of .svg

restive otter
#

thank you! i was hashing over my conversion options

#

Thanks @arctic arch i now have a working DBL command!

arctic arch
#

πŸ‘ŒπŸ»

proper sable
#

who

robust timber
#

What?

proper sable
#

ghost pinger REEEEEE

robust timber
#

I hate them

proper sable
#

.

robust timber
#

It annoys meh

#

Someone pinged @ everyone and got ban πŸ˜‚

loud gulch
#

channel only for dbl api not jsut chatting

robust timber
#

In another server

proper sable
robust timber
#

...

#

Nu

proper sable
#

.

robust timber
limpid sorrel
#

does the webhook fire if someone upvotes/unvotes/upvotes again, or does it only fire once a day or something for each person

#

basically so users can't keep unvoting and upvoting every minute to get free premium on my bot

frank glacier
#

u cant unvote?

limpid sorrel
#

oh, you're right, it's not letting me. it used to be possible before

snow fiber
#

You can only vote every 12 hours now

limpid sorrel
#

thanks, that's useful to know

snow fiber
#

Also voting on the weekends counts double now, but it's still up to you wether to implement that

limpid sorrel
#

πŸ‘

short forge
#

you get the user's object and you do stuff with that

#

the vote.user is just the user's id

#

yeah

#

np

severe schooner
#

how to setup @sacred tinsel

short forge
#

@ripe linden nothing, if you don't want to

#

i highly suggest choosing a auth secret though

#

if you don't set one others can just make requests without you knowing it's actually DBL

ripe linden
#

ok

proud sphinx
#

It is automatically set

#

It is in the constructor of dbl.js

#

Look at the example in the docs

#

You need to forward a port for that

#

Google it up

#

It is too long to write

azure yew
#

Hello, does the getVotes () function only return the votes of our bot?

#

<@&304313580025544704> ⬆

rigid dagger
#

thank god edits doesn't ping

#

I mean

#

I think

azure yew
#

It is marked in the documentation "Gets votes from your bot" while the API returns me a lot of votes.

elfin solstice
#

@azure yew i would recommend you to not try pinged all mods for help next time or you get muted, see #460037222331187200

azure yew
#

ok

#

if anyone can answer my question?

mystic wing
#

yeah

#

it gets the last 1000 votes

#

although I would recommend webhooks as they are easier and less api heavy

#

@azure yew

azure yew
#

But he returns the last 1000 votes on all the bots not only mine? @mystic wing

mystic wing
#

your bot

arctic arch
#

actually there seems to be a bug in the API that causes wrong votes to appear when you use the token

#

@azure yew can you send me what votes you get

azure yew
#

I dont have 1000 votes on my bot x)

arctic arch
#

can I see the top of the list as well

azure yew
copper iron
#

any ideas

#

i installed discordbots-api

#

imported it

#

tells me i dont have it

snow sky
#

because its not discordbots-api its dblapi.js

#

read up

copper iron
#

Read up

snow sky
copper iron
#

ugh

snow sky
#

@copper iron i cant dm you

#

i need to dm you something

inner venture
#

For those using the Java lib, I've just pushed an update for it -- 2.0.0

#

Feel free to give it a spin

restive otter
#

meanwhile none of the admins acknowledge my library

inner venture
#

@restive otter which one is yours

restive otter
#

like a link to it?

inner venture
#

sure

restive otter
#

it's been like 3 months and no response, not even a "no thanks" or something

inner venture
#

hmm

restive otter
#

sure, it's ruby, but still

inner venture
#

πŸ€”

restive otter
#

april 28th, email sent with links to it and "let me know your thoughts"

#

Why can’t we get the bot online status with a API request?

#

That’s the one thing I’d like to get, not only server count and such

humble bison
#

@restive otter, it'd be cool, but seems pointless to me when its done automatically. Plus, that'd be a LOT more API requests y'know.

restive otter
#

No I mean when doing a get request to have the bot info knowing if it’s online or not

#

Cause I’d like to use this to display its status on my website with the server count

humble bison
#

Oh, that.

#

I guess it'd be cool, but yeah you can't.

#

(there is a good workaround that exists, but yeah)

honest root
#

You can get this information directly using discord API

restive otter
#

yeah so like

restive otter
#

not really

#

presences are sent thru ws not rest so it'd be a pain to get online status from discord without having an api in ur bot

restive otter
#

@restive otter I agree, ruby is pure awesome

#

It deserves it's own library

#

yes mine also its*

ruby obsidian
#

@restive otter

#

-bots @restive otter

abstract mothBOT
#
BloodyPikachu#0666
Bots

@wary trench
@rigid zinc

rigid dagger
#

What does that have to do with DBL's API @ruby obsidian

restive otter
#

-bots @restive otter

abstract mothBOT
#
Passive#6880
Bots

@lean lance
@merry juniper
@tribal harbor
@silent oxide

rigid dagger
#

Please dont do that here

restive otter
#

@azure yew could it be that it's returning all unique voters. Like everyone that has votes for your bot, expired or not

#

soz

craggy torrent
#

-bots @craggy torrent

abstract mothBOT
#
MathiSmati#0943
Bots

@jaunty gulch

magic widget
#

How can I use webhooks?

#

I've read the page already

#

I placed the webhook

#

and i tested it

#

but it isn't sending any messages

brave pond
#

it's not a discord webhook

magic widget
#

What's it then?

brave pond
#

its a webhook

shut ibex
#

The dbl webhook wasnt designed for discord

restive otter
#

hey does anyone know how to create a patreon if you pay then get access to a command in heroku?

frank glacier
#

the way i do this is by granting patrons special roles on my support server. the bot then checks if the user has that role and only lets him use the command if he does. @restive otter

restive otter
#

-bots @restive otter

abstract mothBOT
#

This user has no bots

frank glacier
restive otter
#

Oh forgot sorry ;c

#

@frank glacier can you help me with it in DM?

frank glacier
#

sure

restive otter
#

ok

next coral
#

(Sorry, I assumed this was testing like Tommie did-though in my case it was because I saw his chat first)

karmic veldt
#

Yeah I don't know how to use this api...

#
    let tde = bot.guilds.get("429995294542004225");
    let ch = tde.channels.get("471779437164101652");
    ch.send(`User <@${vote.user}> has just voted for Automator! Thanks for voting :smile:`)

})```
#

Tried that and got the error "Cannot read property 'on' of undefined

#

const data = new DBL('TOKEN');

#

And I have that at the top

#

Is there any steps I am missing?

#

I just coded it in like this

#

I made a webhook too

#

And added the link onto DBL

#

Still getting the same error

#

Anyone ._.

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

you need to specify webhookport and webhookauth i guess?

#

i never used it myself tbh

arctic arch
#

@karmic veldt you need to define the webhookPort option to start the webhook

restive otter
#

so i called it

#

tfw only quickly glanced

karmic veldt
#

So just add in webPort: 5000 and webAuth: 'password'

#

and it will work

restive otter
#

well you'd want a more secure password ofc

#

but that is the basic gist

karmic veldt
#

Yeah

#

Will I ever need the password?

#

Or why is it a thing

#

πŸ˜›

restive otter
#

and make sure it is a port you are 100% sure will not conflict with some other program

arctic arch
karmic veldt
#

OH

#

I get it now

#

Okay

arctic arch
#

if you leave that empty, you dont need the password

restive otter
#

i.e. how some people who use nginx make their website localhost on port 8080. Always gets me like "but whyyyyyy"

(so I set mine to 1337, 2552 and 5225)

karmic veldt
#

Okay it turned on this time I think πŸ˜›

arctic arch
#

if you are hosting your bot on your home machine you need to do something called port forwarding

karmic veldt
#

Nah its on AWS

arctic arch
#

aws also has some sort of port trickery

karmic veldt
#

Oh really?

#

:/

#

Do I need to do anything other than specify the port in the code?

restive otter
karmic veldt
#

..

sudden depot
arctic arch
#

:80 and :8080 aren't the same

karmic veldt
#

Idk what to do

#

Do I need to do anything now Tonkku?

#

Or just specify it in code

#

Orrr

sudden depot
#

Well in webbrowsers

arctic arch
#

so you set port 5000 in the code?

karmic veldt
#

Yeah

arctic arch
#

enter the url on the edit page, save and hit test

karmic veldt
#

The webhook URL?

#

Ok

arctic arch
#

if nothing happens (and the url is correct) do the port forwarding bit

karmic veldt
#

It says webhook tested

#

How do I know if its tested?

#

What does it do

arctic arch
#

it runs your code in .on('vote')

karmic veldt
#

Ohh

#

It didn't do anything 😒

sudden depot
restive otter
#

specifying port on my website's address doesn't work even when it's 1337 PLASMA, coz it's not set up that way. In short: DigitalOcean VPS has NGINX running, this has a config for a reverse proxy to localhost:1337 which is a webserver ran by ExpressJS. DigitalOcean is also my Nameserver as configured in my registrar, Namecheap

#

so it doesn't matter either way in the grand scheme of things

karmic veldt
#

Let me try that

#

1 sec

#

Its closed

#

ffs

#

Just tried to open it and nothing

#

._.

#

@arctic arch You don't know how to Port Forward on AWS/Ubuntu do you?

#

I am so confused by these yt vids

#

and none of them open the port

#

._.

arctic arch
#

try the medium post linked before

karmic veldt
#

Ok

restive otter
#

I only know DigitalOcean Ubuntu / Debian.. those come with ufw (uncompilicated firewall) and would require allowing the ports through there. idk about AWS. The only AWS I use is Lambda for my Alexa skill ...

clear geode
#

AWS let's you setup port forwarding via IAM security groups yeah. In DigitalOcean though you just got a basic firewall. You can however setup a reverse proxy (like haproxy or nginx) to do the forwarding instead.

jade holly
#

The user id, that is being given by the API, is it also a user id for discord?

arctic arch
#

yes

jade holly
#

I see

#

Ty!

honest root
restive otter
#

ERROR
TypeError: DBL.isWeekend is not a function

#

@arctic arch

arctic arch
#

is DBL constructed

restive otter
#

yes

arctic arch
#

DBL = new blah()

restive otter
#

yes

arctic arch
#

update the module then

restive otter
#

i did

#

it installed v1.2.1

arctic arch
#

thats ooold

restive otter
#

...

arctic arch
#

recent is 2.2.0

restive otter
#

i did nm i dbl-api

#

and it installed 1.2.1

arctic arch
#

it's dblapi.js

#

dbl-api is something different

restive otter
#

oh

#

i installed wrong package then

#

still error

arctic arch
#

did you change the require

restive otter
#

that was dblapi.js already

#

oh restart fixed it

#

yay

formal lily
#

is 1hr too often on posting to the api?

#

every hour it updates its server count

junior goblet
#

that's a good time interval

formal lily
#

ok good

junior goblet
#

the minimum recommended by tonkku is 30 minutes so yeah

formal lily
#

i mean it's only got 11 servers and it's very niche so

#

beautiful

#

so i just globally installed the npm package for dblapi.js, yet my bot is complaining that that module doesn't exist

#

everything else is globally installed and recognised fine

#

this ain't working

#

also sorry for posting in multiple channels

#

alright, i fixed it

#

NODE_PATH was set to nothing, so i pointed it to the right place and it works

#

but all modules are installed globally, like discordjs, not just dblapi, no idea why that specifically failed, but anyway

honest root
formal lily
#

yeah i wasn't sure if this pertained to dev or api since it had to do with the api but didn't necessarily do with api functions or what have you, sorry

worthy ferry
#

Hey uh... DBL is showing that my bot is on 2 servers, but it's on 164 servers

snow fiber
#

@worthy ferry Then you need to post your servercount

#

It's not auto-updating

worthy ferry
#

I mean, I'm posting same way from like 3 months, just giving my bot onbject

snow fiber
#

Can you log the request you are making?

#

That might give more info

worthy ferry
#

But how can I log request? ```js
const dbl = new DBL(bot.config.tokens.dbl, bot);

#

I'm using this

#

It always worked

#

Ok I know the issue

#

Just version of my d.js isn't supported

#

gotta modify DBL api then

arctic arch
#

hmm?

worthy ferry
#

DBL API just doesn't support internal-sharding structure

#

I don't have client.shard for example

arctic arch
#

ah

worthy ferry
#

I have client.ws.shards

snow fiber
#

It's probably better to handle the requests yourself instead of using the lib in that case

arctic arch
#

is that built in d.js stuff now?

worthy ferry
#

It's one of versions

arctic arch
#

or your custom stuff

worthy ferry
#

Nope, it's official build but it's not default one