#topgg-api

1 messages ยท Page 76 of 1

hollow raptor
#

token is correct?
or maybe hit ratelimit

restive otter
#

the token is ok

hollow raptor
#

Tonkku will help ...

arctic arch
#

it seems like your token is invalid

#

did you copy the whole token

restive otter
#

now it says cant read postStats

arctic arch
#

some people have issues seeing the whole token on the api docs page

hollow raptor
#

or try making new

restive otter
#

i generate a new own

#

one

hollow raptor
#

posted event will post stats

#

no need of postStats options

arctic arch
#

posted event isnt the one posting stats... it's an event that happens after stats have been posted

hollow raptor
#

oh... \๐Ÿ˜

restive otter
arctic arch
#

both

#

the module will handle it for you with the client in the constructor

restive otter
#

well now it says servercount is not defined

hollow raptor
restive otter
#

i did still says servercount is not defined

hollow raptor
#

define ....

restive otter
hollow raptor
#

line 1105

restive otter
#

console.log(posted ${serverCount} Count.)

#

rememeber u told me to add that

hollow raptor
#

${client.guilds.size}

restive otter
hollow raptor
#

just use

console.log('Server count posted!');

#

don't log count ...

restive otter
hollow raptor
#

. . . .

#

it says that because ur logging it

restive otter
#

so where should i make it log i dont know anything about this api thing never done it before

true talon
#

In the ready event

#

After console.log('Logged In as...')

#

@restive otter

hollow raptor
#

no..

true talon
#

Well

restive otter
#

this is getting on my nerves

true talon
#

Why no

restive otter
#

ive been on this 5 hours trying to figure this out alot of problems

hollow raptor
#

dbl is posting server count
but you problem with
consolw.log...

#

?

restive otter
#

u said i shouldnt log it

#

where should i log it then?

hollow raptor
#

you want to log once its done posting stats right?

restive otter
#

it only logs the post count not (Server count posted)

hollow raptor
#

change post count to "Server count posted"

restive otter
hollow raptor
#

don't log count lol

true talon
#

^

restive otter
#

console.log(Server count posted ${client.guilds.size}.)

#

thats what u told me earlier

true talon
#

U could just

#

console.log('Server count posted!')

hollow raptor
#

^

true talon
#

And that's it

restive otter
#

that part wont work with my bot

true talon
#

wdym

restive otter
#

it doesnt show console.log('Server count posted!')

true talon
#

Wait a sec, let's restart from the beggining

#

How do you define dbl

#

In your code

restive otter
#

well i use the code on the site

true talon
#

const dbl = new DBL('token', client)?

#

If yes

restive otter
#

yup i have my token in the code

true talon
#

and client at the end?

restive otter
#

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

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

