#topgg-api

1 messages · Page 127 of 1

heavy summit
#

this is on their API documentation

restive otter
#

it's Works Thanks So Much 🙂

woeful fulcrum
#

Hi, I got an Unauthorised error when sending requests for posting stats on the website, error i haven't got any time ago. I haven't changed anything in my code, and the token is correct. I'm locked at 110 servers, and can't set the 160 count.
Can someone help please, ty :)
( and hi )

#

Please DM me, i'm not in front of my computer

#

or mention me

tame orchid
#

What’s the exact line causing it

heavy summit
#

I figured out the problem (just as a future reference), it turns out using localhost in web.TCPSite(runner, 'localhost', PORT) always causes problem, its best to use 0.0.0.0 instead of localhost

jaunty plank
#

ah yes, makes sense. localhost only serves locally

heavy summit
#

weirdd, it works fine when i use it with the other library, just not aiohttp and all the dumb examples on their doc use localhost sighhh

#

also when i used localhost it turns out it was only working on my machine and not even on the local network devices

#

well, anyway, its fixed whewwww 2 days....

jaunty plank
#

localhost is only itself, thats what localhost means 😄

rain heart
restive otter
#

hey

wheat copper
#

``ReferenceError: Cannot access 'findVote' before initialization`
Wasnt aware that it had to initialise?? what do i do here?

#

check if the person who sent the message voted in the last 12h

#

nvm, fixed it

true owl
#

hi how to do vote webhook

rain heart
covert lark
#

Does client.getVotes in @waxen widget-gg/sdk return votes in the last 12 hours?

rain heart
#

Yes

#

remember to use webhooks when you get more than 1000 votes, though i generally suggest you to do this now than later

covert lark
#

Few

#

Well I'm just using it to check fro my daily command

#

if they've voted in last 12 hours they get a free 1000 coins

#

Just await api.getVotes() - when I get to more then 1000 votes I need to use a webhook for that?

rain heart
#

use hasVoted instead then, to get the vote from that particular user that uses the daily command

covert lark
#

Okay, but that is also 12 hours

rain heart
#

yup both are

covert lark
#

Thanks

#

I'll have to be reading the docs for why I'd have to do that

covert lark
rain heart
#

hasVoted doesn't need a webhook

#

you can do it through a webhook if you wish

covert lark
#

Ah thanks

restive otter
#

How do i do the servercount thonking

#

what do you use(js, py etc)

#

Js

#

look pins

#

What dbl token

#

._.

#

Tf

#

Tnx

#

The token?

#

yeah

#

Thnx

frigid basin
#

Any reason why when I make a post request to my webhook via postman it works, and pressing the test button on top.gg does nothing?

#

it's a web server, not a discord webhook

severe quiver
#

I think I found you have to be specific when entering your url on top.gg

#

Are you using this format:
http://<url>:<port>/<webhook-subdomain>

rapid kettle
#

<webhook-path>*

severe quiver
#

Yeah I didn't know the correct terminology srry

#

In my case I used /dblwebhook

frigid basin
#

Now it's kind of working, it's sending requests to my url, except they are GET requests?

severe quiver
#

Hmm

#

Wait so top.gg is sending a get request?

#

Or postman is?

frigid basin
severe quiver
#

I mean their site clearly says they'll send a POST so idk what kind of saucery is going on here

#

Might wanna ask one of the web nerds about that one

frigid basin
#

and i've only ever entered the /webhook path into the top.gg page

severe quiver
#

So just to be clear, when you do a post from postman to /webhook it shows up?

frigid basin
severe quiver
#

That blows my mind

#

Idk then

#

When I do a get to my webhook from postman it says 404

#

But when I do post it says 403 which proves it's getting there

frigid basin
#

I'm gonna try only allowing POST requests, maybe that'll change something :p

#

now it looks like it's not making a request at all :(

#

i'll just wait like 5 mins, in case it's being slow

severe quiver
#

Are you using the dbl library or your own solution?

frigid basin
severe quiver
#

Ah I see

frigid basin
#

wtf

#

it says it made a get request

#

but

#

/webhook is only post

severe quiver
#

I think your webhook is cursed my friend

frigid basin
#

I'm gonna try changing the path

severe quiver
#

What port are you using?

frigid basin
#

80

severe quiver
#

I'm using 8000 don't know if that makes a difference

#

There could be some unforseen packet trickery going on without you knowing on lower ports

frigid basin
#

i'm gonna try a different bot

#

so I can see if when I vote it does it properly

#

bruh

#

even when I vote it's a get request

rain heart
#

It shouldn't be a get request from my testing

severe quiver
#

Yeah even on the docs it says post but they are still getting get

#
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.middleware(), (req, res) => {
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 221221226561929217
}) // attach the middleware

app.listen(3000) // your port

Example from the new docs - shows that it's expecting a post

#

What's actually in the body of the get request?

unique plinth
#

My bot is saying Server Count is unfined. How can I fix it?

vapid sapphire
#

That’s the easiest way to do it.

unique plinth
#

Discord.JS Sharding | Is it mandatory ?

frigid basin
#

discord requires sharding at 2k servers I think

unique plinth
#

yeah

severe quiver
#

You can use your own sharding manager if you like, and you don't need to use a certain library

#

But you do need to shard at 2.5k

unique plinth
vapid sapphire
#

Yea that’s the easiest way to do it, you can also use

unique plinth
#

nono

#

no problem

#

i fix

hearty lintel
#

if you're not sharding it wont work

unique plinth
#

yeah

#

i fix it

#

now

frigid basin
hearty lintel
#

you're the second person saying you're receving a get request

#

also there's no body in a get request

frigid basin
hearty lintel
#

mmm

#

@restive otter

#

hey did you ever figure out the get request thing?

restive otter
#

no

#

I still get get requests

hearty lintel
#

hm

#

Alright

#

I'm gonna ask veld since it's not an isolated issue

restive otter
#

I think, it happened after putting a secret token to authenticate requests

rapid kettle
#

I get POSTs

restive otter
#

did you do the same? @frigid basin

#

I used to get posts as well

rapid kettle
#

Is your server behind nginx?

hearty lintel
#

@frigid basin what lang are u using?

frigid basin
#

python

hearty lintel
#

ok both python

#

idk what could possibly be causing it

#

it feels like a code issue but idk how that could just happen

rapid kettle
restive otter
#

guess not

frigid basin
#

nah

rapid kettle
#

oh

hearty lintel
#

r u sure u arent just going to the ip yourself?

frigid basin
#

nope

restive otter
#

when I spam test webhook it appears to be all get requests in my logs

#

so its obvious they are made by top.gg

hearty lintel
#

yeah

#

ok

restive otter
#

returns 405 because method not allowed

hearty lintel
#

alright, im going to talk to veld and the python lib creator and see if we can get this solved for you guys, i've no clue what's goin on

restive otter
#

thank you berry

rapid kettle
#

call shiv a twat for me, will you berry?

hearty lintel
#

@restive otter are you sure your webhook auth is correct?

frigid basin
hearty lintel
#

you using the python library or are you using your own thing

frigid basin
#

my own thing

hearty lintel
#

could you try using the library possibly?

frigid basin
#

Might take a while but sure

hearty lintel
#

just to test

frigid basin
#

I think my server just crashed hashflushed

restive otter
#

Hey! How do I to auto refresh the servers my bot is in?
I have this:

module.exports = {
    loadListeners(dbl, GuildsNumber) {
        dbl.postStats(GuildsNumber);
        dbl.on('error', err => {
            console.log(`Error in Top.gg API !\n\n${err}`);
        });
    }
}```
sullen nymph
#

