#topgg-api
1 messages ยท Page 102 of 1
No problem! Hope your endeavours are successful. One thing that isn't handled there is if the user has dms disabled
Such a shame we can't bookmark messages on Discord ๐
but you should be able to troubleshoot that
which music bot do we use here ?
hi
so i want to setup logs
in the https://top.gg/bot/:ID/edit link
where do i put the webhook
im confused
Webhook configuration is at the bottom of the page
Replace :ID with your bot's ID
bots id
i dont have a bot
i thought this ran off webhooks
is it possible for it to
if you dont have a bot, what are people gonna vote for?
i mean
that one
the servers
i want a log of who votes for my server
not bot
i dont think servers have an api
Servers don't support webhooks
:/
im doing an event where the person who votes for my server the most gets nitro
how would you recommend me to track that
o-
Hoe can i setup a webhook in java?
Does anyone know about monitorss bot
-api
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
Does anyone know about monitorss bot
@shivaco do u know
Heyey
Hi
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
hello
i need help with webhooks in java i dont know how to start
-leave
how can i use webhooks in java?!?
check out the official java library
An API wrapper for https://discordbots.org/api/docs that works in Java - top-gg/DBL-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
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?
Aight
5xx error codes means server side error
thanks a lot @vapid cape
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
@empty violet as long as you have passed the client and token into the constructor correctly, then it will post it automatically
ok
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?
๐
saa
is there documentation for the actual api endpoints or do i just have to dissect one of the libraries?
nvm i did that
So what exactly does snowflake translate into using .net Is this a ulong?
string
and i use [FromBody] correct?
No idea, I'm not proficient enough in C# to know that :p
Json or Url parameters?
The data is sent in the request body
thanks โค๏ธ
thats only because most people use js and js sucks at 64 bit ints
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)
sending them as actual numbers would mess with people ๐
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
wow. today i learned: the top 1% of netherlands earners own a whole 33% of the country's assets.
thats astounding
-api @gaunt steeple
it has the highest wealth inequality in the whole world
aaah oops wrong channel.
wrong server in fact. i'll delete.
You're already running something on that port, use a different one
Wheres the token?
isnt at the bot setup?
nvm I found it
to get the number of actual votes is just dbl.getVotes() ?
-api @restive otter
@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
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);
})```
@empty violet remove the setInterval bit
if you pass the client into the constructor (as you have done), it posts it automatically
i've had that running since yesterday and still hasnt updated
bruh still isnt working
did you remove the setInterval bit?
ye

uh you'll get a stern warning asking you to fix it
dont worry i tried and nothing happened
I noticed if your bot is in 0 guilds dblapi.js screams at you.
Lol
Help
@abstract holly what
well
hey idk
How do i make it so my bot logs when someone votes for it in top.gg?
api/docs doesn't work
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?
-api
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
now that's just taking the piss
Is there a api for server voting yet? :3
Nope
same
how i use the vote evant ?
idk too
How long do I have to wait between .getVotes() requests?
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
The webhooks are a bit slow sometimes
how i use the vote evant ?
@grave jungle read the docs
I'm coding in python :)
embed.add_field(name='Upvotes this month:', value=/bots/{650286008432328734}/votes, inline=False)
but i doesn't work
Oops! Error: 429 Too Many Requests
you are being ratelimited
api down?
522 timeout for shards 0 & 1, 503 fetch failed for shard 2
all three shards now 503
Does top gg have server api like the vote one?
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?
Correct
Hey
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
You'll need to use the webhook @restive otter
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
I am python ๐
Yes
And I cant figure the api out for that
@restive otter
I know that there is an api
But I find it confusing
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
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 ๐ฆ
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
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
@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
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
@mild wren DMs please.
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¬RandomNumber=8', 'isWeekend': True, 'discord_bot': {'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data¬RandomNumber=8', 'isWeekend': True}}
discord_bot basically being a repeat of the vote payload
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
Hallo, I've tried the example provided by Tonkku on the pinned message and using the test button but nothing logged... Can someone help?
just got it working, thanks ๐

I get my token when the bot gets approved, correct?
correct
K
hwo do we get "dbl token" ?
where is the button ?
go to your bot page => click 'edit' => setup the webhook and enter the webhook url => click 'test webhook'
ty
How to create your own shitty fucked up Vote Listener for Discord Bot List!
- Set up the Webhook with a Pipedream (webhook website - it's FREE!)
- Create a 'Workflow' so you can now transfer the data to Discord MUST LINK DISCORD ACCOUNT
- For every event (vote) sent by DBL to Pipedream, set it to send a message of the Vote.UserID to a Discord specific channel
- Create a separate bot that can only read the messages in that certain channel
- 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 ?
when need to use shard/shards
ok
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 ?
what language
python
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');
if you're using a Port, you dont need Server
you are supposed to chose one or the other, not both
There is any API for top.gg/servers?
Uh, I submitted my bot for approval a month ago ...
do we get dmed if you get your bot approved?
@mighty shuttle
how do you post the correct number of guilds for a bot if it runs on multiple processes?
Does your bot need to be verified for it to use the api because I am awaiting verification
hello
discord.py users here?
(i have 2 vers of python running, but my discord.py only accepted 3.8, so here i am)
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.
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}]}```
@waxen ridge botblock doesn't work with dbl afaik
use the dbl api directly with your token
at DBLAPI.postStats (/root/Node Apps/Menhera Chan/node_modules/dblapi.js/src/index.js:142:45)
getting this error
code
youโre on discord.js v11 right
12
client.guilds.cache.size
dbl.getVotes() returns a collection doesn't it?
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}`);
})
i believe it returns an object
yes it does
[
{vote one},
{vote two},
{etc}
]
@restive otter try votes.length
working...
votes.length
I wanna make like if someone vote my bot on top.gg then he will receive 1 coins
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))
!p ุงูุง ุฏู ู ููุณุทููู $$ ู ุญู ุฏ ุนุณุงู Mohammed Assaf
?
@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
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
@restive otter dblpy calls that even when successfully posting guild count through the autopost
how to get vps url :/
@maiden dockhttps://server_ip:port/dblwebhook
show code
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!`);
});```
is the port open?
the host port is not working so using the default given on npmjs
Error: listen EADDRINUSE: address already in use :::3000```
does somone have a welcome api?
how long it takes to get access to the api ?
when you get approved, you get an api token
(check pins in #support for how long that takes)
ok thx ๐
=w=
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?
no
asyncio.sleep(43200)
I want vote updates in my server channel what i have to do
I want vote updates in my server channel what i have to do
Yes how can we do that :/
Im new to this
@limber dawn you can't use api before your bot is approved
my bot is approved
my friend having
-bots 512992262704201730
also check pins
show code
can i send u the code
send here
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');
ok sorry
how do you have a dbl token
did you put that on your code
yes
also is the 5000th port open?
what's that idk


Send meme
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
vote locked commands
vote logging (see who upvoted your bot/server)
get information about another bots
how do i set up webhooks for a server?
What ?
vote logging (see who upvoted your bot/server)
@willow spindle can u please tell how to setup this
I had to copy my api token via page source
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)```
what does the data include?
See top.gg/api/docs, webhooks section
thanks
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
I think it's something related to discord.py
when someone vote bot gonna dm message him
hm?
nothing
holy
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
Create a webhook listening to POST requests, convert received request body into JSON, work with it
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
Which library is your bot written in
Discord.js
You can use dblapi.js
The URL will be http://ip:port/dblwebhook if you don't change webhookPath
Oo okay
How to get ip of vps
process.env.PORT works for port but process.env.IP doesn't
Literally your machine's external/public IP
-api
But thinking to switch to pm2
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
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.
Make sure you have the port open and forwarded
as well as firewall isn't blocking any requests to that port
is quick.db fast and reliable for multi server use?
is quick.db fast and reliable for multi server use?
@dawn flume yeah
Are you all just ignoring all messages that say that this is the wrong channel to ask
what?
chill man. i was just asking a question
Use #development
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
-api
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
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
@restive otter #development
oh sorry
-api
-api
Python db api on_vote event is not working. When I vote, it does not write to any channel or consola.
Is threan api for servers?
no but you can use vote webhooks
Wdym
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
What do I put as shard posting
is it Shards:
or
shard_count
or
shardcount
?
@analog quest #development
Ah
Hello, can someone tell me how to make my bot send a message when someone votes for my bot?
-api
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
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"
You can use webhooks provided by our official libraries if there's one for your bot's library
space out your requests more, I believe the rate limit is 1h or so
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)```
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¬RandomNumber=8', 'isWeekend': True, 'discord_bot': {'bot': '629563525722931200', 'user': '604582905053708308', 'type': 'test', 'query': '?test=data¬RandomNumber=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?
Reported to admins
With what?
You can code a bot on phone, but that will be harder than doing it on PC
only mods can use it
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
ok
oh?
huh

