#topgg-api

1 messages · Page 111 of 1

oak estuary
#

not your bot token

restive otter
#

oh ok

#

I've tried it, but I'm still not getting the output

oak estuary
#

¯_(ツ)_/¯

restive otter
#

should I change the port number?

oak estuary
#

idk

silk reef
#

Anyway to trigger the dbl.on_dbl_vote without actually voting?

restive otter
#

The blue highlighted

#

*blurred

soft salmon
#

Yes.

earnest sapphire
#

@Calamardo Tentaculo#3163 There is only invitation on the site, how do I add the voting?

#

@oak estuary

oak estuary
#

idk

#

sorry

earnest sapphire
#

Okay

radiant peak
#

@patent lintel u are missing the @commands.Cog.listener above the the event

soft salmon
#

@oak estuary There is only invitation on the site, how do I add the voting?
@earnest sapphire Is your bot approved?

#

also sorry Cala for the tag.

paper dock
#

Hello, how do i get the token of my server in top.gg? i need it for setting up my api

rain heart
#

oh fuck

wraith trench
#

Also how do you get the webhookAuth pass?

const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });```
rain heart
#

you will only be able to obtain it after your bot has been approved

#

the password is defined by yourself i think

wraith trench
#

wdym

rain heart
#

iirc you will have to host the webhook yourself, but i might be completely wrong with that

wraith trench
#

Yeah but, How do we receive the pass?

#

I am new to webhooks so

jaunty plank
#

You define the password

coarse fossil
#

how do we get the dbl token again?

jaunty plank
#

Its whatever you want as long as its the same in your code and on the site

#

One sec

coarse fossil
#

thanls

silk reef
coarse fossil
#

for?

#

servercount?

silk reef
#

The basic commands that use the top.gg api.

coarse fossil
jaunty plank
#

Woulda sent earlier but discord was down

analog flame
#

hmm

oblique axle
patent lintel
#

ur webhook url

oblique axle
#

where do i find that

patent lintel
#

public-up:PORT is ur url

#

*public ip

oblique axle
#

i just paste that in there?

jaunty plank
#

you paste your info in there

patent lintel
#

NOOOOO

earnest sapphire
#

No

oblique axle
#

i dont know where i find my info

jaunty plank
#

http://ip:port/path

patent lintel
#

yeah

earnest sapphire
#

Please turkish language

jaunty plank
#

wheres your code hosted @cedar blaze

cunning sonnet
#

Does DBL Java Library have events for even a user votes?

oblique axle
#

Heroku @jaunty plank

patent lintel
#

@cunning sonnet u need a webhook

jaunty plank
#

i dont believe the java lib does. youll have to use a webhook library for that @cunning sonnet

patent lintel
#

Heroku @jaunty plank
@oblique axle ur url would be <app-name>.herokuapp.com/<path>

cunning sonnet
#

Oh nevermind I just realize I don't even need that

earnest sapphire
#

Help

patent lintel
#

not api related

#

ask in support channel

oblique axle
#

i dont know where i can find that url tho lol

patent lintel
#

dude what is the name of ur app?

#

heroku app

oblique axle
#

dude i have put the name but i dont know what to put in path

jaunty plank
#

if your not setting path, the default path listed in the docs

patent lintel
#

dude i have put the name but i dont know what to put in path
@oblique axle if u are not using a seperate path, i think you can ignore that

jaunty plank
#

most libs have a default path.

oblique axle
#

i dont

patent lintel
#

r u doing it in your index path?

#

if u r, then u can ignore the path i think

#

what lib r u using

oblique axle
#

discord.js

#

yes in index

patent lintel
#

ok then no need to use path

oblique axle
#

alright

#

thanks for the help 😉

patent lintel
#

discord.js
@oblique axle also, you mean node.js right?

jaunty plank
#

the dbljs lib has a default path

patent lintel
#

r u using dbljs

oblique axle
#

u asked for the library i use

jaunty plank
patent lintel
#

ur asked for the library i use
@oblique axle im saying for the webhook

jaunty plank
#

dblwebhook is the default path if you are using the dblapi.js lib

oblique axle
#

yeah

patent lintel
#

yeah

oblique axle
#

yeah im using the dbljs

patent lintel
#

@oblique axle r u using dblapi.js?

#

ok

oblique axle
#

yeah

patent lintel
#

then the path is dblwebhook

oblique axle
#

oh nice

#

thanks! 😉

patent lintel
#

🙂

fringe panther
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});```
#

i can run this code with removing webhook right

jaunty plank
#

Removing webhook?

fringe panther
#

yes

#

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

jaunty plank
#

The ready event isn't required.

fringe panther
#

ah, so do i just need to get my authorization & token that's all

jaunty plank
#

Yeah. Then set the webhook url on the site.

#

Portforward if applicable. Open through any firewalls too

fringe panther
#

discord webhook url right?

jaunty plank
#

No, the top.gg webhook is not compatible with discord webhooks.

fringe panther
#

@jaunty plank where do i do that

#

i only see the my bots section on top.gg

jaunty plank
#

Edit bot, webhook section

#

Theres a url and an auth section.

fringe panther
#

ah, so what do i set the url to

jaunty plank
#

http://ip:5000/dblwebhook

fringe panther
#

it can be a domain name as well right

jaunty plank
#

Yeah if you have a domain

fringe panther
#

http://ez-bot.xyz/dblwebhook like this?

jaunty plank
#

You'll still need to set the port since its on port 5000

fringe panther
#

it supposed to be dblwebhook right i sound stupid
also i'll do that now

jaunty plank
#

Yeah, the libs default is dblwebhook

#

Dw about it. Some people have zero idea how any of this works. Atleast you have a general idea.

fringe panther
#

Ah, and webhook auth is my authorization right?

jaunty plank
#

It can be anything you want it to be, as long as its the same as what you set on the site and code

fringe panther
#

alright

#

welp, imma test it now ty

#

oop nothing happened

dreamy skiff
#