Do you have an approved bot on top.gg?

restive otter
#

Yeah

#

Like, I don't have the role

#

But yes, i'm co owner

hearty lintel
#

you do not have any bots under your acc

sullen nymph
#

I'll let you handle this, berry

restive otter
#

don't say me this

#

only answer my question

#

pls

hearty lintel
#

are you receiving an error?

restive otter
#

No, i want to auto refresh this

#

Like in the web

restive otter
#

I removed the token after this error started

hearty lintel
#

the requirement for an auth header?

hearty lintel
restive otter
#

ok I will check it

hearty lintel
#

also which http server library are you using?

frigid basin
#

So i got the top.gg lib to work kinda

#

it's hosting a web server rn, but I can only access it locally

#

i've opened port 5000

hearty lintel
#

you can set the port if you want, setting it to the same port and just temporarily disabling whatever u have already would be nice

frigid basin
#

I set it to port 80, now it's saying that the web server is down

rain heart
#

Don't set it to 80 when you have something running on 80 already

hearty lintel
#

temporarily disabling whatever u have already would be nice
they know

can i see the code?

frigid basin
#

which part of it?

rapid kettle
#

Why are you using port 80

hearty lintel
#

oh well actually i think it does that since its just doing the one path

#

does testing the webhook work?

frigid basin
#

Nope cuz it's saying that the web server is down

hearty lintel
#

alr send the code where you use dblpy

frigid basin
#
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=80)``` that's what I have
hearty lintel
#

idk how python exactly works but can you show the full thing? check out the pypi for it the second example has a webhook thing

sullen nymph
#

That's correct

hearty lintel
#

why would it say it's down?

sullen nymph
#

Or closed port

#

Or firewall blocking the port

frigid basin
#

oh wait, I think I found the issue

#

ok I got it to work

#

just gonna test it on top.gg now

#

ok that worked

hearty lintel
#

like you got the event?

frigid basin
#

yep

hearty lintel
#

wth

frigid basin
#

so the lib works, doing it myself doesn't

hearty lintel
#

what http library do you use?

frigid basin
#

quart

hearty lintel
#

@restive otter you too

restive otter
#

flask

#

if thats what you ask

hearty lintel
#

hm

#

for some reason custom http implementations dont seem to work

restive otter
#

.com?

restive otter
#

Why on my bot page does not showing bot shards & servers?

rain heart
#

You need to post them yourself

restive otter
#

did your bot was approved?

hearty lintel
#

what lang do u use?

restive otter
rain heart
#

yeah you need to post it yourself through the api

restive otter
#
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('', client);

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

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
``` i need to login in client beafore i declare DBL?
rain heart
#

yes

#

also, you're not posting them according to your code

#

re-read the docs

restive otter
#

line 4: "const dbl = new DBL('', client);"

const dbl = new DBL('Your Bot dbl_Token', client);

hearty lintel
#

with dblapi.js you have to login after

#

or you risk it not starting

heady glen
#

Hello

rain heart
restive otter
#

I do this thx ;P

restive otter
#

My code for webhooks (votes) does not seems to work

