#topgg-api

1 messages ยท Page 102 of 1

golden adder
#

I'll give that a try

dapper copper
#

No problem! Hope your endeavours are successful. One thing that isn't handled there is if the user has dms disabled

golden adder
#

Such a shame we can't bookmark messages on Discord ๐Ÿ˜‚

dapper copper
#

but you should be able to troubleshoot that

golden adder
#

๐Ÿ‘

#

Perfect

dapper copper
#

I'll shoot it to your dms

#

So you you find it

scenic tendon
#

which music bot do we use here ?

olive arrow
sharp apex
#

hi

cosmic shadow
#

so i want to setup logs

#

where do i put the webhook

#

im confused

sullen nymph
#

Webhook configuration is at the bottom of the page

cosmic shadow
#

hm

#

wdym

#

what did i do wrong

sullen nymph
#

Replace :ID with your bot's ID

cosmic shadow
#

bots id

#

i dont have a bot

#

i thought this ran off webhooks

#

is it possible for it to

vapid cape
#

if you dont have a bot, what are people gonna vote for?

cosmic shadow
#

no

#

i want to log the votes people make on top.gg

#

from my server

vapid cape
#

yes but people vote for bots on top.gg

cosmic shadow
#

i mean

#

that one

#

the servers

#

i want a log of who votes for my server

#

not bot

vapid cape
#

i dont think servers have an api

cosmic shadow
#

hm

#

so there's no way to log it?

sullen nymph
#

Servers don't support webhooks

cosmic shadow
#

:/

#

im doing an event where the person who votes for my server the most gets nitro

#

how would you recommend me to track that

sullen nymph
#

Manually

#

Votes are still WIP so feel free to suggest webhooks on the GitHub repo

cosmic shadow
#

o-

flint ivy
#

Hoe can i setup a webhook in java?

tawdry moon
#

Does anyone know about monitorss bot

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

tawdry moon
#

Does anyone know about monitorss bot
@shivaco do u know

restive otter
#

Heyey

tawdry moon
#

Hi

restive otter
#

I have the automatic server count thing. but I want to set up something so it send a message in a channel saying someone voted.

#

i am python

vapid cape
#

you can use dblpy

#

have you checked the examples?

scarlet vigil
#

hello

restive otter
#

Hi

flint ivy
#

i need help with webhooks in java i dont know how to start

rigid sinew
#

-leave

sullen nymph
#

How long until you will realize that you should use #commands? @rigid sinew

flint ivy
#

how can i use webhooks in java?!?

vapid cape
#

check out the official java library

#

or you can setup your own webserver

#

nevermind i think the java library doesnt support webhooks

#

then you need to setup a webserver

upper acorn
#
    at IncomingMessage.<anonymous> (C:\Users\Nicky\Desktop\TicketKing\node_modules\dblapi.js\src\index.js:118:25)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1220:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:8228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To term
inate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 13)
(node:8228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Anyone know what this error is and if there is a fix for it?
willow spindle
upper acorn
#

Aight

willow spindle
#

5xx error codes means server side error

flint ivy
#

thanks a lot @vapid cape

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

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

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

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})``` i want my bot to show the amount of servers it's in on top.gg but nothings happening
trail sigil
#

@empty violet as long as you have passed the client and token into the constructor correctly, then it will post it automatically

empty violet
#

do i use my bot token for discord or the top.gg token provided

trail sigil
#

top.gg token for that 'token' bit

empty violet
#

ok

river bone
#

if more than 1 people vote at the same time or close to each other vote count fails to get updated in time and gets repeated
any way to fix that?

#

๐Ÿ‘€

cerulean monolith
#

Is there a Server bote webhook?

#

vote*

restive otter
#

saa

vivid surge
#

is there documentation for the actual api endpoints or do i just have to dissect one of the libraries?

#

nvm i did that

tall flume
sullen nymph
#

string

tall flume
#

and i use [FromBody] correct?

sullen nymph
#

No idea, I'm not proficient enough in C# to know that :p

tall flume
#

Json or Url parameters?

sullen nymph
#

The data is sent in the request body

tall flume
#

thanks โค๏ธ

gaunt steeple
#

@tall flume snowflake is a 64 bit unsigned integer

#

ulong sounds right

sullen nymph
gaunt steeple
#

thats only because most people use js and js sucks at 64 bit ints

sullen nymph
#

so eh, if I'm not confusing myself, you'd have to convert it manually (if that's not what you did in the screenshot you sent before)

gaunt steeple
#

sending them as actual numbers would mess with people ๐Ÿ™‚

tall flume
#

yeah converting the data is fine with parsing

#

i just cant seem to get any data its strange ๐Ÿค” i see lots of debugging in my future

gaunt steeple
#

wow. today i learned: the top 1% of netherlands earners own a whole 33% of the country's assets.

#

thats astounding

restive otter
#

-api @gaunt steeple

gaunt steeple
#

it has the highest wealth inequality in the whole world

#

aaah oops wrong channel.

#

wrong server in fact. i'll delete.

restive otter
#

no

#

keep talking, it's interesting

gaunt steeple
dense basalt
#

You're already running something on that port, use a different one

onyx badge
#

Wheres the token?

#

isnt at the bot setup?

#

nvm I found it

#

to get the number of actual votes is just dbl.getVotes() ?

restive otter
#

rr ghost

trail sigil
#

-api @restive otter

abstract mothBOT
#

@restive otter

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

empty violet
#

why this dont work :(

const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(process.env.TOPGG_KEY, client);

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

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

dbl.on('error', e => {
 console.log(e);
})```
trail sigil
#

@empty violet remove the setInterval bit

#

if you pass the client into the constructor (as you have done), it posts it automatically

empty violet
#

i've had that running since yesterday and still hasnt updated

#

bruh still isnt working

trail sigil
#

did you remove the setInterval bit?

empty violet
#

ye

trail sigil
#

and you've provided the correct token?

empty violet
#

yes

#

oh wait

#

ayyyy

#

it works

trail sigil
empty violet
#

what if i made a custom amount of servers

#

like 69 million

trail sigil
#

uh you'll get a stern warning asking you to fix it

empty violet
#

dont worry i tried and nothing happened

trail sigil
#

eventually we'll just ban you and delete ur bot

#

smh

empty violet
#

