#topgg-api

1 messages ยท Page 105 of 1

restive otter
#

lol

zealous vapor
#

@merry stump Yeah, you can use custom HTML and css

merry stump
#

but how

dense slate
#

help

rare saddle
#

Umm

#

Where is api server

#

Plz help

#

U can send dm

#

Thx

restive otter
tropic star
#

My top.gg webhook ain't working

restive otter
#

Ok

quartz raft
#

api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api api
like if you agree

sullen nymph
#

why

upbeat imp
#

Can someone point me to the python API for server count b4 I go and get lost in the google void lol ๐Ÿ˜…

sullen nymph
upbeat imp
#

Ty

misty mica
#

my approved bot is not showing up in its api page?

restive otter
#

I am mega confused on webhooks and votes. Can anyone explain without saying "Look at the docs"?
I just want to receive vote updates

#

Anyone?

restive otter
#

.

rain heart
#

The documentation explains it the most accurate

restive otter
#

Let me rephrase my question.
Can someone help me with webhooks WITHOUT telling me to go to #topgg-api and read the docs?

#

"If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in our #topgg-api channel"

#

Thanks

unborn canyon
#

basically

#

you open a port on your VPS and put that in the vote webhook

#

and it will send data

restive otter
#

Thanks mate

clever urchin
#

๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—

cedar spoke
#

๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—๐Ÿ”—
ok

restive otter
restive otter
#

Hello

#

How can i add my webnook

#

to my server thing

#

hello

#

@willow sphinx Hello

#

sorry for ping

median badger
#

Your bot needs to be approved

tropic star
#

you open a port on your VPS and put that in the vote webhook
How do I open a port on repl.it/glitch

median badger
#

Use port 3000

restive otter
#

lol

sullen nymph
#

On repl.it the port is 8080 @median badger @tropic star

tropic star
#

Okay.

rain heart
#

Logs? Any errors in your console?

#

Ok

frigid basin
#

Is the test button broken? Or does my webhook not work for tests?

tropic star
#

How do I use the webhook.

median badger
#

read the docs

tropic star
#

@median badger Yeah but I don't understand how to make a webserver is it like some php code or something.

median badger
rapid kettle
#

Yeah but I don't understand how to make a webserver is it like some php code or something.
@tropic star do it with express or something similar

#

all you need to do is listen for POST requests

tropic star
#

k

fringe sphinx
#

How do I trigger an event like when someone votes

rapid kettle
#

by listening for voets

#

using a webhook

fringe sphinx
#

i don't rly get how to use webhooks with top.gg how do i?

#

do i need a domain

rapid kettle
#

no

#

where do you host?

fringe sphinx
#

my raspberry pi

rapid kettle
#

ok thats cool

#

do you have the port forwarded?

fringe sphinx
#

no would i need to?

trail sigil
#

yep

#

you need to tell the router which device to send the webhook to

fringe sphinx
#

would having a dynamic ip be a problem

trail sigil
#

that could cause issues occasionally, yeah

fringe sphinx
#

would i just have to change my webhook on top.gg

tropic star
rapid kettle
#

client.channels.cache.get

#

and you dont get a user object

#

just a user ID

tropic star
#

So how can I make it ping the user who voted?

rapid kettle
#

@tropic star <@userID>

tropic star
#

Wait yeah!

#

And also are there any other mistakes?

#

It's still won't work. @rapid kettle.

rapid kettle
#

where u hostin

tropic star
#
rapid kettle
#

oh

#

have you configured the Auth bit

#

the webhook bit

tropic star
#

Wdym?

rapid kettle
#

on the page

magic vapor
#

guys , I need help with webhooks

#

i have this code

rapid kettle
#

ok

