#topgg-api

1 messages Β· Page 33 of 1

arctic arch
#

you seem to be putting it as url encoded i guess

#

i know the only way to do json in postman is to edit it like text

fast tapir
#

who came up with the idea of using JSON instead of post parameters. Just a question

arctic arch
#

post parameters dont exist

fast tapir
#

you know what I mean

#

do you?

arctic arch
#

no because you make no sensd

fast tapir
#

ok

#

nvm then

uncut crystal
#

"post parameters" aren't really a thing

#

the data a post request generally carries is the post body.. which is exactly what JSON is in this scenario

#

JSON doesn't replace the post parameters, JSON is what the post parameters are already in

fast tapir
#

πŸ€”

#

ok

snow sky
#

what would password be?

rigid dagger
#

?

#

your api token?

snow sky
#

nevermind, ive decided not to include dblapi.js

fast tapir
#

I'm still having an issue using the API. I'm getting a 400 error whenever I send a request.

#
    private static boolean updateStats(int payload, boolean disabled) {
        if(disabled) {
            return false;
        }
        try {
            URL url = new URL("https://discordbots.org/api/bots/461938818627665940/stats");
            StringBuilder postData = new StringBuilder();
            postData.append("{\nserver_count: " + payload + "\n}");
            byte[] postDataBytes = postData.toString().getBytes("UTF-8");
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
            conn.setRequestProperty("Authorization", dblToken);
            conn.setDoOutput(true);
            conn.getOutputStream().write(postDataBytes);

            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;
    }
#

I recorded the POST request:

POST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: (TOKEN CENSORED)
User-Agent: Java/1.8.0_171
Host: https://discordbots.org
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 20

{
server_count: 21
}
#

I assume I'm doing something wrong, but I'm not sure what

#

ah, it might be my Content-Type header

#

nope

soft drum
#

I think the content-type needs to be application/json and server_count needs double quotes around it

fast tapir
#

I changed the content type and it still doesn't work. I'll try the quotes now

#

didn't work

soft drum
fast tapir
#

I can't get it to work, but I can look at their code

summer oracle
#

that lib is broken af, last i tried to use it

summer oracle
#

from what the code looks like it (or some parts of it) were never really working in the first place

arctic arch
#

@summer oracle do you code java?

summer oracle
#

I do but I cba to implement the full thing bloblul

#

i also have my own kinda thing already that works with several lists

#

would have PRd already otherwise πŸ˜ƒ

arctic arch
#

I see

bitter jay
#

how do you make a bot

azure pollen
#

you don't

arctic arch
sudden rampart
#

@fast tapir that's invalid json

#

json requires quotes around the keys

#

also content-type should be application/json

fast tapir
#

that would do it

#

ty @sudden rampart (I already figured out the content type issue)

snow sky
#

Idk, I'm high on laughing gas rn

arctic arch
placid owl
#

hello!

latent pebble
#

is it possible to do batch vote checks? my voting mechanism is cached and I want to see if they've voted within 24hours...
and dbl doesnt provide a timestamp so the only possible way I know right now is to check individually with the check endpoint.

sudden rampart
#

webhooks

sharp girder
tardy mauve
#

anyone got a webhook URL Example in full, Thanks πŸ˜ƒ

latent pebble
#

for me I just used this PHP script:

<?php
$headers = apache_request_headers();
if(isset($headers['Authorization'])){
    if($headers['Authorization'] == "Auth 'password' thing"){
        $data = json_decode(file_get_contents('php://input'), true);
        $conn = new mysqli("127.0.0.1", "username", "password", "databasename");

        if (!$conn->connect_error) {
            $user = $data['user'];
            $conn->query("INSERT INTO `voter`(`user_id`, `date`) VALUES ('$user', UTC_TIMESTAMP())");
            $conn->close();
        }
    }
}

hosted it on:
https://somedomain.xyz/somepath/DBLvoteWebhook.php

and used the url where I hosted it on as the webhook url (obv. xd)

restive otter
#

anyone got suggested apis to use for game stats?

tardy mauve
#

@latent pebble
Not the best person for php, Could you explain what to change in your example πŸ˜ƒ

latent pebble
#

then the mysql auth info

#

and the query

tardy mauve
#

i set a password? πŸ˜‚ when xD

latent pebble
tardy mauve
#

I know everything apart from the Webhook side of things. not really focused on it tbh.

latent pebble
tardy mauve
#

oh i get it

#

so the password i put there

latent pebble
#

yeah

tardy mauve
#

i put in the PHP fire

#

file

#

see easy

#

πŸ˜‰

latent pebble
tardy mauve
#

quick learner πŸ˜‰

latent pebble
#

well it just needs common sense xD

vital elbow
#

Quick mafs should be talked in #general not api

latent pebble
#

but webhooks are part of the API

tardy mauve
#

^

vital elbow
#

not webhook, the chat part

latent pebble
#

that'd make the topic irrelevant

tardy mauve
#

it was 4 replys xD

restive otter
#

How do I make a webhook send a message when they voted for my BOT? πŸ˜„

latent pebble
#

since I'm using a PHP webhook, i just add it to db, check the DB and the local voter cache of my bot, then get if a new voter gets added.... do stuff.

tardy mauve
latent pebble
#

no that part is for inserting it into the MySQL DB

#

you do the bot stuff on the bot's side

vital elbow
#

Is there a way to check top upvoters per month?

#

Like storing who upvoted and make them on a leaderboard

narrow charm
#

Get the webhook into action, save the data you reviece from the webhook for a month into a DB, and at the end of the month check it.

restive otter
#

How do I make a webhook say someone voted in a channel

molten lantern
#

I am trying to create my bot, but it is not being confirmed, i keeps saying "Please enter at least 300 characters excluding special characters in your detailed description. If you use iframes, you need to use at least 300 more characters.." but i have 315. COuld i get some help?

sudden rampart
#

spaces are ignored

molten lantern
#

I have 315 characters

#

Nevermind

#

I hade 263

#

had*

#

its not able to fetch my application

sudden rampart
#

did you create a bot account?

#

creating an application and a bot are different things

molten lantern
#

oh

#

So i have to make a seperate account for it

sudden rampart
#

after that, scroll down and click on "Create bot user"

molten lantern
#

How do i get my bot confirmed?

rigid dagger
#

You wait?

molten lantern
#

oh

#

How do i make my bot online?

sudden rampart
#

you need to write code for it

#

and run that code

restive otter
#

!help

rigid dagger
sullen nymph
#

Are webhooks working fine?

clever rock
#

@restive otter

make a webhook in discord, and send it to that webhook when webhook.on(vote) fires

restive otter
#

Oof, ok

restive otter
#

If someone is already voted for first time does DBL send request to webhook we define after first vote?
Like after 24h which user can vote again

#

Ah yes it does

#

@uncut crystal Is it against rules to have users vote every 24h?

uncut crystal
#

no

restive otter
#

Thanks

daring night
#

hello, quick question. I doubt it, but is there any way for a webhook to be able to use emojis from other servers?

crimson adder
#

quick question: if i'll setup a webhook, it will send a message to a chanel when somebody votes the bot?

junior goblet
#

@crimson adder DBL webhooks aren't the same as Discord webhooks
unless you specifically configured it so your bot would send a message to a channel on a vote, it won't do that

#

@daring night what do you mean?

crimson adder
#

oh :C

daring night
#

@junior goblet When a user invoke the embed using a command, there is no problem. But when the bot sends a webhook notification about the same embed, emojis are messed up.
I guess it's because webhook is specific to a channel and can't see emojis from other servers unlike the actual bot

junior goblet
#

is this a Discord webhook?

daring night
#

the first image yes. The second one is a normal bot with commands

junior goblet
#

can you give me a bit more detail on what your bot does possibly? i was going to suggest that your bot sends the message to a pre-determined channel (through the bot account, not a webhook) but i don't know if this would be possible in your case

#

also, do you use the dblapi.js package?

daring night
#

It's a Java bot using Discord4J

junior goblet
#

ah okay

#

what i would recommend is to maybe make a HTTP server within your bot (or at least a HTTP server that can send messages to your bot) to which then the bot can send messages to a pre-determined channel

#

the HTTP server listens for the webhook, and once it receives it, it will send the message to the channel

#

does that make sense

daring night
#

Basically this is a bot for a video game called Geometry Dash. It has commands to get data from the game's servers (levels, users, etc), so for example when I do u?level XXX it will display info for the level named XXX, with an embed containing custom emojis.
The bot also has another major feature, which is sending notifications when an event happens in the game (new levels, etc). So when this kind of event happens, it will send a message to all servers that are "subscribed to event notifications" (server admins can choose a channel where notifications are sent), and the notification contains an embed of the level concerned by the event.

When I first developed the bot I didn't use webhooks at all, the bot was just reading the database to get the list of channels where to send the notification, and then the bot sends a message individually in each channel. The problem is that my bot is in 2500 servers, including ~1000 subscribed to notifications, and because of rate limits it's getting really slow to send notifications to all channels, and also causes CPU spikes on the VM where it's hosted (sometimes it even crashes completely). That's why I wanted to switch to webhooks so I could just send one request to each webhook of subscribed channels, and this way I could get rid of rate limits and save my system resources. But since webhook don't seem to support custom emojis, embeds in notification messages don't look good at all...

junior goblet
#

ah okay i see

#

so you originally did have it so the bot would send the message, but you switched to Discord webhooks

#

does the bot create a new webhook for each server it's in?

daring night
#

It checks for each channel if a webhook already exists, if not it creates one. If the bot doesn't have manage webhooks perms it will just ignore the channel

junior goblet
#

yeah, unfortunately webhooks don't have nitro features like normal bot applications so you wouldn't be able to use custom emoji
other solutions you could try is drawing to an image and posting the image, but you already mentioned that your CPU usage was high so that doesn't work well
can i just ask, in what ways were you hitting ratelimits on your bot? bots can post 5 messages a second per channel, so it doesn't make sense that it would hit the ratelimit that quickly

daring night
#

I don't know what's the ratelimit for sending one message to X channels. What I observe is that it's getting much slower as the bot joins more servers

#

I think I'll try again without webhooks because it might also be an optimization problem within my code

#

I'm believing that using webhooks would solve my performance issues, but it might not even be true

junior goblet
#

best of luck to you and the bot, hopefully you get the performance issues fixed
if you have any more questions or concerns don't hesitate to ask in #development blobsmilehappy

daring night
primal lark
elfin solstice
#

its the hash code of the bots avatar

restive otter
#

I'm trying to use the dblapi.js webhook system, but I get an error on this.dbl.webhook.on (cannot read property on of undefined). I tried use await to wait everything, but it did not work too GWchadMEGATHINK

loud gulch
#

remove the this..?

restive otter
#
this.dbl = await new dblapi(process.env.DBLTOKEN, { statsInterval: 900000, webhookAuth: process.env.DBLHOOKPASS, webhookServer: app }, client)``` ![GWchadThonkery](https://cdn.discordapp.com/emojis/366999788803325952.webp?size=128 "GWchadThonkery") no
proud sphinx
#

Why do you await the constructor?

#

@restive otter

#

Also can you send the code?

#

Like full code, I am not sure what dblapi is

restive otter
#

just a sec

proud sphinx
#

You don't need this

#

And remove the await

restive otter
#

don't need what?

restive otter
#

Hi

#

Is this ok?

#
const dbl = new DBL('<token>', {options: statsInterval=900000}, client);```
arctic arch
#

@restive otter remove the await in front of new

It might be because app is not an instance of http.Server

#

@restive otter change the = in the options to :

restive otter
restive otter
#

@arctic arch i forgot a .app lol, thx

azure pollen
#

ok

arctic arch
#

why do you have options:

molten lantern
#

How do you get a bot online?

rigid dagger
#

You write some code

#

then launch that code

molten lantern
#

wha

#

how?

rigid dagger
#

ffs

#

learn a language

#

programming language

#

you can do that through tutorials

molten lantern
#

I give up on my bot

#

I dont get this at all

rigid dagger
molten lantern
#

I'll just talk to myself

#

Im insane so it works out for me

rigid dagger
#

you do you

molten lantern
#

Got it

restive otter
#

is there a way to vote throught a command?

elfin solstice
#

no

restive otter
#

😭

arctic flicker
#

I don't see a status field in the API, yet bot pages show an online status

#

How can I get that?

elfin solstice
#

you shouldn't need that since the bot is in here and you can get that from your lib via the id

arctic flicker
#

@elfin solstice I'm trying to use it outside of my bot's program

tidal burrow
#

you don't have to worry about the status, it's not related to api anyway

#

the status on the page updates whenever your bot changes it's own status

plain timber
#

i think he wants to access the status

ornate jacinth
#

going to post this again...
/bots/:id/check seems less-than ideal because it doesn't tell during which period that vote is valid
So you have no real way of distinguishing one vote from another
providing the timestamp at which the vote occurred is a good idea

elfin solstice
#

well for the exact date you should use the webhook anyway

#

since you can handle that yourself then (caching the date)

primal lark
#

Hey I reseted my token and since then, I'm getting Unauthorized when I try to post my stats ...

#

Ok I tested the old one and that one is working wwwwhat

arctic arch
#

json

#

jsonjsonjsonjsonjsonjson

restive otter
#

Oh right

#

You can scrap the page to get the status

#

@arctic flicker

arctic flicker
#

Seems way too bulky

#

Why wouldn't that be in the api

arctic arch
#

there is an unfinished undocumented api endpoint

fast tapir
#

If the bot is on the site, it’s in this server (if it got accepted). Just get the bot ID and retrieve its status from Discord

bright lake
#

I have alt accounts and the bots website thinks I'm getting the bots on my alt account and not my main account

arctic arch
#

what

humble bison
bright lake
#

still thinks I'm the alt account

fast tapir
#

clear your cookies

bright lake
#

how

humble bison
bright lake
#

let me check

humble bison
#

DBL gets its account info off the main Discord account your logged into on the website.

bright lake
#

there we go

patent echo
restive otter
#
Individual User Id Voting Check for the past 24 hours.

returns{voted: 1} or {voted: 0}

Could someone tell me what the difference between the 1 and 0 is? I've tried User IDs who haven't upvoted and who have upvoted and it always returns 0

restive otter
#

0 is false, 1 is true

#

Doesn't explain it returns 0 regardless if they've upvoted or not

pale topaz
#

For some reason I can't use the dbl api anymore

#

nvm, started working again

arctic arch
#

is the vote in the last 24 hours?

restive otter
#

Yes

restive otter
restive otter
#

Any mod here who could help me

restive otter
#

DK why but two shards gets an Unauthorized responsed and the third one not

#

All of them use the same config WHY?

shut ibex
#

because you post shard count with the poast stats request

dusk osprey
#

@restive otter you should change all your authentication keys

pseudo plinth
#

Just looking at implementing the API for discordbots.org. It appears they don't have any verification as far as the count of servers that is sent up to the API. Is this known?

dusk osprey
#

not sure if they have any validation, but I guess when your manipulate the server number by intent it might be considered a violation of tos

elfin solstice
#

@pseudo plinth thats true but we monitor guild count updates and if there is something strange about the growth we reserve us to delete the bot from our page. So if someone is faking server count his bot will get deleted the first time and if he does it again he get banned from this server.

pseudo plinth
#

That is interesting and noted. Have you considered having the API send up the guild ids its apart of? That would be a lot more difficult to fake.

elfin solstice
#

yea but that would make the api way more complicated and for big bots would probaly overload the api

sudden rampart
#

that'd be really heavy on resource usage

elfin solstice
#

^

#

as example Rythm would need to sent more than 1.2 milion ids

sudden rampart
#

1.7 million

dusk osprey
#

damn

sudden rampart
#

which would be around 35MB in a single request

pseudo plinth
#

Yeah that is very true.

#

A very difficult problem for sure

dusk osprey
#

just keep the server count and trust people...there is no point in faking the number...it doesnt make your bot in any way better

restive otter
#

Hello

sullen nymph
autumn dagger
coarse heath
#

Quick question why does my bot suddenly crash after being up for like 10-15 days saying incorrect login details, nothing changed (did not change anything on my part)

fast tapir
#

Probably its session expired

junior goblet
#

@coarse heath this channel is only for questions related to the DBL api, not the Discord API

#

i would also agree with what @fast tapir said

coarse heath
#

it's not discord api, since it is logged in

junior goblet
#

either way it's not related to DBL

fast tapir
#

It’s not DBL API either

coarse heath
#

it crashes after logging in with the token and going on with the DBL plgun

fast tapir
#

You can go to the Discord API server and ask there

junior goblet
#

seems like a d.js issue

brisk hornet
#

fixed

#

yesssss

fast tapir
#

πŸ‘Œ

umbral wigeon
#

I need help

#

It won't show the discord acount I want to log into on the website

#

I have multiple accounts

sullen nymph
#

Visit the website and log out from there

rigid dagger
#

go to discordapp.com/login and then click the cog wheel and click log out. Then log in with the right account @umbral wigeon

umbral wigeon
#

Thank you

rigid dagger
#

np

restive otter
#

GET /bots/{bot.id?}/check
Is there a reason why "voted" always returns 0.

I've checked the UserID if they had Voted or Not in the past 24 hours. Yet is always returns 0.

arctic arch
#

show code

tardy mauve
#

could i get a little help please i use .discord.js

proud sphinx
#

with dblapi.js a webhook is running on the port given, you do need to open the port

tardy mauve
#

but how would this be triggered? will it just auto Post threw webhook when someone votes?

tidal burrow
#

with ports opened in your webserver it listens for a POST request from dbl

#

iirc

analog lynx
#

idk

restive otter
#

ok

#

FUCK SORRUY

tidal burrow
restive otter
#

this channel is about DBL’s api not discord

orchid sparrow
#

Hey Can anyone help me with dbl python api??

#

Its not working for me.

fast tapir
#

We could if we knew what went wrong

orchid sparrow
#

It is not showing any error

#

@fast tapir

fast tapir
#

πŸ€”

#

idk then

orchid sparrow
#

It is used to add server counts of discordbots website

#

And to show bots status

fast tapir
#

I know what it is, I’m just not sure about the no error. Are you sure it’s not working?

orchid sparrow
#

Yes

#

@fast tapir see

fast tapir
#

Stop tagging me I’m already here

orchid sparrow
#

Not showing any status and server counts

#

Sorry for that

fast tapir
#

Try clearing your cache

orchid sparrow
#

Tried

#

But still not working

#

Thanks

mystic wing
#

@orchid sparrow do you have it on a setinterval/timeout?

#

Remember you have to wait the time before it runs

slim plaza
short forge
#

are you sure?

#

i use add_cog no problem

#

also this is the wrong channel

slim plaza
#

ok I solve the problem. I use discord.Client() instead of Bot()

tardy mauve
#

anyone got the Files required for DBL Votes Webhook.

elfin solstice
#

you dont need any files, you just need a htto webserver which accepts post requests

orchid sparrow
#

@mystic wing there is no interval

half summit
#

can you get information about bots that are not verified yet?

humble bison
#

I don't think so thonk

tardy mauve
#

@elfin solstice could you explain more? or someone.

ornate jacinth
#

https://discordbots.org/api/bots/:id/check seems to have broken and now only returns {"voted": 0}

#

@snow fiber

sullen nymph
#

https://discordbots.org/api/bots/247134460024193027/check?userId=247741991310327810 returned {"voted": 1} free upvote for ya :^)

ornate jacinth
#

@sullen nymph It worked the first time but now it's no longer working so I'm assuming it only affects users that aren't first time voters

#

OR my vote was bad somehow

ornate jacinth
#

just tried on an alt that had voted before and the same issue happens

#

so it's not just me

#

Looks like it was just taking a long time to update the cache or something

inner venture
#

Hey, I'm working on a rewrite for the Java lib

#

I need a second set of eyes to help me look it over for dumb stuff I've missed

summer oracle
#

@inner venture you can pong me

inner venture
#

@summer oracle Hi napster chan

#

The code is under the rewrite branch of the repo if you wanna take a look

summer oracle
#

not today

#

did you need it today?

#

i can do some chill'n'review tomorrow

inner venture
#

theres no rush ^^

elfin solstice
#

did you also remove the deprecated method of getting votes? πŸ‘€ or marked it as deprecated?

inner venture
#

im rewriting the whole thing

#

so i just dumped it completely

elfin solstice
#

ah kk

inner venture
#

wait

#

do you mean the one that gets the last 1000 users or wahtever

#

@elfin solstice

elfin solstice
#

yea

inner venture
#

Oh, didn't realize

elfin solstice
#

before it returned all users

inner venture
#

I'll mark it as deprecated

elfin solstice
#

not only last 1000

summer oracle
#

is that completely deprecated?

#

ive been using it as my backup way to notify users of upvotes when webhooks are down bloblul

elfin solstice
#

no but it won't work if you have more than 1k votes and to test if someone has voted you should use the new endpoint or webhooks

summer oracle
#

by doing diffs between the polls

elfin solstice
summer oracle
#

dope

#

either missed it or it was added after last time i checked

elfin solstice
#

i guess you missed it, that endpoint is there since idk maybe 2 months

summer oracle
#

yeah missed it

sand pumice
#

I'm using the DBL-Java-Library and want to run some tests of posting my server count to my bot. However, I don't want to be accused of faking my server count. I didn't see any protocol for conducting tests. Am I missing something or am I fine doing this?

elfin solstice
#

we monitor it and see if something strange happens

sand pumice
#

Alright. I'm going to jump from like ~5 to around ~11k.

ripe kernel
#

jesus

elfin solstice
#

wut

#

what you mean with "jump from like 5 to 11k"

sand pumice
#

Well I have a debug bot that's in a few servers. So I'm going to test sending my server count with that. But then I'm going to push the update to my actual bot which has around that many servers

elfin solstice
#

ah

#

yea thats fine

sand pumice
#

Awesome. Thank you!

ripe kernel
#

hey how do you test to make sure that your bot is actually posting it's server count i use the discord.js dbl api

sand pumice
#

I'd imagine you can look at the response or go check your bot's page on the site

ripe kernel
#

well either way it shows it's server count there.

sand pumice
#

But idk if the .js api lets you look at the site's responses

#

So you're probs good then πŸ‘

elfin solstice
#

yes it does, it returns a Promise if you manuall post stats, for autoposting it will show logs if the response errored

ripe kernel
#

oh i'm dumb af

#

nvm i know why it isn't logging the post. I updated my bot and my local bot.js didn't have the api post request smh

sand pumice
#

So I had a comment about your "code of conduct" for your /votes endpoint. This is at least true for the Java library, but have you considered implementing a cache in your API libraries that keeps voters for 24 hours? That could dramatically reduce the number of hits you get.

elfin solstice
#

thats why we recommend using the webhook over the /votes endpoint

#

so you can have your own cache of people who voted

sand pumice
#

gotcha

#

Sorry, one last question. For shard id's, do id's start at 0 or 1?

elfin solstice
#

shards start at 0

sand pumice
#

Just wanted to make sure. Thanks!

elfin solstice
ripe kernel
#

alright everything works

Aurora is online on 21 servers!
-_-_-_- commands folder loading... -_-_-_-
loaded!
-_-_-_- moderation folder loading... -_-_-_-
ban.js loaded from moderation!
kick.js loaded from moderation!
mute.js loaded from moderation!
report.js loaded from moderation!
unban.js loaded from moderation!
-_-_-_- wip folder loading... -_-_-_-
deletecounter.js loaded from wip!
membercount.js loaded from wip!
-_-_-_- Util folder loading... -_-_-_-
restart.js loaded from Util!
stop.js loaded from Util!
>(node:13147) ExperimentalWarning: The http2 module is an experimental API.
>Server count posted!
sand pumice
#

πŸŽ‰

ripe kernel
#

yay lol alright i think i am done for today seeya

sand pumice
#

I'm using the DBL-Java-Library, and I can't seem to hit the /stats endpoint. I keep getting this error

ERROR org.discordbots.api.client.retrofit.GenericCallAdapterFactory - Error while executing request to https://discordbots.org/api/bots/<clientID>/stats

I verified that my token is correct. I cannot seem to get any requests from the API to work on this endpoint.

sudden rampart
#

what's your code?

sand pumice
#
DiscordBotsListAPI dblClient = new DiscordBotListAPI.Builder()
                .token(authToken)
                .build();
...
dblClient.setStats(discordClient.getApplicationClientID(), discordClient.getGuilds().size(), shardID, totalShards);
inner venture
#

@sand pumice Can you try using the rewrite branch?

sand pumice
#

Sure, I'll give that a shot

inner venture
#

f069984

#

This is the latest commit of that branch

#

Just put that in the artifact ID spot

sudden rampart
#

wouldn't it go in the version with jitpack?

inner venture
#

oh yeah

#

sorry

#

I mixed up the two

#

When I was writing it, I was like, hey, that doesnt sound right

sand pumice
#

So it would be

<dependency>
      <groupId>com.github.DiscordBotList</groupId>
      <artifactId>DBL-Java-Library</artifactId>
      <version>f069984</version>
    </dependency>
#

Alright, I have the branch. I'll tackle this when I get home from church.

inner venture
#

@sand pumice alright πŸ™ The syntax is a bit different but it should be pretty easy to switch

ember cloak
#

Ey up lads

#

marginally confused.

inner venture
#

whats up

ember cloak
#

the api reference doesn't actually show what i have to post anympore?

#

just tells me how to auth

inner venture
#

wdym?

ember cloak
#

oh jesus christ

#

never mind

inner venture
#

lmao

ember cloak
#

forgot you had to scroll down there

inner venture
#

πŸ˜‚

ember cloak
#

sigh

arctic arch
#

πŸ‘

inner venture
#

hi tonkku

arctic arch
#

hi groovy

ember cloak
#
{
    'server_count': 4,
    'shard_count': 2
}```
#

single line json is a thing, right?

#
{ 'server_count': 4, 'shard_count': 2 }```
inner venture
#

yeah

#

if youre posting like that though

#

wait, are you able to post like that?

#

im not sure anymore

ember cloak
#

i cant see why not

#

its valid json

#
{ 'server_count': 4, 'shard_count': 2 }```
inner venture
#

well yeah

#

its valid json

#

but thats not my concern

ember cloak
#

dunno.

inner venture
#

try it man

ember cloak
#

wait what do you mean

#

"post like that"

#

i currently just post my counts like

{
    'server_count': 4,
    'shard_count': 2
}```
inner venture
#

The formatting of the json doesnt matter omg

arctic arch
#

I'm pretty sure you need " instead of '

ember cloak
#

cant see why one-lineifying would be bad.

inner venture
#

I was wondering if DBL would accept it

arctic arch
#

for valid json

ember cloak
#

instead of?

#

sorry i have the big dumb

inner venture
#

double quotes instead of single quotes

ember cloak
#

jesus christ

#

i didn't see the quotes...

#

sigh

inner venture
#

πŸ˜‚

#

its ok we're all the big dumb sometimes

ember cloak
#
{ "server_count": 4, "shard_count": 2 }```
#

FWIW i'm writing a program for my bots to POST to that will then POST out to other services.

#

so that my bots only need to deal with POSTing to one place.

arctic arch
#

thats nice

ember cloak
#

rofl

sand pumice
#

Alright, so I'm trying out the newest version (49690ab) of the rewrite branch of the DBL-Java-Library, and I'm getting this whenever I try to send a request

elfin solstice
#

@sand pumice you want to talk with @inner venture about that, he is the dev for the java library

sand pumice
#

My code:

DiscordBotListAPI dblClient = new DiscordBotListAPI.Builder()
                .token(authToken)
                .botId(clientID)
                .build();

...

dblClient.setStats(discordClient.getGuilds().size(), shardID, totalShards);```
#

Ah, alright. Thank you Yukine

#

Groovy, I see you've been actively working on the API. I'm looking through the code and I don't see how the token can be null.

inner venture
#

hmmm

sand pumice
#

I've triple checked that the value of authToken is my token from the DBL website

inner venture
#

yeah, its not a problem with you

#

It's adef a problem with the code

#

Can you try the latest version?

sand pumice
#

3b14ad9?

inner venture
#

yeah

sand pumice
#

Sure

#

Maven can't seem to resolve the dependency

#

But 49690ab is fine

inner venture
#

it might just be jitpack taking a bit to build it

sand pumice
#

Alright. I'll look through your code and see if I can find anything.

sand pumice
#

Hey @inner venture , I think I found something.

     private CompletionStage<Void> setStats(JSONObject jsonBody) {
        HttpUrl url = baseUrl.newBuilder()
                .addPathSegment("bots")
                .addPathSegment(botId)
                .addPathSegment("votes")
                .build();

        return post(url, jsonBody, Void.class);
    }

Shouldn't it be .addPathSegment("stats");?

inner venture
#

Oh yeah, my bad

sand pumice
#

Does that solve the issue? It doesn't look like that has much to do with the header field being null

inner venture
#

I'm takin a look rn

#

@sand pumice I fixed that issue

sand pumice
#

Did it fix the setStats(int,int,int) method throwing the NPE?

inner venture
#

Honestly, I'm not sure

#

It works by my tseting

#

Are you sure that the token you put in there wasnt null to begin with

sand pumice
#

Yes. I can check again

#

Well shoot. It was null

#

LOL I'm a fooooooool!!!

inner venture
#

hahhahahhaha

#

it wouldve failed anyways if it makes you feel any better

sand pumice
#

Only a little, haha

#

It's because I'm using an abstract class and set some data members out of order

inner venture
#

ahh, okay

#

Here, I'll add some checks to the builder to make sure it isn't null when building

sand pumice
#

Saving future fools from their folly. Good call

inner venture
#

πŸ™

sand pumice
#

Alright, we got rid of the NPE! surprise surprise

inner venture
#

πŸ˜‚

sand pumice
#

So I'll go ahead and grab the latest commit once it's available and try it out.

inner venture
#

It should be available now

sand pumice
#

It looks like it ran. Looking at the website to see if it shows up there

#

Does it usually take a bit for the site to update?

inner venture
#

Your browser might've cached the page

#

ctrl shift r it

sand pumice
#

Still nothing

inner venture
#

can i check?

sand pumice
#

Yeah, what info do you need?

inner venture
#

the bot's page

#

to see if its updated for me

sand pumice
inner venture
#

yeah im not seein any hahah

sand pumice
#

RIP

inner venture
#

hmm, you could check the callback

#

to see if its throwing an error

#
api.setStats(whatever).whenComplete((v, e) -> {
     if(e != null) e.printStackTrace();
});```
#

something like that

sand pumice
#

Sure, I'll give it a shot

inner venture
#

it might just not print anything at all

sand pumice
#

I'll put an else in there for good measure

inner venture
#

sure

#

the is for the Void it returns btw

sand pumice
#

I'm unfamiliar with Voids

inner venture
#

Don't worry about it

sand pumice
#

It hit my else

inner venture
#

hmmm

#

Then it seems like it succeded

#

I have

#

no idea

sand pumice
inner venture
#

If you pass over your creds to me I could give it a try

#

i promise i wont mess it up hahahhah

sand pumice
#

Hmmm, I think that'll be better as a last ditch effort

inner venture
#

Yeah

#

I understand

#

I got it to work on my end, though

#

Could you double check that the token and bot ID belong together

sand pumice
#

It's the Client ID from Discord, right?

#

The same as the URL

inner venture
#

206147275775279104

#

should be this one

#

yeah

sand pumice
#

But you said the setStats works for you?

inner venture
#

yeah

sand pumice
#

What if you use setStats(int, int, int) and specify only one shard?

#

I initially did that

inner venture
#

let me tryerino

sand pumice
#

Ah, I got the order of the parameters wrong

#

So I said the total shards was 0

#

I hope I didn't mess something up internally on the site

inner venture
#

I'm having trouble getting that one to work as well @sand pumice

#

let me investigate

sand pumice
#

Alright, cool. I also tried the setStats(int) and that didn't work

#

but that was after I got the total shards wrong

inner venture
#

That one seems to work for me

sand pumice
#

Oh hey, I got setStats(int) to work

#

The bot id in the discordbots url is different from my bot's client id from Discord

inner venture
#

huh

#

how old is your bot

sand pumice
#

They looked similar enough to where I thought they were the same

#

~2 years

inner venture
#

ohhhhhh

#

that would do it friend

sand pumice
#

lol how does that work?

inner venture
#

i didnt think your bot was that old hahahh

#

rn

#

discord uses the bot id for the client id

#

or the other way around

#

basically, theyre the sdame

#

but they used to be different when you made bots ages ago

sand pumice
#

Oh, so the bot's account has a different ID from the client ID

inner venture
#

yeah

#

the bots user ID and the bots client ID are differnet from old bots, basically

sand pumice
#

lol wow, that's a little silly. Took me for a ride

inner venture
#

yeah hahhaha

sand pumice
#

I think that means that my code won't work for newer bots

inner venture
#

How so?

sand pumice
#

Unless I include that data in a config file

#

So Discord4J has this DiscordClient object that keeps track of my client ID

#

However, it looks like I need the bot's user ID when building the DiscordBitListAPI

elfin solstice
#

shouldn't your lib have your ClientUser somewhere where you can get the id of that?

sand pumice
#

Let me check

#

Ah, yes I can

#

The setStats(int,int,int) didn't work with the correct id, so it's not just you

inner venture
#

hmmmmmm

#

@sand pumice i think i mightve found it

sand pumice
#

What's the issue?

inner venture
#

I had a parameter messed up

#

but it also kinda exposes a messed up thing with the error handling

#

so πŸ™

novel cape
#

So how can I setup webhooks?

#

can someone give me a walk through?

elfin solstice
#

its quite easy, just setup a small webserver what accepts post requests and in there you handle the logic for your webhook to add it do cache, a database or something

sand pumice
#

Oh boy. Sounds like an adventure is unfolding. I'll be on the lookout for the next commit

inner venture
#

@sand pumice the issue is like a two second fix hahaha im just figuring out the best way to handle thsi

#

so im leaving it unfixed so i can test out if my error handling works okie doke

novel cape
#

I have no idea on how to do that

sand pumice
#

Gotcha

elfin solstice
#

then you want use google and do [Your choosen langauge here] http web server library tutorial

humble bison
#

I might make a tutorial or example for one using node.js thonk

elfin solstice
#

for node.js you can use the official library tho

#

it supports webhooks

humble bison
#

ah

inner venture
#

hmm, maybe I should add webhook support for the java lib

#

@sand pumice Seems like I've fixed that now :)

sand pumice
#

Web hook stuff would be amazing!

#

Do you think you'd cash voters in the library or let the developer? I use a library called EHCache that is pretty robust. Pretty simple to use too

elfin solstice
#

we would let the dev do that, we just forward the response from the webhook to the dev himself

sand pumice
#

setStats(int,int,int) worked for me!

elfin solstice
#

the lib itself would never cache it itself

sand pumice
#

That makes sense

#

Hmmm, but if you do webhook stuff in the Java API, wouldn't that create an HTTP server for every bot process? So if a dev was running a bunch of instances on the same machine, it would spawn a bunch of servers

#

Thanks so much for the help, groovy! Super appreciate your time and patience for my folly

inner venture
#

@sand pumice Yeah, it would make a bunch of http servers. It's still up in the air thuogh. Thank you for helping me test out the rewrite hahaha πŸ™

sand pumice
#

Sure thing! Thanks for making the API!

tough stream
#
Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}
Traceback (most recent call last):
  File "<ipython-input-6-7b2a7524067c>", line 16, in update_stats
    await self.dblpy.post_server_count()
  File "/usr/local/lib/python3.6/dist-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 "/usr/local/lib/python3.6/dist-packages/dbl/http.py", line 189, in post_server_count
    await self.request('POST', '{}/bots/{}/stats'.format(self.BASE, bot_id), json=payload)
  File "/usr/local/lib/python3.6/dist-packages/dbl/http.py", line 160, in request
    raise Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403): {"error":"Forbidden"}```
#

i have no idea why, but every time i try posting my server count this happens

#

d.py btw, i just copied the example on dbl

inner venture
#

Is your token correct?

tough stream
#

it's the one generated on the dbl site, right?

inner venture
#

yeah

#

the one for the bot youre trying to post to

tough stream
#

ok i'll try again just to be sure

#

yep i reset the token and put the new one in, but same error

inner venture
#

Are you trying to post the stats to the bot that token is attached to?

tough stream
#

yes

inner venture
#

hm, i dont know what to say then

tough stream
#

πŸ˜›

#

i'll figure it out eventually

inner venture
#

might wanna ping python lib dev to see whats up

tough stream
#

who's that?

inner venture
#

honestly, im not sure

#

oh

#

@cobalt ruin Is francis still in here?

cobalt ruin
#

@golden wind

inner venture
#

thanks, couldnt tag him for some reason

tough stream
#

oh cool

arctic maple
#

Been having a few issues binding my client to the dblposter

const dbl = require("dblposter");
const poster = new dbl(Auth.dbl_key);

//inside a client.once("ready");
poster.bind(client);

This throws:

RangeError: You need to provide a client to bind to, either in the constructor of dblposter or in the bind function!
#

actually. I suppose I'll take a look at dblapi.js

uncut crystal
#

dblposter isn't supported by us

arctic maple
#

That's what I figured as the api page doesnt say to install it. I suppose it was my mistake to look at an old channel

tall comet
#

at _response.transport.request.then (/app/node_modules/snekfetch/src/index.js:193:21)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:188:7)