Is this correct? ```
const DBL = require("dblapi.js");
const dbl = new DBL(topggtoken, bot);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})

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

fringe panther
#

yeah it doesn't console.log for me in vote either lol

dreamy skiff
#

i have it inside a bot.on('ready', () => {}) event

restive otter
#

Oh shit

#

Sorry

#

I didn't want to ping you

#

Oh

#

I'm sorry

patent lintel
#

im trying to post server count with dblpy but it isnt working. My code:
index.py

import discord
from discord.ext import commands
import os

client = commands.Bot(command_prefix="$", activity=discord.Game(name="idk"))


@client.event
async def on_ready():
    print('Online!')

@client.command()
async def load(ctx):
    if ctx.author.id == 697628625150803989:
        for filename in os.listdir('./cogs'):
            if filename.endswith('.py'):
                client.load_extension(f'cogs.{filename[:-3]}')
        await ctx.send('Done')

client.run('bot token')```
`topGG.py` (in cogs folder)
```py
import discord
import dbl
from discord.ext import commands


class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl token'
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)
    @commands.Cog.listener()
    async def on_guild_post():
        print("Server count posted successfully")

def setup(bot):
    bot.add_cog(TopGG(bot))``` it doesnt give me any errors, doesn't post the server count, and never prints "Server count posted successfully". Can someone please tell me what I am doing wrong?
silk reef
#

@patent lintel any errors?

#

Also u inserted ur token here self.token = 'dbl token' right?

patent lintel
#

@silk reef of course lol

#

and i said no errors

#

and i realized i forgot to pass in self on async def on_guild_post():

sullen nymph
#

more like it's not added in the examples on top.gg/api/docs but those are planned to be rewritten at some point

patent lintel
#

@sullen nymph wait so what did i do wrong

#

and i realized i forgot to pass in self on async def on_guild_post():
but it still doesnt work

sullen nymph
#

Try to fetch the API data directly to see if it actually changed

restive otter
#

¨hello how can i make that this count update without i have to restart the bot. I'm codin in Java with the JDa librarie

rapid kettle
#

put it on an interval

restive otter
#

hm

oak sinew
rapid kettle
#

it isnt

oak sinew
#

thats not my ip

rapid kettle
#

thats just a placeholder as in all available ip addresses to the machine

#

so just use your public ip instead of 0.0.0.0

oak sinew
#

ok

#

thx

patent lintel
#

if /bots/748670819156099073/stats is the endpoint, what is the base url?

meager tendon
patent lintel
#

requests.exceptions.InvalidURL: Invalid URL 'https:/top.gg/bots/748670819156099073/stats/': No host supplied

meager tendon
#

meh

#

because you need to do https://

#

not https:/

patent lintel
#

oh

#

oops

#

im dum

meager tendon
#

lol

patent lintel
#

oh ty

patent lintel
#

im using python. After I POST the guild count, how do I GET the response? This is how I am POSTing it:

import requests

data = {'server_count': 58}

headers = {'Authorization': 'dbl token'}