magic vapor
#
const http = require('http');
const app = express();
const server = http.createServer(app);
const DBL = require('dblapi.js');
const dbl = new DBL(`Bot token here`, { webhookAuth: 'my password here' ,webhookServer: server});
dbl.webhook.on('ready', hook => {
  console.log(`Succes, webbhook running on http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
    });
app.get('/', (req, res) => {
  res.sendStatus(200);
});

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

bot token doesnt go there

tropic star
#

on the page
Like where on the page?

rapid kettle
#

your dbl api token does

#

@tropic star at the bottom

golden adder
#

Hey is there a problem with the test ping? I can't seem to test my webhook

rapid kettle
#

yea there is

#

i think

tropic star
#

Ok.

#

Can't find it.

golden adder
#

Yeah votes are working though

#

I just had a few come through

#

It's just the test ping

rapid kettle
#

@magic vapor do you want the DSL webhook just out of curiosity?

teal trail
#

So do I need to port forward to detect votes with webhooks?

rapid kettle
#

Yes.

#

If you host at home that is

magic vapor
#

@magic vapor do you want the DSL webhook just out of curiosity?
@rapid kettle for now yes.

teal trail
#

Is there a specific protocol I need to use?

rapid kettle
#

you need to setup an express app for that

#

@teal trail i'd just go for both

tropic star
#

Where is it?

#

I can't find it.

teal trail
rapid kettle
#

@magic vapor So basically, the POST request gets sent to the URL that you provide, and you can pick it up with app.post("/", (req, res) => {})

#

@teal trail i'd go for tcp-udp

teal trail
#

Ok, thanks ๐Ÿ™‚

rapid kettle
#

and the auth is provided in the Authorization header

tropic star
#

Where is that?

rapid kettle
#

and the body is in the req.body

#

@tropic star just down the bottom of your edit page

teal trail
#

And shall I do HTTP for the service?

rapid kettle
#

the POST body would be json { "guild": "guild ID", "user": "user ID", "type": "test or upvote", "query": "?a=1&b=2" }

tropic star
#

Wait I never made a Post body?

#

Where should I make it?

rapid kettle
#

you dont make the POST body

#

it gets sent with the request

magic vapor
rapid kettle
#

And shall I do HTTP for the service?
@teal trail im gonna guess and say yes

#

@magic vapor what

magic vapor
#

can you see the issue happenjng in the bot and help @rapid kettle

teal trail
#

And is there a specific IP address I need to portforward to or just to anyone

tropic star
#

Yeah I check the authentication.

#

I did configure it.

rapid kettle
#

And is there a specific IP address I need to portforward to or just to anyone
@teal trail just to anyone

tropic star
#

What else could be wrong?

teal trail
#

Ok, thanks

tropic star
#

?

rapid kettle
#

did you set the URL to your repl URL

tropic star
#

The webhook URL?

rapid kettle
#

Yes

tropic star
#

did you set the URL to your repl URL
@rapid kettle nope ๐Ÿ˜ณ.

magic vapor
#

their is a problem in the api , what shall i do now?

tropic star
#

That's the problem I guess.

rapid kettle
#

that will be the problem

true talon
sharp wigeon
#

bruh

true talon
#

time to make this code better

tropic star
#

@rapid kettle What should the link look like?

rapid kettle
tropic star
#

Ok.

teal trail
#

If I am running on repl.it what do I put for the port and adress?

rapid kettle
tropic star
#

It still won't work.

#

But where am I meant to link it with the actual webhook?

teal trail
#

Shall i run it on the port 5000?

tropic star
#

Yeah.

teal trail
#

so for the webhook link do I just put https://BotName.replname.repl.co:5000

sullen nymph
#

For repl.it you run the webhook on port 8080 and don't specify it in the url

teal trail
#

Ok, thanks

tropic star
#

Oh.

teal trail
tropic star
#

Does the test button not work?

teal trail
#

It doesnt error if I do the test one in the docs

tropic star
#

Where did you get that from @teal trail?

teal trail
#

If you go to the api docs and then go to My Bots you can test it from there

#

Still nothing happens but nothing errors

tropic star
#

The test button won't work.

#

It does nothing.

teal trail
#

So how can I test it?

#

Do I need to do any extra steps on repl or do I just run it on port 8080?

#

Is there any way to test it?

#

Cause I voted on an alt and still nothing happened

tropic star
#

Oh.

#

@rapid kettle It still won't work and the test button is broken.

sullen nymph
#

It's suggested you use reqbin or postman

teal trail
#

so do I put the .co link in the webhook link?

sullen nymph
#

Yeah

teal trail
#

sohttps://BotName.replname.repl.co:8080 or just https://BotName.replname.repl.co

sullen nymph
#

Latter

teal trail
#

when I test or vote still nothing happens. The passwords are the same, the port is 8080, the link is set correctly

tropic star
#

^same.

teal trail
#

is there anything special I need to do to host it in repl.it and make webhooks work?

sullen nymph
#

It's suggested you use reqbin or postman
@sullen nymph

tropic star
#

How do I use it?

teal trail
#

reqbin just gives a 404 error when I send a POST

#

@sullen nymph how do I use reqbin

tropic star
#

Yes how do we use reqbin.

sullen nymph
#

Send a JSON following the proper data format from the docs in the request body

#

default endpoint is /dblwebhook so add that ig

teal trail
#

I cannot see a request body in the docs

sullen nymph
#

Press the webhooks tab

tropic star
#

Then?

sullen nymph
#

Add an Authorization header with your auth key as value on reqbin and send any JSON in request body

#

No need for the reading docs

tropic star
#

I'm confused now.

teal trail
sullen nymph
#

Eh yeah

teal trail
#

and fill in botID and userID

#

and in authentication put in my token?

tropic star
#

What userid do I put?

teal trail
#

Because I still get 404. I put my repl .co link in the field

tropic star
#

So how would it be?

teal trail
#

It does not work with my .co link

#

It works with other adresses but not with my .co adress

sharp wigeon
teal trail
#

Has anyone else had issues with webhooks on repl.it?

sharp wigeon
#

no because I don't use bad stuff :P
You should look into a vps...

teal trail
#

It is only for testing purposes rn

sharp wigeon
#

still

teal trail
#

we have a more perminent solution for our public one

sharp wigeon
#

the environment is much different

teal trail
#

can you recogmend a hosting company?

sharp wigeon
#

contabo, galaxygate, hetzner

sullen nymph
#

Slowly getting off-topic

teal trail
#

Sorry

sharp wigeon
#

shivaco minimod LUL

#

jk love you, moving

dusty roost
#

for some reason it won't let me test the webhook

#

the alert doesn't show up, and nothing happens in the bot

restive otter
#

await self.dblpy.post_guild_count(server_count, self.client.shard_count)

#

this should post the server count and shard count properly right?

#

for some reason it's posting the guild count and shard count both as the guild count

#

any idea why?

fringe sphinx
#

I'm sending the client to the top.gg api but if I go on the bot page, it shows 3 servers. If I go to my account it shows 1011. Does anyone know how to fix this

sullen nymph
#

@restive otter dblpy actually supports posting a list of server counts

#

That's basically server count of each shard

#

sooo feel free to do that GWomoRaphiWink

drifting inlet
#

karuane aku tak mudun

restive otter
#

@teal trail repl.co domains should work fine with webhooks too
I've got my bot posting a message to my server everytime someone votes the support server

tough stream
#

ah so are dbl webhooks broken? i have a server to receive them but it seems the test button doesn't work and when someone votes no webhook is sent

restive otter
#

@tough stream are you listening for POST requests to the EXACT URL that you put on DSL?

#

also test webhooks take like four seconds to send if you do anything while it's sending the test webhook it will not do anything

tough stream
#

yep, it was working up until the DBL website started changing early october

ripe ether
#

for dblpy, is there a on_member_vote or something of that nature?

sterile zephyr
tough stream
#

it'll be in the authorization header

#

@sterile zephyr

sterile zephyr
#

Thanks.

dusty roost
#

are webhook tests not working or is that just me

tough stream
#

no it seems they're just not working at all

#

it also seems that the website isn't sending any webhooks at all

#

i've confirmed that all my settings on dbl are correct and that my endpoint is receiving requests

dusty roost
#

annoying

#

yeah i'm still getting authentic votes going through

tough stream
#

really? i'm not

dusty roost
#

yeah everything works except testing

#

for me at least

tough stream
#

i'm literally relying on people to type a command to receive voting rewards

dusty roost
#

might be something wrong with your vote event then

tough stream
#

the think is i don't think there is? i did a test with the typical json and proper authorization on https://reqbin.com/ to my endpoint and checked that my endpoint works, then checked if my settings on dbl matched

#

and they do

sullen nymph
#

@ripe ether wululu see dblpy docs

ripe ether
#

My bot has not been approved yet, so is there a way where I can write code to do something on a vote to test it, so as soon as it comes out I can be ready?

#

@sullen nymph

sullen nymph
#

Use on_dbl_vote and/or on_dbl_test and send post requests to the VPS

#

The only requirement for votes to pass from dblpy is to have the Authorization header with value set to your webhook_auth value

ripe ether
#

this is literally my code

sullen nymph
#

but expect a very breaking change in next release (v1.0.0)

ripe ether
#

just to see

#

alright, thanks!

sullen nymph
#

Yeah see docs also

#

You need to initiate DBLClient with webhook_x arguments

sage silo
#

Hello, I'm having some troubles setting up the dsl api, I can't use the event on_dbl_vote, it just doesn't get called when a user adds a vote. Instead the event on_guild_post works just fine. Can somebody help me out?

#

(I'm not using a webhook)

ripe ether
#

@sullen nymph sorry for ping but in all the examples i have to give self.token='', do i put my bot token here, or what do I do? also how would i simulate the vote

sullen nymph
#

@sage silo DSL vote support will be added in next version

#

@ripe ether that's for top.gg token. You don't really have to simulate the entire data, just send some JSON in POST request body and print it

#

what was the request data you sent

#

Oh

sage silo
#

OH, thanks anyway

sullen nymph
#

huh

ripe ether
#

ah, i see, alright thanks!

sullen nymph
#

Mettius, you can use Flask/Sanic/aiohttp.web to host a webhook for DSL

#

Uh why the 2

#

send 2 as number ig

#

Though er

#

might not work as expected

#

shard count must be sent with guild count for each shard

#

uhhhh

#

don't know, not a js dev

ripe ether
#

if on_dbl_vote does not exist in dbl.py, why did they put it in documentation?

sullen nymph
#

DBL votes are supported, DSL aren't

ripe ether
#

oh, alright, thanks so much, you have been really helpful!

#

hopefully the verification doesn't take like a full 5 weeks, but it probably will

sullen nymph
#

Bet your house it will

#

and even more, like 7+ weeks instead

#

Have fun improving your bot or doing something else in the meantime ๐Ÿ˜‚

ripe ether
#

alright to by that estimate it will be 5 days before thanksgiving at the minimum

#

thats nice to know

sullen nymph
#

Unless it's put on hold until thanksgiving wink wink totally can't do that

restive otter
#

@restive otter dblpy actually supports posting a list of server counts
@sullen nymph that shouldnโ€™t be the issue tho right? Iโ€™m sure I can just pass in the guild count value

sullen nymph
#

Uhh

#

It very well can, tbh

#

I don't specifically remember what exactly was bugged apart from shard IDs not working properly

restive otter
#

await self.dblpy.post_guild_count([server_count1, servercount2, servercount3]) so something like this shd be enough? @sullen nymph

grizzled mulch
#

I've tried looking at the docs, but I can't seem to get the webhook to work even though ive put the webhook id and the top.gg id in

sullen nymph
#

@restive otter yeah

#

top.gg will get the sum of all server counts and use that for the total number

#

@grizzled mulch what's your code like?

restive otter
#

Anyone knows how to create webhook vote logs

#

Like that

opal magnet
#

fr

half plover
#

Is the webhook test button broken? I'm seeing in the console:

Request:
POST to https://top.gg/servers/api/testWebhook

{ "bot": "713586207119900693", "type": "test", "query": "?test=data&notRandomNumber=8" }

Response:
400 Bad Request

{ "error": "Invalid request" }
gloomy vortex
#

p/help

sullen nymph
#

@half plover correct

tough stream
#

any idea when it'll be fixed?

sullen nymph
#

In next big update, which is... whenever GWovoRaphiXD

low moss
#

how do i apply the api to my bot to show servers on top.gg page

lyric smelt
#

how can I track server votes? ?????

restive otter
#

can someone explain vote webhooks to me?

slim hemlock
#

Check for the things you need

sharp wigeon
#

wtf is that link LUL

slim hemlock
#

@restive otter @lyric smelt

sharp wigeon
slim hemlock
#

@sharp wigeon for the votes thing

#

ah ok f

sharp wigeon
#

you have the google tracking in that xd

#

I just cleaned it :P

slim hemlock
#

hmm

sullen nymph
#

you have the google tracking in that xd
@sharp wigeon it's Cloudflare cache for the API docs page

sharp wigeon
#

ohh

#

kinda weird champ

sullen nymph
#

they simply blindly copied the URL without removing the query string

lyric smelt
#

@restive otter @lyric smelt
@slim hemlock what should I do

slim hemlock
#

@lyric smelt read it

#

the link i gave

#

contains all u need

lyric smelt
#

@slim hemlock i read that many times

slim hemlock
#

what do you use to run code?

lyric smelt
#

@slim hemlock PY

slim hemlock
#

then check python menu

lyric smelt
#

I just need to know if there is anyway to get server votes

slim hemlock
#

uh idk about you

#

sorry

wispy vine
#

ho

scarlet river
#

Error: listen EADDRINUSE: address already in use :::3000

#

hw can i fix that

#

i got this err when defining dbl for webhook

rapid kettle
#

it means port 3000 is already used

elfin bolt
#

try chanege that to another port like 5000

dire sand
#

Do I need my bot approved in order to use the API?
NO. You can go to top.gg/bot/<yourbotid>/webhooks

This is what I found out, and I wanted to let you know. Before anyone asks, just say "Leon said it".

rapid kettle
#

woah pog that means i can presetup my bot webhooks

#

poggers

sullen nymph
#

I wonder if that's intentional

rapid kettle
#

ok i wanted to test it but

#

memes

#

{"error":"Not approved"}

#

this means you should approve it, shiv

sullen nymph
#

just use reqbin โค๏ธ

violet spoke
#
import dbl
import discord
from discord.ext import commands


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

    def __init__(self, bot):
        self.bot = bot
        self.token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjcwNzY0MTAzMzIxMDU5MzM1MSIsImJvdCI6dHJ1ZSwiaWF0IjoxNTk3NjI5MTE5fQ.00hxNvBquo_no5sOGp_on4ShOykH9VKOXCyBhlY6rTo' # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=False)

    async def on_dbl_vote():
        async with aiohttp.ClientSession() as session:
            webhook = Webhook.from_url('https://discordapp.com/api/webhooks/762378507002445889/JwEXlFzJrd0wlJhVPSs-4oIFQERawMHaJzKA1ucHyFYHWWQBbg-0TTgKKbqdRgFxEWnn', adapter=AsyncWebhookAdapter(session))
            await webhook.send('Hello World', username='Foo')

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

does anyone know why this doesn't work?

sullen nymph
#

Reset your top.gg token immediately

violet spoke
#

oh crap

sullen nymph
#

and possibly the webhook link too

violet spoke
#

ok I did

#

do you know why this doesn't work?

sullen nymph
#

Code-wise all good, see if your port is open and any firewall isn't blocking any requests

violet spoke
#

ok

tough stream
#

is there a way to use on_dbl_vote() without cogs?

sullen nymph
#

Sure, just initiate the DBLClient somewhere with webhook settings

#

Strongly advising you not to blindly update without code updates with the next version btw, there will be a breaking change regarding webhooks

violet spoke
#

are you talking to me?

tough stream
#

ah is dbl going through API changes? my old implementation of webhooks completely broke, and the test button isn't working :<

sullen nymph
#

Well eh, anyone who uses dblpy. There's a very different system for webhooks planned to be implemented

#

nah, not DBL itself

#

dblpy's new version

tough stream
#

right
because i was using a flask webserver to receive post requests but dbl suddenly stopped sending them yesterday

sullen nymph
#

the test button is known to be broken and there's already a fix. An update to fix it will be pushed with several other things

restive otter
#

help

#

nsfw

#

api

unborn canyon
#

no

restive otter
#

dude

unborn canyon
#

this is for topgg api

restive otter
#

stop redirecting me

#

i go there

unborn canyon
#

they gave you wrong info

restive otter
#

they say here

#

u go here

#

they say there

sullen nymph
#

-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

ripe turtle
#

Hey
Is there a way i can catch the upvote event for a server using discordbotlist api with .NET library?

potent tide
#

I have a problem with the API. I want to get information about upvote on a webhook using express. I wrote this code and it doesn't work.

const express = require("express")
const bodyParser = require("body-parser")

const app = express()

app.use(bodyParser.json())
app.use(express.json({ extended: true }))

app.post("/hook", (req, res) => {
  console.log(req.body) 
  res.status(200).end() 
})
app.listen(5000, () => console.log("[API | OK] Api server started on 5000...."))
jagged pine
#

Oh wait you wanna use express?

#

Not the dblapi?

#

Make sure your VPS firewall port is open

#

Also the test qebhook button on top.gg is broken atm

potent tide
merry zodiac
#

How do I get the total number of votes the bot has using the python API wrapper?

sullen nymph
#

monthly or total?

merry zodiac
#

monthly

sullen nymph
#

get_bot_info

merry zodiac
#

ah so i get the monthlyPoints key pair from the returned dictionary?

sullen nymph
#

Mhm

merry zodiac
#

ok thanks!

sullen nymph
#

๐Ÿ‘

jagged pine
#

@potent tide why is there a 5000 at the end

#

There should be hook

#

From rhe code you sent

median badger
#

its a port

#

its running on port 5000

jagged pine
#

Yeah but he has /hook in the code

sullen nymph
#

why not test the /hook endpoint itself

jagged pine
#

It should be :5000/hook

sullen nymph
#

instead of the main domain page

jagged pine
#

why not test the /hook endpoint itself
^

#

You don't habe a rout for /

potent tide
#

@potent tide why is there a 5000 at the end
I specified the IP address of the VPS

jagged pine
#

It should be :5000/hook
^

potent tide
sullen nymph
#

http:// and webhook test button isn't working atm

potent tide
split prawn
#

hey

#

can i run the api on the sharding manager?

frigid basin
echo solar
#

Hm

eternal iron
#

I dont know what url to send my webhook to

#

where do i send it?

#

what

#

who pinged me?

past gate
#

ยฏ_(ใƒ„)_/ยฏ

eternal iron
#

I dont know what url to send my webhook to
where do i send it?

ripe turtle
#

Hey
Is there a way i can catch the upvote event for a server using discordbotlist api with .NET library?

Still cant find a way to do that ๐Ÿ˜ฅ

restive otter
#

I dont know what url to send my webhook to
@eternal iron have an HTTP server listening for HTTP POST requests to the URL

ionic abyss
#

hello

#

i voted for my bot

#

and i aint getting logs

potent tide
#

I have a problem with dblapi.js
I took the sample code

const DBL = require('dblapi.js');
const dbl = new DBL("", { 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!`);
});