(node:13633) 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: 2)

(node:13633) [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.```
#

get this error when I do a command to send bot stats

plain timber
#

can you send your code?

austere swallow
#

seems like a snekfetch bug

uncut crystal
#

what makes you think that

austere swallow
#

Or an api bug

uncut crystal
#

what makes you think that

#

it's a 400

#

it's very likely to be user error

tall comet
#

Nevermind, I fixed it

austere swallow
#

well gladly is has been fixed

#

I mean, there could be a possibility

tall comet
#

I have another problem D:

#

at _response.transport.request.then (/app/node_modules/snekfetch/src/index.js:193:21)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:188:7)

(node:23032) 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: 2)

(node:23032) [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.```
#

keep getting that in my console every time my bot reloads

austere swallow
#

Are you providing the correct token?

tall comet
#

yes

#

It updated

austere swallow
#

It would really help if you can show us parts of the code, it'll help narrow down the problem

tall comet
#
const Discord = require("discord.js");
const fs = require("fs");
const bot = new Discord.Client({disableEveryone: true});
const DBL = require("dblapi.js");
const dbl = new DBL(-snip', bot);
bot.commands = new Discord.Collection();
fs.readdir("./commands/", (err, files) => {

  if(err) console.log(err);

   let jsfile = files.filter(f => f.split(".").pop() === "js")
  if(jsfile.length <= 0){
    console.log("Couldn't find commands.");
    return;
  }

  jsfile.forEach((f, i) =>{
    let props = require(`./commands/${f}`);
    console.log(`${f} loaded!`);
    bot.commands.set(props.help.name, props);
  });

}); 

#
 console.log(`${bot.user.username} is online on ${bot.guilds.size} servers!`); 
   
    bot.user.setActivity(`for +help | on ${bot.guilds.size} servers`, {type: "WATCHING"})
});