#
const DBL = require('dblapi.js');
const dbl = new DBL('mySUPERextraTOKEN', { webhookPort: 5000, webhookAuth: 'AndSUPERsecretPASSWORD', webhookPath: '/'});
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!`);
});
jaunty plank
#

top.gg webhooks are not compatible with discord webhooks.

#

also dblapi.js is deprecated.

restive otter
jaunty plank
#

the url to your webhook receiver.

#

it will look something like http://ip:port/path

restive otter
jaunty plank
#

ip port and path need to be filled in with the valid information

#

webhooks have to be available remotely

#

otherwise they dont function

restive otter
#

wtf?

jaunty plank
#

how do you think webhooks work 🤔

#

thats how discord webhooks work too.

#

well all webhooks work that way.

rain heart
#

If you're probably confused by that, you're not ready to do it yet

restive otter
#

So i must do it on domain?

jaunty plank
#

ip's work too.

#

if you want to use a domain, that works fine.

restive otter
jaunty plank
#

the public ip, not local.

wispy turret
#

how to check if someone is a voter?

hot axle
#

get request to /bots/{bot-id}/check?userId=some-user-id

wispy turret
# hot axle get request to `/bots/{bot-id}/check?userId=some-user-id`
const fetch = require('node-fetch')
module.exports = {
    name: 'voer',
    description: 'e',
    async: run(message){
        const json = await (
            await fetch(`https://top.gg/bots/${message.client.user.id}/check?userID=${message.author.id}`)
        ).json()
        if(!json) {
            return
        }

    }
}```
would this work?
hot axle
#

well the full route has an /api first

wispy turret
#

oh

#

/api/bots/etc.

#

?

hot axle
#

yea

wispy turret
#

ohh

#

kk ty

hot axle
#

oh and

#

you have to check for the voted property in the response

#

it'll be either 1 or 0

hot axle
#

You need a dbl token

wheat totem
#

ok

#

do &token=token

#

or..

hot axle
#

In the authorization header

wheat totem
#

how 😳
can you provide an example

#

using node-fetch?

wispy turret
#

like this? ```js
const fetch = require('node-fetch')
const { MessageEmbed } = require('discord.js')
module.exports = {
name: 'voer',
description: 'e',
async execute(message){

    const json = fetch(`https://top.gg/bots/${message.client.user.id}/check?userID=${message.author.id}`, {
        headers: {
            "authorization": "dbl token",
        }
    })
    if(!json) {
        return
    }

}

}```

#

ok. lmao

wheat totem
wispy turret
#
const json = fetch(`https://top.gg/api/bots/${message.client.user.id}/check?userID=${message.author.id}`, {
            headers: {
                "authorization": `eIkasUugDAiLauysahGFiadhjOLAydbakjJGCDTkHAJydyoajGIUVJJHdgyjbOIuagdhVII`,
            }
        })```
idk where to put voted property
#

its a fake one

#

i just randomly typed

naive dove
#

is there a way to access the servercount with javascript from another website?

wispy turret
#
HiauhsdUIHYIRbfkjdbisfhbsiGVJMusibisjhvdugj````
restive otter
naive dove
#

to what url?

wispy turret
#

so do u know where?

naive dove
#

no i dont

wispy turret
#

see if they voted or not

#

i made nsfw for only voters

#

cant find it. i only see how to track votes and send it thru webhook

naive dove
#

i try to get the servercount from top.gg for my website without php like only with js

wispy turret
#

none

#

it will say i did vote

#

on my alt

#

when i didnt

#

how do i make it return those??

#

its for my bot tho

naive dove
#

i found the answer to my question 😄

wispy turret
#

if they didnt vote = no nsfw command

#

i did.

#

i said

#
if(!json) {
return message.channel.send('no')
}
if(json) {
return message.channel.send('ok')
}```
#

its the authors id

#

and im on my alt

naive dove
#

okay i am to stupid to do this, can someone send me back the url to get servercount?

jaunty plank
naive dove
#

ty

jaunty plank
#

ah yeah, common mistake :p

wispy turret
#
const fetch = require('node-fetch')
const { MessageEmbed } = require('discord.js')
module.exports = {
    name: 'voer',
    description: 'e',
    async execute(message){

        const json = fetch(`https://top.gg/api/bots/${message.client.user.id}/voted?userID=${message.author.id}`, {
            headers: {
                "authorization": `eno`,
                "response": "voted"
            }
        })
        if(!json) {
            return message.channel.send('no')
        }
        if(json) {
            return message.channel.send('???')
        }

    }
}```
@shut flume i can do ```js
const somethinganything = fetch()```
jaunty plank
#

fetch is async isnt it?

wispy turret
#
await fetch()```
jaunty plank
#

yeah, you never do that.

#

so json is just a promise

#

then like init said, your just checking if it exists, not what it contains

umbral venture
#

I just found old api docs...

rain heart
#

these are actually kinda newer

umbral venture
#

but there's no python(and some langs) wrappers...

sullen nymph
#

It's WIP

rain heart
#

the docs.top.gg is the place where v1 (the new api with the review endpoints) is going to be documented iirc

umbral venture
#

so current api is v0?

rain heart
#

Correct

#

Next one is going to be v1, which is currently being worked on

willow sphinx
#

that's the new api docs, I just haven't finished it

#

the old docs are absolutely cringe

pale dock
steel nacelle
#

@tall pelicanGamer_bot

snow surge
rain heart
#

when someone feels responsible and has the know-how to contribute to it

unborn quiver
#

anyway I can use the API without getting my bot verified?

rain heart
#

nope

#

your bot needs to be verified/approved first

unborn quiver
#

alright ty

blissful notch
dry fiber
#

I heard taht i can set my bot's library using the api

#

how can i do that?

rain heart
#

you cant

#

the library field is deprecated

dry fiber
#

Welp

blissful notch
#

Never!

sullen nymph
#

Aww, but...

worn silo
#

this is very commonly asked

#

but how do you do this:

#

if someone votes

#

do this

rain heart
#

webhooks.

worn silo
#

i dont have a website

rain heart
#

you can host a webhook on your bot

worn silo
#

oh

#

like

rain heart
worn silo
#

ok

rain heart
#

and a little bit simplified https://zapier.com/blog/what-are-webhooks/

You might have seen webhooks mentioned in your apps' settings and wondered if they're something you should use. The answer, in a nutshell, is probably yes.
Webhooks are one way that apps can send automated messages or information to other apps. It's how PayPal tells your accounting app when your...

viscid moth
#

How can I get my bot's token on top.gg?

rain heart
viscid moth
#

thanks!

rain heart
#

you wont be able to get it yet because your bot is not approved yet

viscid moth
#

okay

kindred swift
#

Yeah so I've read some about the API, and it says that by voting on Example:- If you vote on Bot A you can't make Bot B give you fictional currency, it has to be Bot A.

But lets say that Bot A has a premium version.
And they share the same currency system, can you then get currency by voting on either bot?

rain heart
#

Vote for bot A: get rewards for Bot A and Bot B/only Bot B no
Vote for bot A: get rewards for Bot A yes

#

currency or votelocked command, it does not matter

#

it can also be a command locked behind voting, rewarding users for voting for another bot is not allowed

modest oar
#
    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        """An event that is called whenever someone votes for the bot on top.gg."""
        voter = await self.bot.fetch_user(data['user'])

        users = await self.get_bank_data()  
          
        votereward = 500
        channel = self.bot.get_channel(794536699246018571)
        await channel.send(f'{voter} voted for the bot!')
        print("Received an upvote:", "\n", data, sep="")


        
        embed=discord.Embed(title="Thanks for voting for Labor-Bot!", description="At the moment you won't get any reward, but there will be rewards soon.\n\n -FateAssassin#0001 :heart:")
        
        try:
            msg = await user.send(embed=embed)
        except HTTPException:
            pass
        await msg.add_reaction('✔')
        await msg.add_reaction('❌')
        while True:
            try:
                def check(react, user):
                    return user == voter and msg == react.message
                react, user= await self.bot.wait_for("reaction_add", timeout=700, check=check)
                user = user
                if str(react) == '✔':
                    await user.send('Alright! I successfuly transfered 500 coins to your account. Thanks again. :)')
                    users = await self.get_bank_data()
                    await self.open_account(user)
                    users[str(user.id)]["wallet"] += votereward
                    break
                if str(react) == '❌':
                    await user.send('As you wish! I will cancel the transaction, remember, you can always change your mind, when you have voted again. Thanks again. :)')
                    break
            except TimeoutError:
                break