And on the site specified IP vps and :5000/dblwebhook
And there is nothing.

violet spoke
#
import dbl
import discord
from discord.ext import commands
from discord import Webhook, AsyncWebhookAdapter


class TopGG(commands.Cog):

    def __init__(self, bot):
        self.bot = bot
        self.token = 'I have my token here'
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=False)

    @commands.Cog.listener()
    async def on_dbl_vote(data):
        channel = self.client.get_channel(762378445841235998)
        await channel.send(data)

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

Does anyone know why this doesn't work?

#

I don't get an error

sullen nymph
#

Specifically, webhook_x arguments

violet spoke
#

oh, do I have to use webhooks?

sullen nymph
#

Yeah

violet spoke
#

since it's a JSON, I can just do a aiohttp request and get all of the info right?

#

or does the data parameter give me the info in the json?

sullen nymph
#

You forgot self there

#

but the data parameter is already a dictionary

violet spoke
#

ok

#

oh yeah I forgot self

#

i changed my code to this

sullen nymph
#

I need to write a whole guide since people keep misunderstanding what the webhook is

violet spoke
#

yeah I guess

#

i've never used webhooks before

sullen nymph
#

webhook_path is the thing after the main URL

#

http://your.vps.ip.address:port/webhook_path

violet spoke
#