bot.on("message", async message => {
  if(message.author.bot) return;
  if(message.channel.type === "dm") return;

  let prefix = botconfig.prefix;
  if(!message.content.startsWith(prefix)) return;
  let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);

  let commandFile = bot.commands.get(cmd.slice(prefix.length));
  if(commandFile) commandFile.run(bot,message,args);
  
});

// Client join and leave Discord
bot.on("guildCreate", async guild => {
  let guildCreateChannel = bot.channels.get("468656742088048640");
  
  let general = guild.channels.find('name', 'general');
  guild.channels.get(general.id).createInvite().then(invite => {
    
    let joinEmbed = new Discord.RichEmbed()
      .setTitle('Guild Joined')
      .setThumbnail(guild.iconURL)
      .setURL(invite.url)
      .setDescription('Join the new Guild')
      .addField('Guild Info', `Name: **${guild.name}** \nID: **${guild.id}**`)
      
    guildCreateChannel.send(joinEmbed);
  });
}); 

bot.on("guildDelete", async guild => {
  let guildCreateDelete = bot.channels.get("468656742088048640");
  
  let leaveEmbed = new Discord.RichEmbed()
    .setTitle('Guild Left')
    .setThumbnail(guild.iconURL)
    .addField('Guild Info', `Name: **${guild.name}** \nID: **${guild.id}**`)
  
  guildCreateDelete.send(leaveEmbed);
});