r = requests.post('https://top.gg/api/bots/748670819156099073/stats/', data=data, headers=headers)``` (this is working completley fine, I just want to know how to GET the response)
cold nimbus
#

When someone votes nothing happens

The code:

const DBL = require('dblapi.js');
const dbl = new DBL(process.env.DBTOKEN, { webhookPort: 5000, webhookAuth: 'password' }, bot)

dbl.webhook.on('vote', vote => {
  let embed = new Discord.MessageEmbed()
  .setTitle('A user just upvoted!')
  .setDescription(`Thank you **${vote.user.tag}** for voting me!`)
  .setColor('FF000')
  .setThumbnail(vote.user.displayAvatarURL())
  let votechannel = bot.channels.cache.get('775360008786280468')
  votechannel.send(embed)
})
glass bone
#

Hello everyone, I just wanted to share an article I wrote about hosting a Python Discord Bot that uses dblpy to Heroku. I had a lot of trouble figuring out how to use the dblpy web server in my Python project when I hosted it to Heroku because of dynos. Hopefully this helps anyone who encounters a similar problem: https://dekoza.medium.com/deploying-a-python-discord-bot-using-dblpy-on-heroku-259e48c873ec

Medium

Deploying a Python Discord bot running dblpy to Heroku

subtle glade
#

¨hello how can i make that this count update without i have to restart the bot. I'm codin in Java with the JDa librarie
@restive otter it autoposts every 30 minutes

restive otter
#

@subtle glade okay thank you 😉

subtle glade
#

np

cold nimbus
#
at=error code=H10 desc="App crashed" method=GET path="/dblwebhook" host=khaira.herokuapp.com request_id=c6c46abe-c71a-48c1-bad2-d4f80aa48c7d fwd="165.22.130.154" dyno= connect= service= status=503 bytes= protocol=https

I am using heroku

cold nimbus
#

anyone help?

light talon
gaunt root
#

Errors would definitely be helpful
@versed storm Error: listen EADDRINUSE: address already in use :::5000

versed storm
#

Well that means you already have something currently running on port 5000

#

Either that or you're doing this in a sharded bot which means it's running this more than once.

jade moss
#

I've been having trouble getting top.gg's library to work with discord.py, the events don't seem to be triggering. Anyone know how to do this?

Here is my current code

class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = TOP_TOKEN
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)
        # Autopost will post your guild count every 30 minutes

    async def on_guild_post():
        print("Posted to top.gg")

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

    @commands.Cog.listener()
    async def on_dbl_test(data):
        print("Test!")
        pprint(data)

I know that it's posting, because top.gg always has the right guildCount, but it's not printing "Posted to top.gg", and when I vote or send a test webhook, the corresponding events aren't triggered.

The code above was copied directly from the documentation and put together.

IF YOU RESPOND PLEASE PING ME

silk reef
#

I have this promblem too ^^ need a solution lol

fossil wren
#

p!daily

paper dock
#

const DBL = require('dblapi.js'); const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }); dbl.webhook.on('ready', hook => { console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path}); }); dbl.webhook.on('vote', vote => { console.log(User with ID ${vote.user} just voted!); });

Where do i find my DBLToken?

keen pebble
#

what must i replace/put in there?

#

😦

#

for server count

pliant swallow
#

I dont understand the webhook setup very well. This is the first API i will use in my bot and I need some setup help

hidden wave
#

@keen pebble you don't need to replace anything

forest shard
#

webhook path seems simple, it’s just your webhook url

#

with /dblwebhook at the end

#

mhm

sullen nymph
#

@patent lintel r would be the response

@glass bone am I allowed to yell "thank you" at you for that article yet? 😂

@jade moss make sure your port is forwarded and firewall isn't blocking any requests

#

@forest shard webhook_path is what comes AFTER the url and it's not about Discord webhooks

@silk reef see my message above

forest shard
#

o ok

sullen nymph
#

The example relies on making http://ip:port/dblwebhook accessible

glass bone
#

haha I'm glad it helped :)

jagged garnet
#

Are there other events with the api? can get it back when someone votes for example, but can we recover when someone puts a notice?

silk reef
#

webhook_path is what comes AFTER the url and it's not about Discord webhooks

@silk reef see my message above
@sullen nymph So we need to make a web request?

jagged garnet
#

Yes, your Bot is hosted on what?

#

No, a vps?

silk reef
#

: (

sullen nymph
#

@sullen nymph So we need to make a web request?
@silk reef the opposite of sending

#

A webhook listens to requests and does something with the data once something is received

fiery owl
#

Hi there, may someone explain me how to set up the upvote command? i alredy read the weebhook thing on top.gg site

gaunt root
#

Either that or you're doing this in a sharded bot which means it's running this more than once.
@versed storm yeah, 3 shards

#

But have any way to fix that?

merry stump
#

Pls help me with the top.gg api

#

i want to use it to give reewards to users

#

but i dont wanna use cogs

#

if u know how to do without cogs(in python of course)

#

pls ping

shut slate
#

Can I make a vote in my bot using the module? (dblapi.js)

wary blaze
#

Pls help me with the top.gg api
@merry stump what api?

merry stump
#

dbl

#

py

versed storm
#

@gaunt root your code needs to be on shard 0 only, or in the shard manager.

gaunt root
#

I ill try

restive otter
#

const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });

what does "yourDBLTOKenHere" mean

#

how to get it

eternal moth
#

is there a limit to post stats on the API?

jagged garnet
#

Are there other events with the api? can get it back when someone votes for example, but can we recover when someone puts a notice

versed storm
#

@restive otter the bot token is given to you on the top.gg api page, after the bot has been approved. You can't use the API until then.

restive otter
#

oh, ok

jade moss
#

@jade moss make sure your port is forwarded and firewall isn't blocking any requests
@sullen nymph Lol that never even crossed my mind, I just assumed that it would work because discord.py worked.

sullen nymph
obsidian drift
#

what do i place in the webhook url

gaunt root
#

@gaunt root your code needs to be on shard 0 only, or in the shard manager.
@versed storm I tried in shard manager, but dont work

obsidian drift
#

how do i create an webhook?

paper dock
#

by webhook, does top.gg refer to self hosted webhooks?

obsidian drift
#

yea thats what im trying to find out too

jaunty plank
#

The webhooks do not work with discords webhooks.
They will work with some services iirc, but it probably makes the most sense to host it yourself

#

Host the receiver yourself*

obsidian drift
#

thats the only way?

jaunty plank
#

it will work with some external services afaik.

#

Any general purpose webhook receiving service theres no reason it won't work.

obsidian drift
#

m ok

lapis turtle
#

Hey where can i get the api may i know?

jaunty plank
eager anchor
#

why does it show in top.gg N/A instead of server count?

#

in my bot

jaunty plank
#

Are you posting your server count via the api?

eager anchor
#

@jaunty plank help me pls

#

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

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

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

#

is this the code?

versed storm
#

yes, it's this code.

jaunty plank
#

Make sure to fill in your token

eager anchor
#

done

#

now?

#

@jaunty plank

jaunty plank
#

Run the bot with the code.

versed storm
#

Sometimes you just gotta wonder how someone ever got to the point where they even have a working bot, amirite

eager anchor
#

@jaunty plank where to place the code ?!!?!?

versed storm
#

in your bot

jaunty plank
#

Anywhere after client is defined

eager anchor
#

wdym by anywhere?

jaunty plank
#

Your actual client

eager anchor
#

wtf are you tring to say

jaunty plank
#

Anywhere

eager anchor
#

.

jaunty plank
#

Put it at the end of the file, how bout that? Lol

lapis turtle
#

@eager anchor bruh you don't know anything bout that? 😂

eager anchor
#

in that web

#

?

lapis turtle
#

And you shouting on him

versed storm
#

Did you even write your own bot?

lapis turtle
#

Lol no

#

Not in that web Ofcourse

eager anchor
#

my brain dead

restive otter
#

!api

eager anchor
#

-api

jaunty plank
#

No bot commands in here

versed storm
#

Then maybe get some rest, sleep, eat, grab a coffee, and then do the code shoveling.

restive otter
#

-api

lapis turtle
#

I'm wondering how u got one bot approved

jaunty plank
#

Again no commands here

versed storm
#

@restive otter what are you trying to do, honey, maybe we can help

eager anchor
#

in here?

jaunty plank
#

Did you make a new file for it?

eager anchor
#

yes

jaunty plank
#

You'll need to run it via an export then

#

Which is fine if you want to go that route.

eager anchor
#

do i need to write things in the code?

#

like the cilent id

#

the bot token

#

because i think i need to replace that

jaunty plank
#

Your bot client(the one you are using to get events from discord) will need to be passed in your export function.

eager anchor
#

and also the token?

jaunty plank
#

The token you can hard-code into your dbl init line.

eager anchor
#

any more changes?

jaunty plank
#

Other than the export stuff. It should work fine.

eager anchor
#

onyl this much change?

#

if it is then let me start

#

now i just need to export the file right?

#

@jaunty plank

#

i did the code

versed storm
#

Man you really should consider actually learning javascript instead of expecting everyone to do your work

eager anchor
#

:/

versed storm
#

You`re being quite the help vampire right now

eager anchor
#

-_-

#

k i dont need help

jaunty plank
#

