#topgg-api

1 messages Β· Page 49 of 1

grizzled agate
#

hello is there something wrong with the api ?

proud sphinx
#

@grizzled agate A. you should check permissions
B. you should catch errors anyway to prevent restarting

solemn knot
#

Read the error next time

restive otter
#

If i use the api links: https://discordbots.org/api/bots/check?userId=
what id i need to add there?

#

is this also need an Authorization?

humble bison
#

the ID of the user you want to check?

#

and yes, all of the API needs auth

calm zealot
#

When sending my serverstats to discordbots.org via the post request, do i have to send individual shard stats or can i sum them up internally?

plain timber
#

@calm zealot there are 3 ways of sending stats with shards

#
  1. Send the server count and shard count from one instance
  2. Send array of servers per shard from one instance
  3. Send server count, shard count, and shard id from all instances
calm zealot
#

i see. the most preferable way for me would be 1. retrieving the servercount from the Discord.ShardingManager object , in app.js so to say.

#

do i have the servercount info in the sharding objects, i cant find it?

Manager.shards.forEach(shard => console.log(shard.id)); // i want shard.servers.size
sudden rampart
#

@plain timber the array is server count per shard

#

[shard0count, shard1count, shard2count, ...]

spiral steeple
#

I dont believe a shard has a guilds.size automatically

calm zealot
#

sure, i am just trying to figure out options. if i do method 3. i dont need broadcastEvals though?

steep zealot
#

dbl.getBots is not working

restive otter
#

Could someone help :<

sudden rampart
#

this channel is for the DBL api

restive otter
#

mb

topaz glacier
#

@arctic arch A way in which the bot checks if the user has voted recently or not?

#

js

arctic arch
topaz glacier
#

I see thanks

restive otter
#

How to get dbl token

spiral steeple
restive otter
#

Thx

#

How to log vote ?

#

Just username has voted

#
const dbl = new DBL("token", bot);```
#

I do that

spiral steeple
#

2nd example

restive otter
#

Webhooks?

#

Wth

vernal adder
#
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });``` Umm where do i find my password
sudden rampart
#

you choose it

vernal adder
#

Do i have to put it somewhere on the website or can i just put it in

plain timber
#

@vernal adder you need to put it in your bot's edit page

vernal adder
#

Ah, Okay Thanks

neat wedge
#

Do you have a list of possible IP ranges from where the webhook triggers can come in?

latent pasture
#

Good evening

I'm using discord.py (Python Lib) and i'm trying to get users who voted my bot using webhook to give them rewards. I've set up the Webhook on my /bot/{bot.id}/edit page and after this i'm completly lost, i don't know what to do. I know how to create Webhook with discord.py and send messages using it but, i don't know how to configure the discordBots list webhook, can someone bring me some help please ?
Ty β™₯

sand hazel
#

Start a http server and listen for POST requests and check for Authorization header

#

Then pass that http server address to the DBL webhook field

latent pasture
#

@sand hazel Wuw, i never did that, is it free ?
Can you please drop me a good tutorial about that or something because it's totally new for me πŸ˜…

(I tried to Google it but didnt find anything descent)

sand hazel
#

Just google python http server

latent pasture
#

Thank you πŸ‘Œ

inner fox
#

would it be possible to make a multi- file system with js lib

#

wondering before i attempt

#

nevermind its definitely better to just have a single file

humble bison
#

wrong channel

#

also yes its possible and no having a single file is the dumbest thing you can do

inner fox
#

i mean only for the dbl api stuff

spiral steeple
#

Meh, tony seperates all events and everything i believe, not that theres anything wrong with that either

inner fox
#

like for now i just include this in my main file to seperate dbl and djs

#
d.run;```
#

dbl.js is file name

past reef
#

Is it possible for the DBL API to be used in PHP? As in, server count, shard count, etc?

light crag
#

As long as your lang can make HTTP requests it is possible

past reef
#

Alright, thanks

inner fox
#

is this correct? not sure if i can so it the same way i can in d.js

  console.log(`Loading a total of ${DBLevtFiles.length} DBL events.`);
  DBLevtFiles.forEach(file => {
    const eventName = file.split(".")[0];
    console.log(`Loading Event: ${eventName}`);
    const event = require(`./dblevents/${file}`);
    dbl.on(eventName, event.bind(null, dbl));
  });
humble bison
#

not related to the dbl api

harsh socket
#

dbl events thonk

median remnant
#

hello, i know the question has been asked a lot of times but i still can't figure out how to send a message that says "user has voted" :x for more information, i use discord js and i host my bot on a vps ubuntu 16.04, if someone wants to help me without trashtalk or insulting me it will be very nice, thank you in advance (ps: i'm French πŸ₯– so my English is not very very good :p)

sand hazel
#

The DBL JS library has a built in webhook server in which you can pass additional args to start, then you just listen for events to send that message to certain channel

median remnant
#

Okay, but how do i specify a public ip for the webhook ?

sand hazel
#

Your public ip is your vps's public ip

median remnant
#

mmmhh if i have understood correctly, the dbl api make webhook with my vps ?

sand hazel
#

Webhook is just a http server in which dbl sends post requests to

median remnant
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'what is password ?' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${VPS IP}:${port ? 5000 ?}${the url webhook on desired channel ?}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
#

I leave 5,000 ? where i find the password ? i set it ? and, url is https://vps_ip:5000(what is a path of webhook ?(in channel ?)) i want details to better understand, i've been looking for two days without results GWgoaSadness

sand hazel
#

You can use whatever port you want, you set the auth password, you can use whatever path

median remnant
#

;-;

#

what path ? ;-;

raw sparrow
#

the path is set to dblwebhook if you use the dblapi

median remnant
#

in node_modules ? ;--;

sand hazel
#

http path

#

you can use whatever

median remnant
#

tell me an example please

raw sparrow
#

Didn't knew you change it (without creating the webserver yourself) however if you use the dblapi the default is
https://publicIP:port/dblwebhook

median remnant
#

okay, i'll try all this

#

but, how test it ?

sand hazel
#

There's a test button your bot page...

median remnant
#

ty :x

sand hazel
#

And you can mock requests to your http endpoint

median remnant
#

ty for help

#

just, how do i get a valid port ?

sand hazel
#

what

median remnant
#

i can define any port ?

sand hazel
#

You can use any valid/unused port within 2^16-1

median remnant
#

okay ty

median remnant
#

good everything looks good, but it only displays the person's id, how I can make it display his nickname or even mention it please (vote.user.username doesn't work)

#

solved thx

#

x)

#
var logsvote = bot.channels.find("id", "id_of_channel");
  var tt = bot.users.get(vote.user).tag
  logsvote.send(`<@${vote.user}>/${tt} has voted`);
raw sparrow
#

You'll get a cannot read tag of undefined if your bot doesn't share a server with the voting user then

median remnant
#

Yeah, that's why I put the nickname next to it

simple ibex
#

hey dear

#

how to showed the avatar of bot on dbl?

restive otter
#

@median remnant The bot can't get the nickname if the user has 0 common server with the people

restive otter
#
  dbl.webhook.on('ready', hook => {
              ^

TypeError: Cannot read property 'on' of undefined```
#