File "/home/container/cogs/economic system.py", line 73, in on_dbl_vote msg = await user.send(embed=embed) UnboundLocalError: local variable 'user' referenced before assignment

Anyone sees a error?

fallen thistle
#

You never define user

#

You define users and voter

#

But never user

modest oar
#

I do in: def check(react, user):

#

oh no..

kindred swift
rain heart
#

Nope

#

That is still considered rewarding users for voting for another bot

kindred swift
rain heart
#

a bit of console logs would help

modest oar
#

Oops forgot to say, there was no error

#

Atleast on heavy_check_mark reaction

jaunty plank
#

so whats the issue

modest oar
#

It doesn't give the 500 coins into the wallet

jaunty plank
#

as in the entire event doesnt happen at all, or its just not doing 500 coins into the wallet

modest oar
#

Its only not giving the 500 coins into the wallet, also not opening an account

jaunty plank
modest oar
#

ight, thanks anyways

#

ill just ask in d.py servers

copper tundra
#

my top.gg api isnt working for my py bot

rain heart
#

what is not working

copper tundra
#

its not showing the server count and i did a print() To see where its not working and it stops working on the @task.loop

#

on the manual server count api code

#

@rain heart

#

and its not showing the server count in the website

#

N/A

copper tundra
#

no

fast agate
#

hmmm

#

I use this and works for me

#

wait

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

    def __init__(self, bot):
        self.bot = bot
        self.token = 'bot token' # set this to your DBL 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("Server count posted successfully")



client.add_cog(TopGG(client))
#

just for servers count

sweet ridge
#

Is it possible to add discord.js-commando as a supported libary in the js libary or do i have to just code my own interval thingy to update the server count?
Edit: I just use this code peace:

setInterval(() => {
    dbl.postStats(client.guilds.size/*, client.shards.Id, client.shards.total*/);
}, 3600000);

Yes, shard commented out because i don't use shards right now.
||[@mention me if anything]||

green wharf
#

is the new SDK node module a drop-in replacement for dblapi.js or do i need to change some code around?

hot axle
#

you probably need to change most of the implementation

#

the webhook runs as express middleware

green wharf
#

so i set up a script to push my bot's count every hour or so, but on my top.gg bot page the server count keeps fluctutating between 3-12 servers even after my POST requests, is this supposed to happen

#

does it take time to update?

hearty lintel
#

it takes a bit of time to update, does it look good now @green wharf ?

green wharf
#

I'll let it run overnight and see how it goes

hearty lintel
#

can i see the code?

green wharf
#

not at pc right now

hearty lintel
#

if its not updated by now its prollly broken

green wharf
#

but it's just a node script that sends the server count via http

#

I get code 200 so I suppose it's working? Not sure

#

I'll do some troubleshooting

hidden wave
#

help

#

i dont really understand the new api very well

#

i want to put it in ready event to know if it is working or not

#
api.on('ready', () => {
console.log(`Server Count Posted!`)

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
    shardId: client.shard.ids[0], // if you're sharding
    shardCount: client.options.shardCount
  })
}, 1800000)
})```
#

is this correct?

#

trying to make the auto server count poster

#

and putting it in a ready event

#

it didnt long in the console

#

i wanna post it automatically :/

#

?

#

yea

#

wait FRICC

#

I WAS USING THE WRONG NPM PACKAGE

hearty lintel
#

@hidden wave you were it's the new package

hidden wave
#

Yea ik

hearty lintel
#

dblapi.js is deprecated and no longer supported

hidden wave
#

@hearty lintel what does the req and res mean in topgg/sdk package?

#

im trying to make voting logs

hazy forum
#

discord.py RESOLVED: It was an API issue I guess because it's back to normal now without changing any lines of code
Does anyone know why this code only returns one user? It used to return all the members who react with ✅ but suddenly it only returns only one user

msg = await ctx.channel.fetch_message(msg_id)
reaction = discord.utils.get(msg.reactions, emoji="✅")
users = await reaction.users().flatten()
hidden wave
#

Berry?

hidden wave
supple karma
#
WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/home/infinity/LambdaBot/LambdaDiscordBot-1.0-SNAPSHOT-jar-with-dependencies.jar) to constructor java.lang.Void()
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
``` I always get this WARNING when posting stats to topgg
still goblet
#

Hi

#

How o can get API of Youtube

#

?

restive otter
supple karma
#

umm ?

restive otter
#

¯\_(ツ)_/¯

supple karma
#

when i use it i get this warning

dapper copper
supple karma
#

i dont know where it came from
but i just used topgg sdk .. it's java

rain heart
#

i had that issue too, make sure you're in java 8, and that your gson isn't outdated

#

though i think that can generally be ignored

supple karma
#

that makes my bot slow , and very slow

#

reply time goes 10 seconds+

#

and i am using java 14...

rain heart
#

use 8, as java versions over 8 causes that error

supple karma
#

i have many features that i use from java 14..

#

should i use Unirest or something to post ?

rain heart
#

I mean you could also post it manually through requests if you wish

#

did the same thing when i realized that there's still an open pr on the repo that is there since 2018

supple karma
#

Hmm ok i'll try that

#

oh

naive dove
#

when i wanna access the stats of my bot with my website i get an unauthorized error, how to fix

rain heart
#

Authheader missing

#

The authorization is your top.gg token

naive dove
#

how to add it

#

is it a good idea to implement my token in the frontend js of my website

rain heart
#

fogetheno

#

no

naive dove
#

jee

#

okay thank you

restive otter
#

how to add the api for DBL in python

rain heart
#

you cannot use it yet

#

your bot has to be approved first

frozen flame
#

U bless u have a token