Yeah, I have said like 3 times now you need to export it.

eager anchor
#

ok

#

ty

ancient kindle
#

they should make a dsl api

versed storm
#

To do what?

ancient kindle
#

so I can award members for voting the server (with my bot)

sullen nymph
#

Webhooks

ancient kindle
#

webhooks

wanton marten
ancient kindle
jaunty plank
#

Webhooks

#

Its mostly the same thing for servers

ancient kindle
#

does it work with servers tho?

jaunty plank
#

Yeah, servers have their own webhooks

ancient kindle
#

cool!

#

thx

#

now I need help setting up the webhook

#

cuz I have no idea how this works xd

jaunty plank
#

I can help in a bit if no one shows. Making breakfast real fast.

ancient kindle
#

okay

jagged garnet
#

Are there other events with the api? can get it back when someone votes for example, but can we recover when someone puts a comment

willow spindle
#

no

sullen nymph
#

I don't think reviews are received via webhooks

jagged garnet
jaunty plank
#

@ancient kindle so webhooks are practically just the reverse of a traditional api.
All you have to do is setup an http server that receives post requests and tell the website(in the webhook section) to post to that relevant http server.

ancient kindle
#

uhh

#

slow down

#

im dumb xd

#

ok

#

im thinking the express could have something to do with this?

#

help me @jaunty plank xd

jaunty plank
#

I'm here, just trying to get a link

ancient kindle
#

ok thx xd

jaunty plank
#

the lib might even work with servers, no idea since ive never played with it like that.

ancient kindle
#

hmm

jaunty plank
#

🤷‍♂️ if you know express it should be really simple for you though

#

just an app.post which checks the auth header is correct. then do what you want with the body.

ancient kindle
#

yey

#

thx

jaunty plank
#

I only know a bit of express, but if you have any questions about the process i think i can figure it out. just lmk

frigid pebble
#

How to code a bot?

jaunty plank
velvet pond
jaunty plank
#

from what i understand, you need to attach the image, not just set the image as the url

restive otter
#

Hi

#

do they?

versed storm
#

No, they need to have a publicly-accessible URL

restive otter
#

Yes

#

I thought so

cerulean monolith
#

You can enable port forwarding through your router

restive otter
#

I dont have access to my router, but I got a vPS

#

*VPS

cerulean monolith
#

If you have a VPS it has a publicly accessible URL

restive otter
#

Ok thats perfect

cerulean monolith
#

How do you connect to the Vps?

#

Ssh?

restive otter
#

I use digital ocean

#

with password

cerulean monolith
#

Ah

restive otter
#

not ssh

cerulean monolith
#

yea same thing

restive otter
#

I had to choose between them

#

so i dont think theyre the same

#

...

cerulean monolith
#

SSH key is different

#

SSH is how you connect to a remote machine in most ways

restive otter
#

But k

#

I got password

#

How to get the URL from my vps?

cerulean monolith
#

you would have been given a IP with your server
That is where your link would be
And just listen to a port and use that IP:Port in the top.gg webhook site

restive otter
#

Oo

#

I got the IP

#

I will test it out

#

😄

#

Omg it works

#

if I type the IP

#

its accisble

#

for me

#

Is it dangerous to share the IP of your vps with someone?

cerulean monolith
#

Enjoy

restive otter
#

Thanks

versed storm
#

If you want to greatly simplify your life look up ngrok.io it makes this sort of thing much easier (though the free plan is limited)

cerulean monolith
#

Uh not really i dont think so

#

But maybe dont do that coz i am not sure

restive otter
#

They may ddos it

cerulean monolith
#

I think digital ocean has DDOS protection

restive otter
#

I think they got protection of that

#

Yes

#

if not

#

i switch

cerulean monolith
#

But eh why do u even need to reveal your IP

restive otter
#

I need to let someone test

cerulean monolith
#

If you are hosting a site, Just use a proxy and link a domain

restive otter
#

if it works

sullen nymph
#

use reqbin or use the test webhook feature on top.gg

thorny thicket
#

please ping me if someone replies

velvet pond
#

@jaunty plank thanks for your help, I used voltrex's method and got it working :) #commands message

jaunty plank
#

perfect!

cerulean monolith
jaunty plank
#

OH

cerulean monolith
#

thats what caused the thingy

#

im dumb

jaunty plank
#

at least it wasnt discord.

cerulean monolith
#

yes it was my dumbness that brought us all down

analog osprey
#

get in general

#

voice chanel

restive otter
#

K I failed

#

I tried to use the api as y'all told me

#

but test webhook doesnt work

paper marten
#

Hallo bro. Iam from INDONESIA

#

Give me Role Bro

versed storm
#

What role? "Indonesian"? lol

thorn bronze
#

I need help with the top.gg dbl webhook
i reading the doc and tried the example and its showing