Anyone help?

arctic arch
#

you dont have the required options for the webhook

restive otter
#

i do now :p

inner fox
#

For the webhook do you need a port forwarded IP address ?

#

When I initiate it the ip shows as 0.00.0:5000

sudden rampart
#

the port must be accessible for outside connections

inner fox
#

Ahh k

sudden rampart
#

replace 0.0.0.0 with your public ip

tidal rover
#

why all of a sudden does my post stats not work

haughty tundra
#

What do you mean?

spiral steeple
sudden rampart
#

because that's not how you use that endpoint

#

Query String Params

wooden sparrow
#

Quick question, anyone having issues with voting on DBL? Seems to have stopped working for me over night =/ (been working fine for months, haha)

sudden rampart
#

?a=b

polar mirage
#

bruh.mp3

restive otter
#

response return to {"error":"Unauthorized"}

sand hazel
#

Where's the auth?

restive otter
#

how can i give

sand hazel
#

Authorization header

restive otter
#

@sand hazel can you explain a little more explanatory?

sand hazel
#

header, Authorizard key

#

look at the example libs

#

google authorization header

restive otter
#

thanks

devout dew
#

My bot is stuck in a loop of logging in, sending one api request, being disconnected and logging in again. It's able to respond to one discord command each time and discord.py isn't reporting any errors to the console. Does anyone know what that's about?

#

Note: the bot functions fine if I use any token other than @sly loom's

inner fox
#

Try regenerating your token @devout dew

wooden sparrow
#

There's been no changes with the voting webhooks recently, right? (still confused why voting stopped working for my bot, haha)

plain timber
#

there shouldnt have been

wooden sparrow
#

Hmm, out of ideas now haha

#

I'll leave it for today and see what else I can try tomorrow

inner fox
#

i have a suggestion, reading a bots current status, idle , dnd, offline, online, in the bot object

devout dew
#

@inner fox can that be done without losing all my servers?

inner fox
#

uh yeah

#

dont regen dbl token i mean the discord my applications token

devout dew
#

Hmm, alright

restive otter
#

Using DBL's API

#

Never had this issue before

spiral steeple
#

Unauthorized means the your authorization is incorrect i believe

restive otter
#

Botinfo doesn't need authorization though?

#

and my other bot I haven't touched in a long time works perfectly fine

spiral steeple
#

To access our API you need to authorize yourself

#

Authorization is always required when doing requests, is it not?

restive otter
#

No?

spiral steeple
#

Then I'm afraid i cannot help you

simple ibex
#

Do you guys know?

#

how to showed avatar bot dbl

#

Im using API

#

discordbots

plain timber
#

@restive otter @spiral steeple yes authorization is needed for all requests

#

@simple ibex have you looked at the docs

restive otter
#

Aight

simple ibex
#

don e

#

ty

devout dew
#

I have another bot that's missing from this list that is working and it's deleted my token.

arctic arch
#

that is the only bot you own

#

that's the only bot you've ever added

devout dew
#

Nevermind, this isn't an issue. I was mistaken.

restive otter
#

How do I trigger when members vote?

#

what i want:
for example
vote-log channel:

Mrtol has voted 25.01.2019 12:45
xx has voted 25.01.2019 12:25

arctic arch
#

webhooks

restive otter
#

how example give please?

tawdry spindle
#

is already on docs

plain timber
#

@restive otter what language

restive otter
#

turkish

plain timber
#

??

sand hazel
#

lmao

plain timber
#

What coding language

restive otter
runic grove
#

Haha

restive otter
#

@tawdry spindle bak ne demiş

#

java @plain timber

tawdry spindle
#

hm?

plain timber
#

You will need to set up a webserver

#

Accept the post request from DBL

#

Or you could just use js and the dblapi.js module

restive otter
#

I guess I can't but thanks

sand hazel
#

wew, stick with java

restive otter
restive otter
#

How to get Authorization in webhooks?

plain timber
#

@restive otter it's sent as a header in the post request

topaz glacier
#

which lang?

#

turkish πŸ˜‚

inner rune
#

Does the api rate limit on IP or Auth KKey

spiral steeple
#

If youre thinking about using multiple auth keys to bypass rate limiting...

inner rune
#

Nah thats not it

#

I got two bots im adding code for it. Just need to know if I need to split the rate limit to accomidate both of them on one server

plucky ore
#

API has only 2 events without using webhooks (error and posted)?

arctic arch
#

those events are there for the autoposting feature when you include your client

cinder kettle
#

plz valide my bot

sterile sleet
#

don't ask us to review your bot

#

and don't ask questions that aren't API related here

simple ibex
#

Hey dear

#

I Using all shard not work

inner venture
#

what are you trying to set it to

simple ibex
#

shard_id and shard_count and shards not work

#

All Shards Not work

plain timber
#

explain

#

is there an error?

simple ibex
#

i try

#

is undefined

#

no error

#

is undefined all

#

@plain timber

#

you know

#

i create a command dbl.js

