#topgg-api
1 messages · Page 120 of 1
just be sure to open the port
how i do that?
where are u hosting your bot
heroku
shall the port be 0000?
bc on my mongo thats how i set my ip to host on heroku
use the port 80
k if u have some problem ping me
is there a way to detect who voted for the bot?
how to get the dbl token
hey is there anyway my webhook can send new announcements by me? also if i wanna send the new vote in the channel do i just put js message.channel.send(`User With The ID ${vote.user} Just Voted!`)
or do i have to cache the channel with the id of the channel
Click Generate Token And DM Me it
JK DONT
LMAO
lol
dbl.webhook.on('vote', vote => {
console.log(`User With The ID ${vote.user} Just Voted!`)
})```
`Cannot Read "on" Of Undefined`
how to get webhook password and port
idk how to get port but the pass you just make a secure password
where
umm where to create pass im new to this xD
const dbl = new DBL('api token', {webhook: 5000, webhookAuth: 'SECURE_PASS_HERE'})```
ez
k
@wispy turret send me the code in pastebin
wait
its in my index.js so just ignore the other shit. well maybe consider it bc some of it might be an error
uhh is dblapi.js still available on npm?
yes.
its not found
@restive otter
module is no longer maintained-
@regal harbor i-
the module is probs outdated
npm
and i do the samething?
how to use the new API @top-gg/sdk
read that
k
idk how heroku works but i think their use dns
no thats an example
wait wh-
in my mongodb i put the ip 0.0.0.0 and it worked
well then try that @wispy turret
but i wanna run on my vscode terminal. how i do that?
@restive otter you mean the topgg token is in your bot dashboard
where is this panel tho
@wispy turret download your project and open the folder in vs code then install the modules and just run the app
@restive otter https://top.gg/bot/YOURBOTID/webhooks
and then
How do i do Show servers here ؟
ok
now i tested it and its not working
whats my express app?
@wispy turret heroku doesn't give ip you cant use it for webhook
on mongo their ip is 0.0.0.0
and 0.0.0.0 basically means accept requests from any ip
oh-
umm how to setup the webhook
so what i put?
@restive otter send your code
ok
@wispy turret you cant use webhooks on heroku without ip afaik
get a good host
@hidden crow the docs say it all
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('pass') // add your top.gg webhook authorization (not bot token)
app.post('/', webhook.middleware(), (req, res) => {
console.log(req.vote.user);
let channel = client.channel.cache.get("786832094802346025");
if(!channel) return;
// req.vote is your vote object e.g
channel.send(req.vote.user) // 221221226561929217
}) // attach the middleware
app.listen(3000) // your port
i did check it
oh the api docs
shows an outdated version for
js lib
it's not outdated
it works but it's not maintained
i use the api straight i dont need a wrapper
@wispy turret yours is the node sdk for the api
so i need that and node sdk?
because when i used dblapi
node sdk is for advanced people
It logged a warn right
That it's not mantained
dbl.webhook.on``` it would always say .on is undefined
because there is no webhook
hol up
mhm wait. but i wanna send when everytime someone votes in a channel
since its a webhook do i just do
message.channel.send?
or
i have to cache the channel
and do channel.send?
discord.js and dblapi.js are unrelated
just get the channel from cache and send it there
ok
use the client channels cache
client.channels.cache.get("vote log channel id").send("a guy voted");
i clicked "test" nothing popped up in my terminal
send your code
are you sure that api token is correct
lemme check the docs real quick
@wispy turret
@wispy turret you did it wrong
you're supposed to pass your discord.js client as the second param forget i said that im dumb
i have been on. it
oh ima set my status online
well im on macos
the webhook will not work if the port is not open
and if the ip or dns is not valid
I definitely don't remember where we were cut off
Send screenshots of your code (token excluded) and webhook settings on the website
so im in my network utility
and it says
opening porn: 80
*port
well you opened the port 80?
its still loading-
how long it usually take to open ports?
usually not much
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use```
idk what is-
lemme try again
ye
idk what is
being used-
its on your pc?
im using macos
use another like 7777 or whatever you want
How infield code api ? Where should I take it?
iam sepeek Arabic, I don't know how to speak English