restive otter
#

the vote thingy

#

i wanna reward them for vote like dank memer

rain heart
#

It is not approved, you would have your bot developer role

restive otter
#

im asking "what if"

#

my friend's bot is approved

rain heart
#

but you wont be able to use it without a token

restive otter
#

okay

#

i have a token on DBL

#

i wont be sharing the whole thing ofc

eternal pagoda
#

I send a guild/shard update every 15 minutes, is that within the rate limits?

eternal pagoda
rain heart
#

I was not referring to you with that

eternal pagoda
#

was able to send requests before it was verified.

rain heart
#

Yeah but they did not do anything

#

as you did not have a token

eternal pagoda
#

that’s the difference between a 403 and you can’t send requests without being verified.

sullen nymph
#

Point still stands, your requests don't do shit without an authorization token as the entire API relies on it

rain heart
#

Correct, you need it for bots webhooks though

true owl
#

I want to make a command that works with voting how can I do

true owl
#

can you give me example?

#

yes i dont understand

#

.hasvoted

eager anchor
#

guys how do i make a system like dank memer that if anyone votes for the bot, that person gets economy game money ( if the bot has economy )

rain heart
eager anchor
rain heart
#

that is literally what you're asking

regal harbor
scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

hidden wave
#

Can someone help me with the voting webhook

#

Lemme get the code

#
  if (client.uptime) {
            client.users.fetch(req.user).then(user => {
                user.send("Thanks for voting!! your vote means so much to us! <![pepeheartMiZy](https://cdn.discordapp.com/emojis/782671403919867905.webp?size=128 "pepeheartMiZy")771257257371500544>")
                client.channels.fetch('785362716906225675').then(channel => {
                    channel.send(`Thanks for voting!! ${req.tag} your vote means so much to us! <![pepeheartMiZy](https://cdn.discordapp.com/emojis/782671403919867905.webp?size=128 "pepeheartMiZy")771257257371500544> you can also vote us at https://top.gg/bot/752384586398302279/vote`)
                })
            })
        }
})