plain timber
#

can you send your code

sand hazel
#

it's like, fundamental, to attach the code

simple ibex
#

nope

#

code dbl.js is a private πŸ˜‰

#

this is a code

#

from my dbl.js

#

shard id is undefined

#

...........

sand hazel
#

kek private

#

have fun getting help

simple ibex
#

no

#

sorry

#

this is a code

#

how to fixed

sand hazel
#

wow, can't tell

simple ibex
#

is all undefined

#

What?

sand hazel
#

or origin of definition or anything

#

10/10

#

@plain timber help this poor soul to f8x his c0de

simple ibex
#

idk

#

idontknow

#

howtofixedit!

plain timber
#

if you dont send the actual posting code we cant help you

#

also can you use real english and spaces between words

simple ibex
#

How to fixed it!

#

Shard Count undefined

#

????

sand hazel
#

quality trace

#

@amber dune peek this iq

simple ibex
#

????????

#

Is not from DBL

#

DBL not posting our code :v

#

is showed an tutorial ;v

#

I using Footer for my funny

#

how dear Website Moderators

amber dune
#

@simple ibex if you dont show us your entire code, we wont know what the problem is

inner venture
#

I believe he's using the get request

plain timber
#

@simple ibex i dont think shard_id is in the bot object

inner venture
#

The get request does not return the shard_id

simple ibex
plain timber
#

dude

#

stop sending screenshots

sand hazel
#

yes, keep showing screenshots

plain timber
#

send the text

sand hazel
#

lmao

simple ibex
#
  let id = msg.mentions.members.first().user.id;
  let avatar = msg.mentions.members.first().user.displayAvatarURL;
  let dblBots = await dbl.getBot(id)
  
  if(dblBots.server_count === undefined) dblBots.server_count = 'None'
   
  let embed = new Discord.RichEmbed()
  .setAuthor(`Stats of ${dblBots.username}#${dblBots.discriminator}`, 'https://images-ext-2.discordapp.net/external/NUQ1frynEtUDB_-ByRw_NBdTl0sVeNacGQogqRLZ77Y/https/cdn.discordapp.com/emojis/393548363879940108.gif')
  .setThumbnail(avatar)
  .setColor('RANDOM')
  .setDescription(` \`\`\`${dblBots.shortdesc}\`\`\` \n \n**Monthly Votes:** ${dblBots.monthlyPoints} \n**Total Votes:** ${dblBots.points} \n**Lib:** ${dblBots.lib} \n**Prefix:** ${dblBots.prefix} \n**Tags:** ${dblBots.tags.join(', ')} \n**Certified:** ${colorMaping[dblBots.certifiedBot]} \n**Posted Guild Count:** ${dblBots.server_count} \n**Posted Shard Count:** ${dblBots.shard_id} \n \n[Discord Bot List Page](https://discordbots.org/bot/${dblBots.id}) | [Invite](${dblBots.invite}) | [Support Server](https://discord.gg/${dblBots.support}) | [Github Repository](${dblBots.github}) | [Website](${dblBots.website})`)
  .setFooter('Credits DBL | Powered By: Discord Bot List', 'https://images-ext-2.discordapp.net/external/1eA2X2zC7-8RAkK8d-VRE_jCyeXxe1MvLPqNDDVKorM/https/cdn.discordapp.com/emojis/376811626197811200.png')