oh

#

so I just do like http://111.111.11:5000/webhook_path?

#

or would webhook_path be my webhook url

sullen nymph
#

it's uhh

#

an endpoint specifically set up for your webhook

#

so if you set webhook_path to /dblwebhook123, the URL becomes http://111.111.111.111:5000/dblwebhook123

violet spoke
#

oh

#

or is the test button on the edit page the only one thats broken?

#

do I have to run my bot on my VPS for it to work?

#

so do I put http://111.111.111.111:5000/dblwebhook123 in my webhook url spot on my edit page

#

and put like /dblwebhook123 in the webhook url spot in my code?

elfin bolt
#

hello
i have been setup dbl webhook and i can post server count but i can't receive a meesage to the webhook when someone voting

vapid cape
#

did you configure your webhook properly?

#

in your top.gg edit page, there is the webhook settings you have to fill up

elfin bolt
#

yp

#

i can posting server & shard count but i cant receive votes

#

-api

timber lion
#

sorry wrong chat lol

elfin bolt
#

i have been setup dbl webhook and i can post server count but i can't receive a meesage to the webhook when someone voting
@elfin bolt

#

0w0

#

anyone can help pls?

hallow timber
#

`ytho

vapid cape
#

@elfin bolt show your webhook configuration

vapid cape
#

where is your bot hosted?

#

are you using express for anything else?

elfin bolt
#

plox.host

#

are you using express for anything else?
@vapid cape no

vapid cape
#

then you dont need express at all

#

nor server

#

you also dont need postStats, and you put the client in the wrong place

elfin bolt
#

where i must put it?

vapid cape
#
new DBL("token", { webhookPort:25573, webhookAuth:"yourwebhookauth" }, client)
#

you can remove http, server and app

elfin bolt
#

ok thx i'll try

vapid cape
#

you can also remove the setInterval and postStats

#

you can use these to console.log when it votes

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

dbl.on('error', e => {
 console.log(`dbl error:`, e);
})
restive otter
#

There's no vote event sweatguy

rapid kettle
#

dbl.webhook.on

regal jungle
#

I'm making a vote reward system, but my code didn't work.
Is there anything wrong?

const DBL = require("dblapi.js");
const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'password'});
....
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
  sendLog(`User with ID ${vote.user} just voted!`);
});
tough stream
#

Yeah from the looks of it https post requests aren't being sent at all
And the test button still doesn't work even though "there is a fix"

regal jungle
sullen nymph
#

yes

regal jungle
tough stream
#

i have that print(body) for any request to that endpoint, but when someone votes i get nothing

sullen nymph
#

Make sure port is open, URL is correct, and firewall isn't blocked requests

tough stream
#

verified all of that from reqbin

#

my github sponsors webhook is working just fine

rapid kettle
#

Didnโ€™t the test button fucking die?

tough stream
#

yes... it would be great if the fix that was mentioned yesterday could be deployed asap so i can actually test what my issue is

sharp wigeon
#

the save button broke too

potent tide
#

I have a problem with dblapi.js
I took the sample code

const DBL = require('dblapi.js');
const dbl = new DBL("", { 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!`);
});