app.listen(2022)```
#

This is my code

violet viper
#

What's the issue?

hidden wave
#

When I try to test webhook, it won't work

#

The auth and webhook URI are correct

#

I'm using the @topgg/sdk npm package btw

#

Yea that's what I wanna do

#

I wanna do POST request

#

But the api docs says that

#

I use express to make the webhook

#

You can even see at the bottom of the code that it says "app.listen(2022)"

jaunty plank
#

The post request seems to be a receiving endpoint, not a sending.

#

For the webhook

#

The url and auth are filled in correct?
http://ip:2022/dblwebhook
?
Filling in ip with the public ip.

restive otter
#

I have a server which is on top.gg and I code with discord.py I want my bot to do stuff when someone votes my server how can I make something like that?

jaunty plank
restive otter
#

Lemme check

restive otter
jaunty plank
#

You can just go to your server click edit and scroll to webhooks

meager saddle
#

Can somebody help me? I do not know why I give "test" and it does not go :c

jaunty plank
meager saddle
jaunty plank
#

Top.gg webhooks are not compatible with Discord webhooks.

meager saddle
#

oh

#

So ... what should I put there?

jaunty plank
#

The url to your webhook receiver

#

It will look something like http://ip:port/path

meager saddle
#

I don't understand what to do. I'm sorry 😔

jaunty plank
#

Webhooks are like backwards apis. Rather than you send a request for info from top.gg, top.gg sends that data to you when it has it.

#

It has to know where to send it.

meager saddle
#

And what should I put in port and path?

jaunty plank
#

The port and path of your webhook receiver.

#

You decide them in your code.

meager saddle
#

I already understand it wumpushype thanks

#

and the ip?

jaunty plank
#

The public ip of the webhook receiver.

#

Typically the public server ip your codes running on

meager saddle
#

okey

#

ip 0.0.0.0 ._.

hidden wave
#

It's normal I think

jaunty plank
#

Is your code running on a home network or a server which requires port forwarding?

#

Or do you have a firewall blocking said port

hidden wave
#

server which requires port forwarding

jaunty plank
meager saddle
#

so...

jaunty plank
meager saddle
#

Then what do I do .-.

jaunty plank
#

Use your public ip as its available

meager saddle
#

I put it on top.gg page but it doesen't work :c

jaunty plank
#

Did you put the full url?

meager saddle
jaunty plank
#

Is this on a home network?

meager saddle
#

yes

jaunty plank
#

Portforward port 5000

meager saddle
#

What is that

jaunty plank
#

Home routers block specific ports, portforwarding allows those ports to go to specific devices.

meager saddle
#

oh thanks

rain heart
gusty rover
#

right

upbeat imp
#

my server count still not showing.. sigh ((Python, and yes i did pip dbl.py))
is this done right?

import dbl
import discord
from discord.ext import commands
import datetime
from discord.utils import get
from urllib import parse, request
import re
import random
import asyncio
class TopGG(commands.Cog):
    
        def __init__(self, bot):
        self.bot = bot
        self.token = '[REDACTED]' # set this to your DBL 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("Server count posted successfully")

def setup(bot):
    bot.add_cog(TopGG(bot))
coral topaz
#

how can I set webhook server in my bot (node.js)

jaunty plank
#

You can use the sdk, top pin.

shy vortex
#

can the middle ware from the top.gg sdk be used with other http frameworks like
fastify

jaunty plank
#

Worth a try.

shy vortex
#

lol

#

I mean fastify has a different request object structure

#

as well as for reply's

jaunty plank
#

Probably not then.

shy vortex
#

to me the middle ware just looks like it extends both objects

#

or the first one

#

actually

restive otter
#

can anyone show me how to display on top.gg the servers my bot is in

#

Shak if you do answer ping plz

near remnant
#

@restive otter What about dblpy

restive otter
#

oh your using python

#

wait a sec

near remnant
#

Nooo

#

I didnt ask the question

#

Im just saying whats dblpy

restive otter
#

ahh ok

upbeat imp
tall shadow
#

fuck discord bot let make a telegram bot

fast agate
#

no

#

dont use 3.9 or more

#

Pyfthon 3.9 isn't supported by dblpy yet

#

I do this and it works, try it

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

    def __init__(self, bot):
        self.bot = bot
        self.token = 'bot token' # set this to your DBL 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("Server count posted successfully")



client.add_cog(TopGG(client))
upbeat imp
#

Tht is literally what I’m using ~ and it’s not pickin up the DBL lib installed no errors no trace backs no nothing

near remnant
#

Can someone help me use dblpy

#

I dont use cogs btw

#

@fast agate how can i do that without cogs

fast agate
#

all my bot is with not cogs

#

I just put it in the code and works xd

fast agate
#

my code be like

#
client = commands.Bot(command_prefix='//', intents=intents)
prefix = "//"
Client = discord.Client()


@client.event
async def on_member_join(user):
bla bla bla

@client.event
async def on_ready():

@client.command()
async def lang(ctx, lang=None):

@client.command(aliases=['helpme'])
async def help(ctx):
    guild_id = ctx.author.guild.id

@client.command(aliases=['8ball'])
async def _8ball(ctx, *, question = None):



client.run('dasdasdadas')
#

and I put it here and works

near remnant
#

Oh

fast agate
#
client = commands.Bot(command_prefix='//', intents=intents)
prefix = "//"
Client = discord.Client()


@client.event
async def on_member_join(user):
bla bla bla

@client.event
async def on_ready():

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

    def __init__(self, bot):
        self.bot = bot
        self.token = 'bot token' # set this to your DBL 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("Server count posted successfully")

client.add_cog(TopGG(client))

@client.command()
async def lang(ctx, lang=None):

@client.command(aliases=['helpme'])
async def help(ctx):
    guild_id = ctx.author.guild.id

@client.command(aliases=['8ball'])
async def _8ball(ctx, *, question = None):



client.run('dasdasdadas')
near remnant
#

Do i need to add any extra things to this

fast agate
#

amm if u want server count no

#

if u want webhooks and more things... yes

near remnant
#

I want like whenever someone voted for the bot the bot woll dm them

fast agate
#

u need a webhook

#

I dont have code for this...

near remnant
#

Wdym

#

Who do you think can help me

fast agate
#

shivaco

#

or here, but wait

#

other persons can help u

#

:3

near remnant
#

@client.event
async def on_dbl_vote(self, data):
voter = await self.client.fetch_user(data['user'])
await voter.send('Thanks for voting for the bot!')

#

Do you think this will work?

#

@sullen nymph

buoyant crane
#

What’s this?

sullen nymph
#

Next time just send manual requests to the machine your bot is hosted on lol

restive otter
#

lmao why on earth you instantiate 2 different clients and a cog inside the main file

sullen nymph
#

I'm not gonna question that part

#

And let them suffer the consequences of bad management

hot axle
#

wise decision

restive otter
#

also shiv, isn't the guild_post dispatched using dispatch method? That way you need to register the function as a listener, don't you?

#

Hi,so how do we use the top.gg api to remind a user to vote after 12 hours!

#

webhook, once top.gg's made a post request, sleep for 12 hours, then remind the user mmLol

#

and how do we setup the webhook? like with js or top.gg api

#

You can either use the official top.gg lib to set it up or set up a webserver that listens to post requests yourself I suppose.

#

oh ty

sullen nymph
#

Hence needed decorator but I missed it when docs were updated

restive otter
#

the docs would confuse newbie then kekw

sullen nymph
#

Yeah, I'm working on adding more details such as examples and detailed explanations for docs

#

(P.S. I'm not, but planning to)

restive otter
#

It should be self-explanatory by reading the source code anyway KEKW

sullen nymph
#

Yeah... I don't think anyone does that

#

Any newbie, rather

pale fulcrum
#

alright

#

for the POST bots/ID/stats, can I post shards count and server count without shard id?

jaunty plank
#

hi 😄

#

i dont think shard id is needed @pale fulcrum

pale fulcrum
#

ah yes my summon worked

#

poggers

jaunty plank
#

yeah shardid isnt requried

pale fulcrum
#

ok ty

#

What is the response supposed to be? @jaunty plank

jaunty plank
#

the status code should be 200 in the response

#

thats what id look for

pale fulcrum
#

im getting 200

#
    const req = await fetch(`https://top.gg/api/bots/${message.shard.user.id}/`, {
      method: 'POST',
      headers: {
        Authorization: process.env.DBL
      },
      body: {
        shard_count: this.client.options.shards,
        server_count: this.client.guildCount
      }
    })``` this.client.guildCount is 74, yet its returning a json saying server_count is 76 still
#

@jaunty plank

jaunty plank
#

caching maybe?

#

if you give it an hour or so and see if it updates properly?

pale fulcrum
#

alright

#

shouldn't I get an error if I post 2x in a row?

#

wait

#

/stats endpoint mmLol

#
    const req = await fetch(`https://top.gg/api/bots/${message.shard.user.id}/stats`, {
      method: 'POST',
      headers: {
        Authorization: process.env.DBL
      },
      body: {
        server_count: 73,
      }
    });``` its working but im getting 400, `Required parameter server_count or shards missing`
#

@jaunty plank is body incorrect?

#

headers wrong

#

posted correctly

#

content type was needed

jaunty plank
#

yeah, you need a content type right?

pale fulcrum
#

yep

jaunty plank
#

totally wasnt going over the sdk to find it lmao

pale fulcrum
#

thats what I did lmao

jaunty plank
#

you know what they say about great minds

static kayak
#

How do we setup webhooks for our bot?

jaunty plank
#

you can use one of the libs listed on the docs(some dont have webhook support), or make your own webhook receiver

static kayak
#

Well how can we show on top.gg that my bot is in a(number of) of servers?

jaunty plank
#

posting your server count using the api.

static kayak
#

I mean, to setup the webhook

jaunty plank
#

webhooks are not of posting your server count

#

they are for receiving vote events.

static kayak
jaunty plank
#

depends on your bots lib and lang.

static kayak
#

Where it should be done?

jaunty plank
#

in your bots code, outside any irrelevant functions or events.

pale fulcrum
#

kekw

weak zealot
#

Can I see who voted for my bot?

rain heart
weak zealot
#

How to make webhook to get votes ?

restive otter
#

it tells you in the docs

weak zealot
#

i didnt know how

#

and i didnt know who vote to my bot

#

i generate an API what now ?

#

@rain heart

rain heart
#

If you regerated a token, read the docs

weak zealot
#

i am read but i do not know English well

rain heart
#

Use a Translator

weak zealot
#

ok

#

all things need Authorization

#

how to Authorization the bot ?

rain heart
#

With adding a Authorization header to your request

#

The Header should contain your dbl token

weak zealot
#

Can you help me i am not understand any thing

#

? @rain heart

rain heart
storm sand
#

anyone can help with bal command

rain heart
storm sand
#

thx

weak zealot
#

not webhooks in Authorization

rain heart
#

If you're not understanding anything from the docs, i cannot help you and you're not ready to do that yet

weak zealot
#

Why ?

#

only say to me where Authorization

empty jay
#

The docs literally give you the code you need except for the webhook itself

weak zealot
#

I taked the api key but how Authorization

empty jay
#

like i said...it literally gives you the code and tells you word for word what to do

weak zealot
#

i do not know English well

#

can u help me with all things ?

empty jay
#

I'm not giving you the stuff that the website has...what library is your bot in?

weak zealot
#

repl it

#

java scrips

#

script

empty jay
#

ok so go to the website...and choose your library...

weak zealot
#

ok

#

then ?

empty jay
#

then read what the website says 🤦‍♂️

weak zealot
empty jay
#

I don't need pictures...my code works

weak zealot
#
const dbl = new DBL('Your top.gg token', client);
#

i must add this to the bot project right ?

#

and bot my bot token yes ?

weak zealot
#

can i get who vote to the bot in discord channel ?

rain heart
#

yes

#

with the api

#

still

restive otter
#
dbl.webhook.on("vote", (vote) => {
            ^

TypeError: Cannot read property 'on' of undefined
#

@rain heart Can you help?

rain heart
#

did you define dbl

#

webhook is undefined

restive otter
#

yes

#
const DBL = require("dblapi.js");
const dbl = new DBL(DBL_TOKEN, client);
willow spindle
#

you didn't configure webhook

restive otter
#
const webhook = dbl.webhook;

webhook.on("vote", vote => {
    console.log("");
    console.log(yellowBright(`VOTE INITIALISED | By: ${vote.user}`))

    const VoterMessage = new Discord.MessageEmbed()
        .setTitle(`${vote.user} Just Voted`)
        .setDescription(`*Want to vote for lovell? [Click Here](https://top.gg/bot/ ID /vote)*`)
        .setColor(0x82D6FD)
        .setFooter(`© MY BOT | Prefix: ${prefix} `)
        .setTimestamp(Date.now());

    const webhook = new Discord.WebhookClient(" ID ",
        " TOKEN ");

    webhook.send(VoterMessage);
})
#