bot.login(process.env.SECRET);```
#

@austere swallow

austere swallow
#

Hmm

#

I don't seem to see anything wrong here

tall comet
#

It might've been the token, just re-pasted it. But I had 11 and It turned to 12 before I replaced it

austere swallow
#

Yeah always double-check the token

tacit forge
#

(Assuming this is the right channel) Okay so, I've properly set up my webhook, it's up and running, I've even tested it on my own with curl and some "apitester" website to make sure it's usable. However, when I test the webhook in discordbots, nothing seems to be happening, the bot doesn't react (not even with some debug lines of code that print stuff to console when the post request is received). I'm not exactly sure if it's something I'm doing wrong or not, since nothing seems to be happening at all fatThunk

mystic wing
#

Could you post the link you have in there @tacit forge ?

#

Remember it has to have the port included

inner venture
#

Is the Get Bot's Last 1000 Votes endpoint considered deprecated?

elfin solstice
#

kinda since it won't work anymore if you have over 1k votes, you should use the check endpoint for votes instead or use webhook

inner venture
#

should i just remove it from the java lib honestly

elfin solstice
#

well the C# one marked it as deprecated

#

guess you could add and mark as deprecated or remove, what you like more

inner venture
#

yeah, but im rewriting the entire thing so breaking changes galore anyways

elfin solstice
#

yea remove then

inner venture
#

that simplifies my code a bit, hmm

#

thats the only place simple user objs are returned right?

summer oracle
#

kinda since it won't work anymore if you have over 1k votes

not true πŸ™ƒ

#

or at least it doesnt fail in a hard way

honest root
#

Yo. Is there a way to check if user have voted for my bot using .net library?

elfin solstice
#

@summer oracle what do you mean "fail the had way"?

summer oracle
#

it gives data

#

which looks pretty valid

elfin solstice
summer oracle
#

and if i got upvote, the endpoint will include my vote after a few minutes

#

i did this on aki a few weeks back

#

when webhooks broke

elfin solstice
#

how much votes does it give you?

summer oracle
#

about 1k

#

enough to make a diff between calls

elfin solstice
#

oh maybe it discards old votes and include the new ones

summer oracle
#

yeah

#

thats what i figured

#

i didnt see the user vote check route lol

#

which im about to deploy now so i wont have to rely on the 1k endpoint hack when webhooks are borked

elfin solstice
#

@arctic arch could you explain how the endpoint works in that case later πŸ‘€

inner venture
#

I mean it's pretty clear

#

It returns the last 1000 votes

arctic arch
#

which endpoint?

inner venture
#

the last 1000 votes oen

arctic arch
#

last 1000 votes?

#

self explanatory

inner venture
#

πŸ˜‚

tacit forge
mystic wing
tacit forge
#

that doesn't seem to be working either

inner venture
#

are you curling to that url?

#

or a different one

#

@tacit forge

tacit forge
#

that one

inner venture
#

@tacit forge does it work when you press the test button

tacit forge
#

Nothing seems to happen when I press the test button

#

as if it can't communicate with the webhook or something

sudden depot
#

Why does dbl.getVotes() return me 1000 random votes

plain timber
#

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

sudden depot
#

@plain timber my probmel is i get 999 random votes as my bot only has 1 vote on the page atm

plain timber
#

oh

#

ummm

#

no idea

sudden depot
#

IS there any use of puting client into the .js api
( const dbl = new DBL(process.env.dbl, bot ( Discord.JS Client) ); )

autumn dagger
#

wh

grim beacon
#

client.shards is undefined and I am using shards. How can I post the server count to the bot then?
I am using discord.js

arctic mesa
grim beacon
#

client.shards is undefined

arctic mesa
grim beacon
#

gives me 400 Bad Request

#

if I use without s

arctic mesa
grim beacon
#

yeah

#

it exists

#

but it gives me 400 Bad Request

#

(node:30748) UnhandledPromiseRejectionWarning: Error: 400 Bad Request
at _response.transport.request.then (bot directory\node_modules\dblapi.js\node_modules\snekfetch\src\index.js:193:21)

arctic mesa
#

ahh

arctic arch
#

what's the value?

grim beacon
#

.id is 0, .total is 1

arctic arch
#

.total isn't a thing

#

try .count

arctic mesa
#

id is the number of the shard that is on the server

grim beacon
#

oh, I meant count*

#

nvm

#

I put .total in the 3rd arg

#

shet

arctic mesa
sudden depot
#

const DBL = require('dblapi.js');
const dbl = new DBL(process.env.dblkey, { webhookPort: 5000 });
does not make a webhook

weary ember
#

you have to go to the bot page and insert the link and port + password

sudden depot
#

yeah but i do not even see the webhook running

arctic arch
#

add dbl.webhook.on('ready', () => console.log('webhook running, yay!'))

sudden depot
#

that logs it but pressing the test button still doesn't do shit

arctic arch
#

okay

#

problem changed

#

is your configuration on the DBL website correct and can you receive http requests on your machine and connection

light crag
#

If you host it on your machine you will need to port forward.

sudden depot
#

okay it looks like it works now hmm

#

thanks

honest root
#

how can I show if my bot is online on DBL website?

mystic wing
#

have it added here

sudden depot
#

does .hasVoted(id) reset after 24h

arctic arch
#

it resets when the user is able to vote again

gilded summit
#

What happens when I don't specify webhookPort?

honest root
#

I feel like I should use JS for this API, as .NET library very weak. it does not have .hasVoted(id) function, all it shows its all votes. even though it should return only amount of votes for day I entered, as a parameter, but it always returns all voters

mystic wing
#

Webhooks

arctic arch
#

the day stuff was removed from the api

#

@gilded summit the webhook doesn't start

gilded summit
#

Oh

#

Ok

#

@arctic arch I still never figured out what to put my port as

#

And test doesn't seem to be working

mystic wing
#

put it as one you aren't using

#

5000 is a good one

gilded summit
#

I set it to 5000 but still nothing

#

Do I need to port forward? @mystic wing

#

It no woooork D:

#
const DBL = require("dblapi.js"), dbl = new DBL(Token Here, {
    "webhookPort": 5000
});
dbl.webhook.on("ready", (hook) => {
  console.log(hook);
});
dbl.webhook.on("vote", (vote) => {
    console.log(vote);
});```
#