Webhook running at http://0.0.0.0:5000/dblwebhook
``` and is not receiving votes
jaunty plank
#

the library is hardcoded to say 0.0.0.0

#

you need to set the url on the webpage to the proper ip

thorn bronze
#

k

dreamy fulcrum
#

:Nd_HSiririquinha:

#

@analog finch

restive otter
#

this chat is fot?

wheat totem
#

um tf lmaocry

#

im tryna find the docs for api but it gives me hello world

#

nvm got it

jovial kiln
#

@wheat totem

#

You cannot use the API unless you are approved on top.gg

sharp hollow
#

how can i make my bot reward users when they vote?

placid peak
#

wEbHoOkS

sharp hollow
#

how do i set those up

torn yarrow
#

@placid peak any good tutorial for that? I'm quite new to coding

placid peak
#

dovs

#

docs

merry stump
#

Hey anyone who knows how to use python library for voting rewards using top.gg API WITHOUT COGS

sullen nymph
#

Initialize the DBLClient

#

Attach appropriate events

vagrant oyster
#

Can someone help me with the webhook setup?

#

Never worked with webhooks

jovial kiln
#

@vagrant oyster sure

thorny leaf
#

@everyone

jovial kiln
#

Well

#

Depends on the Lang

vagrant oyster
#

JS Eris

jovial kiln
#

@thorny leaf nice try bud

#

I know js discord js, don’t think there is much of a difference other then what you do with the results

vagrant oyster
#

I don't even really know where to start

#

I create a server with http, right?

#
const http = require("http");
const server = http.createServer((req, res) => {
  res.end();
})
server.listen(5000);
jovial kiln
#

I use express to do it but yeah you can

vagrant oyster
#

Then?

#

new DBL(token..

jovial kiln
#

Oh

#

Your trying to get the dbl webhook/api

vagrant oyster
#

Yeah that's why I'm here

#

It doesn't work

#
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });

Did exactly this, console logged it as http://0.0.0.0:5000/dblwebhook

#

On vote I got an error saying something like already in use or whatever

#

So I passed the http server I created into dbl's webhookServer

jovial kiln
#

Try a different port

vagrant oyster
#

But so 0.0.0.0 is fine?

#

Because that does look kinda wrong

jovial kiln
#

Yeah

vagrant oyster
#

And in the bot edit on top.gg, I put the same url into the Webhook URL field?

latent narwhal
#

Noo

#

Replace 0.0.0.0 with your IP address

#

IP address of place where Ur bot is hosted

#

@vagrant oyster

vagrant oyster
jovial kiln
latent narwhal
vagrant oyster
#

And the code?

create server

dbl:
webhookServer: server,
webhookPort: 1234,
webhookAuth: "somePass"

#

Oh nice I just logged a vote

rustic mauve
#

CREEPER

jovial kiln
#

?

rustic mauve
#

CREEPER

#

AW MAN

jovial kiln
#

Stop

rustic mauve
#

CREEPER

jovial kiln
#

@fresh plover

#

@rustic mauve stop

#

Your not funny

#

your just being annoying

rustic mauve
#

like your profile picture

fresh plover
#

keep this channel on topic please

rustic mauve
#

ok but what is the subject of this channel?

fresh plover
#

-api

abstract mothBOT
#

TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://top.gg/api/docs

rustic mauve
#

okay thanks

jovial kiln
#

👍

queen blade
#

The hasVoted method has not been working consistently. Even 20 minutes after voting the method still returned false for some members. (Javascript Library) Please ping me in a response, very busy.

jaunty plank
#

I have heard of people having this issue previously but not very commonly.
I would look into using the webhooks to receive vote events and tracking them via a database rather than on Voted method.
Won't be tagging since I dont have a fix for the specific issue your having.

patent lintel
#

Im posting my server count using python: ```py
import requests

data = {'server_count': 63}

headers = {'Authorization': 'api token'}

r = requests.post('https://top.gg/api/bots/748670819156099073/stats/', data=data, headers=headers)

data = r.json()

print(data)```, but when I run it, it prints {'server_count': 59, 'shards': []}, and the top.gg still shows 59 servers, instead of 63!

#

why?

random kindle
#

@random kindle you using eris or discord.js?
@steel terrace discord.js and on heroku

#

if you forgot about this, my question was "How do I send a message to a channel via the dbl.webhook.on function?"

steel terrace
#

alr, do you know where to start or are you just having error problems ? @random kindle

#

ping me when you respond lmao

restive otter
#

What should webhook auth be?

#

THe password?

jaunty plank
#

whatever you want

#

as long as its secure

restive otter
#

What do I put there?

#

I tried many things but nothing works

jovial kiln
#

A endpoint

#

That you are listening to

#

With http or express

#

It will send you a json response that you need to parse

restive otter
#

I was trying to use the module dblapi.js

jovial kiln
#

Oh

restive otter
#

I've read that

jovial kiln
#

Ok

restive otter
#

I feel very stupid

#

but I failed again

jovial kiln
#
const DBL = require(`dblapi.js`)
const dbl = new DBL('token', client)

dbl.webhook.on(`ready`, () => {
console.log(`Ready`)
})```
#

Somethin like that

restive otter
#

I did that too

#

There is more too it

#

But

jovial kiln
#

Yeah

restive otter
#

Like nothing sends

jovial kiln
#

What part are you lookin for

#

Oh

restive otter
#
dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
});```
#

I have that

jovial kiln
#

For your webhook part you need a endpoint

restive otter
#

and it doesn't send

jovial kiln
#

So

restive otter
#
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!`);
});

const dbl = new DBL("MyDblToken", { webhookPort: 5000, webhookAuth: 'MyAuth' });

I got now...

jovial kiln
#

[ip]:port/endpoint

restive otter
#

what is the endpoint?

#

I have the ip and port

jovial kiln
#

The endpoint is where it is sent

#

Just do IP and Port

#

It will work the same

restive otter
#

so

#

I replaced 0.0.0.0 with the IP

#

for example

#

of my VPS

jovial kiln
#

And on the site you would input [ip]:port and then have a auth

restive otter
#

and it still aint working

jovial kiln
#

Which you put in your code

restive otter
#

Yes Nutella I have the same issue

fair sparrow
#

Am I able to use a webhook for an api?

restive otter
#

http://0.0.0.0:5000/dblwebhook

#

That is what it logged

#

and nothing happens still

#

I replaced that 0.0.0.0 with my IP

#

so it would be

fair sparrow
#

I have an app installed called HTTPBot and allows it to send requests like GET, POST, PUT etc for links, add params and headers etc too

restive otter
#

how would I get my ip?

#

http://IP:5000/dblwebhook

#

Well

#

Idk

#

What happens if its on a vps?

#

What would I do then

#

My IP is accisble

#

from outside

#

Get ur VPS ip

#

as i did

#

Did that work for you?

#

No

#

It does not

#

Man why do they make this so difficult lmao

#

I think im just too stupid to do this

#

It's either difficult or we are stupidly dumb

#

It should not be difficult

#

Yes

#

I think we're just dumb

#

I tried it with express too

#

since a lot persons can do it

#

Nothing send

#

sends*

#

I know

#

i tried same

jovial kiln
#

The api is more advanced and is more understandable for experienced developers in this region

restive otter
#

I tried everything

jovial kiln
#

It is hard give me a sec to try and find mine

restive otter
#

Thanks for taking the same to even help us