And on the site specified IP vps and :5000/dblwebhook
And there is nothing.

jagged pine
#

Did you open the port?

#

What is nothing?

restive otter
#

is there a way to add fallback stuff to the DSL API so if for whatever dumb reason DSL webhooks don't function (aka status code is not 200) then it will do the stuff which i tell it (or maybe even send me a DM through @wild lantern botum)

restive otter
#

Hello, what would be the first codes to create a page like top.gg?

sullen nymph
#

-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

restive otter
#

Ok

#

@sullen nymph What is this channel about? I speak Spanish

sullen nymph
#

Literally translate the text Luca sent

restive otter
#

@sullen nymph Ok Gracias

fickle current
#

orrospular

tight hound
#

hello

#

how can i get spo presence

#

but its look like custom status

tough stream
#

@tight hound this is for the DBL API only, not the api of your library; go to the library's support server or to #development

tight hound
#

oh ok ty

lost geode
#

why was there a problem with saving my webhook?

#

it's a valid url

thin forum
#

the test button doesn't seem to work on the webhook setup page, if I vote for my bot a POST request shows in my logs but pressing the test button does nothing

median badger
#

It doesn't work

rapid kettle
#

@craggy sentinel

sullen nymph
#

-b 589632747073437696 Spamming and then leaving

abstract mothBOT
#

dblMod Banned Nikiand US#4432 (@faint marten)

proud matrix
#

e

halcyon rampart
restive otter
#

Rip

#

Wait why's my name no ads

mental tinsel
#

How can I find the API token of my bot?

jolly moth
#

@mental tinsel

restive otter
#

Hi, Can someone help me out with sending my bot's stats?

#

there is a function called post_guild_count() in py, does it have any argument?

potent basalt
rapid kettle
#

Itโ€™s where the Webhook is hosted

#

and auth is a way of verifying requests

#

itโ€™s sent in the headers

lost geode
#

the site says there is a problem saving the webhook

#

is it because my bot is unapproved or is it for some other reason?

rapid kettle
#

because itโ€™s unapproved

lost geode
#

alright thank you

sullen nymph
#

anyone ever just read the docs

restive otter
#

Add bot plez

#

@sullen nymph

merry zodiac
#

How can I make like a "voting-logs" channel in my server? Like when someone votes the bot on top.gg it'll post a message in voting-logs that this person voted. What exactly can I do to achieve this?

jovial kiln
#

when vote is emitted, then get the guild with the channel, get the channel, then send to the channel with vote.user

#

Can we not get a API key for our bot before it is on top gg? PES_Cry

jaunty plank
#

nope

jovial kiln
#

Screw it, setting it up anyways

restive otter
#

Where do I get dbitoken?

jaunty plank
restive otter
#

Thanks

tender furnace
#

how could i set the password for my webhook ouath?

jaunty plank
#

the bots page, edit near the bottom

tender furnace
#

can u provide a screenshot?

jaunty plank
#

not at the bottom anymore

#

damn they have done a lot

tender furnace
#

oh okay

tender furnace
#

(node:19288) UnhandledPromiseRejectionWarning: Error: socket hang up

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

it didn't log anything although someone voted

tender furnace
#

anyone?

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jaunty plank
#

he said he is helping someone else iirc

tender furnace
#

yes

restive otter
#

How can I make like a "voting-logs" channel in my server? Like when someone votes the bot on top.gg it'll post a message in voting-logs that this person voted. What exactly can I do to achieve this?
@merry zodiac Have your bot listen for vote events to the top.gg API then when it detects one verify that it's coming from top.gg by using your API key then if it passes the verification have your bot send a message in your server

merry zodiac
#

ah ok thanks!

restive otter
#

Hey can anyone help in how to set Server Webhooks in top.gg

rapid kettle
#

do you know any programming languages?

#

if so, itโ€™s pretty simple.

restive otter
#

Js

rapid kettle
#

just create a web server that listens for post requests

restive otter
#

Ok

restive otter
#

My 5000 port is already used. If i change it will something happen to vote listener? If so, what shall I do?

restive otter
#

where will i get this ( top.gg token )

#

where will i get this ( top.gg token )
@restive otter on your (approved) bot's page

#

Ok

#

@restive otter My bot is still not approved

covert geyser
restive otter
#

Why when someone votes, the bot announces it twice ?
@covert geyser the bot is probab running

#

somewhere else

#

trying disconnecting ur host and run the cmd

#

if it runs then the bot is running somewhere

#

hey

#

hi

covert geyser
#

if it runs then the bot is running somewhere
@restive otter Tried, the bot is running only in my VPS

restive otter
#

Reset the token

#

That'll stop anywhere else from running

#

Then restart the bot on the VPS with the new token

covert geyser
#

I don't need to do that, I said my bot only runs in my VPS. It does not run elsewhere, I tested.

restive otter
#

I don't need to do that, I said my bot only runs in my VPS. It does not run elsewhere, I tested.
@covert geyser just do it

#

u wont lose anything

rapid kettle
#

My 5000 port is already used. If i change it will something happen to vote listener? If so, what shall I do?
@restive otter no

#

Just change the port on the site

restive otter
#

Just change the port on the site
@rapid kettle I searched a lot but couldn't find somewhere that determine the port in website

terse bridge
#

how would i go about connecting my bot to the api so it can send an embed when someone votes for my support server

jovial kiln
#

Check latest pin

vernal dagger
#

Oh wait, Wrong channel.

#

Sorri.

terse bridge
#

@jovial kiln that only documents how i would send an embed for when my bot is verified.

#

Not the support server

median badger
#

@covert geyser again, its on your end