lol

#

just curious

restive otter
#

I noticed if your bot is in 0 guilds dblapi.js screams at you.

bold badger
#

Lol

abstract holly
#

Help

onyx badge
#

@abstract holly what

icy hazel
#

well

restive otter
#

hey idk

gaunt sierra
#

How do i make it so my bot logs when someone votes for it in top.gg?

#

api/docs doesn't work

restive otter
#

my vote is not working

#

when i do vote it dont show nothing

restive otter
#

cool

#

code?

#

error?

#

no error

#

emotional support?

gaunt sierra
#

someone help with the vote webhook thing

#

smh

#

it doesn't work at all.

river bone
#

if more than 1 people vote at the same time or close to each other vote count fails to get updated in time and gets repeated
any way to fix that?

slender ridge
#

can i get help

#

pls

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

rigid sinew
#

-leave

#

-skip

plush ore
#

now that's just taking the piss

jade kindle
#

Is there a api for server voting yet? :3

plush ore
#

Nope

gaunt sierra
#

:v

restive otter
#

ConcernedPoliwhirl same

grave jungle
#

how i use the vote evant ?

gaunt sierra
#

idk too

vagrant oyster
#

How long do I have to wait between .getVotes() requests?

dapper dawn
#

I put the webhook url in the place it asks for, and when someone votes, it doesn't send the message in the console logs

median badger
#

The webhooks are a bit slow sometimes

#

how i use the vote evant ?
@grave jungle read the docs

hollow mountain
#

I'm coding in python :)
embed.add_field(name='Upvotes this month:', value=/bots/{650286008432328734}/votes, inline=False)

#

but i doesn't work

oak sinew
#

Oops! Error: 429 Too Many Requests

willow spindle
#

you are being ratelimited

velvet pond
#

api down?

#

522 timeout for shards 0 & 1, 503 fetch failed for shard 2

#

all three shards now 503

frozen jolt
#

Does top gg have server api like the vote one?

dapper copper
#

not yet

#

which is why server votes haven't been officially announced yet

keen panther
#

if i go in "My Bots" section there isnt any bot listed, how can i use the API token if it isnt listed? do i have to wait for my bot to be approved first?

sullen nymph
#

Correct

keen panther
#

i see

#

ty

restive otter
#

Hey

mild wren
#

How can I get the top.gg API to give me the top voters.

restive otter
#

Can someone help me please.

#

I want to make it so it sends a message in a channel when someone upvotes.

#

And I cant figure the api out for that

mild wren
#

You'll need to use the webhook @restive otter

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

I am python ๐Ÿ™‚

mild wren
#

lol okay python

#

rip

restive otter
#

Yes

#

And I cant figure the api out for that
@restive otter

#

I know that there is an api

#

But I find it confusing

hollow cradle
#

not yet
@dapper copper I saw a server have and use a api for votes for servers on top.gg, either its out for certain servers for testing or something

mild wren
#

Anyone here made a working webhook for their bot?

#

I can't find anything about it when incorporating a webhook with the bot. I am using pipedream as my webhook but I don't know how to transfer the data collected to the bot for it to be stored.

#

Is DBLAPI a webhook listener? It doesn't seem to work for me ๐Ÿ˜ฆ

gaunt sierra
#

I put the webhook url in the place it asks for, and when someone votes, it doesn't send the message in the console logs
@dapper dawn ^^ someone help me with this one too

mild wren
#

Just made the worse webhook listener but I got there

#
How to create your own shitty fucked up Vote Listener for Discord Bot List!