dbl.on('error', e => {
console.log(Oops! ${e});
})
client.on('ready', () => {
setInterval(() => {
dbl(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
dbl.getStats("651003099636301834").then(stats => {
(stats) //{"server_count":2,"shards":[]}
});
console.log(Server count posted ${client.guilds.size}.)

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

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

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

thats my code had to remove my token so no one see it

true talon
#

Should be smth like that

#

Outside the ready event

#

Outside any event

hollow raptor
#

or main file

true talon
#

Just copy paste this in index.js

restive otter
#

its already in there

true talon
#

U don't need to put additional stuff in ready event

#

Delete it

restive otter
#

i didnt

true talon
#

U did

restive otter
#

i remove those earlier

true talon
#

Delete this part

restive otter
#

thats from my index.js

true talon
#

Yes

#

Delete this part of your ready event

#

The dbl part

restive otter
#

i did

#

what now?

true talon
#

Restart and see

#

Should work fine

restive otter
#

shouldnt i get something here?

true talon
#

Look at the website

#

No

#

Only when server count gets posted

#

Like every 3o min

#

30

restive otter
#

still n/a for my bot

true talon
#

Wait

#

And check if token is correct and valid

restive otter
#

yup token is valid

hollow raptor
restive otter
#

i have it

hollow raptor
#

....

restive otter
#

look at the top

true talon
#

Well wait

#

Til it get posted

restive otter
#

@true talon like an 1 hour?

true talon
#

Yep

#

Do smth else

#

While waitinf

restive otter
#

alright if it works ill let u know

arctic arch
#

what the heck is going on

#

does nobody helping know how to use the damn module

#

stop helping if you have 0 idea of whats going on

#

you're all going back and forth with where you're taking this guy

#

REMOVE THE MANUAL POSTSTATS FUNCTION AND THE INTERVAL IF YOU PASS YOUR CLIENT TO THE CONSTRUCTOR OR YOU'LL CONFUSE THE FUCK OUT OF YOURSELF AND EVERYONE ELSE WHILE ALSO POSTING YOUR STATS TWICE FOR NO REASON

#

if everything was done correctly the module will automatically post stats when the bot is ready

#

no need to wait

fiery shadow
#

Tonkku goes wild

#

no cap

arctic arch
#

@restive otter are you sure you've passed in the client of your bot that's actually running instead of creating a new client

restive otter
#

yh

arctic arch
#

send your whole index.js

restive otter
#

ok give me a sec

#

@arctic arch it says the characters are too big to send

hollow raptor
#

remove token in file

restive otter
#

ill generate a new one

arctic arch
#

your bot client is named

#

bot

#

and you're creating a new client which doesnt even connect

#

literally two lines above you're creating a new client

restive otter
#

oh

#

what if i do bot then?

hollow raptor
harsh stream
#

You just posted your dbl token

restive otter
#

read the top

harsh stream
#

Still it's bad practice to post secret tokens, some day you will do it accidentally

restive otter
#

nah

#

got it working now

tawdry spindle
#

oof right

#

why doesn't it say it's deprecated in docs

#

smh

restive otter
#

ask lincoln

restive otter
#

XD

#

This is fun reading

#

Someone knows how to get a log when someone votes your bot with dbl api?

#

I can't get it to work.

knotty garnet
#

create a webserver and hook it in the webhook field in bot config

#

whenever someone votes it'll send a request to that webhook mentioned

true talon
#

Apparently shouldnt

#

Webhook running at http://0.0.0.0:5000/dblwebhook in logs

narrow geyser
#

port is forwarded

knotty garnet
#

Is that heroku?

true talon
#

Nope

#

This is a contabo vps

knotty garnet
#

Are you using nginx?

true talon
#

ask to @narrow geyser

knotty garnet
#

To fuck me?

#

Lol

true talon
#

no

knotty garnet
#

Ik, just kidding

#

Go to your vps

#

Write cd /etc

#

See if there's a nginx folder there

true talon
#

there is one

knotty garnet
#

Ok, cd into it

#

Then cd into config.d folder

#

What's inside?

true talon
#

conf.d?

#

nothing

knotty garnet
#

Ok

#

You'll have to create a proxy to allow your vps to be found in the internet

#

Brb, I'll get you the file model

true talon
#

k

narrow geyser
#

@knotty garnet Please do not spread bullshit. nginx is not needed.

worn quail
#

I dont think a vps requires that

narrow geyser
#

yeah it doesnt

worn quail
#

I dont care enough about vote locking commands to set it up, but I doubt webservers require that.

#

Besides, discord essentially is just one big webserver.

knotty garnet
#

nginx is already installed there, it'll block incoming request attempts to webhooks

#

also, you don't need to be a d**k just because I offered help

#

I'm currently using webhooks actively on my bot, that's why I pointed to that

restive otter
#

So if I do this would it be ok?

dblsetup(bot)
print('Started top.gg webhook')


bot.run("************************")```
#

@sullen nymph it still doesnt work, rewards are now being given twice..

#

My bot is an AutoShardedClient, could that be why?

left egret
#

In how many guilds is your bot rn?

restive otter
#

450

left egret
#

AutoSharding is unneeded then

#

but shouldn't be the reason of this issue

restive otter
#

hm

#

any ideas as to what's causing the issue?

#

wait don't worry

#

ive fixed it

#

thanks for the help :)

left egret
#

@restive otter What was the issue?

restive otter
#

I kinda forgot to turn on the Atom FTP before saving so it didn't upload to the GCloud VM ๐Ÿ˜…

#

Completely my fault :P

left egret
#

Ah lol

restive otter
#

I feel like that gif was needed

left egret
#

it's fine :^)

frigid shore
#

hi

#

how can i use port 3000 for dbl webhook if it's used?

vapid cape
#

add your existing webserver to dbl instead of port

#

webhookServer: server/listener

frigid shore
#

ok

vapid cape
#

you dont need that if you're using dblapi.js

#

unless you wanna manually process the webhook

frigid shore
vapid cape
#

you didnt define the webhook options

frigid shore
vapid cape
#

then you did something wrong

#

show code

frigid shore
vapid cape
#

hmm weird, did you save the code before running?

frigid shore
#

yes

vapid cape
#

do you need express for anything?

frigid shore
#

no

vapid cape
#

then try without it

#

use the webhook example with port instead

#
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!`);
});```
frigid shore
#

but i need port 3000

vapid cape
#

just change the port number

frigid shore
#

but its only port 3000 available on glitch

vapid cape
#

yes, just change it

#

webhookPort: process.env.PORT

#

its more accurate than 3000

frigid shore
#

yes, but my bot is in port 3000

#

and i want to add roles to voted people with bot

#

but port 3000 is unavailable :(

vapid cape
#

why is port 3000 unavailable?

frigid shore
#

because bot using it

#

o, port 5000 is working!!

vapid cape
#

5000 will not work on glitch

#

you will never receive anything

#

and you told me you dont need express, then how are you using port 3000?

frigid shore
#

but... port 5000 is working..

#

WHAT

vapid cape
#

did you receive a vote in it?

frigid shore
vapid cape
#

that makes no sense lol

frigid shore
#

WTF

#

5000 never worked

#

glitch opened port 5000?

#

๐Ÿค”

vapid cape
#

are you sure you dont have another dblapi code somewhere in one of your files?

frigid shore
#

yes..

#

ok

vapid cape
#

well if it works it works lol, but if you want i can take a look at your project code

frigid shore
#
const DBL = require('dblapi.js');
const dbl = new DBL('token', { 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!`);
});
vapid cape
#

i mean your full glitch project

#

i g2g for 15min

frigid shore
#

its full..

#

without bot

#

but in bot's project nothing works.

restive otter
#

Dbl is throwing me emitter mem leaks

#

Anyone have that issue

vapid cape
#

not really

#

show code

restive otter
#

I will later when I'm off my phone

hollow raptor
#
// Main File ie index.js

// npm install dblapi.js

const Discord = require("discord.js");
const client = new Discord.Client();

const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);

const port = 5000; // Glitch 3000

const DBL = require("dblapi.js");
const dbl = new DBL("top.gg_token", {
  statsInterval: 1800000, // milliseconds - Default 30 minutes | May not be smaller than 15 minutes
  webhookPort: port,
  webhookAuth: 'password',
  webhookPath: '/dblwebhook',
  webhookServer: server
}, client);

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

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

// Optional
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(port, () => {
  console.log(`Listening to ${port}`);
});
#

just example keep if good or delete \๐Ÿ˜

true talon
#

My DBL webhook works just fine, but server count isn't posted

#
const DBL = require("dblapi.js");
const dbl = new DBL(client.dbl_token, { webhookPort: process.env.PORT, webhookAuth: 'my password' })
#
dbl.webhook.on('posted', () => {
  console.log('Server count posted!');
})

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

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

dbl.webhook.on('vote', vote => {
  user = client.users.cache.get(vote.user)
  client.channels.cache.get('685971547315240969').send(new Discord.MessageEmbed().setColor('RANDOM').setThumbnail(user.avatarURL({ format: 'png', dynamic: true, size: 2048 })).setDescription(`Thanks you for voting <@${userid}>! `))
});
hollow raptor
#

any error |
not updating count on bot page

true talon
#

No error

#

Jusy not updating server count

#

Wait

#

Just checked logs

#

Full of 429s

hollow raptor
#