analog quest
#
   let sniper1 = args.splice(0).join(' ');
   // let sniper2 = msg.content.slice(1).join(' ');
   let sniper2 = args.slice(1);
   let sniper3 = args.slice(2);```why is this isn't working
#

when i use my cmd like !addsnipers first second third
{ t1sniper1: 'first second third' } it prints all in first array

median badger
lunar helm
agile plank
sullen nymph
#

The way I'd do it is suggest you two @restive otter @analog quest to use the appropriate channel, #development

#

-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

sullen nymph
#

Is there any way to make you read the message right above yours?

covert geyser
#

@covert geyser again, its on your end
@median badger I did it, I reset the token.. but same problem.

The bot still send twice the reward message.

unique vessel
#

my bot used to do that

#

it stoped

covert geyser
#

It's very weird.. it ping twice people who vote

#

I'll try, thanks

jaunty plank
#

i feel like i had this same issue with the default example

analog quest
#

const t1sniperlink2 = await page.evaluate((fileData) => window.find(fileData), [fileData.team1.t1sniper2]); isn't this correct way to use eval?

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

  if(config.sendToChannel === false || !client.channels.cache.get(config.channelId)){
    console.log(`User with ID ${vote.user} just voted!`)

    /* Gets username */
    dbl.getBot(vote.user).then(bot => {
      console.log(bot.username)
  });
  }

  if(config.sendToChannel === true || client.channels.cache.get(config.channelId)){
    let channel = client.channels.cache.get(config.channelId)
      /* Gets username */
      dbl.getBot(vote.user).then(bot => {
        channel.send(`User with ID ${bot.username} just voted!`)
      });
  }
});

it isn't sending the votes to my channel nor logging it in console

restive otter
#

hi

#

hi

tender furnace
#

dbl.webhook.on isn't working yeet

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

Am I able to emit a vote?

#

For testing

austere swallow
#

I think so, put in the URL and press the test button on your bot webpage

jovial kiln
#

Kk

wary jacinth
#

@restive otter

restive otter
#

Which is best. Api for chatbot

restive otter
rigid badger
#

-spi

#

-api

#

: D

potent basalt
#

How can i receive vote updates?

restive otter
#

you have to provide your webhook to top.gg to send updates to

#

means your firewall has to be configured to let shit on port 5000 through to whatever you are hosting the bot on

#

if you are hosting it locally, that is

harsh drum
#

Hi guys, where do I start with implementing webhooks?

#

Is there a tutorial?

jagged pine
#

I'm passing the client object inside the DBL constructor in dblapi.js but it doesn't automatically update the server count

#

I'm using dblapi.js v 2.4.1

harsh drum
#

Hold on - is it possible to implement voting by simply using the on_dbl_vote event?

potent basalt
#

@restive otter i'm hosting to repl.it

sharp wigeon
#

webhooks don't work

#

for me at least

#

it doesn't allow to save it

potent basalt
#

Can you help me how to setup and i can receive vote updates

sharp wigeon
#

...

#

"webhooks don't work, it doesn't allow to save it"

potent basalt
#

ok i mean i setup now and wait until works later.

sharp wigeon
#

also you are botdev, shouldn't you know this stuff LUL

potent basalt
#

ok thanks for help

tawdry aspen
#

am i using this correctly?

    dbl.getStats("264811613708746752").then(stats => {
        status_list = [`honkhelp | ${server_count} servers`]
};
scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

restive otter
#

if you wanna get server count, client.guilds.cache.size

scarlet cobalt
#

One message removed from a suspended account.

tawdry aspen
#

if you wanna get server count, client.guilds.cache.size
@restive otter yeah, but then i don't know how to setInterval to refresh that

white onyx
#

When I have a value inside of the Authorization field, the webhooks dont post. This issue only occurs for bots not for servers

#

Has anyone else noticed this?

restive otter
#

setInterval(()=>{
// set status
},60000) @tawdry aspen

#

@white onyx what

white onyx
#

whenever there is a value inside of the Authorization field of webhooks they wont post to me

#

but if there is no value in there, it posts fine

#

Nvm, I guess there was some lag or something

restive otter
#

How to setup server vote webhook

#

I don't know how to

#

I tried

#

๐Ÿ˜ฆ

gilded imp
#

Hi, I want to know how to do an advantage when someone votes for my server, they get the rank of voter, how do I do it

#

plz

#

plz help mee

#

๐Ÿ˜ญ

#

plz help me

#

anybody

ebon mist
#

bruh

#

read the API docs

#

you have an API or a callback url on your bot/api for the bot

gilded imp
#

how

ebon mist
#

that requests some data in body

#

based on the docs provided in API

#

then you put that url as the callback/endpoint to hit on vote with info

gilded imp
#

Do you need to activate it?

ebon mist
#

dorime read the docs

#

the docs show it all

#

you need an API endpoint that recieves the data that dbl will send you on vote

#

that contains user info, and a token to verify the request

#

you can have an API endpoint do some shit when it gets hit

sullen nymph
#

Do you see the Server Rewards section in server settings on top.gg

gilded imp
#

go to discord evoloper and create new bot and go to visual studio and go to my server and create a webhooks ?@ebon mist

ebon mist
#

...no

#

your bot needs to host a public web API

#

like a webserver

gilded imp
#

how Do you need to activate it?

ebon mist
#

that accepts data from DBL

#

no you dont need to "activate" it

sullen nymph
#

DSL supports role rewards

ebon mist
#

do you know what an API is?

gilded imp
#

no

sullen nymph
#

Fucking christ

ebon mist
#

yeah dont make a discord bot, go back to basics

#

you dont have the knowledge for this PepeLaugh

#

yet

sullen nymph
gilded imp
#

I do not know anything

ebon mist
#

learn

sullen nymph
#

Sigh

ebon mist
#

go like

sullen nymph
#

Cut the chatter

ebon mist
#

watch a tutorial or read some docs and make a website or smthn(no php or asp)

gilded imp
#

Please do it for me

#

plz

sullen nymph
#

I'm about to mute you two if you keep this conversation in here

#

@gilded imp I told you to move to #support

gilded imp
#

ok

restive otter
rapid kettle
#

Needs to be approved

restive otter
#

Thanks

ember swan
#

is it possible to use the vote's api for server and not for bot ?

restive otter
#

yes

vestal imp
#

.

grave sundial
#

i did console.log(vote)

#

and query was undefined

#

?

rapid kettle
#

@grave sundial query isnโ€™t always defined

grave sundial
#

if it's undefined that should mean the vote was directly from the site?

restive otter
#

I need help! I'm trying to set up a vote webhook, but I keep getting this error message
I'll do everything right, copy and paste these, and then ERROR MESSAGE. can someone help me :)

#
  • Translation for the text, which is in German: The following is displayed on top.gg:
#

Pleaaaaase Help me โ™ฅ

agile oak
#

Hey guys! How can I call a method every time an user votes for a server?

distant oak
#

I dont understand how webhooks work sorry

agile oak
#

Is there any event for it?

distant oak
#

Yes with webhook

agile oak
#

@distant oak isn't that just for bots?

#

I want to get the votes for a server

distant oak
#

Oh

#

Idk

#

I think no

#

On the edit page of ur server

restive otter
distant oak
#

?

#

You don't have bot

scarlet cobalt
#

One message removed from a suspended account.

restive otter
#

is it possible that the API is not working because my bot is not yet vertified?Can that be because of that?

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

restive otter
#

And that's why the bot is still displayed ...? Ah ... now I understand

#

Sorry, I use Google Translate, I can speak English, but not soooo good that I can write whole sentences with it (I know the grammar is a catastrophe in this sentence)

#

I hope you can understand me ;-;

#

I just see a message like this ... What happens if the bot is not accepted? Will it stay that way forever, or can you then ask again about it?

#

Thanks for your help ^^ So from above

distant oak
#

I can speak a bit german in #general-int if you still need help

restive otter
#

OK nice ^^

analog quest
#

const t1sniperlink1 = await page.$(`a[href*="/player/111111/Firstname_SecondName"]`);
is it possible to avoid those "/player/ID/" and evaluate "First_Second" name

potent basalt
harsh drum
#

When I am setting up my webhook, what am I supposed to set webhook path to? I am hosting my bot locally.

flat sonnet
#

Hi

jaunty plank
#

sorry man just noticed that question, its just the path
/dblwebhook for example

restive otter
#

@harsh drum you need to open ports to the webhook

#

If you use vps then you can do it easily.

#

The path is the path to the dbl webhook.

harsh drum
#

@restive otter I'm not sure I understand? How come O have to manually do the networking for this webhook but the library will automatically connect?

#

I am hosting my bot locally too so how do I go about that

#

And also in top.gg webhook url what do I put there if I'm hosting locally?

#

There are no tutorials at all and the docs explain nothing, it's so hard to understand what I'm msupposed to do here

jaunty plank
#

it will be
http://yourip:yourport/yourpath

#

or something simular

restive otter
#

Yes.

#

You gotta path it.

austere swallow
#

if you are hosting your bot locally, you will likely need to port forward your dbl webhook port so that it is accessible by top.gg to send the webhook to

harsh drum
#

My IP changes sometimes... How can I make sure this doesn't stop it from working?

jaunty plank
#

my isp charged about $10 a month

#

to keep it static

austere swallow
#

use a dynamic DNS service

regal fjord
restive otter
#

@potent basalt 0.0.0.0 means "any IP" you need to put the IP of the VPS bruh

potent basalt
#

@restive otter how can i get IP of VPS

ripe ether
#

like it should tell you

restive otter
#

try doing curl https://portquiz.net in bash

restive otter
#

Hey, is there a way to send a message everytime the bot gets added to a server via top.gg?

potent basalt
restive otter
#

Hey, is there a way to send a message everytime the bot gets added to a server via top.gg?
@restive otter you can specify a redirect URI on the invite URL you put on top.gg specifically

#

@potent basalt put <IP>:<PORT>/<WEBHOOK_PATH> as the URL for webhooks

#

don't forget to put the correct http protocol

#

I'd always go for HTTPS

#

If the VPS doesn't have https stop using it

#

๐Ÿ‘

storm surge
#

i have tried many times to make the top.gg website show my bots server count but i can never understand it. sorry if its easy but i just dont get it

potent basalt
shrewd burrow
#

Is there an API endpoint for updating the bot?

light talon
#

Is there any documentation on dsl voting webhooks?

rapid kettle
#

Is there any documentation on dsl voting webhooks?
@light talon pins

light talon
#

thanks

restive otter
#

@potent basalt i can't help you with every step

charred seal
#

Ik his is for discord bots, but how can i get all votes for a discord server? Because there is no API docs for servers and can't get a token for a server...

restive otter
#

Ik his is for discord bots, but how can i get all votes for a discord server? Because there is no API docs for servers and can't get a token for a server...
@charred seal The DSL API is still in beta

#

But you can use webhooks with it

#

The dblapi libraries don't support DSL yet

#

The pins in this channel show how to use it

junior tusk
#

Is there a way to get a more detailed overview of recent bot votes? Like a vote timestamp/time + whether it was counted as 2 or 1

restive otter
#

Wdym by the last part? "counted as 2 or 1"

junior tusk
#

@restive otter if the weekend multiplier is applied

#

I am sure my bot is handling them correctly, but my database contains 1 more vote than dbl has saved

#

no wait, this is weird

#

I could post my code if anyone wants to look at it

rapid kettle
#

@junior tusk <vote>.isWeekend

junior tusk
#

yes I'm using that and the total vote amount in the database is different than the total vote amount in dbl's database

#

that's what I realised when I said "no wait, this is weird"

rapid kettle
#

weird

junior tusk
#

so there's probably something going wrong in how I save it in the database, or (which is not the case, I guess) dbl didn't save it correctly

quartz obsidian
#

I need help with the API, how can I get the password for top.gg?

sturdy frost
#

what makes an official api library official

golden adder
#

yes I'm using that and the total vote amount in the database is different than the total vote amount in dbl's database
@junior tusk just a thought, does your database reset the number of votes at the end of the month? If so, maybe your db resets at a different time to the top.gg db and that timeframe between the two resets is where that extra vote slipped in?

#

I need help with the API, how can I get the password for top.gg?
@quartz obsidian in the webhooks tab in your bot's profile editing page https://top.gg/bot/YOURBOTIDHERE/webhooks

junior tusk
#

@golden adder thanks for the answer. But my votes reset at 2 am UTC, the same as DBL does

#

I asked them once

quartz obsidian
#

@quartz obsidian in the webhooks tab in your bot's profile editing page https://top.gg/bot/YOURBOTIDHERE/webhooks
@golden adder ohh, ok thanks!

#

And for the port, what should I put?

golden adder
#

I just used 5000 like the docs say, but you can open any port for it

quartz obsidian
#

Oh ok, yeah cuz I also put 5000

#

Alright thanks so much again, sorry for bothering

merry plume
#

im new to the api, how'd i go about getting the voters discord id?

merry plume
#

thanks

golden adder
#

Check the pins

#

vote.user

south crow
sullen nymph
#

wha

south crow
#

why do I get that error?

#

the channel exist, I use that channel somewhere else in my code

sullen nymph
north geode
#

@south crow sanฤฑrฤฑm kanalฤฑ bulamฤฑyor

sullen nymph
#

-notr @north geode

abstract mothBOT
#

@north geode

ฤฐngilizceden baลŸka dillerde sohbet etmek iรงin #general-int kanalฤฑnฤฑ, top.gg hakkฤฑnda (Tรผrkรงe olarak da) destek almak iรงin #support kanalฤฑnฤฑ kullanฤฑn.
Bu kanalda Tรผrkรงe konuลŸmayฤฑn.

north geode
#

ok

sullen nymph
#

-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

swift wagon
#

Hols

#

Xs

slender oxide
#

how do i get server votes? cant find anything about it in the api docs, only about bot votes

sullen nymph
#

DSL doesn't have an API (as of yet)

#

You have to solely rely on webhooks atm

slender oxide
#

any documentations for the webhooks?

sullen nymph
#

See pins for the request payload

compact eagle
#

Any Java experts around?

marble nymph
#

yes

#

im java expert

hot quest
#

someone help me. i can't put a hyperlink in the footer of an embed

#

im using python

#

text doesn't work in the footer

dense basalt
#

-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

dense basalt
median burrow
#

Hello, I want to make a voting reward for my bot. I've read the documentation, but I do not understand, what should I put there? I tried to put there my webhook URL, but doesn't seem to work

shrewd burrow
#

Is there an API endpoint for updating the bot description etc?

median burrow
#

(I am using python)

velvet raven
#

is the api only for bots or also for servers?

jovial kiln
#

Currently the api for dsl is in beta, read the pins in this channel

sullen nymph
#

DSL API isn't a thing as of yet

jovial kiln
#

I thought it was in beta?

sullen nymph
#

Well if you consider webhook support an API...

jovial kiln
#

Ah yeah

fast spruce
#

its not showing

#

this wont work in the thing either

fast spruce
#

Rip

rapid kettle
#

I made it a message attachment

#

worked for me Shrug

peak lodge
#

how do i setup the DBL vote logs

restive otter
#
    @commands.command(hidden=True)
    async def test(self, ctx):
        """test."""
        test = await self.dblpy.generate_widget_small()
        await ctx.send(test)```