yeah, i see.
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?
@sullen nymph Yes, i'm pressing test button, but it's not working 
I don't remember connecting on_dbl_test with on_dbl_vote
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)```

Are you sure you entered the correct URL and auth key?
Ah....
It won't work without a webhook???
@sullen nymph
Hey what does dbl.hasVoted(user).then(voted => {
return like if the user voted in the past 12h?
a boolean value iirc
or if user has voted ever
dbl.hasVoted() returns boolean
ik but
Ah....
It won't work without a webhook???
@sullen nymph
@torpid sandal Those events rely on DBLClient's webhook. Make the conclusion yourself :p
does it return if the user has voted in the past 12h or ever?
Let's see
Ok, thanks :3
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
#development, this is top.gg api only.
Ohmy bad
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 :/
how do i make a command that works only if my bot is voted (dblapi.js)

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
Hey, I saw in #announcements that now we can vote for servers, how can I config the webhooks for voting?
There is no API yet @heavy vine
Okey
The only thing you can do rn is that the DSL bot can reward users roles for voting
Yeah I do that
Anyone know how to make a webhook with heroku that works with dbl?\
it's basically the same way you'd do normally, except you'll be using heroku's url

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
Event?
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?
And what lang?
Ah no, you don't need that afaik
lts
I don't even know what those are for
Come to #development
oki
Does a webhook system exist for server voting yet?
Please let me know if it exists, even if it isnโt documented.
@willow spindle So I can set it up the same way I setup bot webhooks?
yes
Alright thanks
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
@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. :)
Can some one help me about CSS
can i get token without adding bot ?
no
@restive otter dms :D
I still need help with the vote system for javascript
Been waiting weeks, Nobody helped me yet.
dblapi.js
@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
You need to confiure your webhook settings in your top.gg edit page
The webhook url should point to your vps's ip address
http://vps.ip.address.here:port/path
port defaults to 5000 iirc and path defaults to /dblwebhook iirc
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
elaborate
http://vps.ip.address.here:port/path
@rapid kettle How do i get my exact vps ip adress
?
The public one or the private one
Public.
open that port first
@gaunt sierra bash sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent sudo firewall-cmd --reload
^ that would open port 8080
@rich pawn Thanks alot but sudo isn't recognized as a cmd
Im on a windows server 2016
RDP
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
then port 8080 is open
It's already there.
I want my bot to send me when a user votes
dbl.webhook.on
This ip right^
ah ok. yeah you would have to use your public ip
yes
-api
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
shiv are you drunk again this is api talk
@gaunt sierra do you own the vps.ip domain?
lol
Did you enable port forwarding on your router?
oh wait nvm lol
what kind of server do you have setup on the VPS?
I work mainly on linux so I'm not sure ab why its not working on windows.
ok
or does that not matter
idk. I can try voting though
yes it sends a post to the url
http
ye it's http
with authorization password too
still doesn't work
"this may take a few seconds" never said anything else
uh
Did you change your code to listen(8080)?
lol
is there a way that if i upvote the bot it will get the user and send dm?
ok
so yeah, you can fetch that user and then try to send them a DM
yeah ik
Has restored a new token
can someone give me the structure of a POST (i think it's POST) request by a DSL webhook?
{
"guild": "358630393869631498",
"user": "247741991310327810",
"type": "upvote",
"query": ""
}```
`type` difference stays the same as DBL webhooks
where is the auth stored? @sullen nymph
Request headers, Authorization key
req headers, thanks
can someone tell me how do I make the "extra money by voting" feature?
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
#topgg-api message
Just reposting so someone sees. :p
ok
looking good so far its running
No
<vote>.isWeekend
itโs the vote object given to you via the webhook
letโs see your webhook code
uh no ig
When I get votes for my bot I want him to send a message
ok
When I get votes for my bot I want him to send a message
@frozen lark you need to setup vote webhook
@rapid kettle
/newbot
@frozen lark you need to setup vote webhook
Where do I find the webhook password
ahh i see
is it here ?
Plz night bot
how can I find out what rank my bot is the top rated bot with the dbl api?
@uncut sundial Is that for bot or server votes?
server votes
mhm
If you click Test Webhook does anything happen in your server?
You dont have to give it authorization afaik
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?
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
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
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
@limber dawn by server do you mean a server listed on top.gg or your bot's support server?
When I test it it doesn't work
same here
ufw firewall settings
@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);
});
code913 could you help me? Do you see anything wrong in what I did?
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!!!")
});
Seems like receiving webhooks on localhost doesn't really work
yeah
one second
dbl.hasVoted("95579865788456960").then(voted => {
if (voted) console.log("Tonkku has voted!!!")
});
@restive otter its for a specific user
my internet is not functioning properly
!play
Hello, how can I start my authorization?
what is 400 bad request
Invalid request... body, iirc
ehhh... interesting
its something on my side, idk what tho.
What are you doing exactly?
wait i figured it out
i was sending an object instead of a number
well that'll be why lmao
๐
200iq
how can I start my authorization? x3
@tardy night wdym
yes
Webhook running at http://0.0.0.0:3000/dblwebhook
is that bad? ip is 0.0.0.0
hosting on glitch
I wrote the same code given on the site (https://top.gg/api/docs#pylib) but it didn't work. does not write when voted.
not localhost it vds
Where will I do the auth?
whatum isum theum problemum
It's not logging on my vps no eventum
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}`);
})
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
no its on a vps and it doesn't do anything
is the Port variable defined?
yes
ok
is your webhook URL like this on top.gg?
http://serverIP:port/dblwebhook
and does the webhookAuth match the password too?
yes
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
if you are on linux you can do
sudo ufw allow port
@jagged pine that did it thanks so much
Can someone teach me how to use a bot? I'm new to discord
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?
https://server ip:port/dblwebhook
what
Whats up?
hmm
i think it is http://localhost:5000
yeah
also look at my code
what do i do??
@willow spindle is it my pcs ip?
and whats server??
yes
u dont know whats server?
witch is defined as express();
OOPS
i saw it
shi- i leaked my ip
no u didnt
but i could not see it
i blured the top but
the middle part
huh
thats the port lol
ye ik