too many requests

true talon
#

Bruh

hollow raptor
#

d.js master?

true talon
#

V12.0.2

hollow raptor
#

yes, it's a bug by d.js

true talon
#

Oof

#

So let's go back to djs v12.0.0

hollow raptor
#

stop running bot

#

go back to stable

arctic arch
true talon
vapid cape
#

404 not found

true talon
vapid cape
#

they are two separate things

true talon
#

using same lib

#

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

vapid cape
#

still separate things

true talon
#

yea

vapid cape
#

show code?

true talon
#

k

#

or im wrong

#

or after wehbhook settings

#

according to dblapi.js, after

#

lets try

vapid cape
#

if you didnt add the client at all, there should never be any attempt at sending, let alone 404s lol

true talon
#

now lets wait for dblapi to post server count

#

*with heroku I've never added client but posting worked as normal

arctic arch
#

theres no waiting

vapid cape
#

if you used postStats, yeah

#

but if you dont use either postStats, nor add the client to it, then it should never attempt to post anything

#

now sure how you got that 404 lol

true talon
#

wdym by no waiting tonkku

#

updated

vapid cape
#

the autoposter posts every 30 minutes by default, including minute 0

arctic arch
#

the module has other functions

#

like getting bot stuff

#

you could get a 404 with an invalid id

sullen nymph
toxic niche
#

Just saw that sorry

harsh stream
thorny parrot
#

Constantly getting Unhandled rejection at: Promise [object Promise] reason: Error: postStats requires 1 argument

#

js library

#
dbl.postStats(stats.guilds != null ? stats.guilds : 200000, null, totalShards);```
hollow raptor
#

stats.guilds

#

how it's defined or what is that

#

why ur passing null/

sullen nymph
#

ternary operator

hollow raptor
#

3 parameter types are numbers

thorny parrot
#

It worked fine before when I had this:

dbl.postStats(stats.guilds, null, totalShards);
#

I thought maybe adding the if/else would fix it so /s

#

let stats = (await pool.query("SELECT * FROM stats WHERE index=1")).rows[0].botstats;

arctic arch
#

why are you getting your stats from a database

thorny parrot
#

Because that's where the stats are posted to by each cluster.

Trying something new.

gaunt umbra
#

Are there rules for the API ?

green mantle
#

yes

#

dont spam it

#

dont post a fake guild count

#

use webhooks if your bot gets >1000 votes a month

gaunt umbra
#

I shouldn't use webhooks if my bot gets less than 1k vote ?

#

๐Ÿค”

vapid cape
#

sure you can

#

webhooks can be used whenever you want, getting votes using other methods is what stops working if you have more than 1000

green mantle
#

if you implement webhooks from the start you dont have to worry about it later on

gaunt umbra
#

Ok nice

harsh stream
#

No more than 60 requests per minute

#

And also what CF8 and Tim said ^

gaunt umbra
#

The rate isn't a problem, I'm not requesting the api

#

Excepet for stat update every 2 hours

nova summit
#

Could somebody help me with dblapi webhooks?

true talon
#

Yes, me

#

What lib

#

js, py...? @nova summit

nova summit
#

js

true talon
#

Ok

#

What you need

nova summit
#

The problem is, I want to use port 3000 for my webhook , which I use for https data with express

true talon
#

U use glitch?

nova summit
#

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

#

Lol yes

true talon
#

Port will be process.env.PORT

nova summit
#

Ik, that port is usually 3000, but I cannot have express and dblapi use it at the same time

true talon
#

Try it and sdd

#

See

nova summit
#

Ok

arctic arch
true talon
#

@nova summit

nova summit
#

I tried that

true talon
#

server.listen(300

#

Lol

nova summit
#

Do I need the app.get part?

#

Or is that extra

true talon
#

Recommended

arctic arch
#

app.get is an example for the rest of your webserver

nova summit
#

Okay ty

#

Also, do I have to use server.listen, or could I use app.listen

true talon
#

Look how server is defined

#

And do the same

nova summit
#

Okay lol, I think it works

worn quail
#

oh my god

#

yea, the API examples are something you should in general follow

golden osprey
#

hell

restive otter
#

How do you get a top.gg bot token?

#

api token*

#

oh

restive otter
#

How do you vote restrict a command?

cerulean monolith
#

@restive otter Maybe log the vote in a database with a data and when the user uses the command running by the database?

#

Not sure

#

What should be in URL bar?

#

In Webhook Title?

#

In API options

cerulean monolith
#

.

true talon
#

Dotpost

steel hawk
#
module.exports.startUp = async (client) => {
  const dbl = new DBL(post["topGG"]["token"], { webhookPort: 5000, webhookAuth: post["topGG"]["password"] });

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

  dbl.webhook.on("vote", async (voter) => {
    console.log("voted");
  });
};```
#

The ready event works

#

But the vote event doesn't

#

Not sure why

true talon
#

webhookAuth

steel hawk
#

Can you elaborate a bit more?

#

What am I supposed to understand from webhookAuth

willow spindle
#

webhookAuth is your own choice

#

like password

#

you can set it from website

steel hawk
#

I know..

#

I'm asking why the vote webhook is not working

#

smh

steel hawk
#

Nvm got it to work

steel hawk
#

I keep getting this error:
Error: listen EADDRINUSE: address already in use :::3848

#

I've tried 10 different ports now

true talon
#

or what

steel hawk
#

What?

#

I use a VPS

true talon
#

hl

#

hmm

#

try using the port 65334

vapid cape
#

@steel hawk are you sure you're not trying to use the same port twice?

#

ie: every new port you try, you're always using it twice, thats why it always says its already in use

steel hawk
#

so the ports have to be different?

vapid cape
#

what are you trying to do?

#

you cannot use the same port more than once

steel hawk
#

I am trying to check if someone has voted or not

vapid cape
#

but if you have an existing webserver, and you want to use dbl webhooks, you can attach it to the existing server

steel hawk
#

my webhook.on event and hasvoted event use the same port

vapid cape
#

hasvoted is not an event

#

show your code