Is it me or none of the generated images can be shown on Discord?
#

how do i setup the DBL vote logs
@peak lodge U gotta be approved by top.gg

peak lodge
#

ok

#

@restive otter what are you coding in

#

what language

restive otter
#

thats python

peak lodge
#

oh i only know js

restive otter
#

I think thats an issue for lot of us, widgets arent showing up

rare storm
#

-api

harsh drum
#

What could be the issue

#

I have my events

@client.event
async def on_dbl_vote(data):
    print(data)
@client.event
async def on_dbl_test(data):
    print(data)
``` set up
#

I have never done networking or used webhook before I need help

#

There are no tutorials for this

restive otter
#

Did you init it

harsh drum
#

Yeah

#

My init looks like:

#

@restive otter

restive otter
#

dont share your creds lol

harsh drum
#

They aren't my creds obviously

restive otter
#

aight

#

you miss the path

harsh drum
#

Doesn't it default to /dblwebook?

restive otter
#

also

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        """An event that is called whenever someone votes for the bot on top.gg."""
        print("Received an upvote:", "\n", data, sep="")

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        """An event that is called whenever someone tests the webhook system for your bot on top.gg."""
        print("Received a test upvote:", "\n", data, sep="")```
harsh drum
#

^^ this is for a cog

#

My code is the same just with less formatting in the print and not in a cog