@willow spindle would this work?

#

nah nvm it don't work

devout pelican
#

Can we do that on servers vote?

restive otter
#

check their api

rain heart
#

There's no api for top.gg servers, but there's webhook support for servers @devout pelican

#

Unfortunately that is not documented, but the concept is pretty much the same, just different data format you get from the webhook request

green flame
#

where do i put the webhook

rain heart
#

on your bot page settings under "webhooks"

devout pelican
#

Ok thx

green flame
#

?

rain heart
#

token

#

delete

#

@green flame

#

@empty gazelle deletum token above

#

nevermind gone

green flame
#

srry

rain heart
#

regenerate the token right now

green flame
#

but where do i put the webhook

green flame
rain heart
green flame
rain heart
#

Oh, servers?

green flame
#

Yes

rain heart
#

one second again

green flame
#

Ok

rain heart
#

on your "Server Info" Section, scrolling down should bring you to this

green flame
#

And how do i get an auth code?

#

Becuse it just says
Super_Duper_Secret_Auth

rain heart
#

replace it to whatever you want to use to make sure that the request is indeed coming from top.gg

#

you can change it to whatever you want

#

As long as it is the same on the Authorization field

green flame
#

Oh ok thx

#

@rain heart how do i get a dbl token?

rain heart
restive otter
#

am i meant to put the whole discord channel webhook url link?

rain heart
#

discord webhooks do not work

restive otter
#

oh-

rain heart
#

you need to make your own one

restive otter
#

wow

rain heart
#

or use a discord bot such as DBL Vote

restive otter
#

to check if a user voted or not?

rain heart
#

If you just want a notification (such as a thank you message in a channel) you could use a bot such as DBL Vote. For rewarding your users with a currency, you will need to make your own one

restive otter
#

interesting

#

okok

#

well thank you sir

rain heart
near remnant
#

can someone help me with dblpy

rain heart
#

just ask

near remnant
#

self.token = 'dbl_token' # set this to your DBL token

#

what do i put in 'dbl_token'

#

@rain heart

rain heart
#

set this to your DBL token

near remnant
#

ok

#

thats mine

rain heart
#

Delete

#

you should not share this

#

@left egret deletum

near remnant
#

i shortened it though

#

its not the ful one

rain heart
#

Still, don't share it

near remnant
#

👍

rain heart
#

enter that token inside your self.token of the dblpy instance

#

in other words, replace the dbl_token with it

near remnant
#

webhook_auth='password'

#

what do i put in password

rain heart
#

the authorization of the webhook you wish to use. If you do not use voting-webhooks, you can ignore that

near remnant
#

im tryna make it so whenever someone votes for my bot the bot will dm them

#
    def __init__(self, bot):
        self.bot = bot
        self.token = ''
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        voter = await self.client.fetch_user(data['user'])
        await voter.send('Thanks for voting for the bot!')
#

and thats my code

#

what do i have to fix

rain heart
#

Remember that the user needs to share a server with that bot

near remnant
#

yup

rain heart
#

also, then you will need to replace the webhook_auth with whatever you want to use as the webhook password

near remnant
#

any password?

rain heart
near remnant
#

ok

rain heart
#

it is generally just for you to identify that the webhook request is coming from top.gg

near remnant
#

k

#

do i need to do anything on top.gg for this

rain heart
#

your webhook url

near remnant
#

ah

#

where can i find this

rain heart
#

which should be the ip/domain of your server the webhook is running on

near remnant
#

oh

rain heart
#

so for example with your current code, it would be http://yourserverip:5000/dblwebhook

green flame
#