#

Yeah thanks for the help Extremely Vibin, I really appreciate it.

#

I think people are laughing their asses of, of seeing us struggling

#

Probably

#

But its very hard for me

rapid kettle
#

So what do you lot need

restive otter
#

We want to make the voting system works

rapid kettle
#

webhook stuffs?

restive otter
#

Not make it work

rapid kettle
#

what library are you using

restive otter
#

Make it send that someone voted

#

djs

rapid kettle
#

for the http requests

#

not the bot

restive otter
#

dblapi.js

#

Yes

#

or something else that does works

#

I tried express too

rapid kettle
#

ok so both dblapi.js?

restive otter
#

Didn't work for me

#

But yes

rapid kettle
#

can I see your initialisation line

#

new DBL() without token

#

I don’t want your token

restive otter
#

const dbl = new DBL(token, { webhookPort: 5000, webhookAuth: 'pass' });

rapid kettle
#

ok so what are you putting on the top.gg page

restive otter
#

We want to receive

rapid kettle
#

replace your IP with ip

restive otter
rapid kettle
#

I see an immediate problem

restive otter
#

But we tried with our ip too

#

0.0.0.0 = ur ip

#

and doesn't work

#

Ik

rapid kettle
#

no it isn’t

restive otter
#

O

#

wait im confused now

jovial kiln
#

One sec he will explain

rapid kettle
#

it’s all IPs available to the machine

jovial kiln
#

Has to be public

#

Right?

rapid kettle
#

so basically any IP the VPS has access to, commonly the public IP.

#

yes, public IP, not private.

restive otter
#

Where would I find a public ip?

#

I suck with pcs

#

lmao

#

My VPS has 8 ips

#

or smthing

#

lmao

#

how do I find the correct one

rapid kettle
#

there is no correct one

#

just any that is public

#

Where would I find a public ip?
@restive otter should be on your VPS page

restive otter
#

ah okay

#

and just replace that with 0.0.0.0?

rapid kettle
#

no

#

replace 0.0.0.0 with that

restive otter
#

That's what I meant

#

lol mb

#

ipv4: <MY VPS IP HERE>

#

this is what it says

#

thats it

#

PUBLIC IPV4 ADDRESS
<VPS IP>

#

PUBLIC GATEWAY

#

I got all of these

#

what i need to pick

#

SUBNET MASK

#

also that

jovial kiln
#

Holy

rapid kettle
#

The public one

restive otter
#

Anyway I could test it while running on my pc?

#

Before putting it back on the vps?

#

Would I just grab my public ip for my pc?

rapid kettle
#

not really

#

you'd need to port forward and all that

restive otter
#

oh yikes ok

#

Thanks for the help. I really appreciate it

fair sparrow
#

I’ve got an api working but it only sends files like index.html and not text?

#

If I try text it says it cannot send an empty message

dire sand
#

I'm using the botblock API (with discord.py), but it doesn't seem to post the servers on the website for my bot :/

fair sparrow
#

To my webhook

jaunty plank
#

channel topic

random kindle
#

alr, do you know where to start or are you just having error problems ? @random kindle
@steel terrace idk how to start

steel terrace
#

alr lemme get some of my code out lmao

#

do you know the ip for your heroku server?

#

@random kindle

#

this will prolly be easier if you just dm me KaineKek

jaunty plank
soft salmon
#

Hello so with the webhooks I wanted to make it so it shows in the console whenever someone votes User with ID ${vote.user} just voted! and someone voted and it didn't go in console. It is all connected since of it said in console when starting bot

#

oh nvm

patent lintel
#

Im posting my server count using python: ```py
import requests

data = {'server_count': 63}

headers = {'Authorization': 'api token'}

r = requests.post('https://top.gg/api/bots/748670819156099073/stats/', data=data, headers=headers)

data = r.json()

print(data)```, but when I run it, it prints {'server_count': 59, 'shards': []}, and the top.gg still shows 59 servers, instead of 63!

restive otter
#

Few problems with ur code:

  1. Requests is blocking.
  2. You should put this in a loop so it auto updates every so often instead of just on bot startup. What if your bot is online for a month? It'll only update once in that time.
  3. I'm too fucking drunk right now so I sadly can't really tell if this actually works or not.
#

@sullen nymph Fellow Python guru, please help me answer here

sullen nymph
#

@restive otter as a one-time thing it's fine, yeah

#

@patent lintel What do you get when visiting /api/bots/botidhere/

low shadow
#

hi

#

i dont hav any thing

sharp hollow
#

can someone help me to make vote receiver?

dusky spoke
#

can someone help me to make vote receiver?
@sharp hollow Just ask your question

rain heart
#

they did

#

lol

dusky spoke
#

me :confused :

soft salmon
#

Hello so ever since I added webhooks into my bot the server counter aint updating on the bot page.

jade moss
#

Do I still need to set the webhook field on my bots page?

inner leaf
#

Yea

#

And give webhook info in the cog __init__

jade moss
#

@inner leaf So I set my servers ip as the webhook, do I need to set a port number?

#

and if so which?

inner leaf
#

The port number you setup?

jade moss
#

oh nevermind

#

I completely missed the extra kwargs passed to the client

#

thanks

#

I've got it now

glad minnow
#

hi guys

#

how work the dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});

#

i need get update from vote

#

but i dont receive the response from top.gg

pallid forge
#

0.0.0.0 is not your IP

glad minnow
#

is local

pallid forge
#

Yes but thats not the actual IP

#

You need to replace it with your actual IP address

glad minnow
#

what is the options?

pallid forge
#

No idea, it's your IP not mine. Sorry :/

glad minnow
#

I'm talking about the parameter that I should pass to the function

#

const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });

#

No idea, it's your IP not mine. Sorry :/
@pallid forge i set port and webHookAuth same for the api doc

pallid forge
#

You are using 0.0.0.0

glad minnow
#

i need extra step?

pallid forge
#

You can't use that if you want to connect to something online

glad minnow
#

as I told you, in the api doc I don't get that I have to set the ip in the webhook options

#

@pallid forge

pallid forge
#

You need to put a URL