@marsh ginkgo i told you where
yes
Mother project Bot?
find it on your bot dashboard
Is that cog loaded?
I asked you if that cog was loaded in your bot
lol yes
Fun
@tawdry bone
?
you don't need to paste the port 8080
means?
in port keyword?
oh srry
i mean you need to put the port at the end of your url
or is it a default port on repl
url...repl.co:8080
when i do this it doesn't even sends anything to repl.it
prev it used to send 404
but now nothing
@tawdry bone are you using flask?
yes
show me the code
do @app.route('/', methods=['GET', 'POST'])
insted of app.run??
no
also from flask import Flask, render_template, request, Response
yes you're getting both GET and POST so it shouldnt disrupt uptimerobot
now under your def home(): you wanna check for the authorization that dbl sends
so Py authorization = request.headers.get("Authorization")
ah okay
can u pls wait?
alright
ah okay
so
can u tell about this one again?
so get your authorization with Py authorization = request.headers.get("Authorization"), it'll return a string. check if its same as the one you give to top.gg (should be right under the place where you enter the webhook url)
yes except its request.json and notrequest.json()
yes
before the authorization line try printing request.headers and request.json
thats not dbl, thats probably uptimerobot
are you sure you entered this exact url that was here?
Please remind me why you're using Flask
as much as im aware your flask application url isnt supposed to have a 8080/dblwebhook at the end
Have fun Deity
it ends at repl.co
yes
where did you get the 8080.dblwebhook part
you're not sending them to the correct flask application
It is
I did say you don't enter the port in the URL
somene said me
you still have this part
-_-
it worked
uk
one question thgh
ah
is this part correct?
helo ?
anyone?
everyone died or what?
it's not happening now
i click on test nothing happens
no response
can we use the test buton only once?
everyone went

it did not work for me to. I made an extra webserver with aiohttp
no it worked for me
after pressing the test button
there's a cooldown of some seconds
idk specifically
and after taht it works
🙂
guys it works correctly but just that i now want to post this tst upvote or upvote thing to a particular channel in the bot's support server
but this thing is not working
kinda
did you update the webhook setting on your bot page?
make sure to press save ofc
use a few debug lines maybe
oh
/dblwebhook is needed, though
duh because you hosted a Flask script on the main route
yes
Can you show your main bot file
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it returns data
then the webhook works
if i use only the url without the /dblwebhook
you are daft

i did this
but doesn't works