That's what I have

arctic arch
#

yea you need to port forward

gilded summit
#

Ok

#

It still hasn't worked

#

hook = { hostname: '0.0.0.0', port: 5000, path: '/dblwebhook' }

arctic arch
#

whats the url you set on the edit page

gilded summit
#

I left it empty...

#

Do I need to set it to something?

inner venture
#

πŸ˜‚

#

yeah

gilded summit
#

B O I I've never worked with this before!

#

What do I set it to?

inner venture
#

you're runnign this in your house right

gilded summit
#

Yes, but soon I'm going to upload it to my host

inner venture
#

Just the host's ip

#

and then the port

gilded summit
#

Oh

#

Ok, cool

#

Thanks

inner venture
#

and then the path

gilded summit
#

Thanks

honest root
#

should I edit your api for .net and pr?

arctic arch
#

yes that would be nice

honest root
#

I will add at least "has voted" and fix some redundant data there

arctic arch
#

πŸ‘πŸ»

tacit forge
#

After some intense google searches, I'm still not understanding why clicking test on the edit page doesn't do anything to my webhook. I know it works cause I've tested it multiple times in multiple areas and PCs, but in the one place I need it to work, it doesn't seem to. Is there something specific I need to do with the webhook for it to work...?

proud sphinx
#

it might take some time