steel hawk
#
        const dbl = new DBL(dblToken, { webhookPort: 65335, webhookAuth: dblPassword }, this.client);
        dbl.hasVoted(message.author.id).then(voted => {
            if(!voted){
              const embed = new Discord.MessageEmbed()
              .setDescription(`Enjoying the bot? Vote for it here (it only takes a few seconds!): https://top.gg/bot/685159987638435861`)
              .setFooter(`Voting will remove this message.`)
              .setColor(colors.main)
              message.channel.send(embed);
            }
        });```
#

This is in my ready event:

                    const dbl = new DBL(dblToken, { webhookPort: 65334, webhookAuth: dblPassword }, client);

                    dbl.webhook.on("ready", async (hook) => {
                      console.log(`Top.gg webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
                    });```
vapid cape
#

why are you creating dbl twice?

steel hawk
#

two different files

vapid cape
#

still no need to create it twice

steel hawk
#

ok

#

is that whats causing the error tho

vapid cape
#

yes

#

also, hasVoted doesnt need a webhook, its a rest method

#

just create dbl once and then attach it somewhere you can access from all files

#

such as client

#

client.dbl = new DBL(...)

steel hawk
#

Still displays the error...

vapid cape
#

are you still running something else it the same port?

signal hawk
#

is port 5000 the one recommended to use? how do i know if thats open on my vps?

restive otter
#

ping it

signal hawk
#

ping (myip):5000 in commandline?

restive otter
#

should work afaik

signal hawk
#

ping request could not find host

#

so that means its not open?

restive otter
#

could not find host should mean that the ip is invalid

#

i can check it if you want if you wanted to dm me your ip

signal hawk
#

ill try to figure it out

restive otter
#

oki

signal hawk
#

im assuming that means i need to enable those thigns to be able to use them

restive otter
#

ye

signal hawk
#

okay gotta figure out how to do that

restive otter
#

you might be able to do it from within linux

signal hawk
#

i ssh into it from my computer to upload the files so idk why it has a red x next to ssh

restive otter
#

hm

signal hawk
#

if i dont put the port i can ping the vps but if i put the port then i can't ping it

restive otter
#

OH

#

cuz

#

pretty sure

#

ping does

#

ping ip -p port

#

or

#

wait no

#

hold on

#

ping doesnt support ports

signal hawk
#

ah okay, so gotta find a different way to find if the port is open

restive otter
#

are you pinging it from a linux or windows machine?

signal hawk
#

i was trying to ping the linux vps from a windows machine

restive otter
#

do you have telnet

#

or

#

actually

#

open powershell

#

and do

#
Test-NetConnection <ip_address> -p <port_number>
signal hawk
#

tcp connect failed

restive otter
#

try it with port 22

#

or 21

#

to see if the command works

#

(those are the ssh ports)

signal hawk
#

21 also failed

#

22 worked

restive otter
#

ok

#

so yea

#

not open

#

(21 is used for sftp file transfer sometimes)

signal hawk
#

so i cant use 5000 so i gotta find a different port to run the webhook on?

restive otter
#

just open it

signal hawk
#

oh how do i do that

restive otter
#

send output of sudo ufw status verbose

signal hawk
#

i guess i can google it lol

#

inactive

restive otter
#

do sudo ufw enable

#

and sudo ufw allow 5000/tcp

signal hawk
#

error: bad port

restive otter
#

^

#

i corrected

signal hawk
#

ah

#

okay it says rule added

restive otter
#

now ping it

signal hawk
#

it still says tcp connect failed

restive otter
#

hmm

signal hawk
#

from powershell

restive otter
#

sudo ufw allow 5000

#

should open all traffic

signal hawk
#

still says failed

restive otter
#

and should show up on sudo ufw status verbose

signal hawk
#

should i restart the vps?

restive otter
#

i'd just restart networking

signal hawk
#

To Action From


5000/tcp ALLOW IN Anywhere
5000 ALLOW IN Anywhere
5000/tcp (v6) ALLOW IN Anywhere (v6)
5000 (v6) ALLOW IN Anywhere (v6)

#

thats what the status says lol

restive otter
#

sudo service network-manager restart

#

(avoids a full reboot)

signal hawk
#

it says that service isnt found

restive otter
#

what distro is that

signal hawk
#

ubuntu

restive otter
#

cat /etc/issue

signal hawk
#

ubuntu 18.04.3

restive otter
#

hm

signal hawk
#

this is a lot more complicated than i thought it would be

restive otter
#

try rebooting

#

cuz that should have opened the firewall

#

(it also could be the fact that nothing is actually listening on the port)

signal hawk
#

i have the stuff set up on the top.gg website and in my index file

restive otter
#

well when your bot starts, do netstat -tulpn | grep LISTEN

signal hawk
#

its not wanting to let me ssh back into it, and the control panel says its restarted

#

i hope i didnt break it lol

signal hawk
#

thanks

#

alrighty it says its configured to allow all tcp traffic to port 22 but still wont let me shh in

restive otter
#

does ovh have a cloud console?

signal hawk
#

not as far as i can see

#

i wish they did at this point lol

#

i can ping it so i know its online lol

restive otter
#

hm

#

does your bot have an eval command by any chance

#

(is it online?)

signal hawk
#

the bot's not online

#

cause pm2 didnt restart

restive otter
#

seems odd that there isnt a web console

signal hawk
#

lemme look

left egret
#

@quartz quest no

severe quiver
#

Is there a way to find out who has voted in the past?

#

Nvm found it

safe harbor
#

hi, i maded a basic command checks if user is voted, if user is voted gives user to a point. But i want to let user use command just one time. Until other day. How can i do it?

severe quiver
#

You could add their user id to a database when they use the command and remove it when they vote

#

Then just check that their id isn't in the database when they try to use the command

#

Obviously you could have their id be added when they vote and removed when they use the command

#

Works either way

safe harbor
#

ty i will try.

bleak ledge
#

I had accidentally posted this in the wrong channel before, but
I assume that the Java DBL wrapper does not support webhooks, unlike the js one?

knotty garnet
#

@bleak ledge in java you can setup springboot to make a webhook listener

#

Also make apis, but thats another history

bleak ledge
#

K, I might do that
I'd prefer to do it with direct TCP, more used to that

#

Thanks

knotty garnet
#

Springboot is quite straightforward, you just need to set a few annotations here and there and call it a day

lost flower
#

Why's voter.discriminator returning null by using .GetVotersAsync() in C# authorised API?

knotty garnet
#

GetVotersAsync returns an array, are you treating it correctly?

lost flower
#

Yes, using foreach. You can see from the debug info that all other properties are defined.

#

I just used discord websocket client .GetUser(id) anyways to get their discrim

signal hawk
#

If i am using a webhook, to post my stats, would i need to do dbl.postStats or dbl.webhook.postStats

restive otter
#

wrong channel

#

how do i use dbl.webhook

#

js btw

#

because like uh

#

its undefined

#
const DBL = require("dblapi.js");
const dbl = new DBL(config.dbltoken); 
dbl.webhook.on('vote', vote => { });```
#