msg.channel.send(embed);```
#

.......

#

thi is my code

vagrant ruin
#

lmao

simple ibex
#

don

#

done

#

you can copypaste the code

#

Beacuse

spiral steeple
#

Why would we want to?

simple ibex
#

:v

#

k

#

how dear

#

@amber dune

#

i has showed my code

sand hazel
#

@inner venture ye it doesn't in the doc, but the actual request do

simple ibex
#

let brain = null?

amber dune
#

nothing :p

simple ibex
#

......

amber dune
#

but anyway i dont know much javascript

simple ibex
#

Oh nope

arctic arch
#

the get request doesnt send a shard id

simple ibex
#

;v

arctic arch
#

you post with shard id but you dont get it back as a shard id

simple ibex
#

ouh

plain timber
simple ibex
#

😭

plain timber
#

??

#

obviously you dont know what shard id is

arctic arch
#

use shard_count

plain timber
#

^

simple ibex
#

is not work

#

All has undefined

arctic arch
#

the ? after shard_count in the documentation means it could be undefined

simple ibex
#

???

#

is say

arctic arch
#

@simple ibex you're looking at the wrong section

simple ibex
#

for server_count

#

will works

spiral steeple
#

because you can get the server_count

simple ibex
#

yes

#

Server_Count & Shard_Count Is Same

#

You Know It!

plain timber
#

no

#

they're different

simple ibex
#

ouh

#

is ok

#

wait

#

i will using

#

shard count

#

if undefined Ok

#

done

arctic arch
#

server_count is the amount of servers or guilds the bot is in
shard_count is the amount of shards the bot is running

simple ibex
#

i can't posted shard

plain timber
#

i guess medalbot doesnt post a shard count?

simple ibex
#

ouh yeah

#

ok dear

#

i will try it!

#

there all

#

is undefined

#

i using shard_count

#

@plain timber

#

you know

#

how to fixed

#

or @arctic arch | Team DBL

#

??????

plain timber
#

can you stop spamming

simple ibex
#

ok

arctic arch
#

as I said, not every bot has a shard_count

simple ibex
#

Done im not spam again

#

ouh

arctic arch
#

you can check if it's undefined and do something about it

#

like remove that line completely

sand hazel
arctic arch
#

which ones

sand hazel
#

monthPoints, donatebotguildid, server_count, guilds, shards

plain timber
#

docs are super outdated

arctic arch
#

monthlypoints should be

#

donatebotguildid as well

sand hazel
#

It's not part of the bot object in the resources

arctic arch
#

servercount and shards idk what my thoughts were

#

I think those weren't even supposed to show up in there

#

just stats

sand hazel
#

also the go lib link needs to be updated still

plain timber
#

and the py docs link

arctic arch
#

but I dont wanna remove them now and break people's stuff

#

guilds should be documented

sand hazel
#

and the py example needs to be updated or removed, it's been causing the forbidden error for py users

plain timber
#

did you guys not know api docs are really outdated Thonk

sand hazel
#

πŸ‘πŸΎ

plain timber
#

everyone else does

arctic arch
#

of course I do

plain timber
#

then why havent they been updated zoomeyes

#

do you do docs or does oliy

arctic arch
#

anyone whenever

simple ibex
#

ok

#

done

#

i can't using Posted Shard Count:

sand hazel
#

open source the doc so we can update it πŸ‘πŸΎ

spiral steeple
#

Yes

plain timber
#

yes

#

i suggested that

simple ibex
#

dblBots.guilds

#

is working ???

arctic arch
#

the whole docs need a rewrite for that

simple ibex
#

for shard

#

ehehhe

#

Im so very idk

sand hazel
#

let there be a rewrite πŸ‘πŸΎ

simple ibex
#

Sorry for my bad english

#

πŸ˜ƒ

#

Im not using translate

arctic arch
#

well I updated the bot object

sand hazel
#

py and go while you at it jerrycheese

plain timber
#

also mobile compatibility kthx

arctic arch
#

mobile compatibility isnt in my ability

#

and I'm tired and need sleep

plain timber
#

rip

#

gn

arctic arch
#

and idk wtf is going on with the py lib

#

we need a new maintainer I guess

plain timber
#

well

#

the docs link is outdated

#

change it to https://dblpy.rtfd.io

#

rn its http://dblpy.readthedocs.io/en/v0.1.3/ which is a 404

simple ibex
#

i done

#

i can't using Posted Shard Count:

simple ibex
#

hey all

#

In here

#

How to return if member's bot is not in here/dbl and send to channel Bot not registered on DBL

summer pine
#

Hi, with this line written on the API page for C#, which bit does the server count and which does the shard count?
await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });

#

I did mess around with it to try and figure it out but no luck

topaz glacier
#

My bot is online but in the site it shows offline

wicked crag
#

It can take a short while until the bot is shown as online. Try refreshing

loud gulch
#

caching is the reason it does that

topaz glacier
#

catching?

coarse isle
#

Π±Π»

topaz glacier
#

The site still shows that the bot is off lol

spiral steeple
#

@topaz glacier is the bot in this server?

ember kayak
#

The online status of my bot is ???, im using D.JS and the api. Do i need to do something special to have the online status correct?

spiral steeple
#

The bot needs to be in this serevr

#

server*

ember kayak
#

my friend Cole#7575 is in here with bot developer and he posted the bot multiple months ago, IDK if the bot is actually in here

spiral steeple
#

Ping it, easiest way to see if its here.

ember kayak
#

It's not.

summer pine
#

Hi, with this line written on the API page for C#, which bit does the server count and which does the shard count?
await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });
I did mess around with it to try and figure it out but no luck

light crag
#

24 = current shard id
50 = shard count
array = each shard guild count

tidal forum
#

hey what is the easiest way to download the api because i want to use python but i use a windows computer and have git bash but don't know how to download pip

shut ibex
#

@topaz glacier is the bot in this server

#

the bot must be in this server to show status

summer pine
#

@light crag if I do
await me.UpdateStatsAsync(2, 2, new[] { _client.Guilds.Count, 0 });
all it does is display the amount of servers the bot is in, but if I use the default one await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 }); then it does display the shards as well?

#

sorry for tag btw

light crag
#

The C# library is pretty confusing in terms of updating stats

#

Might as well make your own class for it

#

so like

#
await me.UpdateStatsAsync(new DBLStatsObject({
    ShardCount = 2,
    GuildCount = _client.Guilds.Count
}))

Make the DBLStatsObject (or whatever name) which uses the JsonProperty attribute. [JsonProperty("server_count")] (for GuildCount) and [JsonProperty("shard_count")](for ShardCount)

#

then the library can make the request with your custom object

#

@summer pine

summer pine
#

cheers, I'll try this now :)

#

I am getting this error:
Argument 1: cannot convert from 'Bump_Bot.DBLStatsObject' to 'int' for this line
await me.UpdateStatsAsync(new DBLStatsObject()

#

also I had to change that line a bit from what you wrote

#

@light crag

simple ibex
#

cuk

#

guys

#

guys

#

im using d.js

light crag
#

@summer pine Show the code

#

It shouldn't need to convert the object to an integer

summer pine
#
    {
        [JsonProperty("server_count")]
        public int GuildCount { get; set; }

        [JsonProperty("shard_count")]
        public int ShardCount { get; set; }
    }```
```                AuthDiscordBotListApi DblApi = new AuthDiscordBotListApi(511167075801235478, "token");
                IDblSelfBot me = await DblApi.GetMeAsync();

                await me.UpdateStatsAsync(new DBLStatsObject()
                {
                    ShardCount = 2,
                    GuildCount = _client.Guilds.Count
                });```
light crag
#

oof exposed token

summer pine
#

yep

#

lmao

runic grove
#

Better reset it then

summer pine
#

will do

light crag
#

Oh it might be calling the wrong method. I am pretty sure UpdateStatsAsync(object <object>) is protected

#

I'll fork this library and improve the method

summer pine
#

Ok

#

thanks :)

spiral steeple
misty geyser
#

why does retrieving stats for a bot requires authorization?

simple ibex
#

guys how to posted shard count im using d.js create command dbl info

spiral steeple
#

All interaction with the api requires auth

misty geyser
#

fml >_<

light crag
#

@summer pine made a PR for it. Look in pull requests for the github repository

spiral steeple
#

It's to prevent abuse. And to ensure that when calling it users have a bot listed on the site

simple ibex
#

Can't be respon WIth Define | shard_count |

misty geyser
#

yeah fair enough

#

I have to change my website now xD

old river
#

How come all these people always have Minecraft avatars

summer pine
#

Ok will do in the morning, cheers :)

spiral steeple
#

You can do it on your website?

misty geyser
#

no, since it requires authorization

spiral steeple
#

You just have to pass your token in the Authorization header