1. Set up the Webhook with a Pipedream (webhook website - it's FREE!)
2. Create a 'Workflow' so you can now transfer the data to Discord **MUST LINK DISCORD ACCOUNT** 
3. For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
3. Create a separate bot that can only read the messages in that certain channel
4. For every message (UserID) sent, add a 'vote' (1 value) to that User's vote count on the Database

There you go, a very inconvenient but does the job vote listener since I don't know how to use webhooks.
#

someone should pin makes sense

dapper copper
#

@hollow cradle they don't. You can give roles atm but that's in. If they say they're using the API they're liar

restive otter
#
How to create your own shitty fucked up Vote Listener for Discord Bot List!

1. Set up the Webhook with a Pipedream (webhook website - it's FREE!)
2. Create a 'Workflow' so you can now transfer the data to Discord **MUST LINK DISCORD ACCOUNT** 
3. For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
3. Create a separate bot that can only read the messages in that certain channel
4. For every message (UserID) sent, add a 'vote' (1 value) to that User's vote count on the Database

There you go, a very inconvenient but does the job vote listener since I don't know how to use webhooks.

@mild wren genius

restive otter
#

@mild wren DMs please.

restive otter
#

what's with the discord_bot field being sent in the api

#

a webhook post

#

I don't see it anywhere on the documentation

#

here's the payload I get

#
{'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data&notRandomNumber=8', 'isWeekend': True, 'discord_bot': {'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data&notRandomNumber=8', 'isWeekend': True}}
#

discord_bot basically being a repeat of the vote payload

restive otter
#
How to create your own shitty fucked up Vote Listener for Discord Bot List!

1. Set up the Webhook with a Pipedream (webhook website - it's FREE!)
2. Create a 'Workflow' so you can now transfer the data to Discord **MUST LINK DISCORD ACCOUNT** 
3. For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
3. Create a separate bot that can only read the messages in that certain channel
4. For every message (UserID) sent, add a 'vote' (1 value) to that User's vote count on the Database

There you go, a very inconvenient but does the job vote listener since I don't know how to use webhooks.

@mild wren this is the best solution you could ask for.

#

If you need help with this Dm me

mild wren
#

bruh

#

works

#

lmao

#

no need for bots

#

just use two webhook

#

webhook the webhook

frigid thunder
#

!afk

#

?

solar crypt
#

Hallo, I've tried the example provided by Tonkku on the pinned message and using the test button but nothing logged... Can someone help?

unborn canyon
#

you need to have sn open port

#

on your VPS

solar crypt
#

just got it working, thanks ๐Ÿ™‚

restive otter
foggy kelp
#

I get my token when the bot gets approved, correct?

trail sigil
#

correct

foggy kelp
#

K

unreal fractal
#

hwo do we get "dbl token" ?

trail sigil
#

click your bot and the token will show up (you may need to generate one)

unreal fractal
#

ty

#

and is there a way to simulate a vote

rapid kettle
#

yes

#

the test button

unreal fractal
#

where is the button ?

trail sigil
#

go to your bot page => click 'edit' => setup the webhook and enter the webhook url => click 'test webhook'

unreal fractal
#

ty

unreal fractal
#

How to create your own shitty fucked up Vote Listener for Discord Bot List!

  1. Set up the Webhook with a Pipedream (webhook website - it's FREE!)
  2. Create a 'Workflow' so you can now transfer the data to Discord MUST LINK DISCORD ACCOUNT
  3. For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
  4. Create a separate bot that can only read the messages in that certain channel
  5. For every message (UserID) sent, add a 'vote' (1 value) to that User's vote count on the Database

There you go, a very inconvenient but does the job vote listener since I don't know how to use webhooks.
could you help me with this ?
3. For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
how to I make DBl send vote to Pipedream ?

jagged prawn
#

when need to use shard/shards

median badger
#

when you have a lot of servers

#

google it

jagged prawn
#

ok

raw quarry
#

Hey, I can't see how to use dbl to post on top.gg my bot's server count, i read the documentaiton but actually can't manage to make it work.. any help ?

rapid kettle
#

what language

raw quarry
#

python

restive otter
#
const dbl = new DBL('', {
    webhookPort: 5000,
    webhookServer: '',
    webhookAuth: '',
});
#

I get if (server && !(server instanceof Server)) throw Error('The server is not an instance of http.Server');

vapid cape
#

if you're using a Port, you dont need Server

#

you are supposed to chose one or the other, not both

restive otter
trail sigil
#

not yet

#

well, there are webhooks but that is about it at the moment

rapid kettle
#

what

#

webhooks for /servers/?

trail sigil
#

indeed

#

go to the edit page for your server

#

there is a box at the bottom

fallen basin
#

How do i get the user of a Vote Request from the webhook? JS

#

with normal express

little wolf
#

Uh, I submitted my bot for approval a month ago ...

unborn canyon
#

๐Ÿ˜ฉ

leaden plank
#

do we get dmed if you get your bot approved?

jaunty plank
#

Yes, by @abstract moth

#

Approved or denied

unborn canyon
#

@mighty shuttle

craggy anchor
#

how do you post the correct number of guilds for a bot if it runs on multiple processes?

finite moat
#

Does your bot need to be verified for it to use the api because I am awaiting verification

restive otter
#

hello

#

(i have 2 vers of python running, but my discord.py only accepted 3.8, so here i am)

rugged minnow
#

I am confused as of how to make a vote-rewards and vote-logs system, can anybody help? I am using Discord.js v12.

#

Please ping me when you respond.

waxen ridge
#

Keep getting this error when posting to the api via BotBlock. Can anyone explain the error to me?

{"top.gg": [403, "error code: 1006", {"server_count":180}]}```
humble bison
#

@waxen ridge botblock doesn't work with dbl afaik

#

use the dbl api directly with your token

bold badger
#
    at DBLAPI.postStats (/root/Node Apps/Menhera Chan/node_modules/dblapi.js/src/index.js:142:45)
#

getting this error

rapid kettle
#

code

bold badger
#
        dbl.postStats(client.guilds.size);
    }, 1800000);```
#

in ready.js

rapid kettle
#

youโ€™re on discord.js v11 right

bold badger
#

12

rapid kettle
#

client.guilds.cache.size

bold badger
#

aah i see my bad i didn't notice that

rapid kettle
#

or you could let it autoposted

#

const dbl = new DBL("token", client)

restive otter
#

Help Sad

#

dbl.getVotes()

rapid kettle
#

dbl.getVotes() returns a collection doesn't it?

restive otter
#

I want to fetch votes

#
dbl.webhook.on('ready', hook => {
  let votes = dbl.getVotes();
  let embed = new Discord.MessageEmbed()
    .setColor(`#FFFB00`)
    .setDescription(`Webhook running at : http://${hook.hostname}:${hook.port}${hook.path}\nwe have total ${votes}`)
  webhok.send(embed);
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
})
rapid kettle
#

i believe it returns an object

#

yes it does

#

[
{vote one},
{vote two},
{etc}
]

#

@restive otter try votes.length

restive otter
#

working...

#

votes.length

#

I wanna make like if someone vote my bot on top.gg then he will receive 1 coins

rapid kettle
#

dbl.webhook.on("vote", vote => {})

#

that works iirc

raw quarry
#

hey, i'd like to use the dbl to post guild count, I saw this but don't really know what to do with it

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 = 'dbl_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")

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

It there any way to test votes?

#

Ah prefect, thank you :)

restive otter
#

!p ุงู†ุง ุฏู…ูŠ ูู„ุณุทูŠู†ูŠ $$ ู…ุญู…ุฏ ุนุณุงู Mohammed Assaf

maiden dock
#

?

#

@restive otter im here

#

oof

#

docs wont say which url i have to use

#

how to get vps url :/

#

Im not used to these things

restive otter
#

What triggers on_guild_post?

#

-api

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

what we have to use here 
`{ webhookPort: 5000, webhookAuth: 'password' });`
#

I want vote updates in my server channel what i have to do

#

@sullen nymph

sullen nymph
#

@restive otter dblpy calls that even when successfully posting guild count through the autopost

willow spindle
#

how to get vps url :/
@maiden dock https://server_ip:port/dblwebhook

maiden dock
#

Ook

#

still same

#

not working :/

#

its not loggin when im doing Test

willow spindle
#

show code

maiden dock
#
const DBL = require('dblapi.js');
const dbl = new DBL("Censored", { webhookPort: 5000, webhookAuth: 'Censored' });
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!`);
});```
willow spindle
#

is the port open?

maiden dock
#

the host port is not working so using the default given on npmjs

#
Error: listen EADDRINUSE: address already in use :::3000```
cerulean parrot
#

does somone have a welcome api?

maiden dock
cerulean parrot
#

ou uhm sorry

#

stupid asf

maiden dock
#

and no

#

idk any welcome api

#

Seems like no help for me

#

channel ded

balmy dagger
#

how long it takes to get access to the api ?

trail sigil
#

when you get approved, you get an api token

#

(check pins in #support for how long that takes)

balmy dagger
#

ok thx ๐Ÿ™‚

maiden dock
#

=w=

jagged mantle
#

How would I give someone a role for 12 hours when they vote for my bot? And DM a user a message? I assume โ€œsend.voterโ€ or smthin?

rapid kettle
#

no

restive otter
#

asyncio.sleep(43200)

limber dawn
#

I want vote updates in my server channel what i have to do

maiden dock
#

I want vote updates in my server channel what i have to do
Yes how can we do that :/
Im new to this

willow spindle
#

@limber dawn you can't use api before your bot is approved

limber dawn
#

my bot is approved

willow spindle
#

-bots 692567055458762769

#

yes weirdsip

limber dawn
#

my friend having

willow spindle
limber dawn
#

-bots 512992262704201730

willow spindle
#

also check pins

limber dawn
#

its not working i made a code

#

but its not sending

willow spindle
#

show code

limber dawn
#

can i send u the code

willow spindle
#

send here

limber dawn
#
const Discord = require('discord.js');

const client = new Discord.Client();

client.once('ready', async () => {
    console.log('Bot is up and ready!');
  
});


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('dbltokenhere', { webhookAuth: 'test', webhookServer: server });

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running with path ${hook.path}`);
});