except this
And the link I sent is your current settings on the website?
Do you have a Flask script running atm
and the current webserver settings
-_-
why
whymeans?
Why do you need Flask
without it how will the uptime monitor ping?
the site
if it doesn't pings if i close my pc bot also goes offline
simple
uptimerobot doesn't need you to ping it though?
-_-
The webhook isn't running because the port is occupied by your Flask script
So?
Try to run some aiohttp.web script that does both things
kk
Also, it's supposed to be request.headers.get("Authorization") 🙃
my pswds diff
you get an Authorization header with a value being your password
Who told you to replace that with your auth key ever
at least that's dealt with for one, yes
Good luck with converting your webserver to aiohttp.web
thnx
or maybe i won't
i have got other cmds to focus too
i have wasted 2 days
in this single thing
حطيت التوكن والكود ب البروجكت
كيف بدي اشغله ب الموقع ؟
I got up token api but project
He did not operate on the site
const topgg = require('dblapi.js')
module.exports = TopGG = new topgg(config.botlist.top, { webhookPort: 5000 }, client)
value of TopGG is not an emitter
:/
Add BL package.json : "dblapi.js" : "2.4.1"
bl?
The dblapi.js package is deprecated. It's suggested to the new one, @top-gg/sdk
يمكنني استخدام مترجم
oh how do i use the new one like any docs link or something?
The translator sometimes understands what 
See its README on the package page, I guess
انني احاول اعملها لا اعرف كيف
مجرد قراءة من خلال المستندات فمن السهل جدا مثل الشيء نفسه تقريبا
dbl.on("حدث"....)
yes
its deprecteated
and wont recieve updates
@restive otter https://www.npmjs.com/package/topgg-autoposter
if you want to just post stats
and nothing else
nah i even want to do the votes thing
k
so top.gg/sdk is maintained and all right?
yes
like can it post stuff and all?
yes
Yes
oh but better
kinda
yes
it should
its deprecteated because it was maintained by a person who is no longer in dbl so he wont update it ofc
Would it be main if I use both?
will i need to use express also?
@restive otter yes
oof
never used it no experience i guess i will just copy that code
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user) // 221221226561929217
}) // attach the middleware
app.listen(3000)
is there no events way for this?
?
@glass frigate you mean use the sdk and the autoposter
@shy vortex I don't know what code should I add to fix this problem
it posts the stats every 30 minutes
if you used any of the example codes
and only after 30 minutes it will update the stats
try tunning the function with eval command
?
Not one that exists as of yet. You can emit the events manually, though
@shy vortex oky thank you. Can I use 2 commands for this information?
To post server count automatically, use the first one on that screenshot.
Remove anything related to shards, however, if you don't use shards.
You can use both webhook and API implementations at the same time, but I don't see why you would need anything else on top of the API part.
@shy vortex I did not write the line of code that gives the server information Which code will I write?
@shy vortex @sullen nymph oky thank you.
lol
I'm too used to having one package do everything
@sullen nymph is there any older version of dblapi.js that will work or something?
lol
The current one technically works but is bound to break when new changes are made to top.gg API
you shouldn't stay with dblapi.js
Can't help as I'm not familiar with it
i did not understand a single thing in the readme votes thing
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express() // Your express app
const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
// req.vote is your vote object e.g
console.log(req.vote.user) // 221221226561929217
}) // attach the middleware
app.listen(3000) // your port
imagine never having used express before
@restive otter express is a web framework for javascript
basically it makes an express app first
wanted to use eventHandler
express basically functions as a web server that recieves requests
rip my index.js file then
and then you just add the webhook to it
and add a post method
so top.gg can send data to you
oh so it is automatic?
yeah
just waits for requests to come in
from top.gg
basically anytime a vote occurs it sends a request and ur code waits for that request
can i make it emit or something
like ```js
if (req.vote) client.emit('vote', req.vote)
something like that?
oh
Disregard that
that would just be a second and non useful step
you are basically listening for the vote twice
?
Yup. You don't gain anything in specific by making your webhook emit events.
You still have access to the data, the client object, all that crap.
basically ur event activates and then you just use that to activate another event which does the same thing
if req.bot emit bot vote
else if req.guild emit guild vote
my index.js was like 3 lines before this :/
what
so like even guild votes can be seen?
never knew that 
Yes, DSL supports webhooks
is it actually allowed to reward people for voting for servers
like reward bot-currencty?
i don't use it personally but a bot does
you can reward for votes if I recall
for bots you can defenitly do that
and dsl already lets you setup a role reward for ur server
so I suppose for servers also
but im not so sure on servers
you can defenitly reward users on ur bot with bot currency or something
no like there was a rule or something that voting for bot A should not give rewards for Bot B
so i thought must be something like that for servers also
🤦 the dbl-api.js was working
i forgot to add a const
and now i changed my files
@shy vortex so like does it get deprecated every update to api?
and like how often does the api recieve any update?
talking abt the dblapi.js
nobody knows its random
oh
yeah not using
there is not a single reason to use it anymore
is there any way i can keep this file away from index.js
like just load it?
i didn't even make a command handler so i have no idea (used discord-akairo framework rather)
nvm
bruh
Hello, I am speaking Turkish:api nedir ve nasıl alabilirim yardımcı olabilecek varmı
Help me
translated:
What is the api and how can I get it. Can anyone help?
@coarse bobcat
Sanırım botunuzu hangi dilde kodladığınızı bilmemiz gerekecek
Yes
Turkish
How so
Programlama dilini kastettim
Hmm
js?
1 munites
Js
Yes
Readme.md dosyasında ihtiyacınız olan şey var, bazı ekstra yüklemelerde biraz değişiklik gerekecek
@coarse bobcat ^
gerçekten emin değilim
Hm
Ama şimdilik gitmem gerekecek üzgünüm ama sanırım başka biri sana yardım edecek
Arkadaşlık isteğini kabul edemiyorum çünkü seni gerçekten tanımıyorum ve ayrıca seninle konuşmak için bir çevirmen kullanıyorum
:(
Ok I loved you, don't forget me
it did not work
my friend voted but no console log nothing
// Top.gg api part
const config = require('./config.json')
const topgg = require('@top-gg/sdk')
const TopGG = new topgg.Api(config.botlist.top)
setInterval(() => {
TopGG.postStats({
serverCount: client.guilds.cache.size
})
console.log(`[ TopGG ] - Server Count Posted!`)
try {
//DisConsole
const channel = this.client.channels.cache.get(config.channels.disconsole)
channel.send(`${emojis.discord.Analytics} [ TopGG ] - Server Count Posted!`)
}catch{}
}, 1800000)
//Over
// Voting badass part
const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook(config.botlist.topwh)
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
/**
* Vote
*/
console.log(`[ TopGG ] - ${this.client.users.cache.get(req.vote.user).tag || 'Unknown User'} has voted!`)
try {
//DisConsole
const channel = this.client.channels.cache.get(config.channels.disconsole)
channel.send(`${emojis.discord.Boost} [ TopGG ] - ${this.client.users.cache.get(req.vote.user).tag || 'Unknown User'} has voted!`)
}catch{}
try {
this.client.users.cache.get(req.vote.user).send(new MessageEmbed().setTitle(`Thank You so much for voting ❤️!`).setDescription(`${emojis.discord.Social} For now it does nothing but is still a lot appreciated `))
}catch{}
})
app.listen(3000)
// Over
whole code^
anyone?
did you set the webhook url in your bot settings?
in your bot page settings
oh
you need to enter your webhook url, it should be something like http://yourip:port/dblwebhook
i have a non-static ip
If you're hosting it on a server (and presumably deploying it there), use your servers ip instead
can i use 0.0.0.0 instead?
0.0.0.0 is a universal ip, it doesn't work like that
0.0.0.0 is just a indication of being able to connect to it from anywhere, like localhost, your internal ip or external ip
auth is something you can define yourself
it has to be the same in your bot page settings and code
oh
(node:11932) UnhandledPromiseRejectionWarning: Top.GG API Error: 401 Unauthorized (You need a token for this endpoint)
at Api._request (F:\Dhruvin's coding work\Node JS\Discord Bot's\Vilicus\node_modules\@top-gg\sdk\dist\structs\Api.js:74:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Api.postStats (F:\Dhruvin's coding work\Node JS\Discord Bot's\Vilicus\node_modules\@top-gg\sdk\dist\structs\Api.js:94:9)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11932) 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 terminate 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: 1)
(node:11932) [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.
¯_(ツ)_/¯
using the correct token
wait nvm didn;t relaise it is the webhook token and bot token that are same
again, the webhook token isn't a token, it is like a password you can define yourself
is the python api maintained (the one in the docs?)
if so then like the next rewrite i wil do in python ;-;
maintained by @sullen nymph iirc
You can ask Veld if he wants someone to take over but I was planning to push out significant changes to the library to support everything
shiv big brain~
imagine
what it mean by the dblapi error 400 bad request?
invalid value in body etc
yes, but I found a solution by my own
i got this : /bots/{bot.id}/stats/server_count? but where i put it to show on my bot's page?
I get the error 401: Unauthorized, I've entered my bots api token correctly
Here's the code
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('[entered token]', client);
const member = message.mentions.members.first() || message.member;
dbl.getVotes().then(votes => {
if (votes.find(vote => vote.id == member.user.id)) message.channel.send("You voted in the last 12 hours!! Thank you!")
});
Check if you have copied the token correctly
Or renew it
@restive otter
@restive otter you mean use that in your website?
You can use jquery or fetch
renewing it worked, thanks
um can anyone tell me how to make voting rewards using DBL's API?
for discord.py
use the webhooks and setup something like a database to reward users everytime they vote
I can't help you with python I'm pretty noob in that language
ohk np
no i mean in my top.gg page
Then just use the autoposter from topgg sdk
See pins
It's not that hard just install it and copy paste the code given and replace the token for your token
That's what I just explained to you.
ok but what code i need and where i put it?
I dont see why you can't just acess it normally
const AutoPoster = require('topgg-autoposter')
const poster = AutoPoster('topggtoken', client) // your djs client/shardingmanager or eris client
An
in your main script
i just paste this, put my token and it will work?
Yes
lemme see
i pasted this in my index.js file, changed the token, restarted my bot but there is nothing on my top.gg page
I think it have a delay
If no errors just wait
ok
@restive otter how can i get api
so how can i get
@restive otter I'm on the phone so I can't explain you well srry
np i'll wait to see the refresh
How can I get api, can you help me?
when you finish your call you can DM me @regal harbor
@coarse bobcat what you mean by get the api?
You need the token?
You need the endpoints?
Explain
what do i need
you tell me
turkish
nope
dude I have close to 0 idea what you're talking about
you have to give us more context
can i send a picture
do i have permission
yea
if you only want to check in how many guilds your bot is just use the cache
client.guilds.cache.size
turkish
whats glitch
what should i do next
read the docs
"Api documentation can be found [here]"
hmm sorry
Where should I write the coin
token
sorry
Where should I write the token
@worn lion
hey
@worn lion
help me
please
just wait for a response 
how much
until whenever they are free
jsjsjsjjs
which wrapper are you using
What
2pac

i am so boring any one here chat with me then add me
@restive otter no need to send that into literally every channel
Hi, I get this error when dblapi.js post data on top.gg :
Error: 401 Unauthorized
at IncomingMessage.<anonymous> (/home/creeper/gj/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) {
raw: '{"error":"Unauthorized"}',
body: { error: 'Unauthorized' },
status: 401,
headers: {
date: 'Fri, 11 Dec 2020 18:04:36 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '24',
connection: 'close',
'set-cookie': [
'__cfduid=dc2a20b1f2010206dbe951b8cfd82fde91607709876; expires=Sun, 10-Jan-21 18:04:36 GMT; path=/; domain=.top.gg; HttpOnly; SameSite=Lax; Secure',
'country=FR; Path=/'
],
'x-powered-by': 'Express',
'access-control-allow-origin': '*',
'access-control-allow-headers': 'Authorization',
etag: 'W/"18-XPDV80vbMk4yY1/PADG4jYM4rSI"',
'cf-cache-status': 'DYNAMIC',
'cf-request-id': '06f492f9420000082c5aaef000000001',
'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
'x-content-type-options': 'nosniff',
server: 'cloudflare',
'cf-ray': '600121086a2f082c-CDG'
},
ok: false,
statusText: 'Unauthorized'
}``` Someone know how to fix it ?
client.on('message', msg=> {
});
for some reason this function activates 3 times is that normal?
This is about top.gg api, not discord.js, go #development
check the token or renew it
yea I guess the clien.on() function works three times
Do you need a website to set up a webhook?
no
Then how do you set up webhooks?
you need a service that can requests though
your top.gg wrapper from https://top.gg/api/docs should do too
How do I know the webhook got sent something?
Like does something trigger when that happens?
vote event
It's not sending at all
I'm trying to get the bot to thank when it is voted, the first shard calls successfully but the others say that the port is already being used, what to do?
use a different port
you only have the option to put a port, the first shard uses the port and the second says he cannot use it because it is already in use
You should not have a webhook receiver in every shard.
Only in the sharding manager, or using a seperate process entirely.
@restive otter msg event you mean msg.content?
?
it doesn't seem to read it twice anymore
im not sure it only prints once per message in the console log
I was referring to this response also it seems the command I am doing it is print multiple times
Client.on can happen a ton of times.
just a stupid question, do I have to set the "Authorization" header content to this ("Authorization: {key}") or this ("{key}")?
The content is just key
@young haven you need to set the webhooks in the shards file not in the file that you are sharding
or in another file
When will it be possible to fetch reviews from the api or view all reviews?
soon ™️ probably
Error: 502 Bad Gateway I randomly got this error... what does it exactly mean?
what was the autoposter to post just the server count?
^q is the same again
for js^
why? ._.
lol
Whi my webhook doenst work on heroku ?
server webhook?
is it a webhook for a bot or a server
ok what you have done so far?
you created a webhook that'll receive requests from top.gg?
my bot recieve POST request on vote and send this message on my server https://i.imgur.com/RPGg6Sn.png
ok so it works
also please someone tell me about this #topgg-api message
it's not bot upvote, server upvote
https://i.imgur.com/ZwDDxQw.png @silk cobalt
@restive otter for me its POST request https://i.imgur.com/0TkMCEC.png
I tested webhook like 10 times and it keeps sending me post requests
check your pm
no wory
ty @potent jolt
ty ?
thank you
no problem ^^
haha nice
npm i dblapi.js if you are on node.js else idk @quartz dew
your bot needs to be approved
???
@quartz dew your bot yet approved
just wait for approved from moderation
or bot reviews
hlp
for approved wait 3-4weeks maybe
add @wild lantern
wait what is that
server status shows how many servers are on
like this right
oh yes you need to check api docs
yesss
check doc
there are discord js and discord py guides
for make that using dblapi.js package
is it here
@true pebble ```const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(Oops! ${e});
})```
put your token there
then restart your project
thank you ❤️
and your server has posted
why is top.gg making get requests for server votes
anyone
bot votes are working fine
My bot does not seem to post stats to top.gg, however I don't get any errors or so. What should I do? :/
code?
use https://npmjs.com/topgg-autoposter dblapi.js is deprecated
Well, it's weird that on https://top.gg/api there is still dblapi.js but fine
Thanks :)
Do I need to do something else from this?
just replace "topggtoken" with ur token
Ok, thanks
@outer summit you get the bots token from here
I know
oke sorry^^
It didn't work with dblapi.js so I came here
That's fine, thanks, anyway :D
i just tried topgg-autoposter and works fine for me, so hopefully for you too
ok
How do I get my token?
Yes
xD
read above lol, probably answers your question
bit stuck here... im trying to get my webhook to point to my service subdomain (essentially IP) and i'm using express to listen to port 2000 but when i try and point dbl to port 2000 express says port is already in use...
I can kinda understand that but how can i get this to work lol... sorry not done anything with webhooks before 😬
so, you using express on port 2000 and dbl on port 2000?
yeah
thats a conflict
if you're using express use the new library as it uses express middlewares https://npmjs.com/@top-gg/sdk
ads
actually just realised that i ought to check the new api thingy
check pins
lol, what berry just said
e oki
ok, ill check the new stuff and ask if i need any help 😁
👍
whats your dbl constructor look like?
I understand, my Client did not log in!
um, probably a daft question but what should i expect when i click 'test webhook'?? i am assuming something should log in my console?
?
you need to initialize the webhook in the constructor.
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!`);
});
with webhook port, and auth.
as?
Okay!
Where do I get the password?
@next flame dblapi.js is deprecated. Use https://npmjs.com/@top-gg/sdk instead
Hello how cna set-up the webhook like this ?
which lang
C#
https://top.gg/api/docs#webhooks
I don't know C#, so I can't help you about this
Isn´t helping
If when i was to add the comand .vote was so complicate, imagine the docs now have a lot of information or some exmples
this is basically: you are creating a webserver on your vps and set your webserver's url in top.gg bot settings.
there is a Test button so you can test it
Can I put my dbl token on webhookAuth without my token being stolen?
Why not use a password of your own choice
Wrong place to search