#

make sure your port is forwarded

tacit forge
#

It is

gilded summit
#

@noble iron My 2nd bot was approved

#

@dense sinew ping

#

...

#

Wat

#

@dense sinew ping

#

M-Missing permissions?

#

What permissions?

noble iron
#

wat

inner venture
#

This isnt testing

gilded summit
#

Oh crap

fast tapir
gilded summit
#

I thought I was in testing-1

fast tapir
gilded summit
#

Sorry

inner venture
#

s my h

gilded summit
#

SORRY

#

I THOUGHT I WAS IN 1

inner venture
#

S MY H

gilded summit
#

D:

fast tapir
#

I'm in 0

#

k bai

tacit forge
#

smh

#

Anyway, the port is forwarded, the webhook works, clicking test doesn't seem to do anything and my webhook doesn't seem to be receiving the post request at all.

inner venture
#

@tacit forge One thing I noticed is that you have https in dbl but all the curl screenshots you posted use http

tacit forge
#

I was using cloudflare at one point, but when I used curl on my PC it got in the way and didn't work, so I turned it off just to see if that would change anything. I tried http earlier today and it didn't make much of a difference (despite it working on my PC)

fast tapir
#

@restive otter

#

read

inner venture
#

What language are you using?

#

Not sure what DBM is