const dbl1 = new DBL('dbltokenhere', client);

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

dbl1.on('error', e => {
 console.log(`Oops! ${e}`);
})
client.on('ready', () => {

    setInterval(() => {
        dbl1.postStats(client.guilds.cache.size);
    }, 1800000);
});
dbl.webhook.on('vote', async vote => {

 const user = await client.users.cache.get(vote.user)
const HouseannorGuild = await client.guilds.cache.get('705748846248067132')
const member = HouseannorGuild.members.cache.get(vote.user)
  const votedEmbed = new Discord.MessageEmbed()
            .setColor("FA61FF")
            .setTitle(`๐ŸŽ‰ Lynx Welcomer Voter!`)
            .setDescription(`Thank you <@${vote.user}> (\`${user ? user.tag : "Unable to get user tag"}\`) has voted for Lynx welcomer on top.gg!`)
            .addField('Vote again','[Vote for Lynx Welcomer](https://top.gg/bot/693112937404956692/vote)')
            .setTimestamp()
            .setFooter(`ID: ${vote.user}`);

  client.channels.cache.get('752121949076848660').send(votedEmbed)

});

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

server.listen(5000, () => {
  console.log(`Bot starting up`)
  
});
client.login('bot-token');
sullen nymph
#

thanks

limber dawn
#

ok sorry

rapid kettle
#

how do you have a dbl token

limber dawn
#

u get this from dbl

#

site

willow spindle
#

did you put that on your code

limber dawn
#

yes

willow spindle
#

also is the 5000th port open?

limber dawn
#

what's that idk

maiden dock
#

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

#

Its not ez for beginners to understand it

#

Idk too

limber dawn
maiden dock
#

Im trying to do from months

#

No one helping me they are saying to check docs :/

limber dawn
slate bramble
#

Send meme

restive otter
#

why

#

@sullen nymph -api

unborn canyon
#

wrong

#

channel

#

๐Ÿ‘

#

not

#

the

#

place

#

๐Ÿ‘

compact creek
#

Hiya using dbl.py - when a user votes, how can get the users information but format it on an embed the way I like it as at the moment it just shows the default data however I want it to mention the user and put my own custom message

#

Ping me with an answer

carmine dome
#

what can i do with top.gg api ?

willow spindle
#

vote locked commands

#

vote logging (see who upvoted your bot/server)

#

get information about another bots

novel moth
#

how do i set up webhooks for a server?

light prism
#

@limber dawn wait

#
const
#

w-we can use programming langauges here?

#

didnt know lol

limber dawn
#

What ?

#

vote logging (see who upvoted your bot/server)
@willow spindle can u please tell how to setup this

restive otter
#

I had to copy my api token via page source

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

what does the data include?

sullen nymph
restive otter
#

thanks

restive otter
#
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fd07869cc10>, 558522.357858045)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fd090c6c668>

can I ignore this, happens on dbl cog

sullen nymph
#

What the fuck is that

#

Show your code please

restive otter
restive otter
#

when someone vote bot gonna dm message him

willow spindle
#

hm?

restive otter
#

nothing

dawn flume
#

holy

maiden dock
#

How tf can i make bot send vote logs to channel in my server??? Im waiting from 1 day now

#

My boss is forcing me to finish it by today
I have 12 hours left :/ help pls

sullen nymph
#

Create a webhook listening to POST requests, convert received request body into JSON, work with it

maiden dock
#

Im noob :/
I have never used any listing api
Idk which url put to on edit page ( Api settings )

#

And where to get

#

Can u explain it pls? @sullen nymph

sullen nymph
#

Which library is your bot written in

maiden dock
#

Discord.js

sullen nymph
#

You can use dblapi.js

maiden dock
#

Thats code for it ;-;

#

I want help on api settings page

sullen nymph
#

The URL will be http://ip:port/dblwebhook if you don't change webhookPath

maiden dock
#

Oo okay
How to get ip of vps
process.env.PORT works for port but process.env.IP doesn't

sullen nymph
#

Literally your machine's external/public IP

maiden dock
#

Ok

#

Thanks for help

waxen pagoda
#

Is pm2 better?

#

For bot startup

#

I'm using nodemon for now

sullen nymph
#

-api

waxen pagoda
#

But thinking to switch to pm2

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

dawn flume
#

isnt pm2 something that keeps a process alive 24/7 by restarting the index.js once it detects the process has died which can also be used for micro management?

#

i've got a webserver that pretty much does the same except it doesnt allow my processes to die and it doesnt use any fancy stuff. just 18 lines of code.

restive otter
#