the code errors there

#

sec

#

cannot read property 'on' of undefined

#

yes thats how mine ssetup

#

i left the webhook object out when i sent code

#

yup

signal hawk
#

I get my ready event to post the webhook running at (path) but i can't get anything to happen when i test the vote feature, it doesn't console.log the (user has voted) part

#

idk what i've messed up

#

const DBL = require(`dblapi.js`);
const dbl = new DBL(config.topggtoken, { webhookPort: 5000, webhookAuth: config.topggpass});

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

dbl.webhook.on(`vote`, vote => {
    console.log(`${vote} received`);
 }); //THIS DOESNT```
vapid cape
#

@signal hawk what did you put in the URL field in top.gg?

restive otter
#

got it to launch! what do i put in the url section of the Webhook?

vapid cape
#

where is your bot hosted?

restive otter
#

locally

vapid cape
#

then the URL should be YOUR.PUBLIC.IP.ADDRESS:PORT/dblwebhook

#

you might need to open ports in your router

restive otter
#

ahhhhhhhh

signal hawk
#

@vapid cape I put the http://(ip of my vps):5000

#

I allowed traffic on port 5000 from the vps firewall settings

vapid cape
#

did you put /dblwebhook after port?

signal hawk
#

No, I thought that was the default

#

I'll try that

#

i get this: Webhook running at http://0.0.0.0:5000/dblwebhook but when i try to test a vote it doesn't send anything

vapid cape
#

and the url is YOUR.VPS.IP.ADDRESS:5000/dblwebhook right?

signal hawk
#

the url on the bot page is that, yes

vapid cape
#

and the Authentication in the bot page, is it exactly the same as the value in config.topggpass?

signal hawk
#

should it have the http:// in front of it? cause i have that

#

yeah the passwords the same

vapid cape
#

did you save the top.gg URL before testing?

signal hawk
#

yeah it shows "saved" under the test button

#

oh hold on im getting an error in console

#

its working now, i must not have saved it ๐Ÿคฆโ€โ™‚๏ธ sorry

vapid cape
#

๐Ÿ‘

frigid shore
#

hi

#

how to see vote count with JS library?

#

pls help

dense basalt
#

What do you mean with vote count?

true talon
#

Vote count in dbl bot info @frigid shore?

#

Or something else

frigid shore
#

number of votes in my bot

#

because i have 31 votes

#

but code:

#
dbl.getVotes().then(votes => console.log(votes.length)
#

print 22

placid peak
#

it takes time to update in api

frigid shore
#

:(

true talon
#

This returns monthly votes

#

Not all time votes

frigid shore
#

monthly 31 votes

true talon
#

Hm

frigid shore
mighty shuttle
#

I use this method and it works

frigid shore
#

hmm

#

@ripe crow

frigid shore
#

i can use await

#

but....

#

.then must also wait

mighty shuttle
#

I suggest you use the getBot() method

frigid shore
#

and bot.votes?

arctic arch
#

bot.monthlyPoints

#

bot.points

frigid shore
#

tks

mighty shuttle
frigid shore
mighty shuttle
#

You need to use your DBL token when making requests

frigid shore
#

i use..

mighty shuttle
#

Try again and make sure your token is correct?

frigid shore
#

without code

let b = await dbl.getBot('659831331169239060')

all works

#

but with it..

#

pls help

#

why

#

with this code

#

prints that unauthorised

arctic arch
#

do you have the token in the constructor

frigid shore
#

yes

#

without this code

#

all works

#

but with is - no

fluid river
#

Hey guys, I am using your npm module for posting my bot's srver count, recenly moved to v12 and couldn't post the bot's server count and I get an eror now.

#

Oops! Error: 400 Bad Request

manic basin
#

I wanted to get a acces token but it showed that I havent have any bots

vapid cape
#

@fluid river did you install the latest dblapi.js? if not, update it

#

@manic basin your bot needs to be approved first

fluid river
#

Ok. Thx

solid dune
#

@vapid capei think new discord.js is weird

#

Why we should check our embeds

#

Or messages

manic basin
#

Where do I get the Acces token?

vapid cape
restive otter
#

a

topaz verge
#

how can i make if user vote for my bot send message with webhook

true talon
#

u cant

topaz verge
#

oke with bot

#

@true talon

true talon
#

?

topaz verge
#

oke thanks

vapid cape
#

wdym you cant?

#

you can

true talon
#

he says "without webhooks" first

vapid cape
#

oh

#

well technically you still can, but its terribly inefficient and will have a lot of delay lmao

restive otter
#

What is this problem

median badger
#

discord is down

restive otter
#

Oooo

left egret
green comet
#

can anyone help me out with this 400 error? thanks

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

dbl.on('posted', () => {
    console.log('Server count posted!');
  })
dbl.on('error', e => {
   console.log(`Oops! ${e}`);
  })
vapid cape
#

whats your discord.js version?

green comet
#

12.0.2

vale sonnet
#

12.0.2

#

stable

vapid cape
#

update your dblapi.js

vale sonnet
#

okay

vapid cape
#

and no need to use postStats

vale sonnet
#

?

vapid cape
#

if you have new DBL(token, -> client <-)

#

it does it automatically

vale sonnet
#

ah

#

i see

craggy anchor
#

can anyone guide me through with the webhook process to retrieve user from dbl api

frank pollen
#

Does somebody know how to add server count to your bot on top.gg?

#

Hello?

jaunty fog
#

Can someone help? My webhook is not working. But last time i tried to vote it worked

slender kelp
#

where do I get an api key

true talon
#

you need to have a approved bot to get it

craggy anchor
#

how come my the dbl token seems to change every time I refresh the page 0.o

true talon
#

it shouldnt

craggy anchor
#

think its buggy, when I click refresh on the token, it regenerates a new one, but if u refresh the page I guess it somehow just keeps regenerating a new one till u exit the page and come back

#

works fine if I exit the page and come back instead of refreshing

vapid cape
#

show full code

craggy anchor
#

ugh wrong channel sry

#

the url I put is this: ip_address:5000/dblwebhook

#

website

knotty garnet
#

@stiff orbit is your counter inside an "onReady" event?

willow ruin
#

Bot got errors since there are no 'Authorization' header in webhooks. Was API changed or there are some problems atm?

knotty garnet
#

hmmm, have you setup the authorization header in the bot's page?

knotty garnet
#

there will be no authorization header if you haven't set one

#

@stiff orbit in your case, have you put the guild count uploader inside an onReady event?

#

like, it'll not send any stats if your bot isn't ready yet

#

where is the counter located?

#

ok, but it has to be somewhere

#

like, just putting it in a file will not make it run

#

could you show the code?

#

but where?

lament sigil
#

The used API for this Command returned an Error, please try again later.

knotty garnet
#

like, it depends on WHERE the method call is located

lament sigil
#

anyone can help me ?

knotty garnet
#

you can't just "place" it in the code

#

The used API for this Command returned an Error, please try again later.
@lament sigil for what command?

lament sigil
#

X!rule34 bot's Senpai

knotty garnet
#

X!rule34 bot's Senpai
@lament sigil are you sure you're in the right server?

lament sigil
#

in general all of commands nsfw

knotty garnet
#

-wrongserver @lament sigil

lament sigil
#

you know something information that can help me ?

knotty garnet
#

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry ๐Ÿ˜ฆ

lament sigil
#

ok thanks

knotty garnet
#

i was thinking its easy just put the code and the token and it will works
@stiff orbit the code you use to upload the server count is called a method (or function), it HAS to be called somewhere within the code execution

#

depending on where you've put it it might not work at all

#

could you show us your code?

willow ruin
#

@knotty garnet yes. it worked fine for a long time

knotty garnet
#

@knotty garnet yes. it worked fine for a long time
@willow ruin what message are you answering?

cosmic hornet
#

Hey can any one help

#

Fot

#

Me

#

dbl has no attribute client

sullen nymph
#

If you could at least specify your library or programming language

cosmic hornet
#

Sir

#

I am using pydroid

#

Help me

#

@sullen nymph

sullen nymph
#

Did you at least visit the dblpy docs

cosmic hornet
#

Ya

#

Sir

sullen nymph
#

What's your dblpy version

cosmic hornet
#

0.3.4

#

Sir

#

@sullen nymph

sullen nymph
#

Do I need to explain further

cosmic hornet
#

Ha sir

#

Can u explain correctly

#

Sir

sullen nymph
#

There's no Client class in module dbl

#

And I am literally linking the class that you need

jaunty fog
#

Can someone help me how to set up the webhook properly?

willow ruin
#

Bot got errors since there are no 'Authorization' header in webhooks. Was API changed or there are some problems atm?

hmmm, have you setup the authorization header in the bot's page?

yes. it worked fine for a long time

@knotty garnet Got a few similar errors again...

knotty garnet
#

could you show us your error?

willow ruin
#
  File "C:\Python36\lib\site-packages\aiohttp\web_protocol.py", line 418, in start
    resp = await task
  File "C:\Python36\lib\site-packages\aiohttp\web_app.py", line 458, in _handle
    resp = await handler(request)
  File "C:\Python36\_Scripts\Bot\bot.py", line 1729, in post_handler
    if request.headers['Authorization'] != DBL_VOTE_AUTH:
  File "multidict\_multidict.pyx", line 62, in multidict._multidict._Base.__getitem__
  File "multidict\_multidict.pyx", line 57, in multidict._multidict._Base._getone
  File "multidict\_multidict.pyx", line 52, in multidict._multidict._Base._getone
KeyError: 'Authorization'```
sullen nymph
#

use .get or handle KeyError

willow ruin
#

Sometimes it's all ok, sometimes got errors

broken marlin
#

!play Sevimli dostlar

willow ruin
#

@sullen nymph it doesn't solve the problem

#

I need that authorization header

sullen nymph
#

Do you have Authorization set to anything on top.gg Think

willow ruin
#

And it worked fine long time before

#

Yes, of course

sullen nymph
#

Are you sure the request is coming from top.gg

willow ruin
#

yes

wet pebble
#

!!yardฤฑm

copper rune
#

yo

wintry kernel
#

Am I able to get help with one of the dbl wrappers here?

sullen nymph
#

Yup

lament frost
#

s

cosmic hornet
#

@shivaco#0001

#

@sullen nymph

#

Can u give example

#

Of python working

#

Of dbl api

sullen nymph
#

What issue are you having

cosmic hornet
#

Sir same issue

#

dbl has no attribute client

sullen nymph
#

I thought I linked the proper docs?

cosmic hornet
#

I couldn't understood the docs yesterday

visual grotto
#

how i can invite my bot here?

sullen nymph
#

Wrong channel to ask

visual grotto
#

;-;

sullen nymph
visual grotto
#

where i should ask?

sullen nymph
visual grotto
#

ok

sullen nymph
#

I don't see dbl.Client anywhere

cosmic hornet
#

Wait I will show sir

sullen nymph
#

I'll wait for another traceback of the same issue

#

even though it's not needed

cosmic hornet
#

@sullen nymph

sullen nymph
#

Why did you name your file dbl

cosmic hornet
#

That is the problem

#

Sir

green mantle
#

yes

cosmic hornet
#

Name dbl

sullen nymph
#

yes

green mantle
#

you are litterally just overriding the module name with your own file

cosmic hornet
#

Wait sir

#

I will retry

#

Sir name was not a problem

#

Same error

#

@sullen nymph

sullen nymph
#

Do you have any folders named dbl

cosmic hornet
#

Ya sir

orchid sundial
#

shivaco hi need a little help when you're done

sullen nymph
#

Well yes that's the issue, Marshmellow

#

LeJon just state your issue

orchid sundial
#

I remember I had this exact problem a while back where my console would show the request but my on_vote_test event wouldn't fire and we solved it by setting my webhook_auth to None, it's been the same ever since but I'm getting the problem again [18/Mar/2020:10:01:53 +0000] "POST /a21votes HTTP/1.1" 401 178 "-" "DBL"

#

Only thing that's changed is I recently moved bot hosts

#

And I checked the ports they're fine

sullen nymph
#

Oh

green mantle
#

401 is denied no?

sullen nymph
#

@arctic arch Does top.gg send Authorization header for webhooks even when the field has no value set on top.gg?

#

cf8 hold it

#

dblpy responds with 401 whenever auth isn't the same

arctic arch
#

I don't think empty header values are even valid for HTTP

orchid sundial
#

I tried setting an authorization on both sides, still the same behavior

sullen nymph
#

Yeah that might be the issue then

arctic arch
#

so I think it should be empty

cosmic hornet
#

Sir thanks problem solved @sullen nymph

sullen nymph
#

Congratulations me

orchid sundial
#

Well that's the conclusion we came to last time though?

#

And it still worked after I set the auth to None

sullen nymph
#

I'm not sure how I didn't get to fix it then ๐Ÿคฃ

#

Not exactly sure what's happening rn

green mantle
#

cant you just do is not None or is None

orchid sundial
#

Or maybe you did fix it but since I recently re-installed dblpy my old fix got yeeted?

sullen nymph
#

I highly doubt I remember telling you to change the internal code

orchid sundial
#

I meant the solution you gave me of setting the webhook_auth to None

#

Could be that just doesn't work anymore

sullen nymph
#

Yeah, that'd make sense

#

But it doesn't make sense because it's returning 401 when you're comparing None == None special_think

#

ig I'll make both empty strings and push that later today and see if it does the job

#

but I ofc can't test anything I do currently

green mantle
#

if (self.webhook_auth == req_auth) if self.webhook_auth is not None else True: :P

sullen nymph
#

Yeah nah thanks I want the module code to be readable

#

:^)

green mantle
#

tho that belongs in #development and idek if python would accept that

sullen nymph
#

condition = (self.webhook_auth == req_auth) if self_webhook_auth else True

orchid sundial
#

Still not sure if that's the actual problem though cause even when I do set an authorization I still get a 401

green mantle
#

did you save it

orchid sundial
#

Yes

#

Saved, restarted bot, tested

sullen nymph
#

Try not giving any webhook_auth to the client

orchid sundial
#

No changes

#

ok just worked

#

webhook_auth="DBL" then bot restart seems to have done it

sullen nymph
#

So both None and '' don't work?

orchid sundial
#

Yeah those didn't give me any responses

sullen nymph
#

if you have the auth field on the website empty

orchid sundial
#

Yes

sullen nymph
#

That's fun

#

I'll look into it later, thanks

orchid sundial
#

and thank you for giving the masses of kids wanting vote rewards some peace of mind lol

sullen nymph
fiery shadow
#

๐Ÿ‘€

cosmic hornet
#

@sullen nymph

#

See

#

Sir

sullen nymph
#

That seems to be an error in your code

grave sundial
#

im having difficulty understanding the webhook on my bot's page, i get a warning that it's designed for my bot that it doesn't post messages to channels, its for my bot only. i put in a webhook link that goes to a channel in my server, is that not correct?

cosmic hornet
#

import dbl import discord from discord.ext import commands, tasks import asyncio import logging 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) # The decorator below will work only on discord.py 1.1.0+ # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats()) @tasks.loop(minutes=30.0) async def update_stats(self): """This function runs every 30 minutes to automatically update your server count""" logger.info('Attempting to post server count') try: await self.dblpy.post_guild_count() logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) except Exception as e: logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e)) # if you are not using the tasks extension, put the line below await asyncio.sleep(1800) def setup(bot): global logger logger = logging.getLogger('bot') bot.add_cog(TopGG(bot))

#

@sullen nymph

#

Bro I am using this

#

Code

sullen nymph
#

Uhhghuugv

green mantle
#
  1. Have you heard of indentation
sullen nymph
#

I'm not sure how to read this

green mantle
#
  1. the error wasnt about that code
sullen nymph
#

That's probably just the way it was copied

green mantle
#

Your error was from the on_member_remove() event not dbl

cosmic hornet
sullen nymph
#

Learn to read stacktrace

simple knot
#

Is it okay to return recommended shards * 1000 for the server count? The way my bot is setup makes it a little tricky to find the exact count.

true talon
#

?

simple knot
#

?

green mantle
#

No you should just do shardcount * 1000

#

what lib are you using

simple knot
#

I'm using a semi custom C++ lib

#

I guess I'll just hack in a way

#

Can each shard post it's count separately or do I have to tally them myself?

vapid cape
#

they can post separately

#

its not hard to keep a server count, even if you're using a custom library

#

you get a server count for X shard when it connects, then just listen to guild_create / guild_delete packets to add/remove from it

simple knot
#

I'm just using the ready event & updating delete/create events yeah

topaz verge
#
            ^
TypeError: Cannot read property 'on' of undefined
at Object.<anonymous> (/app/server.js:80:13)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)```
#

help

#
  •     throw er; // Unhandled 'error' event
        ^
    

Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/luffy.js:80:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)```

vapid cape
#

dbl.webhook only exists if you set a webhookPort or a webhookServer

#

check the webhook example

#

and ports can only be used once. you're already using port 3000 somewhere else

#

like an express server

#

@dense compass russian dota2 ads up there lmao

dense compass
#

๐Ÿ‘€

nova summit
#

What should I do to retrieve votes without using a webhook?

topaz verge
#

-botinfo @restive otter

abstract mothBOT
#
Bot info
ID

652156490819436544

Username

LuffyBot. V2

Discriminator

2836

Short Description

LuffyBot. have a lot of images commands like random animals images and fun commands and anime commands.

Library

Other

Prefix

luffy

Total Upvotes

106

Monthly Upvotes

41

Server Count

2 Servers

Owner(s)

@topaz verge

topaz verge
#

oh sry

#

iam so sry

#

for i am using commnads here

#

iam sry
iam thinking i am in testing1 room

restive otter
#

Calmdown

restive otter
#

lol

bleak ledge
#

If somebody voted and then ran this twice within 12 hours
Would hasVoted be true both times, or would it be true the first time and false the second time?

vapid cape
#

should be true both times

bleak ledge
#

Ok
That's gonna be a problem

#

Let's say I vote
wait 11 hours
Run a vote reward command
Wait another 2 hours
Run the command again

Unless I use webhooks, I won't know that those were two different votes.

vapid cape
#

afaik there's no way to know when a person voted, besides webhooks

#

so without knowing the time, you cant know which vote is which

bleak ledge
#

Ok
I'll have to find a better webhook tunnel than pagekite then
And use webhooks
Hopefully I can find a good webhook tunnel

vapid cape
#

cant you simply use http.server?

bleak ledge
#

I need a tunnel
Otherwise the outside world communicate can't with me
Because direct IP does not work without port forwarding

#

Actually, it looks like pagekite is temporarily giving an unlimited quota for free.
So I can stick with pagekite for webhook forwarding for now.

oblique osprey
#

Hi guys

bleak ledge
#

Hi

restive otter
vapid cape
#

you dont

#

just wait a bit and try again

#

its a server issue

ionic field
#

im getting a Error: 403 Forbidden when trying to check individual users in the api

harsh stream
#

everyone is getting errors at the moment

#

voting is also broken atm

ionic field
#

gg

restive otter
#

It's probably just the system getting updated, most likely they didnt deploy it on a seperate system so they're just live editing the code in the main site

#

idk

balmy hamlet
#

I don't think so

shell valve
#

i saw that there is something called cloudflare

#

or smth

woven flare
#

gg

hollow sandal
#

call to get upvotes from dbl using the python library prints cloudflare error page:

        <div class="cf-columns two">
          <div class="cf-column">
            <h2 data-translate="what_happened">What happened?</h2>
            <p>This website is using a security service to protect itself from online attacks.</p>

          </div>



        </div>
      </div><!-- /.section -->

      <div class="cf-error-footer cf-wrapper">
  <p>
    <span class="cf-footer-item">Cloudflare Ray ID: <strong>576532c2c9ccccfe</strong></span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span>Your IP</span>: ||IP ADRESS||</span>
    <span class="cf-footer-separator">&bull;</span>
    <span class="cf-footer-item"><span>Performance &amp; security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>

  </p>
</div><!-- /.error-footer -->


    </div><!-- /#cf-error-details -->
  </div><!-- /#cf-wrapper -->

  <script type="text/javascript">
  window._cf_translation = {};


</script>

</body>
</html>
limber solar
floral grail
#

Hi guys, do you know what's the method in discord.js to make the bot reply not parse _ as italic marker

#

?

harsh stream
#

Wrong channel, but try putting a \ in front of it

topaz verge
#
  dbl.on('vote', vote => {
    let guild = client.guilds.get("563708914265358336")
    let embed = new Discord.RichEmbed()
    if (guild.members.get(vote.user)) {
      let member = guild.members.get(vote.user)
      let user = client.users.get(vote.user)
      .setDescription(`T
hanks so much for <@${vote.user}> for upvote for me
If you want to vote for me go to [https://top.gg/bot/652156490819436544/vote](https://top.gg/bot/652156490819436544/vote)`)

    .setColor("#33333")
    .setTimestamp()
    guild.channels.get("689908901235130634").send(embed)
    }
    });```
dons't work why
vapid cape
#

there is no dbl.on("vote")

topaz verge
#

webhook ?

vapid cape
#

yes

topaz verge
#

dbl.webhook.on("vote")

vapid cape
#

yes

topaz verge
#

oek

#

oke

#

@vapid cape

#

webhookAuth:
"here webhook token??"
}

vapid cape
#

here

#

its what you write there

topaz verge
#

oke

#

webhookAuth:
"here what "}

vapid cape
#

what you put there

topaz verge
#

oke

#

put name ?

vapid cape
#

put whatever you want

#

as long as its the same in both

topaz verge
#

ohhhh thaanks

knotty garnet
#

by both he doesn't mean "same as url field"

young needle
#

Im wondering how to get if bot is online

knotty garnet
#

for your bot just run the code, if it's not running then it's offline
for other bots just get the bot's member object, it has a "status" property

topaz verge
#

@vapid cape

  const embed1 = new Discord.RichEmbed().setColor(config.emcolor)
    .setDescription(`
Thanks so much for <@${vote.user}> for upvote for me
If you want to vote for me go to [https://top.gg/bot/652156490819436544/vote](https://top.gg/bot/652156490819436544/vote)
`);
  client.guilds
    .get("563708914265358336")
    .client.channels.get("689908901235130634")
    .send(embed1);
  console.log(`User with ID ${vote.user} just voted!`);
});```
not work 
offffffffffffffffffffff
vapid cape
#

what did you put in the URL field?

topaz verge
#

webhook token

vapid cape
#

? why lol

topaz verge
#

i don't know

#

lol

vapid cape
#

where is your bot hosted?

topaz verge
#

glitch

vapid cape
#

then the URL should be YOURPROJECTNAME.glitch.me/dblwebhook

knotty garnet
#

why are you telling the person to vote inside a "onVote" event?