misty geyser
#

yeah, I don't feel like making that request using JS now πŸ˜‚

spiral steeple
#

Yes, and you should have authorization

#

I do it in js mmLol

misty geyser
#

so everyone that opens your website can see your api key?

#

o_o

spiral steeple
#

You can encrypt it tho

misty geyser
#

meh

#

rather just cache it

#

and do it on server side instead

light crag
#

Make the front-end request an API endpoint to your server which returns the stats

misty geyser
#

yap ^

#

@spiral steeple how would you encrypt it btw?

#

js obfuscator?

#

those can be reverted in minutes (they are not encryption too)

potent comet
#

not sure if this is the place to ask, but how would i make it so everyone is able to see all the servers my bot is in on the website?

sand hazel
potent comet
#

ah thanks

weary patio
#

The FOOK PiNGED ME

#

@plush ore I have a feeling it was you -_-

plain timber
#

@weary patio check recent mentions

#

and dont send spammy caps messages

weary patio
#
  1. it was deleted 2) Sorry
topaz glacier
#

@arctic arch Lol my bot is not in the server

plain timber
#

@topaz glacier dont mention admins

#

and wrong channel

#

if you have fixed the issue tell a mod in #general

sour garden
#

if i send a request to the api to update my bot's server count every 10 seconds, will i be ratelimited?

#

@potent comet you probably shouldn't do that, people may not want the names of their servers to be public

humble bison
#

@sour garden it's suggested every like 15 minutes

#

10 seconds is extreme

topaz glacier
#

@plain timber how should II find in #mod-logs The list is so big

sour garden
#

@humble bison i don't do it every 10 seconds because i want quick updates, its mainly because its in a function with another thing that runs every 10 seconds and it would be convenient not to have to put it in a separate function. i just wondered if it would work without getting rate limited

sand hazel
#

You won't be rate limited w/ 10 seconds

topaz glacier
#

Why was the bot kicked from here?

sour garden
#

thx Fishy

#

but anyway, i now made it do 10 minutes

#

because also each of the 4 shards were doing it every 10 seconds, now only shard 0 does it every 10 minutes

topaz glacier
#

Ok ok I understood why u kicked it I fixed the problem The bot reacted without a prefix sorry about that

#

Now it is fixed

#

@arctic arch

restive otter
#

is webhook the only way to send a message when someone votes?

tidal burrow
#

it's up to you how you want to send the message, but the dbl webhook doesn't mean discord webhook

restive otter
#

@tidal burrow can i use the vps hostname

http://${here}:5000/dblwebhook
#

?

tidal burrow
#

iirc should be fine

plain timber
#

@topaz glacier there's a search bar, also I already told you to not ping admins... If you fixed it ping a mod in #general since this doesn't belong in api

topaz glacier
#

Oh sorry ok