Not working.. : (

sullen nymph
#

Make sure you have the port open and forwarded

#

as well as firewall isn't blocking any requests to that port

restive otter
#

What

dawn flume
#

is quick.db fast and reliable for multi server use?

urban phoenix
#

is quick.db fast and reliable for multi server use?
@dawn flume yeah

dawn flume
#

is it better than mongodb?

#

does it take up more space?

sullen nymph
#

Are you all just ignoring all messages that say that this is the wrong channel to ask

dawn flume
#

what?

sullen nymph
dawn flume
#

chill man. i was just asking a question

sullen nymph
dawn flume
#

i happened to see quick.db in that screenshot

#

i hate strict mods

bold surge
#

What's the channel rate limits? Cuz i wanna host a event where a lot of people are going to participate, and last time they did hit those rate limits, i wanna know the rate limits so i can be prepared for next time. Ty

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
#

Is there a good way to make the bot auto remove a vote role after being added?

#

after 12 hours

#

without using setTimeout/databases or something

#

well if i have to i can use a database but not a timer because the bot might restart

trail sigil
restive otter
#

oh sorry

split bison
#

-api

restive otter
#

-api

thorny prism
#

Python db api on_vote event is not working. When I vote, it does not write to any channel or consola.

restive otter
#

Is threan api for servers?

willow spindle
#

no but you can use vote webhooks

restive otter
#

Wdym

analog quest
#

    const browser = await puppeteer.launch({
        defaultViewport: {width: 1920, height: 1080}});
    const page = await browser.newPage()
    await page.goto('https://sa-mp.im/login', {waitUntil: 'domcontentloaded'})
    await page.waitForSelector('input[name="username"]');
    await page.type('input[name="username"]', 'username');
    await page.type('input[name="password"]', 'password');
    await page.click('input[type="submit"]');
    await page.goto('https://sa-mp.im/profile/faction')
    const el = await page.$('body')
    const buffer = await el.screenshot({ path: `${Date.now()}.png` })

    await browser.close()
    return buffer
};
```why isnt it logging in.. i already changed username/password to real ones to be used for logging .. even login page have red message error if username/pass incorrect but it just prints login page w/o even typing into fields and clicking login
restive otter
#

What do I put as shard posting

#

is it Shards:

#

or

#

shard_count

#

or

#

shardcount

#

?

restive otter
#

shard_count

#

If you're looking for shard count.

willow spindle
thorny prism
#

How do I use the top.gg on vote webhook?

restive otter
#

Ah

restive otter
#

Hello, can someone tell me how to make my bot send a message when someone votes for my bot?

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
#

i mean, it is related to the top.gg api isnt it

#

?????

sullen nymph
#

Misreading questions is fun

#

My apologies

restive otter
#

but where can I find it?

#

they want to DM people after someone votes for the bot

#

so person X votes for the bot, they want the bot to tell X "hey thanks for the vote"

sullen nymph
#

You can use webhooks provided by our official libraries if there's one for your bot's library

oak sinew
#

Error: 429 Too Many Requests

#

What do I do to solve it?

willow spindle
#

be slow

#

429 means you are being ratelimited

restive otter
#

space out your requests more, I believe the rate limit is 1h or so

torpid sandal
#

Hi.
It's not working and there is no errors in bot logs.

@client.event
async def on_dbl_vote(data):
	print(data)
	channel = client.get_channel(752896080387244052)
	await channel.send(data)```
restive otter
#

what's with the discord_bot field being sent in the api
a webhook post
I don't see it anywhere on the documentation
here's the payload I get

{'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data&notRandomNumber=8', 'isWeekend': True, 'discord_bot': {'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data&notRandomNumber=8', 'isWeekend': True}}
#

discord_bot is a repeat of the bot

#

or an actual vote

#
{'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'upvote', 'query': '', 'isWeekend': False, 'discord_bot': {'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'upvote', 'query': '', 'isWeekend': False}}
#

I changed my validation schema to accept that, but is this behavior expected for all votes?

sullen nymph
#

Reported to admins

lusty lotus
#

-api

#

-api

upper raven
#

-help

#

Someone help

#

-api

#

Uhmmmm how do I get help :<

sullen nymph
#

With what?

upper raven
#

My bot

#

I donโ€™t know got to program it

sullen nymph
#

-faq 3 13

abstract mothBOT
upper raven
#

Am on mobile

#

Does it work on mobile?

#

._.

sullen nymph
#

You can code a bot on phone, but that will be harder than doing it on PC

upper raven
#

Oh ok

#

I be back if donโ€™t understand

rapid kettle
restive otter
#

-faq

#

-faq 3 13

knotty garnet
#

only mods can use it

restive otter
#

Hi.
It's not working and there is no errors in bot logs.

@client.event
async def on_dbl_vote(data):
    print(data)
    channel = client.get_channel(752896080387244052)
    await channel.send(data)```

@torpid sandal you're trying to register the function as a client event, but discord.py doesnt handle top.gg's api

#

unless client is your top.gg API client

torpid sandal
#

ok

sullen nymph
#

@restive otter Actually

#

Your guess is incorrect

restive otter
#

oh?

sullen nymph
#

dblpy does utilize d.py's Client/Bot object to handle events

restive otter
#

huh

torpid sandal
restive otter
sullen nymph
#

I couldn't be assed to write an event handler for DBLClient and saw it a bit inconvenient in the end

#

In any case. Lincoln, are you voting or pressing the Test button on your bot's Edit page?

torpid sandal
#

@sullen nymph Yes, i'm pressing test button, but it's not working 5_Hmmhm

sullen nymph
#

I don't remember connecting on_dbl_test with on_dbl_vote

torpid sandal
#

I have 2 events and when i'm voting or pressing "Test" button, nothing happens

@client.event
async def on_dbl_test(data):
	print(data)
	channel = client.get_channel(752896080387244052)
	await channel.send(data)
	
@client.event
async def on_dbl_vote(data):
	print(data)
	channel = client.get_channel(752896080387244052)
	await channel.send(data)```
sullen nymph
#

Are you sure you entered the correct URL and auth key?

torpid sandal
#

Ah....
It won't work without a webhook???
@sullen nymph

brisk vigil
#