patent lintel
#

@patent lintel What do you get when visiting /api/bots/botidhere/
@sullen nymph uh it still didn't update and it responded this: https://hasteb.in/fexonayo.bash

oblique axle
#

does someone knows why it doesn't notify me when someone votes my bot?

jaunty plank
#

wheres your code being hosted?

oblique axle
#

heroku

jaunty plank
#

what url are you filling in on the site? does it include the heroku url?

oblique axle
#

no

#

i don't know the heroku's url

jaunty plank
#

well, its the public url for heroku.

#

heroku doesnt provide IP's

#

they provide urls

oblique axle
#

so what should i put in there?

jaunty plank
#

yourprojectshurokuURL/dblwebhook

restive otter
#

uh guys there is something weird, my bot is in 59 servers but for some reasons it doesent show up in the website any clue why

jaunty plank
#

are you posting your server count?

restive otter
#

yes

hidden wave
#

Firstly, what language are you using @restive otter

restive otter
#

discord.js

#

js in other words

oblique axle
restive otter
#

i can only see an N/A in there not a server count that the thing

#

and the other thing is 'no views yet'

jaunty plank
#

dont think its the dashboard url, but i am not a heroku user so maybe? not sure.

restive otter
#

which is really weird

hidden wave
#

https://github.com/top-gg/dblapi.js you could read this github to understand or just do npm install dblapi.js and then copy paste

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

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

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

@restive otter

oblique axle
#

hmm

restive otter
#

wait i have to use npm install dblap.js?

#

ah okay make sense

#

thanks

hidden wave
#

it's dblapi.js and np! @restive otter

glad minnow
#

does someone knows why it doesn't notify me when someone votes my bot?
@oblique axle did you get a solution? I have the same problem

oblique axle
#

unfortunately no..

restive otter
#

s

ancient kindle
#

@oblique axle

#

a heroku url usually looks like this

#
https://yourAppName.herokuapp.com
#

for example

#

btw dont play the games

#

its horrible

glad minnow
#

I have my bot in a vps, normally I deploy locally. That is why it is not clear to me which url I should place in the webhook

jaunty plank
#

@glad minnow the url will be
http://IPofVPS:port/path

glad minnow
#

@glad minnow the url will be
http://IPofVPS:port/path
@jaunty plankwith server param?

#

webhookServer: myip

#

right?

jaunty plank
#

like a hostname?

glad minnow
#

like a hostname?
@jaunty plank yes

jaunty plank
#

you can just use the ip.

#

http://IP:port/path

glad minnow
#

const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});

#

but i need set the ip in options

jaunty plank
#

there is no ip in the options

#

this library listens on any available ip*.

oblique axle
#

@ancient kindle nope. It's not telling me who voted. It pops up an error in the console.

ancient kindle
#

oof

jaunty plank
#

in the url you used, did you add your path?

ancient kindle
#

^

oblique axle
#

me?

jaunty plank
#

yes

oblique axle
#

yeah: /dblwebhook

jaunty plank
#

🤔

#

does heroku require the use of an environment port variable?

glad minnow
#

this library listens on any available port.
@jaunty plank is that I need to understand how to place the url in the webhook client. It's what I don't quite understand

jaunty plank
#

the webhook lib doesnt take in a url

oblique axle
#

wdym? 🤔

jaunty plank
#

it takes in a port and optionally a path, or optionally a server.

#

some providers require the use of
process.env.PORT rather than a static port.

oblique axle
#

i dont think so

jaunty plank
#

heroku, glitch repl, some require it, some dont.

oblique axle
#

so what can i do now?

jaunty plank
#

swap to using the env port variable.

oblique axle
jaunty plank
#

in the init line.

#

thats just the event that logs the webhook is ready

glad minnow
#

0.0.0.0 again

jaunty plank
#

it just logs 0.0.0.0

#

it will always log 0.0.0.0

#

its hardcoded to say 0.0.0.0

glad minnow
#

with that I should already register the votes?

jaunty plank
#

on the top.gg webpage, your bots edit page, in the webhook section you need to fill out the url and auth section

#

other than that, should be good to go.

glad minnow
#

I understand, that is the part that I was missing! I will do that and tell you the results

jaunty plank
#

http://ip:port/path is the format.

glad minnow
#

good

quasi rose
#

Can i give a dbltoken to unverified bot?

hidden wave
#

@quasi rose it doesn't matter if it's verified or unverified, it still works

quasi rose
#

Hmm ok

glad minnow
jaunty plank
#

Ay

glad minnow
#

thanks man!

jaunty plank
#

No problem

obtuse coyote
#

Pls weekly

rapid kettle
#

you do see the channel topic right

#

and dank memer can't send or see messages

restive otter
#

oops

#

i thought it said dank meme

#

r

#

hm

olive seal
#

hi

#

lets play some minecraft

#

GAAA

versed storm
soft salmon
#

Hello so ever since I added webhooks into my bot the server counter aint updating on the bot page.
Anyway to fix that?

ancient kindle
#

Does my bot need to be accepted before im able to use the webhook?

soft salmon
#

Yes @ancient kindle

ancient kindle
#

oh

#

now that would take forever xD

restive otter
#

can someone help me on how to find the total upvotes for a discord bot with discord.js

restive otter
#

like with the command? anyone?

vapid kindle
#

Is it recommended to post server stats using dblpy

#

I didn't know which channel to send it in

proper narwhal
#

So, I just voted for my bot, and nothing happened in my code. This is the code that I have:

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


class VoteCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token ='TOKEN'
        self.dblpy = dbl.DBLClient(self.bot, token=self.token)

    

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