soft geode
#
C:\Users\Lachlan\Desktop\Bots\AllRounderBot\index.js:194
dbl.webhook.on('ready', hook => {
            ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (C:\Users\Lachlan\Desktop\Bots\AllRounderBot\index.js:194:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
PS C:\Users\Lachlan\Desktop\Bots\AllRounderBot>```
#

help?

#

do i need to create a webhook on my server or...

restive otter
#

obviously

#

@soft geode

#

You can't post to a webhook if it's non-existant

plain timber
#

@soft geode you need to include the DBL webhook settings in the "new dbl" line. DBL webhooks are not related to discord webhooks.

soft geode
#

What do u mean @plain timber

#

@restive otter how do I connect the two

restive otter
#

Well you didn't share your actual code, so I can't help you going off of an error.

plain timber
#

@soft geode did you look at the docs

soft geode
raw sparrow
#

you should use a different port rather than 0 - i think port 0 is valid but some OS refuse incoming connections to port 0 and not sure but even some ISP dont forward port 0 requests since there is a potential exploid reading OS infos with it

soft geode
#

Yeah

#

I use 5000 now

humble bison
#

i run my webhook on my actual server, which is on port 80

sudden rampart
#

you can't actually bind to port 0

#

binding to 0 just means "give me any free port, no matter which one"

soft geode
#

Ok

#

Why does my bot say running webhook on 0.0.0.0:5000

#

Like not an actual ip

humble bison
#

because that's localhost

sand hazel
#

@soft geode That's not localhost, but like a wildcard address or unspecified

#

In the context of servers, 0.0.0.0, can mean all IPv4 addresses on the machine

soft geode
#

Ok

#

Thenn why does nothing happen when someone votes

sand hazel
#

ensure it's reachable, try it from your browser

sudden rampart
#

0.0.0.0 == replace me with one of your public ips

plain timber
#

@soft geode did you set the webhook settings in your bot's edit page

soft geode
#

What do u mean

plain timber
#

You need to set the webhook url and authorization header in the edit page in DBL @soft geode

soft geode
#

What would I see URL as @plain timber

harsh socket
#

http://ip:port/dblwebhook

spiral steeple
#

Can I ask what lib you are using?

restive otter
#

JavaScript

spiral steeple
#

Good, idk how to use it with any other ones lol

runic grove
#

thats not a lib

spiral steeple
#

Well

runic grove
#

wait

spiral steeple
#

d.js

#

?

restive otter
#

yes...

spiral steeple
#

Alright, do you have your webhook set up on your dbl bot page?

restive otter
#

.... I don't even know how

spiral steeple
#

Alright

#

How do you host it

restive otter
#

glitch

spiral steeple
#

Alright

restive otter
#

sooo?

spiral steeple
#

I don't know a lot about glitch, I was just reading up on it

#

give me a sec

restive otter
#

kk

spiral steeple
#

Now, I may get some stuff wrong with this, so forgive me if I do

restive otter
#

ok

spiral steeple
#

Honsetly it might be better to wait for someone that uses glitch to respond, but I'll try anyways mmLol

restive otter
#

Bruh glitch is only to write the code

spiral steeple
#

I asked how you hosted it...

restive otter
#

Wym hosted?

spiral steeple
restive otter
#

Glitch has a console

spiral steeple
#

Yea

#

Then its hosted on glitch

#

but its different

#

change the xxxxxx part to your project's name

#

Head over to your bots page on dbl

restive otter
#

Ok I am on my bot page

spiral steeple
#

Hit edit

#

and scroll all the way down

restive otter
#

Oh I see webhookΒΈ

spiral steeple
#

Paste the link I gave you with the xxxxxx part replaced with your project name

restive otter
#

done

#

Do I save it like that?

spiral steeple
#

No, make a password

#

or authorization

#

whatever its called on there

restive otter
#

Ok I've made a pass

#

I save now I think?

spiral steeple
#

Now save

#

Keep that open to test later

restive otter
#

ok

#

now what I have to do?

spiral steeple
#

Do you have the dblapi module?

restive otter
#

yes

spiral steeple
#

Alright, do you have it setup to receive them yet, or does that still need to be set up

restive otter
#

How do I setup that?

spiral steeple
restive otter
#

I already went there but I don't see i which context I can use it

spiral steeple
#

I think glitch uses 3000 for the port though

#

so you'll need to change that

#

or actually, I know people use process.env.PORT I'm not sure if thats automatically there or not

restive otter
#

hhhmmm

#

I did that

#

I guess I have to change the ip

spiral steeple
#

No

#

0.0.0.0 is local host

restive otter
#

oh ok

spiral steeple
#

but like I said thats where glitch is different

#

If you hit test

#

just what happens

#

on the dbl site

#

I'd expect nothing

restive otter
#

Webhook tested! This may take a few seconds

#

^^^^

spiral steeple
#

Yea, that says that

#

whats your console say

restive otter
#

nothing

spiral steeple
#

Alright, try adding :3000 after the .me part of your url so it looks like https://xxxxxxxxx.glitch.me:3000/webhook

#

Idk if that will work, but it's worth a try

restive otter
#

/dblwebhook or just webhook?

spiral steeple
#

dblwebook

#

my bad

restive otter
#

kk

spiral steeple
#

then hit save and then test it again

restive otter
#

still nothing...

spiral steeple
#

You got the dbltoken and your auth right, correct?

restive otter
#

yes

#

I've put my dbl token

#

and the password

spiral steeple
#

get rid of the :3000 part I talked about earlier

restive otter
#

done

spiral steeple
#

and you do have the dbl.webhook.on('vote' ...) event?

restive otter
#

no..

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

I've got this ^^

spiral steeple
#

well you need the vote event too

restive otter
#

ohh

#

ok

spiral steeple
#

Thats probably why it didnt work mmLol

restive otter
#

Ok I added it

#

do I retry?

spiral steeple
#

You restarted it so it actually uses the changes?

restive otter
#

ye

spiral steeple
#

Alright as long as you hit save after you removed the :3000 part, it should work

#

I think

#

:+1:

restive otter
#

wait... actually

#

lemme try again

spiral steeple
#

mmLol ok

restive otter
#

Yes, worked I clear the messages and it just send:User with ID 420321095334363137 just voted

spiral steeple
#

Great, now you can do whatever with the vote that it passes

restive otter
#

Oh at the place of console.log, do you think I can do message.channel.send?

spiral steeple
#

Yea

runic grove
#

if you have access to the message scope somehow

#

yes

spiral steeple
#

Well

#

make a channel

#

for it

restive otter
#

Ye Ye

#

And I will find it

#

And all...

plain timber
#

What

finite ridge
#

M

rain niche
#

Is there any way to give players a reward for voting for my bot?

sand hazel
#

Yeah?

rain niche
#

Like, how would I tell that a user has voted

sand hazel
#

webhook?

rain niche
#

Oh

visual flicker
#

$help

rain niche
#

His webhooks work? There aren’t any docs for your API...

#

how does your webhooks/api work*

humble bison
#

read the docs

rain niche
#

Your docs don’t tell me any

#

Anything

spiral steeple
#

What are you using?

rain niche
#

Python

spiral steeple
#

Oh yea

rain niche
#

πŸ‘€

spiral steeple
#

Do they even have python docs that work

rain niche
#

Idk

#

It just told me to go here and set the link

#

And check to see if it’s the same pass I set

#

Like wtf

#

And then the links to the full docs don’t work

spiral steeple
#

Im a JavaScript person so

rain niche
#

Yeah idk

#

Maybe I could look at the other languages’ docs

#

HOLY CRAP

#

that’s like

#

An actual doc... for python it’s just.. yeah here is some crap sample code.. yeah yw

#

...

spiral steeple
#

Hes not a mod

rain niche
#

?

spiral steeple
#

Check his roles

humble bison
#

mods are red

rain niche
#

He’s the fricken dev of the library

spiral steeple
#

🀦

rain niche
#

Even worse

spiral steeple
#

Wot

humble bison
#

fishy is the Go library dev

spiral steeple
#

Hes a lib dev

rain niche
#

Ohhh

humble bison
#

he makes the dbl-go library

rain niche
#

For GO

#

Ok

#

Not as bad

spiral steeple
rain niche
#

But still

spiral steeple
#

Still not a mod

rain niche
#

Idk they looked similar

#

In color

#

Ima have to contact somebody about this tho cuz... there are like 0 docs for the api

#

For python

humble bison
#

your supposed to implement it yourself

#

the docs are there to explain how it works, not to spoonfeed you the code for it

plain timber
#

@rain niche for webhooks you will need to set up a webserver to receive requests

rain niche
#

ahh

#

but the thing is... idek what the API does

#

or what thi ngs it offers

#

so

#

..

cyan kestrel
#

So why are you trying to work with it?

plain timber
#

You would know if you read docs wtfpalm

#

It lets you set the server and shard counts, and get information on bots and users

#

You can also check what users have voted for a bot and if the weekend multiplier is in effect

rain niche
#

i cant read the effing docs m8

plain timber
#

Why

rain niche
#

thats the problem\

humble bison
#

then learn to

rain niche
#

there are nONE

plain timber
#

Do u not know English

humble bison
#

do you have eyes

#

there are

plain timber
#

...

rain niche
#

ok watch

plain timber
#

Wdym there are none

humble bison
plain timber
#

^

humble bison
#

there even in the channel topic

rain niche
#

all i get

plain timber
plain timber
#

That's not the docs

rain niche
#

an example that shows me basicly nothing

plain timber
#

That's an example for the python lib

rain niche
#

..

humble bison
#

the python lib is outdated anyways

#

use your own requests

plain timber
#

But you can look at the other pages to find the docs for the http API itself

rain niche
#

ahhhhh ok

#

in the python lib example

#

it says

#

read the full docs at //...

#

but the link is broken

plain timber
#

Yeah that's broken

#

Blame oliy

rain niche
#

yeah... this is quite stupid... just to get here like omg

#

i contacted a couple mods and they basicly said

#

"yeah idk m8"

#

"gl"

#

...

sand hazel
#

What part of webhook is confusing

#

it's implemented similarly to other platforms

spiral steeple
#

You could just use your own server and listener too, cant you?

#

And Fishy good luck in that game mmLol

sand hazel
#

@spiral steeple Yeah you can and I won

spiral steeple
#

:+1:

rain niche
#

hey how do you authenticate

#

using client

#

nvm

#

wait... the get_upvote_info keyargs don't do anything...

#

i said days=1

#

and onlyids=True

#

and it still returns a full list of users, and every vote ever

#

....

#

im about done with this.

#

this whole thing is broken

sand hazel
#

Pretty sure someone said python lib is outdated

#

Days and onlyids are no longer working, as there are no longer valid fields in the api

#

reference the resources section of the api doc for a somewhat updated request/response

rain niche
#

...

sand hazel
#

Pretty much every lib except the py one is updated

rain niche
#

nvm in fricken done

#

thanks for the outsatanding support

sand hazel
#

Yw

plain timber
#

@rain niche you can just use a http request library (aiohttp) and make requests to the api itself

#

instead of using dblpy

rain niche
#

why do you guys still point ppl to this libraray

#

i just spent 2 hours coding something based on something that doesnt work

sand hazel
#

Because it partially works

#

And is the only lib available if you don't want to do it yourself

sudden rampart
#

feel free to write a new one

#

Β―_(ツ)_/Β―

rain niche
#

how would i send http requests to the api..

plain timber
sand hazel
#

Wew, so uh, do you know what http request is

rain niche
#

i just dont know how i would get the same functionality as get_upvote_info()...

plain timber
#

you want to check if someone has voted?

rain niche
#

Yes

plain timber
rain niche
#

So, how would I implement that with aiohttp?

#

@plain timber

#

Thanks for the help btw

#

I don’t need fully working code for a vote check, I just need a basic way to revive that

plain timber
#

uh it should have a way to do a GET request

rain niche
#

receive

#

Ahhh ok

plain timber
#

so just GET https://discordbots.org/api/bots/BOTID/check?userId=USERID

rain niche
#

Ahh yeah that makes a lot of sense now

#

Thanks a lot

plain timber
#

yw

tawdry spindle
#

does module has a function for that?

blissful zodiac
#

F

snow sky
#

i got an error 400 bad request in the api

#

nevermind it fixed itself

arctic arch
#

your code did an oopsie

rustic torrent
#

nm i got it forgot the repo

fallow sequoia
#

i been looking so long for a working Api for anime characters

#

can anyone HMU with one?

humble bison
#

i'm not sure if it'd do though

#

looks like they have a character api

sudden rampart
fallow sequoia
#

thanks

bold edge
#

How do you post your server count to the list?

#

I use discord.js

humble bison
#

look at the api docs

bold edge
#

Thank you πŸ˜ƒ

humble bison
#

np

bold edge
#

Excellent @humble bison that has worked perfectly.

humble bison
#

πŸ‘Œ

bold edge
#

How often does it post the server count?

sand hazel
#

1800000 ms apparently for the default

bold edge
#

So I don't need to put it in the guildCreate and guildDelete event? will the ready event be fine?

sand hazel
#

?

#

Ready event be fine for what

bold edge
#

It's okay I just realised my error lol don't worry.

spiral steeple
#

if you just include your client object in the new DBL it should just auto post for you

#

I think

#

Wait no

tender fiber
#

try to get votes from api but returns this??? list of people who voted: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

#

here is code ```js
//Code credits to Tony ThatTonybo#0001 thanks much for help alot :)
const config = require("../config.json")
const p = require("phin")
module.exports.run = async (bot, message) => {
if(message.author.id !== "388489346208104464") return message.reply("for r2d2 only")
const {
body: r
} = await p({
url: https://discordbots.org/api/bots/${config.botID}/votes,
headers: {
'Authorization': config.dblapiKey,
'Content-Type': 'application/json'
},
});

if (!r.length) return message.channel.send("nobody has voted yet");
message.channel.send("list of people who voted: " + r.map(user => ${user.username + user.discriminator}).join(", "))

}
module.exports.help ={
name:"checkvote"
}```

plain timber
#

wtf

tender fiber
#

what is wrong on code?

plain timber
#

Uh I can't really see any issues

#

But you don't have the bot dev role Thonking

#

Your bot hasn't been approved? That might be why

tender fiber
#

no i left server and came back

plain timber
#

It should have given you the role though iirc

tender fiber
#

idk

restive otter
#

How to unlock bot to my server

#

Apply bot

polar mirage
#

yes

restive otter
#

how to get bot

narrow zenith
#

What do you mean?

#

Like how to create it?

restive otter
#

where is that

#

i want to yous bot

hybrid crag
restive otter
#

but dosent show me a server

hybrid crag
#

If you dont have the right perms in the server you wanna add it to then it wont show up

restive otter
#

Returns N/A

#

Nvm.

#

My bad.

#

new issue, bot shows offline.

#

@arctic arch

rustic torrent
#

wat

restive otter
craggy apex
#

 if(msg.content === prefix + "test")
  {
  
  dbl.hasVoted("487515609815580672").then(voted => {
    if (voted) return msg.channel.send(`LEL its a TEST`);
    else{
    
    
    msg.channel.send(`Pls Vote`);
    
    }
});
  }

i have make this Code But its not Work Pls help

#

My inglish is not so good

finite ridge
#

@craggy apex

#

what does db1 refer to?

spiral steeple
#

Im pretty sure thats an l

#

just a font thing

finite ridge
#

oh

spiral steeple
#

it may be a 1 tho

finite ridge
#

nah

#

i copied it

#

it's an i

spiral steeple
#

How did you copy it

finite ridge
#

ctrl c

spiral steeple
#

its in a photo

finite ridge
#

no?

spiral steeple
finite ridge
#

it's not

#

it's an code block

spiral steeple
#

Oh wait

#

Was looking at the one above

finite ridge
#

i am talking about this one

spiral steeple
#

yea I can see that now

finite ridge
#

what lib are you using @craggy apex

craggy apex
#

dblapi.js

finite ridge
#

oh lol

#

ofc

#

this is the api chat

#

can you send the whole code?

craggy apex
#
 if(msg.content === prefix + "test")
  {
  
  dbl.hasVoted(msg.author.id).then(voted => {
    if (voted) return msg.channel.send(`thanks for vote`);
    else{
    
    
    msg.channel.send(`Vote on Discordbots.org`);
    
    }
});
  }

finite ridge
#

don't use return

craggy apex
#

ok

rustic torrent
#

is there a way to tell how many times your bots page was visted?

sand hazel
#

js tracking prob, only for cert

rustic torrent
#

oof 😦

plain timber
#

Yeah

steel hawk
#

I need help with webhooks

#
  const dbl = new DBL(dblToken, { webhookPort: 5000, webhookAuth: "" });

  dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });
  dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
  });```
#

I'm doing this so far, how can I test if the vote webhook is working without having to vote?

sand hazel
#

Test button, construct your own payload, it's just a http endpoint

#

You can mock it however you want

steel hawk
#

I pressed the test button, and nothing happened..

sand hazel
#

Visit the endpoint yourself to make sure it's reachable

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

This works

humble bison
#

wrong channel

steel hawk
#

But the vote webhook doesn't

restive otter
#

Sorry

sand hazel
#

@steel hawk yeah go to the endpoint yourself

humble bison
#

also @steel hawk make sure the vote webhook is set in your bots edit page

steel hawk
#

Wdym go to the endpoint myself?

sand hazel
#

It's literally a http server, visit it in your browser

steel hawk
#

I did

sand hazel
#

Is it up?

steel hawk
#

nothing there

sand hazel
#

Is it reachable?

steel hawk
#

nop

sand hazel
#

Then it's prob your server configuration issue

#

check ufw, selinux, etc

steel hawk
#

I'm gonna be honest with you, I don't understand half the words ur saying

sand hazel
#

What endpoint did you visit

steel hawk
radiant lynx
#

hey guys.. not sure if someone can help me

#

I hit 'test' for webhook

#

then the votes on my bot seemed to have disappeared

sand hazel
#

@steel hawk You are suppose to replace it with one of the ipv4 address

radiant lynx
#

is that... meant to happen?

#

or, who's the best person to check with πŸ˜‚

sand hazel
#

going to need more context

steel hawk
#

Which one of the ipv4 addresses?

sand hazel
#

The public one?

plain timber
#

@radiant lynx votes reset at the end/beginning of every month

radiant lynx
#

@plain timber oooh I see, gotcha thanks πŸ˜„

steel hawk
#

@sand hazel Any that work (I really have no idea how to do this)

sand hazel
#

The public one on your machine

#

0.0.0.0 is unspecified or wildcard in this case

steel hawk
#

So, if I'm hosting my bot on a VPS

#

Would I just replace 0.0.0.0 with the ip of the vps?

sand hazel
#

Yeah

steel hawk
#

Ok thanks

#

@sand hazel It says page can't be found now

plain timber
#

@steel hawk it's a post request, u can't look at it in a browser

#

Browsers normally do get requests

sand hazel
#

then replace that url in dbl settings

steel hawk
#

ah

#

Omg it worked

#

Thank you

restive otter
#

set up the bot to receive vote confirmation message
how to do that?

latent pasture
#

You have to create an HTTP server and listen for POST request
Then you have to pass the link of your server to your DBL edit page

If it's a localhost it should look like that :
http::/localhost:8000/dblwebhook

8000 is the port, replace it with the port you've chosen

hollow wraith
#

link to your webhook server, on dbl edit page will be the public ip of where your bot is hosted

restive otter
#

@hollow wraith

hollow wraith
#

?

restive otter
#

How to post server count to bot's page? I tried all the examples but all is not working

#

@hollow wraith

hollow wraith
#

never done it

latent pasture
#

@restive otter Which language are you using ?

restive otter
#

@latent pasture js

latent pasture
#

Erf, got the example in Python but not in JS, but it should not be really different :

    dblToken = 'YOUR_DBL_TOKEN'
        headers = {'Authorization' : dblToken}
        url = 'https://discordbots.org/api/bots/' + {bot.id} + '/stats'   # Looks like : https://discordbots.org/api/bots/125781235411256784/stats
        payload = {"server_count"  : len(client.guilds)}  # len(client.guilds) returns the number of servers the bot is on
        
        async with aiohttp.ClientSession() as aioClient:  # Here we do a POST request to the url that we specified above
            await aioClient.post(url, data=payload, headers=headers)```
rustic torrent
#

are you not able to use a discord webhook for voting?

shut ibex
#

No

#

Dbl doesn't support discord webhooks

crude sandal
#

Hey I have my bot split into 6 shards and 2 Clients. One Client is handling shards [0,1,2,3] and the other one is runnign on a different server handling shards [4,5]. How should I post server count to the api, because the first Client only gets server count for it's 4 shards and the other one for it's 2 shards.
I tried using shard_id parameter passing shard_id=0 for one and shard_id=4 for the other client. However it doesn't work πŸ˜•

#

am I doing something wrong? e.g. does it maybe only work when I post stats for each shard individually? The problem is that I cannot get each shard's server_count but only for each Client

plain timber
#

@crude sandal if you use shard id then the server counts need to add up to the total