Hey what does dbl.hasVoted(user).then(voted => {
return like if the user voted in the past 12h?

sullen nymph
#

a boolean value iirc

brisk vigil
#

or if user has voted ever

rapid kettle
#

dbl.hasVoted() returns boolean

brisk vigil
#

ik but

sullen nymph
#

Ah....
It won't work without a webhook???
@sullen nymph
@torpid sandal Those events rely on DBLClient's webhook. Make the conclusion yourself :p

brisk vigil
#

does it return if the user has voted in the past 12h or ever?

sullen nymph
#

Let's see

torpid sandal
#

Ok, thanks :3

sullen nymph
nimble solar
#

I have a question about youtube googles api

#

I know that there is limited uses.. is there any other public api from youtube for searches

rapid kettle
nimble solar
#

Ohmy bad

restive harness
#

the go library in the top.gg docs links to a 404

#

just heads up

maiden dock
#

Permission denied while trying to connect to port 22

#

but im connecting on vps on that port

#

process.env.PORT is returning null.. what port should i use now :/

restive harness
#

open that port

#

if you setup ufw you can use ufw enable 22/tcp

restive otter
#

how do i make a command that works only if my bot is voted (dblapi.js)

rancid kraken
rapid kettle
#

how do i make a command that works only if my bot is voted (dblapi.js)
@restive otter <dbl>.hasVoted(userID) returns a bool iirc

spare rapids
#

o shit

#

my bad

heavy vine
#

Hey, I saw in #announcements that now we can vote for servers, how can I config the webhooks for voting?

restive otter
#

There is no API yet @heavy vine

heavy vine
#

Okey

restive otter
#

The only thing you can do rn is that the DSL bot can reward users roles for voting

heavy vine
#

Yeah I do that

brisk vigil
#

Anyone know how to make a webhook with heroku that works with dbl?\

knotty garnet
#

it's basically the same way you'd do normally, except you'll be using heroku's url

short glen
brisk vigil
#

it's basically the same way you'd do normally, except you'll be using heroku's url
@knotty garnet In heroku it requires an event what do i press there lol

knotty garnet
#

Event?

brisk vigil
#

yeah

#

heroku says something abut an event

knotty garnet
#

I currently have an API hosted on heroku, and all I had to do was code 'n run it, idk about any event

#

Are you using dbl official api?

brisk vigil
knotty garnet
#

And what lang?

brisk vigil
#

disfcord.js

#

discord.js*

#

node

knotty garnet
#

Ah no, you don't need that afaik

brisk vigil
#

lts

knotty garnet
#

I don't even know what those are for

brisk vigil
knotty garnet
brisk vigil
#

oki

restive otter
#

Does a webhook system exist for server voting yet?

#

Please let me know if it exists, even if it isnโ€™t documented.

willow spindle
#

@restive otter yes

#

just edit your server and scroll down

restive otter
#

@willow spindle So I can set it up the same way I setup bot webhooks?

willow spindle
#

yes

restive otter
#

Alright thanks

brisk vigil
#

Hi so i made a webhook system i have done all the things right i have made a project that runs and the port is open but it does not do anything..

#

also since my cc not working im not able to buy a vps rn

#

so im using my ip

restive otter
#

@brisk vigil hey! seeing your comment above, im willing to offer a vps ip to use if you are willing to send the code in a zip or something. :)

chilly sun
#

Can some one help me about CSS

restive otter
wet swift
#

can i get token without adding bot ?

true talon
#

no

brisk vigil
#

@restive otter dms :D

gaunt sierra
#

I still need help with the vote system for javascript

#

Been waiting weeks, Nobody helped me yet.

#

dblapi.js

vapid cape
#

Which part do you need help with?

#

What have you done so far?

gaunt sierra
#

@vapid cape Im hosting it on a vps

#

And i've not done anything else than putting in my top.gg token in the dbl thing

vapid cape
#

You need to confiure your webhook settings in your top.gg edit page

#

The webhook url should point to your vps's ip address

rapid kettle
#

http://vps.ip.address.here:port/path

#

port defaults to 5000 iirc and path defaults to /dblwebhook iirc

scarlet river
#
const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);
const dbl = new DBL('bottoken', { webhookServer: server, webhookAuth: 'nevrmindpassworduh });
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!`);
});
app.get('/', (req, res) => {
  //..
});
server.listen(3000, () => {
  console.log('Listening');
});
#

why it does not working

willow spindle
#

elaborate

gaunt sierra
#

http://vps.ip.address.here:port/path
@rapid kettle How do i get my exact vps ip adress

#

?

rapid kettle
#

itโ€™s usually on your VPS panel

#

or something similar

#

could be in your email

gaunt sierra
#

The public one or the private one

rapid kettle
#

Public.

gaunt sierra
#

starts with 172

#

what should the port be

willow spindle
#

curl ifconfig.co weirdsip

#

it is your choice

gaunt sierra
#

so any port

#

and it works

#

?

willow spindle
#

open that port first

gaunt sierra
#

how do i open a port

#

๐Ÿ’€

rich pawn
#

@gaunt sierra bash sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent sudo firewall-cmd --reload

#

^ that would open port 8080

gaunt sierra
#

@rich pawn Thanks alot but sudo isn't recognized as a cmd

#

Im on a windows server 2016

#

RDP

rich pawn
#

That command was for linux. This would work in windows bash netsh advfirewall firewall add rule name="TCP Port 8080" dir=in action=allow protocol=TCP localport=8080

#

^ that should be run in an administrator command prompt

#

This command is for administrator powershell bash New-NetFirewallRule -DisplayName 'TCP Port 8080' -Profile 'Private' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8080

gaunt sierra
#

I did the first one

#

It said "Ok."

rich pawn
#

then port 8080 is open

gaunt sierra
#

What'd i do now?

#

Go to the top.gg website and do the webhook thing with my bot?

rich pawn
#

Do you want to register your bot on top.gg?

gaunt sierra
#

It's already there.

#

I want my bot to send me when a user votes

#

dbl.webhook.on

#

This ip right^

rich pawn
#

ah ok. yeah you would have to use your public ip

rapid kettle
#

yes

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

rapid kettle
#

shiv are you drunk again this is api talk

rich pawn
#

@gaunt sierra do you own the vps.ip domain?

rapid kettle
#

no

#

lol

#

itโ€™s just a place holder for their VPS IP

rich pawn
#

lol

gaunt sierra
#

moment of truth

#

in 3

#

bruh

#

still doesn't work

rich pawn
#

Did you enable port forwarding on your router?

gaunt sierra
#

lemme check

#

wait

#

on my router

#

when it's on vps?

rich pawn
#

oh wait nvm lol

gaunt sierra
#

๐Ÿ’€

#

I opened that port as u said

#

But I never got a log when I voted

rich pawn
#

what kind of server do you have setup on the VPS?

gaunt sierra
#

windows server 2016

#

amazon aws

#

ec2

#

t2.micro

rich pawn
#

I work mainly on linux so I'm not sure ab why its not working on windows.

gaunt sierra
#

why is my life cracked

#

๐Ÿ˜ญ

#

Maybe because I voted?

#

Could you try voting?

rich pawn
#

ok

gaunt sierra
#

or does that not matter

rich pawn
#

idk. I can try voting though

gaunt sierra
rapid kettle
#

Use the test button

gaunt sierra
#

I-

#

Bruh

#

Is that what im supposed to click on

rapid kettle
#

yes it sends a post to the url

gaunt sierra
rapid kettle
#

http

gaunt sierra
#

ye it's http

#

with authorization password too

#

still doesn't work

#

"this may take a few seconds" never said anything else

#

uh

vapid cape
#

Did you change your code to listen(8080)?

nimble chasm
#

lol

pastel bloom
#

is there a way that if i upvote the bot it will get the user and send dm?

trail sigil
#

when a user votes, you get their id from the webhook

pastel bloom
#

ok

trail sigil
#

so yeah, you can fetch that user and then try to send them a DM

pastel bloom
#

yeah ik

trail sigil
#

@wise dune reset your token

wise dune
#

Has restored a new token

rapid kettle
#

can someone give me the structure of a POST (i think it's POST) request by a DSL webhook?

sullen nymph
#
{
  "guild": "358630393869631498",
  "user": "247741991310327810",
  "type": "upvote",
  "query": ""
}```

`type` difference stays the same as DBL webhooks
rapid kettle
#

where is the auth stored? @sullen nymph

sullen nymph
#

Request headers, Authorization key

rapid kettle
#

req headers, thanks

eternal moth
#

can someone tell me how do I make the "extra money by voting" feature?

restive otter
#

for this npm package [dbl-api] can someone tell me what i can do to show the name of a user and not their ID?

#

vote.user.username in console isnt showing anything, but user (alone) shows id and i tried user.user.tag too i think and it was undefined.

#

and user.username as well is undefined.

#

how to get the api

#

i need it for my bot for it to work

#

For server count?

#

yes

#

i think its like im editing atlanta bot

#

and i need this api

#

You need a bot (the bot you want) listed first

#

it is but a other version of it and i guess i have to wait for it to be accepted

#

mhm. you cant use api keys til then for this site.

#

dang can i speed it up in anyway?

#

do you have a temporary one i can use

#

nope. you've to wait til its accepted.

#

ok

#

or it will post to the wrong bot anyways.

#

ok

#

also if you want to use any bot tht requires dbl api, leave it blank? since its not required to run. only for posting bot information to the site... itll just give an unauth'd message i think

#

ok

#

looking good so far its running

placid kelp
#

Plis role

median badger
#

No

pastel bloom
#

how do i get the weekends

#

of webhooks

rapid kettle
#

<vote>.isWeekend

pastel bloom
#

@rapid kettle how can i set the vote thing im noob

#

;-;\

rapid kettle
#

itโ€™s the vote object given to you via the webhook

pastel bloom
#

how to set it

#

i dont know how webhook api works

rapid kettle
#

letโ€™s see your webhook code

pastel bloom
#

i dont have any webhook code

#

idk how it works

rapid kettle
#

ah

#

did you read the docs?

pastel bloom
#

uh no ig

rapid kettle
pastel bloom
#

ok

frozen lark
#

When I get votes for my bot I want him to send a message

rapid kettle
pastel bloom
#

ok

rapid kettle
#

When I get votes for my bot I want him to send a message
@frozen lark you need to setup vote webhook

pastel bloom
rapid kettle
#

/newbot

frozen lark
#

@frozen lark you need to setup vote webhook
Where do I find the webhook password

pastel bloom
#

ahh i see

rapid kettle
#

the webhook password is set by u

#

on the edit page

#

and in ur code

frozen lark
rapid kettle
#

no.

pastel bloom
#

web url

#

and github url?

thorny prism
#

Not required

#

Optional

calm stag
#

Plz night bot

rigid badger
#

how can I find out what rank my bot is the top rated bot with the dbl api?

uncut sundial
#

oh, how do i get my authorization thingy?

plush swallow
#

@uncut sundial Is that for bot or server votes?

uncut sundial
#

server votes

plush swallow
#

mhm

#

If you click Test Webhook does anything happen in your server?

#

You dont have to give it authorization afaik

uncut sundial
#

nope

#

k i think i did something wrong

#

where do i actually get the URL for webhook

#

cuz what i did

#

i went to a random testing channel and made a webhook bot thingy

#

then copied the url

#

and pasted

#

@plush swallow was i meant to do that?

plush swallow
#

I think so, yes. Never used server webhooks before. Only bot webhooks to catch votes I think this is wrong

#

Try clicking the Test Webhook-button a couple more times, with a few seconds delay inbetween each retry

#

For the bot webhook test it took a couple tries until it actually did something

#

It may also be that you need a specific bot which launches a webserver with a webhook URL, so that bot can receive data from top.gg and your bot processes it accordingly

thorny prism
#

My vote webhook not work

#

For bot

limber dawn
#

@thorny prism same here and noone is supporting

#

๐Ÿ˜”

#

ya

restive otter
#
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
dbl.getStats("Your bot client ID").then(stats => {
    stats.server_count; // returns a number
    stats.shard; // returns an array
});
#

@limber dawn

#

you can't get stats for DSL there is nothing about it on the docs page

limber dawn
#

it will send bot server and shards stats on top.gg

#

i want voters info in my server

jagged pine
#

I'm using this
const dbl = new DBL(apiToken, { webhookPort: 7000, webhookAuth: 'anyPassword' });

And in the webhook settings (the IP is my localhost)

#

Am I doing anything wrong?

#

When I test it it doesn't work

restive otter
#

@limber dawn by server do you mean a server listed on top.gg or your bot's support server?

limber dawn
#

When I test it it doesn't work
same here

jagged pine
limber dawn
#

@limber dawn by server do you mean a server listed on top.gg or your bot's support server?
@restive otter my bot iis in top.gg and i want the voter info in my server ... voters = those who voted my bot

restive otter
#

@limber dawn you can only get stats for a bot listed on top.gg. Your bot can take those stats and send them to your server's text channel.

#
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
dbl.getStats("Your bot client ID").then(stats => {
    // do smth with stats
    // Example: send them off to a server channel
    bot.channels.cache.get("X").send(stats);
});
limber dawn
#

ufff

#

we also can get voters info

jagged pine
#

code913 could you help me? Do you see anything wrong in what I did?

restive otter
#

one second

#
dbl.hasVoted("95579865788456960").then(voted => {
    if (voted) console.log("Tonkku has voted!!!")
});
#

yeah
one second
dbl.hasVoted("95579865788456960").then(voted => {
if (voted) console.log("Tonkku has voted!!!")
});

jagged pine
#

Seems like receiving webhooks on localhost doesn't really work

limber dawn
#

yeah
one second
dbl.hasVoted("95579865788456960").then(voted => {
if (voted) console.log("Tonkku has voted!!!")
});
@restive otter its for a specific user

restive otter
#

my internet is not functioning properly

tropic patrol
#

!play

tardy night
#

Hello, how can I start my authorization?

rapid kettle
#

what is 400 bad request

sullen nymph
#

Invalid request... body, iirc

rapid kettle
#

im using the official lib

#

might be outdated tho so i'll try an update

sullen nymph
#

ehhh... interesting

rapid kettle
#

its something on my side, idk what tho.

sullen nymph
#

What are you doing exactly?

rapid kettle
#

wait i figured it out

#

i was sending an object instead of a number

#

well that'll be why lmao

sullen nymph
#

๐Ÿ˜‚

rapid kettle
#

i only found out b'cus i attached my system webhook to it

sullen nymph
#

200iq

restive otter
#

how do I get my token

#

?

tardy night
#

how can I start my authorization? x3

rapid kettle
#

@tardy night wdym

restive otter
#

how do I get my token
?

#

my top .gg

#

token

rapid kettle
#

you cant

#

not when ur bot isnt approved tho

pastel bloom
#

can i edit my bots info on top.gg anytime?

rapid kettle
#

yes

scarlet river
#

is that bad? ip is 0.0.0.0

#

hosting on glitch

restive otter
#

can we get DBLAPI with fetch()

#

or only the node module

thorny prism
#

Why don't discord bot voting webhooks work?

rapid kettle
#

It doesn't post to a discord webhook

#

It posts to a webhook hosted by you.

thorny prism
rapid kettle
#

is your port forwarded (if localhost)

#

is the auth correct

#

is the IP correct

thorny prism
#

not localhost it vds

rapid kettle
#

ok

#

so is auth correct

thorny prism
#

Where will I do the auth?

vapid sapphire
#

@rapid kettle why is my webumhookum notum working?

#

I followed the docs

rapid kettle
#

whatum isum theum problemum

vapid sapphire
#

It's not logging on my vps no eventum

jagged pine
#

did you use the correct IP:port?

#

share your code

vapid sapphire
#
const DBL = require("dblapi.js");
const dbl = new DBL(token, {
   webhookPort: Port,
   webhookAuth: 'Password'
}, bot);

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

dbl.webhook.on('vote', async vote => {
   let votedUser = await bot.users.fetch(vote.user);
   console.log(` ${votedUser.tag} has voted for the bot!`);
})

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

what isn't working

#

does the webhook log running at https...

#

also it's http not https but that doesn't matter seen that it's just a console.log

#

are you running it on local host? @vapid sapphire

vapid sapphire
#

no its on a vps and it doesn't do anything

jagged pine
#

is the Port variable defined?

vapid sapphire
#

yes

jagged pine
#

ok

#

is your webhook URL like this on top.gg?
http://serverIP:port/dblwebhook

#

and does the webhookAuth match the password too?

vapid sapphire
#

yes

jagged pine
#

did you open the port in the firewall

#

if you are on linux you can do sudo ufw allow port

#

replace port with your port

vapid sapphire
#

if you are on linux you can do sudo ufw allow port
@jagged pine that did it thanks so much

jagged pine
#

Yeah I forgot to do that too sometimes

#

np

haughty palm
#

Can someone teach me how to use a bot? I'm new to discord

vapid sapphire
brisk vigil
#

Hey,i am using this code

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("mytokenhehe", { webhookAuth: 'mypasshehe', 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');
  });
``` but i do not know what the webhook url is any help?
willow spindle
#

https://server ip:port/dblwebhook

brisk vigil
#

what

muted eagle
#

Whats up?

brisk vigil
#

i didn't set an i[

#

ip*

muted eagle
#

hmm

brisk vigil
#

is it my pcs ip since its in my test bot

muted eagle
#

i think it is http://localhost:5000

willow spindle
#

top.gg can't send requests to your localhost weirdsip

brisk vigil
#

yeah

muted eagle
#

did u start it in the console @brisk vigil?

#

oh lol

brisk vigil
#

also look at my code

#

what do i do??

#

@willow spindle is it my pcs ip?

#

and whats server??

willow spindle
#

yes

muted eagle
#

u dont know whats server?

brisk vigil
#

what do i put insted of server?

#

No..

muted eagle
#

so u copied that code?

#

srsly?

#

ok

brisk vigil
#

what

#

server is my app

muted eagle
#

yas

#

lol

#

hmm

brisk vigil
#

witch is defined as express();

muted eagle
#

only thing i can think is

#

Contact

#

Support Team?

brisk vigil
#

uh

#

i am alr here lol

muted eagle
#

Idk dude, im sorry.

#

i am alr here lol
@brisk vigil gud lol

brisk vigil
#

OOPS

muted eagle
#

i saw it

brisk vigil
#

shi- i leaked my ip

muted eagle
#

no u didnt

brisk vigil
#

its fine vpn

#

yep

#

i did

muted eagle
#

but i could not see it

brisk vigil
#

i blured the top but

muted eagle
#

yeah

#

i did not see it in time

brisk vigil
#

the middle part

muted eagle
#

ohhh

brisk vigil
#

huh

muted eagle
#

yeahh

#

i saw a bit of it

#

5000?

#

nvm

brisk vigil
#

thats the port lol

muted eagle
#

ye ik

brisk vigil
#

wait no im dumb

#

its not even on

#

nvm same thing