def setup(bot):
    bot.add_cog(VoteCog(bot))```
#

am I doing something wrong

#

ping me if you know

hidden wave
forest shard
#

@proper narwhal You didn't enter your token.

proper narwhal
#

I did

#

I just took it out for the example

#

Cuz I don’t want y’all seeing it

#

Lol

forest shard
#

o ok

#

are you using cogs for your actual bot?

proper narwhal
#

Yes

forest shard
#

hmm

#

try using webhooks

proper narwhal
#

Like in the declaration of the dblclient?

#

I tried that at fist

#

First

#

Then I took it out cuz it wasn’t working

forest shard
#

rip

#

sorry i'm still new to the API.

proper narwhal
#

It’s ok

obsidian drift
#

does anyone know how to create a webhook or some websites that can help me? Im new to this stuff

eager anchor
#

guys

#

any body there?

#

help me]

rain heart
#

hm

#

dontasktoask

hidden wave
#

Wut

eager anchor
#

the server count code doesnot work

#

in my bot

hidden wave
#

Show code

rain heart
#

and what does not work?

hidden wave
#

He typing bee movie script doe

eager anchor
#

const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('||do not look at my dbl token||', client);

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

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

client.login('||do not look at my token I||');

rain heart
#

now

#

what exactly does not work

hidden wave
#

^

rain heart
#

do you get and errors for example?

eager anchor
#

others said this code for showing server count in your bot page

rain heart
#

it should show an error if it doesn't work

hidden wave
#

Yea

rain heart
#

oh wait

#

are you even posting your guild count or am i missing something?

hidden wave
#

@eager anchor can you give link to ur top.gg discord bot in dms

eager anchor
#

-_- ok

rain heart
#

you should read the full page

eager anchor
#

hm?

rain heart
#

scroll down

#

on the apidocs page

candid tendon
#

hy

eager anchor
#

k

candid tendon
#

verification

eager anchor
#

client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});

#

at the top off all?

#

@rain heart ?

candid tendon
#

what is this

rain heart
#

use common sense

#

you have client.on('ready' already in your code right?

eager anchor
#

yes

#

but i opened anew file for it .

candid tendon
#

no

rain heart
#

put setInterval inside your on ready

#

so

    setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);
eager anchor
#
  setInterval(() => {
      dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
  }, 1800000);
});```
#

like this?

rain heart
#

do you have a client.on already?

candid tendon
#

Where do I write this

rain heart
#

write what?

eager anchor
rain heart
#

best is to put the client.onready inside your index.js

#

just append the setInterval inside your onready

candid tendon
#

online

eager anchor
#

just append the setInterval inside your onready
@rain heart
can you show the code? i guess i putted ir=t wrongly

rain heart
#
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('do not look at my dbl token', client);

client.on('ready', () => {
     setInterval(() => {
      dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
  }, 1800000);
});

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

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

client.login('do not look at my token I');
eager anchor
#

holy

rain heart
#

like this for example

#

thats your code from above

#

but i cant guarantee that it works because i have only basic knowledge of js

eager anchor
#

oh k

#
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('do not look at my dbl token', client);

client.on('ready', () => {
     setInterval(() => {
      dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
  }, 1800000);
});

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

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

client.login('do not look at my token I');

@rain heart
when i putted this nothing happend

rain heart
#

Where did you put it?

eager anchor
#

in the code

candid tendon
#

yes

rain heart
#

which file?

eager anchor
#

a new one

#

the one which i showed

rain heart
#

please use common sense. You posted your main js file (index.js)

#

in there, you should put your setInterval

eager anchor
#

k -_-

rain heart
#

you have a on('ready') according to your screenshot of your code because it tells you the username of the bot

eager anchor
#

is there any problem if i turn my bot turned off for now?

#

because if people use it they can find some werid things -_-

rain heart
#

nope, shouldn't be

eager anchor
#

wait

#

lemme see

#

1o mins

candid tendon
rain heart
#

?

candid tendon
#

comud

limber crystal
#

Im confused, my bot doesnt get vote notifications, why?

const dbl = new DBL(topggToken, { webhookPort: 5000, webhookAuth: 'password' }, client)

dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });
dbl.webhook.on('vote', async vote => {
    const user = client.users.cache.get(vote.user);
    console.log(user)
// rest of my code
})
restive otter
#

can someone help me on how to find the total upvotes for a discord bot with discord.js
@restive otter can someone help me?

rain heart
#

give me a minute

#

I don't think top.gg is sending requests to the specified URL
@restive otter it should normally

restive otter
#

yeah but what thing do you use @rain heart like [something].monthlyPoints What goes in that something

rain heart
#

i can only tell you the things from the apidocs

#

I can send requests to the same URL using https://reqbin.com but whenever I test the webhook with top.gg, the web server isn't receiving it.
@restive otter i'd say wait for someone who has a clue about webhooks

#

because I'm just the dude looking through the docs

#

like does your bot even get a request or doesn't top.gg send it?

restive otter
#

i can only tell you the things from the apidocs
@rain heart because dbl.monthlyPoints is not working and vote.monthlyPoints is not working so im stuck on what to use before the period.

rain heart
#

as unfortunate as it sounds, but I'd suggest waiting for someone who has some idea why that might happen

#

you can always direct message a Moderator/Team member, but they most likely wont respond

#

@Hoffnung because dbl.monthlyPoints is not working and vote.monthlyPoints is not working so im stuck on what to use before the period.
refer to the apidocs, there's an explaination of getting your bot

#

@restive otter

restive otter
#

yeah but what do you use before that?

rain heart
#

oohhh now i understand

#

use .getBot before that

#

so you can get your own bot's object in order to be able to get points and monthlyPoints

restive otter
#

oh

#

so

#

dbl.getBot.monthlyPoints?

rain heart
#

so for example dbl.getbot. etc

restive otter
#

or

#

ok

rain heart
#

yeah that should work afaik

#

i dont code in js, just know the barebones, but that is what i understand from the docs

restive otter
#

ok

rain heart
#

because getbot returns your own bot object when no id is given

restive otter
#

ok

#

hmm

#

@rain heart didnt work, says undefined

rain heart
#

dbl.getBot() then maybe?

restive otter
#

should i do dbl.getBot('mybotsclientid).monthlyPoints?

#

nope, didnt work, still says undefined

rain heart
restive otter
#

OH

#

one second

#

dbl.getBot("mybot'sid").then(bot => {
console.log(bot.montlyPoints) //
});

rain heart
#

that works?

#

but again, the parameter is optional. It should return your bot object

restive otter
#

yep it works 😄