#

but i'd take a look at this\

#

oh

#

well uh

#

I have no idea how that would work

magic widget
#

Me too

#

I’m using DBM

honest root
#

just made a PR for .net lib, should I notify anyone?

inner venture
#

@honest root i think pinging the .net lib dev would be acceptable

honest root
#

who is he? thonkku

inner venture
honest root
#

DrakezZ is the owner

#

but I have no idea who is he on this server

inner venture
#

DrakezZ?

#

isnt it velddev

honest root
#

velddev another person who developed this lib 5 month ago

inner venture
#

well yeah

#

it hanst been touched by anyone else

honest root
#

what is his nickname on this server?

#

well, I will wait for few days, in worst case will ping admins or something

inner venture
#

@honest root where did you even submt the price?

#

Pr*

honest root
elfin solstice
#

@honest root you did not submit the PR to the right repo

honest root
#

._.

elfin solstice
#

there

honest root
#

I am blind...

#

done ._.

#

thank you Yukine

tacit forge
#

discord bot maker

#

when programming is too hard

honest root
#

Discord bot maker
when you follow a tutorial and later on ask billion questions

rigid dagger
scarlet lynx
#

ok

plain timber
#

@restive otter this channel is only for the DBL api, check the channel topic

honest root
#

My pr merged dblCertified