so the webhook dont wotk anyone know why```python
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""

def __init__(self, bot):
    self.bot = bot
    self.token = 'Nope' # set this to your DBL token
    self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='https://discord.com/api/webhooks/Nope', webhook_auth='Nope', webhook_port=5000)

# The decorator below will work only on discord.py 1.1.0+
# In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())

@tasks.loop(minutes=30.0)
async def update_stats(self):
    """This function runs every 30 minutes to automatically update your server count"""
    logger.info('Attempting to post server count')
    try:
        await self.dblpy.post_guild_count()
        logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
    except Exception as e:
        logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

    # if you are not using the tasks extension, put the line below

    await asyncio.sleep(1800)

@commands.Cog.listener()
async def on_dbl_vote(self, data):
    logger.info('Received an upvote')
    print(data)

def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(TopGG(bot))

rain heart
green flame
#

Idk how it works i havent even used python before lmao
And there are no vidios on yt that tells how to do it

rain heart
#

I'd say get more experience first

#

Or as recommended, use something like DBL Vote if you only need the Notification

green flame
#

Hmm k thx anyway

loud jewel
restive otter
# green flame

you cant use discord webhooks in that you need to set one up by yourself

green flame
#

Ok

restive otter
#

how do i setup wwebhook

rain heart
hollow gorge
#

how to I get the server counter to work??

rain heart
#

read the docs

wind oasis
#

есть русс

rain heart
#

@wind oasis

unborn quiver
#

what does the bot verification process consist of?

scarlet cobalt
#

One message removed from a suspended account.

unborn quiver
#

alright cause my bot is private and made specifically for one server, can it still get verified so I can use the API?

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

unborn quiver
#

ik that xD

#

alright then

restive otter
#

how can i make a vote message in my server

rain heart
#

with webhooks

restive otter
#

ok i look

sullen nymph
#

Will probably rename it to webhook_route at this point

inland wedge
#

İm turkey

rain heart
restive otter
#

hey i made webhook server but server dont send messages how do do that

eternal atlas
#

I am writing with discord.js and I can see that dblapi.js has its own events.
const DBL = require ('dblapi.js')
const dbl = new DBL ('dbl token', client)
dbl.on ('vote', vote => {
})
but I can show you how it's time to vote again

#

or is there such an event?

jaunty plank
#

you would have to make that event yourself.

eternal atlas
#

ok thanks i understand

fringe osprey
rocky frost
#

Hello, is the webhook test a vote?

rain heart
#

a test vote

#

it doesn't count towards your actual votes

#

it just sends a request to your webhook with the type "test"

rocky frost
#

I know, I was just wondering because the event didn't work

rain heart
#

make sure to press save before being able to test it

rocky frost
rain heart
#

that's what i thought so at first too

rocky frost
#

It seems that it didn't work here, I think it's the URL of the webhook, how do I put it in?

rain heart
#

inside the webhook url field

#

also make sure it is not a discord webhook, they're different

rocky frost
rain heart
#

If you created the webhook through your bot, your webhook format should be something like http://yourserverip:port/dblwebhook

rocky frost
#

can the port be 5000? If not, how do I get the port?

rain heart
#

You can choose whatever port you want

#

As long as it isn't used already

rocky frost
#

I tried everything and still won't

#

How can I be creating a server? I don't understand that

#

python

#

Do I really need to do this? I just want the voting event to work

#

I'm using the dbl lib, this would be if I hadn't been using it right?

#

I will take a look at the doc

#

hm

#

ok, thanks

restive otter
#

use aiohttp as it's async and one of d.py's dependencies, so you can have it in your bot

#

otherwise flask with threading, probably.

upper sage
#

الوو

hot rock
#

How i can make api vote?

vale quarry
#

how do i make a bot

hot rock
vale quarry
#

ok

#

im downloading the thing to make a bot lol

hot rock
#

api for vote or something

jaunty plank
hot rock
#

hm

#

it ```const DBL = require('dblapi.js');
const express = require('express');
const http = require('http');

const app = express();
const server = http.createServer(app);
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });

dbl.webhook.on('ready', hook => {
console.log(Webhook running with path ${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});

app.get('/', (req, res) => {
// ...
});

server.listen(5000, () => {
console.log('Listening');
});```

#

idk how to use api vote

#

it my first time use it

hot axle
#

you probably wanna use @top-gg/sdk

#

check da pins

#

wait

#

AA ping

hot rock
#

hm lol

#

yeah

jaunty plank
#

yeah, old lib is deprecated

hot axle
#

they should update the docs smh

hot rock
#

???

jaunty plank
#

the new docs are still a work in progress

hot rock
#

im confused

jaunty plank
#

they did update the github link at least pogey

hot axle
#

o aight

#

so its work in progress

hot rock
#

yal going help me or not

jaunty plank
#

that library is deprecated

hot axle
#

check the docs for top-gg/sdk

jaunty plank
#

and is no longer supported

hot rock
#

oh

jaunty plank
hot rock
hot rock
#

k

#

brb i need get my dog inside

#

back

hot rock
hot axle
#

check the docs for @top-gg/sdk

hot rock
#

i did

hot axle
#

that's the new lib

hot rock
#

im still confused lol

hot axle
#

there are examples over there

hot rock
#

?

jaunty plank
#

is there something specific you want to do with the api? or

hot rock
#

i just want make api vote in my support server

jaunty plank
#

as in you want to receive an event when someone votes?

hot rock
#

yeah

jaunty plank
#

bottom section

hot rock
#

ik

#

im in

#

but still confused

jaunty plank
#

about?

#

or if you have a specific question, its easier to just ask it.

hot rock
#

i really dont know how use a webhook of javascript

jaunty plank
#

well, the library does most of the work for you.

hot axle
#

you add it as middleware to the route you want

hot rock
#

dbd,js KEKW

#

im using a dbd.js

hot axle
#

then you can use req.vote to get stuff about the vote

hot rock
#

Hello?

jaunty plank
#

hi

hot rock
#

bruh

#

im still confused with api KEKW

jaunty plank
#

thats not a question, we cant read your mind on what you want to know

hot rock
#

i really dont know how to use webhook but what i ned do?

restive otter
#

what are you even laughing at

rapid kettle
#

their own incompetency ig?