restive otter
#

oh ure not using a cog

harsh drum
#

No just for testing to make sure it works I couldn't be bothered to put it in a cog

#

I'll do that when I actually implement it to my bot

restive otter
#

it doesnt print anything on your console?

harsh drum
#

No

#

It just does nothing

#

I tried voting for the bot on a dummy account, and also using the built in test function

#

Neither did anything

restive otter
#

well try with the path set in init

harsh drum
#

Ok

#

Let me try test it again

restive otter
#

when you try to access to that link, do you get on an error webpage

harsh drum
restive otter
#

aight then the link is not reachable

harsh drum
#

Ffs

restive otter
#

thats what u should get

harsh drum
#

Here, I will try with HTTP server

restive otter
#

its hosted on your pc?

harsh drum
#

Yes

#

Well, at my house, not on my main PC

restive otter
#

ye try with http

harsh drum
#

On another pc I use as a server

#

Ok

restive otter
#

https is when you have a ssl certificate

#

Also mine works with https so for some reason u cant reach it

harsh drum
#

Ok, let me try again

restive otter
#

If its still not working, try to install a webserver on your pc such as IIS or Wamp

harsh drum
#

With http server i see 405

restive otter
#

aight so its good

#

It should print on your console then

harsh drum
#

It worked ๐ŸŽ‰

#

Thanks for your help !

golden adder
#

I just save votes to my db and attach a timestamp. Obviously that's not precise when the DBL API is slow to respond since sometimes it can take up to 30 minutes to fire the webhook event.

golden adder
#

Honestly though do we need anything more precise? Like, being off by 30 minutes for the DM reminder my bot sends doesn't make that much of a difference. The user will still have 11h30min to vote again.

#

I store that info too but I run it in a separate process so if my bot crashes for any reason and misses the event, my voting manager process will still pick it up, save it to the db and send the confirmation DM to the user.

#

The only way my system can fail is if my host goes offline but I've had 100% uptime so far

#

Get a cheap VPS ๐Ÿคทโ€โ™‚๏ธ

#

At least to manage the voting?

#

Yeah

#

Take a look at Pulseheberg. They have the best value VPS plans I've seen. Been using them for 6 months now no problems.

restive otter
#

Can I add fallback stuff to webhooks? Like if the vote reward webhook doesn't work the API will do smth else?

sharp wigeon
#

sadly no

#

I wish we had fallback webhooks (as I want to collect them accurately too), but rn there is no fallbacks

#

and they send the webhook once

harsh drum
#

Hi guys, when running the bot code on a windows PC the webhooks are receiving events and when you go to the url it says 405, but when running on linux pc webhooks aren't receiving events and when going to url it says "refused to connect"

#

Is there something extra I have to do to make this work on linux

#

Nevermind, the issue is not with the PC

restive otter
#

i'll keep it bookmarked for the future, thanks
@restive otter you could just create data for the user on dbl vote

#

Nevermind, the issue is not with the PC
@harsh drum You fixed it ?

stray hatch
#

UnhandledPromiseRejectionWarning: Error: 403 Forbidden

harsh drum
#

@harsh drum You fixed it ?
@restive otter Yep

restive otter
#

Are u working on dblpy?

stray hatch
#

hmm