honest root
#

are all http request I can see in documentation, or there is something not added yet?

inner venture
#

theyre all documented afaik

fading kraken
#

can i receive vote-webhooks without a URL? just to my bot-servers IP perhaps?

light crag
#

Yes.

arctic arch
inner venture
#

i dont know why i expected that url to work

plain timber
#

Lol

gray root
#

Can webhooks get a attribute to see if it is a weekend? I don't want to ping the weekend endpoint for every vote that comes in.

dull sundial
#

This is in no way shitting on how dbl did it. But wouldn't it make alot more sense to include whenever the vote counted double in the weebhook payload rather than making a whole endpoint just for the purpose of checking it?

inner venture
#

The inconsistent naming in this API kinda bothers me, tbh

gilded summit
#

What do you mean?

inner venture
#

Some fields use snakecase

#

Some fields use all lowercase

#

Some fields use camelcase

#

Some boolean fields have the is prefix

dark pine
inner venture
#

some boolean fields dont have it

gilded summit
#

Ooof

#

Yeah, it still says 24 hours all over the site

inner venture
#

I would honestly appreciate a standardization effort but it's more effort than its worth at this point

gilded summit
#

Imo 1 person should take charge to update the API and the 24 hour thing

summer oracle
#

meh

neat wedge
#

It would be great to receive the amount of time (maybe in seconds but doesn't matter) that the user has to wait for the next upvote.

snow fiber
#

Correct me if I'm wrong but wouldn't that always be 12 hours?

inner venture
#

Oh my gob

#

Even more naming inconsistencies

#

@cobalt ruin Oliy this is out of control

restive otter
#

the site still says "Please wait 24 hours to vote"

#

not 12

inner venture
#

I don't think that is what the multiplier is @restive otter

cobalt ruin
#

what

inner venture
#

oh nevermind

#

I misread

#

@cobalt ruin The naming inconsistencies within dbl are insnae

#

You literally just added a feature and named the same value two different things

#

or atleast, used two different naming schemes

#

in the REST api, is_weekend, in webhooks, isWeekend

plain timber
#

lol seriously

inner venture
#

Yes

summer oracle
inner venture
#

Even within the Bot object, 3 different naming schemes are present

plain timber
#

maybe each admin uses a different naming scheme or something

inner venture
#

The actual bot object returned by DBL is also woefully different from the one in the documentation

cobalt ruin
#

@inner venture yes it's quite bad at the minute but we're going through a rewrite so all of this will be fixed

inner venture
#

I'm assuming there'll be a /v2/?

#

or a ?v=2?

cobalt ruin
#

yea something like that, we haven't reach the api yet

inner venture
#

I sure hope, Oliy

#

I sure hope

#

What is the date returned in the bot object?

#

@cobalt ruin

#

Last modified?

dark pine
#

Or is it still 24H?

inner venture
#

or is it creation date

plain timber
#

unless thats one of the wrong ones

inner venture
#

tjhank you

#

missed that one

#

^^

calm torrent
#

what timezone does "weekend" use?

fast tapir
#

GMT

calm torrent
#

ok thx

#

(basically utc)

haughty isle
#

OΓ― is someone still online ?

honest root
austere swallow
#

lol

autumn dagger
#

^

#

yeah you're getting the wrong thing

honest root
#

thx

sand pumice
#

I'm not sure where to ask this question, but it sorta relates to the API and it's not in the FAQ. Do I need a website to get certified, or can my commands be documented on discordbots/a help command?

#

I saw someone get denied certification because of a poorly constructed website (or something along those lines)

honest root
#

Made another PR related to weekend update + fixing a bug where you can send a HTTP request even if you have more than 1000 votes
P.s. maybe this time I will get the role!

autumn dagger
#

@sand pumice Full documentation of commands, either in a help commands or external site.

#

is one of the requirements

#

OR

#

so

#

if your help command shows EVERY command

#

like it should

#

then you're fine on that front

#

its not really related to the API

restive otter
median cedar
restive otter
#

nvm

#

Found it

median cedar
#

πŸ‘Œ

#

Hi there! Could anyone help me out setting up webhooks in Python? I don’t have a website so it might not be possible. I simply want some code to be triggered every time someone votes so I can put the voting stuff in there

arctic arch
fading kraken
#

im trying to get a webhook sent to my bots' server when someone votes, what am i doing wrong? I have the URL set to the server IP with the port (I tried without the port too)

#

in my code i have the webhookPort set to 5000, with the right auth and token

restive otter
#

Hey the generate token button on the website isnt working

#

it isnt actually a button

arctic arch
#

yea its a link

#

@fading kraken http:// ip.here.yes.pls:port/path

fading kraken
#

@arctic arch /path?

arctic arch
#

yes

#

like /dblwebhook for example if you're using default settings of dblapi.js

median cedar
#

does anyone know anything about webhooks in python? i'm struggling to find anything online that works

arctic arch
median cedar
#

thx

fading kraken
#

@arctic arch im testing it locally and in my console it says its running at http://0.0.0.0:80/dblwebhook - & on the website I have http://{{MY_IP}}:80/dblwebhook but i dont seem to be receiving them?

arctic arch
#

have you port forwarded

fading kraken
#

i thought I wouldnt have to because i set it to port 80 πŸ€” ill try it on the server

median cedar
#

it says running on http://127.0.0.1:5000, but this isn't my IP address. Should I use this or my actual IP?

arctic arch
#

your actual ip

#

127.0.0.1 is localhost

median cedar
#

k

#

it's not working

#

it can't connect

arctic arch
#

what can't connect

median cedar
#

when i try and send a webhook, it just gives me a connection error

arctic arch
#

how are you sending a webhook

median cedar
#

i've tried through DBL and Postman

arctic arch
#

try using 127.0.0.1 when testing in postman

median cedar
#

that worked

arctic arch
#

okay so you need to port forward as well