#topgg-api
1 messages · Page 169 of 1
hmm
can u just give me thge code?
the*
and i copy paste it

That is indeed what you need to do what you were asking for
explain this line
i got 23 heart attacks while reading it
That is the code you need to do what you asked for
where am i supposed to insert it?
your index
you cant use it when you arent approved
bruh
but why isnt it possible to see how many servers my bot is in?
(without getting verified on top.gg)
You can see it on your console with just logging the guild size, but not on top.gg until it is approved
can u explain how can i do that?
Are you using discordjs
yes
read there guide
link?
i make personal bots for myself
never did this stuff before
this is my first time ;-;
idk how to handle bot when its in several servers :0
Thank You mate ^-^
Is there any way to get if a person has been voting for the last 12 hours?
yes, using the check vote endpoint
it will return 1 if a user has voted in the past 12 hours
is it possible to make an vote tracker without haveing an open port?
using third party services yeah
try integromat or zapier
How do I make a webhook that says when someone votes my bot?
anyone willing to share their code for the voting logs? thanks in advance
thats considered spoonfeeding so lets not
🥴
whats that
i have mine setup so it sends the top.gg webhook to the integrately webhook
then sends a discord message
but you can change the output of the webhook
sign up for an account on https://integrately.com
Is it possible to add it to your bot if someone voted for the bot like it will say user has upvoated your bot?
Upvoted*
Like that but without the footer
@tidal idol are u helping or are just taking a bit for a diff one
How to use Integrately to send vote notifications
-
Sign up for free on https://integrately.com
-
Select *Webhook / API Integration / https://bens-files.xyz/shot_210925_195415.png
-
Select Discord / https://bens-files.xyz/shot_210925_195529.png
-
Select the options shown in the SS / https://bens-files.xyz/shot_210925_195613.png
-
Copy the webhook and set it as the webhook at https://top.gg/bot/BOTID/webhooks / https://bens-files.xyz/shot_210925_195716.png
-
Save and send a test request!
-
Integrately will have picked this up and will know the data sent across in the request.
-
You will be asked to link Integrately to a server. When linked, choose the Channel ID (Where you want the vote message to go) and the message you want to send. You can choose the message to send.
-
Click test and activate.
This should now work!
You can choose other outputs too, not just Discord!
(An alternative is https://webhook-topgg.com/ which tells you how to set it up as you go along.)
was sending instructions for the other person but it will help you too
@polar birch
ok
you need a published bot for it i
Tysm!
no problemo
const dbl = new DBL(dbltoken, { webhookPort: port, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook's running`);
});
dbl.webhook.on('vote', vote => {
bot.users.fetch(vote.user).then( u => {
const voteEmbed = new Discord.MessageEmbed()
.setTitle("Thank you for voting me!")
.setDescription(`:logo:Thanks a lot \`${u.username}\`, you just got 20,000 coins!\nYou can vote every 12 hours on top.gg by clicking [here](https://top.gg/bot/828349677950074881/vote)`)
.setColor("788cdc")
.setFooter("Global Economy💸")
var user_money = db.fetch("money_" + vote.user);
db.set("money_" + vote.user, user_money + 20000)
const votetestchannel = bot.channels.cache.find(channel => channel.id === "885139561355804703")
console.log(`User with ID ${vote.user} just voted!`);
votetestchannel.send({embeds: [voteEmbed]})
}).catch(console.error)
});
it worked before
it worked today after noon
ooooooo ok
any one knows why isnt it working now?
Any errors?
no
Then its not a issue on our end
Tbh, that library is so out of date I'm not sure how to help with it.
Which library
The dblapi.js library
We moved to the sdk what, 6-8 months ago.
longer than that
Hey yall, i just tested around with top-gg/sdk and i've tested everything and it works, my url link is https://not-real-project.something.repl.co and how i inserted it in the dash https://not-real-project.something.repl.co/webhook, how would i convert that so smth like a localhost url since im using express within visual studio code instead of using replit.com for bot projects
listen on the port you want and add localhost: to the start?
I meant like on the dashboard, what would i put instead of https://not-real-project.something.repl.co/webhook
whta dashboard
Webhook part of top.gg bot dash
You can't do that with localhost
You can use like ngrok or something to make a temp url
just to give a bit more context, localhost means "myself"
you cannot have webhooks sent to you by telling top.gg "myself", at that point top.gg just sends the webhook to itself.
you need to identify yourself, such as by using a domain(repl uses repl.com), direct ip(1.1.1.1 for example is cloud flare), or a third party service that receives that data for you.
Okay thanks
guys hello! what is shards?
There are rate limit for API request?
Hey what will be the vote webhook link for heroku?
Yourprojecturl/path
Note, not the dashboard url but the actual url
You'll also need to enable a web dyno
Or whatever it's called
api means application programming interface, its how your code gets/submits data to other platforms.
the documentation for ours is on https://docs.top.gg/
@restive otter hey, what are you confused about?
-p dj luffy thai
this is some pretty basic stuff, but this code has been working fine for months and recently i migrated to google cloud and it stopped updating my bot guild count which is now stuck at 1
just to double check, try printing the server_count variable
just checked, and the server_count variable is correct
i also tried sending requests from my own computer, and it seems to work fine: is it possible that top.gg is rejecting my post requests because its from my vps (?)
without any error messages, we cant help
ok
the main thing that sorta confused me was why it was working fine before but suddenly stopped for no (?) apparent reason
You seem to be using Python 3.9 on your VPS and lower version on your PC
To fix this, migrate to topggpy. dblpy is deprecated anyway
i think thats it, thank you so much!
How to make that if i use a command and i willl have to wait for seconds so i can use the same command again?
how do i get an API key
I now get error 403 on that page
replace BOTID with your bot id
yes i did
I am now getting error 403 on that page again
and then ?
You cannot use webhooks or the API when your bot is not approved
thanks for the explanation
I have already added the bot to your panel but where can I see if it has been added
and how long will it take to get results?
Dblupto
The average up-to-date approval times are stated [here](#support message).
This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.
There is no exact time for how long bot approval will take.
There is a queue and you're not first, nor are you last.
Read more about our reviewal process here.
And your bot page shows if its approved, and you'll get a dm from @celest pier
I have another question about
My bot has no music function is that required and only has 39 commands is that a point where you will be disapproved
Nope. You just need one functioning feature and the majority working
thank you for the information
i have my bot hosted by my own panel in my house but it is sometimes not always quick to respond so usually it takes 2 seconds to respond
is that a disaster
It might help to mention that in your bot page, as we can test commands faster than that and may not realize some are responding slowly and might be perceived as non functioning.
So I should mention that the commands take some time to process
and that has to be on the page where I added the bot
do I understand correctly then
Not required, but probably a good idea
TopGGAPIError: 401 Unauthorized (You need a token for this endpoint)
at Api._request (/home/runner/Clash-Chest/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Api.postStats (/home/runner/Clash-Chest/node_modules/@top-gg/sdk/dist/structs/Api.js:99:9) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api//bots/stats',
status: 401,
statusText: 'Unauthorized',
headers: [Headers],
counter: 0
}
}
}
what?
i put a token
const { AutoPoster } = require('topgg-autoposter')
const ap = AutoPoster('SECRET TOKEN', client)
ap.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
The same token for the bot you are using?
Ie you got the token in the webhook page you are sending requests to?
Always have gotten that, or just started getting it now?
always?
i added this code today
now
few minutes ago
sorry if i'm uncomprehensible
Try regenerating the token then using that
ok
working
i regenerated 2 times before idk why didn't work
now it works
thx
If it stops working in the next few days tag me.
Trying to track the issue down
ok
how would i get how much time a certain user has left before they have to vote again
You'll need to track that on your end.
Once they vote it's just 12 hours ahead
Im tryin to use this website https://webhook-topgg.com/ to convert a discord webhook to a top webhook but it keeps getting stuck on the first step any ideas why?
Stuck how?
Did you fill it in with a discord webhook? Any errors displayed?
just to clarify, the first step expects a discord webhook. looks something like this.
yah, i put in the link and it doesnt let me click next
am i doing something wrong here?
hmm, so next entirely refuses to work?
does the page flash then return?
wait
i think i solved it by looking at your link
when i did it from the actual discord desktop app it gives me a different type of link when you hit "copy webhook url"
but when doing it in the chrome version it worked
ah, weird.
thanks though that helped
oh yeah, thats my fault. Ill put in a bug fix tonight
only checks for discord.com links currently(whoopsie)
oh thanks, looking to add websocket support here soon potentially, maybe even vote counts too. so bot devs can do rewards/reminders a bit easier.
ah need to implement query strings too
from my perspective the api lets u:
get a bot's/user's info,
post stats to a bot,
webhooks?
or r there more 
hi
^
Same question + How to make a vote message?
Python?
https://docs.top.gg/libraries/python/
Bottom of the page
could you perhaps give an example? the only examples there are about posting server count
I meant the webhook in Python, Not java
That is python
Language?
Mind giving me a example coding for python about webhooks 😅
Bottom of this page it's literally copy paste
irs about uploading server count
The next one up
https://docs.top.gg/libraries/javascript/#webhooks does this work the same way for Discord Servers?
...

Mostly, just has a guild property not bot.
oke
Hello I have concerns our server in top.gg pages is error anyone knows how to fix that?
Hey, I am using topgg api to post statistics to my bot page, I am using the javascript version with this code
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const { AutoPoster } = require('topgg-autoposter')
const ap = AutoPoster('Your http://Top.gg Token', client)
ap.on('posted', () => {
console.log(`Posted stats to Top.gg!`)
})
but the amount of servers my bot is in is showing wrong, it shows on the page that there is 95 servers that use my bot but in fact there is 98 as discord shows, any help?
just to double check, what does console.log(client.guilds.cache.size)
give?
discord's invite page number is almost always off by some amount as they estimate server counts.
hey
console.log(client.guilds.cache.size)
``` throws up 95 (the number that is also displayed on top.gg page), so yeah probably discord invite page shows wrong, anyway thanks for quick help :)
the topgg-autoposter lib pulls the count from that when it posts, so it can only give that.
Hiii
im new to this,
what do i put in here??
?
my bot is hosted on heroku
Heroku ip
@craggy sentinel
this is like the "key" for auth that I can create, right?
yes
ok, thanks. finally updating from the dblapi.js package lol
@hot locust hey, what library are you using?
python
library, not language
dbl
that library is deprecated for quite awhile.
https://docs.top.gg/libraries/python/ is the current library
oky
this code
return bot.dispatch("dbl_test", data)
will send status 200 to topgg?
@jaunty plank
thats for test votes, the new library sends a 200 status on its own.
oh oky
How to change address ?
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 5000): address already in use
@jaunty plank
change this number
https://i.imgur.com/k5wpY6V.png
and change from website topgg?
yeah, whatever it was on before needs to be the new number too
@jaunty plank How to Post shard count?
bottom example https://docs.top.gg/libraries/python
this?
bot.topggpy = topgg.DBLClient(bot, dbl_token, autopost=True, post_shard_count=True)
yep
post_shard_count and autopost post every 30 minutes?
\
@pastel raptor
hi,i trying to take the token but it's still redirect me to this everytime
Ctrl + F5
If not worked, clear cache and login into topgg again
what should i put my webhook destination to?
what is this?
A deprecated option
define what? the deprecated option?
its deprecated
did you fill in your token, with a topgg token?
@here does anyone know how i get my API key?
regenerate your token and try again
your bot page, edit, webhooks, showtoken
they are something bots use when they get in over 2500 servers.
discord only allows 2500 servers per connection, so if your bots in over 2500 you need to shard and have multiple connections
its something your bot uses, if you dont use it dont worry about it.
Does anyone have a layout on how I can implement guild counts for my bot?
Like that
You need to post them to the API
Take a look at the pins, the docs are listed as well as code examples etc.
Can u help me with that?
I kinda hinted at this in #support but we cant help without knowing what language and library.
Js
wherever a bot client exists and makes the most sense to you.
It keeps erroring
@jaunty plank
what error?
depends, what is the error?
you cannot declare client twice
You already declared client before
So what do I do?
I am working on a bot. I want to reward the person who votes on top.gg with a 24hrs premium. I have achieved it. But after voting the user has to use a command to claim premium. I want it to be done automatically as soon as he votes.
You can check the current version here: https://top.gg/bot/875678983465885706
I mean can I get a snippet?
you define the auth yourself.
line 15 is the way the webserver is started
"app" in this case is a webserver using express.
"listen(80)" tells the app(webserver) to start and listen on port 80.
Ok thanks
I mean there must a way to define it how to do that
my favorite method is to just smash on my keyboard
dnnhjoFOINFoifr90suojks
perfect
^_^
its like a password, you are the one who decides it.
but since its a webhook you dont need to remember it, so any long random text will do fine.
Thanks
The two apis are likely not compatible
nor would be provide help for a competitors api
I mean this dbots
https://dbots.js.org/#/docs/main/latest/general/welcome
or is it from the same company?
yeah not an official library, you wont get support for that
its not from top.gg
if you need help with it, consider using their support server
okay understandable thanks! 🙂
the request are returning response 400, why?
AH
sorry if I speak english wrong :/
is this to send the servercount?
yes
make sure to include a content type
should do, but not the latest version 3.1.2 is latest
but the only change i see needed in the above request is the need for the content type header
np
how to get my top gg token?
Read pins
Thank you 
I can't listen to two ports in the same app?
how to active servers count?
No, 1 port can only be used for 1 service
const express = require("express");
const app = express();
const webhook = new Topgg.Webhook("secret");
app.post("/dblwebhook", webhook.listener(vote => {
// vote will be your vote object, e.g
console.log(vote.user);// 395526710101278721 < user who voted\
vote.user.send(`Thank you for voting (:`);
var current = new Date(); current.getTime() = 1426060964567
var followingDay = new Date(current.getTime() + 86400000); // + 1 day in ms
premiumGuildSchema.findOne({
User: vote.user
}, async(err, data) => {
if(data) vote.user.send(`You have already got rewards for voting in last 24 hours! What you want double premium?
Anyways thanks for voting in less than 24 hours (:
\`Note: If you have voted then you can get a special role in VOTIFY's support server.
To join support server use the button at the bottom of the help[v!help] command (:\``);
else {
const Expire = day(followingDay).valueOf();
new premiumGuildSchema({
User: vote.user,
Expire,
Permanent: false,
}).save();
return vote.user.send(`As a reward we have given you premium {lasts for 24 hours from now!}
\`Note: If you have voted then you can get a special role in VOTIFY's support server.
To join support server use the button at the bottom of the help[v!help] command (:\``);
}
});
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))
app.listen(2200);```
It won't works as expected
Whenever a user votes he doesn't gets a dm and even he doesn't gets premium
Are you getting the webhook request at all?
How to check?
No
how can i create like if someone votes my server , he will get a reward in my server ?
Is the url and auth filled in on top.gg?
This channel is specifically for top.gg apis
Just a reward role? Or using webhooks?
where should i go
Auth is but what about url?
reward like some money , ( example - casino coins )
Url needs to be the url to your webserver, on the path /dblwebhook
Is this casino bot your bot?
Or someone elses
yes it's mine bot
You'll want to use webhooks to get vote events then give them coins.
What language is the bot in?
english
oh sorry
You mean the url is /dblwebhook
js
No that's just the path
Where is your bot hosted? Vps, heroku, replit, home?
yes i read that , but i have no idea how to give reward
Replit
@raw bough let's not spoon feed
Ok sorry
Yourrepliturl/dblwebhook
Ok thanks I am trying
Get webhooks working, then focus on the reward. Its a bit easier
Btw can I use 2 webhooks simultaneously?
Not with top.gg, but if you want to forward another to another webhook you can from your code
big booty
Yes I want
As I am using my webhook with a vote counter bot
so should i copy the whole code on the docs page
Edit it in ur way
The example code for webhooks should work fine
You should focus on getting this webhook to work first
Like I have this url as input in top.gg https://somename so can I use the same in my code?
You'll want to use your replit url, then the path you define in code.
But then the vote counter will go down
You cannot use the vote counter directly and your code too
I use a separate bot for that
If you want to use both you need to forward the webhook in your code.
Otherwise there's no other method
And how to forward?
You'll need to get the current webhook working first to do that
Ok
is there any video that it shows step by step installation of top-gg api ?
Not that I'm aware of
Woah its spamming
And also says vote.user.send isn't a function
port 200?
hmm, weird the sdk is supposed to do that for you
potentially because your code is erroring?
I think its repeating because your code is erroring.
youll need to fetch the user, vote.user is just an id
how to get token of our server ?
you need to use your bot library to fetch the user, the top.gg sdk doesnt do discord functions for you.
servers dont get tokens
then now ?
you need to use webhooks to do what you want to do, you do not need a top.gg token for webhooks
how to fetch user from I'd in discord.js ?
I can do id from users but have no idea about vice-versa (:
Ok I will check above docs
then what to put here ?
const webhook = new Topgg.Webhook("your webhook auth")
your webhook auth, you are the one who decides that. its like a password.
how to get that ?
any way you want.
if you just want to smash on your keyboard for a few seconds that will do
just make sure its the same for your code and the website.
I did
temp.send("some text");```
Still shows temp.send isn't a function
@jaunty plank means bro I didn't get it ? sorry
ok, imagine you are signing up for a website.
you they ask you for a password.
the webhook auth is like that, you need to decide what that password is.
I did
var temp = fetch(vote.user);
temp.send("some text");
Good to go?
ohh
nope
means i can put there anything
yeah, as long as you fill it in the same way on the top.gg website
I have to use Discord.fetch()?
also nope, you need to use it on the usermanager of your bot client
Uh?
ohk i got it
almost, client.users.fetch(user.vote);
Ok
ohk i got Authorization , but form where to get Webhook URL?
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=users
client.users
users is a UserManager
UserManager has fetch();
https://discord.js.org/#/docs/main/stable/class/UserManager
fetch is a promise so you will need to await it.
where are you hosting again?
replit/home/vps/heroku?
Still temp.send isn't a func
replit
did you await the fetch
YourReplitURL/dblwebhook
for forwarding the webhook?
youll need an understanding of how web requests work.
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#supplying_request_options
and https://docs.top.gg/resources/webhooks/
any example bro please
what to put here ?
const topgg = new Topgg.Api("")
for my server
api token
you cannot use that with a server
then what should i use
how to i get voter username instead of voter id
${vote.user} to username ?
I am using Vote Tracker#2242 and how to it gives a webhook url to fetch so how can I keep my own webhook and it's webhook too
Check above I just discussed the same
i am not getting it bro , can you please give me
what to put before .hasVoted ?
if (message.content === `vote`) { .hasVoted(message.author.id).then(c => { if (c) { message.channel.send("you voted") } else { message.channel.send("you didn't vote") } }) }
You'll need to forward the webhook.
@raw bough
You cannot use hasvoted, you must use webhooks
bruh
Go to #support and read the pins
it takes 1-2 weeks to get to your review
ok
so how to make a command vote for server ?
and does anyone know how to approve the bot we made
You gonna use the API to fetch the voter or webhooks and use the user ID (of the voter) in your with whatever you wanna do with it
Servers can't use the api.
Thought he means a command in his own server lol
hello does any one know how i approve my bot
it dont have answer of my question
it say how much ti me it take but my question is how to approve my bot
Did you already submit it on topgg?
so what should id do ?
Then read the post again and wait.
ok
I've linked to how to do it several times I can't keep repeating the same things
I didn't understood by reading the docs
Anyone know cookie checker bot?
you told to use use webhook , i did that , but i don't know how to make vote command using webhook
Do you even know what are you doing or you're just copy pasting things
Our docs don't cover forwarding webhooks.
You'll need to use fetch or another library to send webhook requests to other platforms
Like node-fetch
Seems to forward to discord not your vote tracker
Probably best to do it manually with code anyway. Really good learning opportunity
I checked through its repo
I think editing index.js will be a good idea
Anyways I will follow what you said i will do from scratch👍🏻
Someone deleted it?
Make sure, port 80 (TCP) is opened up.
Webhook url configured on top.gg website?
yes
no
Then what's ur problem
i want to make a command which will only work after voting server
On servers votes to vote lock commands you'll need to store the webhook data in a database and access it.
Preferably with a 12‐13 hour ttl
is this correct code ?
if (message.content === `vote`) { const webh = await client.users.fetch(vote.user) message.channel.send("you voted") } else { message.channel.send("you didn't vote") }
top.gg gamer , am i doing correct bro ?
If somebody writes vote into the chat, you gonna respond with, you voted... weird
yes bro
You might wanna check before if he has actually voted.
@plucky lance do you mean this ? ⏫
Yep, with that data you'll need to put it into a database then access it in the command
how should i put it in database ?
is there any docs regarding this ?
You need to setup a database, integrate it into to code, then work with it, like querying it, saving and fetching data
i am using quick.db to save data
Alright, you should know how to fetch and save data then
sorry to say , but I really don't know

If you receive a POST request with the webhook, save the user ID in your database and the current timestamp
If somebody runs your "vote only" command, query your database and check if he has voted (generally or in the last 12 hours - whatever you prefer)
If you still have no clue on how to do it, I highly suggest doing basic stuff without webhooks first (such as working with quick.db, then basic requesting / webserver hosting etc)
if(!db.has(``${message.author.id}.use``))
why did all my votes just reset?
votes reset monthly
-botinfo 816798869421031435
how come my bot stops updating the server count after around a week of the bot being online?
Take a look at the response you get from topgg
A lot of internal server errors have happened the last weeks
How frequently do you send requests?
every 30 mins
Hmm might be a decision by Cloudflare locking you out.
Impossible to say why…. 
How i get the api, i readed https://docs.top.gg/ and still cant find that token.
Go to https://top.gg/bot/[YOUR_BOT_ID_HERE]/webhooks, and scroll down to "Token"
-botinfo 876383024089006100
-help
I tried the webhooks forwarding but can't achieve it
-bots
-bots
-botinfo 892796343792336986
How do i set up one?
You can use one of our given libraries to do it
Yes?
Wut am i supposed to outin the password field of dbl_webhook
You can set it as whatever you'd like
It just has to match what you put in your server/bots webhook page
Its running on 2 instances
Then you prob port it wrong
but dis is the node and port
you need to add /dblwebhook on the end of that URL
oh
like dis?
indeed
Did you enter the correct password?
yes

what do i put in dbl_webhook() to do it without the password
tanks
np
i went to the webhook url and this was what i saw, does this mean i cant do it?
Yeah, that's a issue with your host.

It's supposed to be POST only
Can anyone show me how to do webhook forwarding
so if i run a webhook at /dblwebhook on replit, what will the webhook url be
when i put ${vote.username} , it's give me undefined
aurel any solution
vote is not defined
i want the username of the voter
not possible
vote.user returns the id
which you can then use to fetch the user
vote.username does not exist
check the docs
then how can i get voter's username ?
how long will it take to review ? im just askin
@rain heart
fetch the user from the id, that's basic discordjs knowledge
check the djs docs
so like https://ChuckVoting.thekungfuchuck.repl.co/dblwebhook ?
try it and see
but it shows dis
opening it in your browser is making a get request
which it does not support
top.gg makes a post request to send data to it
HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can also be nouns, these request methods are sometimes referred to as HTTP verbs. Each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempot...
ok
it workss
thankss
so the response is in json right?
Yes
what is this tho
ok it works, but i did this on replit, and now my keep_alive wont run
cuz my host doesnt allow webservers
client.users.cache.get('id')
correct ?
If the docs say that, can't help as I don't code on js
how to get the total votes of the user ?
you can't, you'll have to store that information yourself
top.gg does not provide such stats
ohh

Hi! I have a question: Im coding my Bot but I would like to add a vote system on it. The problem is that you guys need to verify my Bot on the top.gg website, and then I'll be able to use the API. But there's another "problem": Im currently coding it, so the Bot will not be available for you to test the features. Will the verification be denied? If yes, will I just be able to add the vote system when my Bot is finished?
Ideally you should wait to add these features after approval.
Otherwise we may need to contact you to give us access(since we can't vote before approval)
how do I need to use the server_count ?
I've found how I need to use it, I'm gonna try that now
Hey, I have a question, When I post my bot stats to top.gg, I'll required to post my bot stats again or it will update automatically?
Can someone teach me js. If I learn it well then I'll gift 1 year nitro
Or should I claim it
This channel is ONLY for the Top.gg API!
This channel is only for: suggestions/help/bugs to do with official API libraries and API docs found at: https://docs.top.gg
Any Off-Topic conversation may get deleted and muted.
If you need help with development about your bot or development in general, feel free to use #development.
ÑÑÑÑÑÑÑÑÑÑÑÑ
what values does the isWeekend return?
if im not mistaken its a Boolean yet all thats getting returned is undefined
not sure if it being a test vote effects it or not but 
how do get votes for a bot in python
it is undefined because weekend ended?
isWeekend returns 1 or 0
You cannot use discord webhooks
You have to use a webhook that processes the data top.gg sends
You then have to use your webserver, not discord webhook
@sacred shell
is this scam?
i click the button but the protcter wont let me so i eed to be protcect my pwd so i ant
How do I set up vote rewards for my bot
your bot will need to be approved before you can do that.
however, youll probably want to use webhooks.
https://docs.top.gg/resources/webhooks/
no, test votes just give undefined for the isWeekend value for some reason
oh
Hi is it possible to post Votes to the API?
Does anyone know which package I use to pull user votes
Does anyone know what this is
@whole python
In order to clear your cache for the site, press CTRL+F5.
If this does not work, try one of these resources below:
Instructions on Microsoft Edge
Instructions on Google Chrome
Instructions on Mozilla Firefox
Instructions on Safari
Instructions on Opera
Instructions on Brave
What programming language?
javascript
Documentation for @top-gg/sdk
This is the library
https://www.npmjs.com/package/@top-gg/sdk
@jolly moth
?
how to calculate the total votes of the user ?
you will need to track that
how sir ?
webhooks and a database of your choice
https://docs.top.gg/resources/webhooks/
i am using webhook for my server votes
from there youll need to save the votes for each individual user in a database, incrementing it each time they vote.
is there any guide for top.gg on database ?
like how to interact top.gg api with database
realistically the database queries have nothing to do with topgg, you are just upserting data.
so no, we dont have anything for that. a bit of research will get you what you need
its all one api.
https://docs.top.gg/
ty
how to i make the server count of my bot show on the voting page thingy
https://3sj.today/i7MULmvT
like that
Library?
https://docs.top.gg/libraries/python/
Bottom section
once posted, 30 minutes or so, you may need to clear your cache.
There should be an api token that goes with that
i put the wrong token xD
oops ^_^
I am thinking to take errors/console_logs in a specific call and send all of them to a specific channel in my server
So what I thought is everytime I use console.log , I will replace it by calling a specific file say log.js
Can anyone guide me about this (:
Ok
Hi i get this error when i try using the autopost topgg cog for python
did you fill in the authorization?
yes
i generated a new token
i think the old one had some issues
imma try it now brb
It worked now
weird. has happened to a few others too
aye just wondering if there an voted event for @ top-gg/sdk like
client.on('voted', (user) => {
client.users.cache.get(user.id).send('Thanks for voting')
})
It also won't be a client event, but an express event
Im trying to create the vote webhook but i get this error
i changed the port a bunch of times already
Try add your pubic IP address instead of 0.0.0.0
Maybe python isn’t able to get your public address or there are multiple IPs assigned or non-static ones
do you know if your provider has shared nat?
idk
any way to check that?
Yeah VPS mostly got floating IPs only which aren’t static and the OS notices this
Try to add your public IP address
A small number share ips between vps, and can cause issues like that yeah
do i add the ip before the port?
You must have specified the IP somewhere?!
I didnt i got the code from the example to test it
I think the py lib auto assigns it
yea
Looks like it fails to assign it
imma go check in the py lib
I hope this error is regarding the IP address and not the port
Dunno py good enough to be 100% sure
Nah I don’t think so […] bind address on
But who knows py is weird anyways

I mean the line of error is mentioned in the error message
found where the ip is assigned
Go into the file of the lib and replace 0.0.0.0 with your actual IP
its auto assigned in the topgg module
yea
the ip i use to connect to the vps right?
Yes that’s it’s public IP
ok imma try it now
If it still doesn't bind contact your vps provider and see if it's NAT
You may need to request access to a port
its still showing the 0.0.0 ip for some reason I think i have to change it in more files
Alright gtg, report back please
i will thx for the help
I think i got it now...
how do i get my webhook link is it http://myip:port/dblwebhook ?
i get this when i try using the test for the webhook
I got it working now
@plucky lance
http://myip:port/dblwebhook
not /:port
i did :port but it puts a /
Ah
when i edit the / disappears
is your method set to get(code side)?
it needs to be post
not sure why it would error though.
ah
its http
also the error before was part having to change the files from 0.0.0 to my ip
and cant use cog reload on the webhook
bc it tries to run on the same port and gives that error
have to restart the bot
Does it work now?
Discord doesn’t allow to add a port to the URL
It does automatically add a slash before
ah i getchu
yes
Great
Aye remember this was an issue we noticed a few weeks ago
We shall never know
try regenerating the token and using that.
I think I did not save the token but now regenerated and saved and worken right now thanks 
what is this for in the webhook part?
Top.gg will have whatever you put there as the Authorization header whenever it makes POST request to your end
so i can type anything i want there?
Correct
and on this is should put my discord webhook link from the webhook i created right?
because i did it and if i click send test nothing happens
It doesn't directly support Discord webhooks afaik, you'd need to use something like Woo's thingy: https://webhook-topgg.com/ if you can't be bothered to set up your own webserver
Hi Woo
okey thank you, its because i found a webhook vote tracker on githubg and yeah
im struggeling a little bit xD
not that anyones asking, but it soon will support vote tracking and streak tracking
yeah but not at the moment 
well, beta has it.
should be functioning(tests will show undefined)
ignore the animation kek

relogin to the site
yeah
should do
How To Make Vote Reminder System For The Bot ?
is your webhooks working?
yes
make a new db table which stores userid's and revote times(12 hours added to the current vote time)
then every few minutes search for rows which are expired, any you get send a dm reminder.
i have a problem , i can't use message.author.send outside client.on("message", async message => { , then how should i solve this ?
youll need to fetch the author(more specifically user)
Because message isn't defined outside the event scope
Problem Solved Sir , I Just Changed message.author.send to user.send
As i have defined user
👍
uptimerobot re-start everything after 24 hours , is there any other hosting platform , which give 24/7 hosting?
@jaunty plank what is billing.galaxygate ?
Free hosting
galaxygate costs money
😐
Do you know the best free hosting ?
free is never good
I dont know of any free hosts which are 24/7, I also dont know any good ones
read pins in #development why that's never a good idea
I am a student , my parents will not give me money
😢
Free and paid hosting
i use them for one of my bots
Education pack for github - $100 free credit for DigitalOcean (Host a discord bot on there on the lowest plan for 20 months free)
Is this 100% safe & secure?
Yes
Nice
You get your own account
still need CC to register an account on digitalocean
danbot bluefox
One Person Told Me Autocode Is The Best , So Is It Best?
It’s not very good no
2021-10-09T07:16:53.608272+00:00 app[Worker.1]: /app/node_modules/dblapi.js/src/index.js:1142021-10-09T07:16:53.608296+00:00 app[Worker.1]: response.body = res.headers['content-type'].includes('application/json') ? JSON.parse(response.raw) : response.raw;2021-10-09T07:16:53.608297+00:00 app[Worker.1]: ^2021-10-09T07:16:53.608298+00:00 app[Worker.1]: 2021-10-09T07:16:53.608298+00:00 app[Worker.1]: TypeError: Cannot read property 'includes' of undefined2021-10-09T07:16:53.608302+00:00 app[Worker.1]: at IncomingMessage.<anonymous> (/app/node_modules/dblapi.js/src/index.js:114:55)2021-10-09T07:16:53.608303+00:00 app[Worker.1]: at IncomingMessage.emit (events.js:412:35)2021-10-09T07:16:53.608303+00:00 app[Worker.1]: at endReadableNT (internal/streams/readable.js:1334:12)2021-10-09T07:16:53.608304+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:82:21)2021-10-09T07:16:53.743549+00:00 heroku[Worker.1]: Process exited with status 12021-10-09T07:16:53.818515+00:00 heroku[Worker.1]: State changed from up to crashed
I'm getting this error from the dblapi package which causes my bot to crash
I've been using it for a year and never had this issue
same
maybe you can move to https://docs.top.gg/api/@reference/
yeah i will do it.
yet another day the top gg api fails
what do you mean? am i supposed to go to a generic support channel when there's a topgg api specific one already created?
TopGGAPIError: 522 undefined
at Api._request (/home/runner/Clash-Chest/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Api.postStats (/home/runner/Clash-Chest/node_modules/@top-gg/sdk/dist/structs/Api.js:99:9) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api//bots/stats',
status: 522,
statusText: undefined,
headers: [Headers],
counter: 0
}
}
}
/node_modules/dblapi.js/src/index.js:114
response.body = res.headers['content-type'].includes('application/json') ? JSON.parse(response.raw) : response.raw;
^
TypeError: Cannot read property 'includes' of undefined
at IncomingMessage.<anonymous> (/node_modules/dblapi.js/src/index.js:114:55)
at IncomingMessage.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Keep facing this error recently, any changed in the API?
bot needs to be approved
it is but not approved, does it needs to be?
yes
i use free host but its very good
Using the by Aurel linked docs to configure receiving webhooks by topgg
The user ID of the voter the webhook will send to you is all you need to work with
And probably the timestamp if voter only commands should be available only within the 12 hours until a voter can vote again
You gonna fetch the user ID you got via. djs and can then send a message to him or save his information in your database (or cache)
I wanted to use the webhook events but I think I'm too dumb to enter the correct configs to the webhook settings because it ain't sending test events
where are you hosting? vps, heroku, replit, home?
vps
windows server 2012 or 2019 I dont remember
windows server has a firewall by default youll need to allow the port through that firewall
your url will likly look something like this
http://YOURVPSIPHERE:YOURPORTHERE/YOURPATHHERE
so for example, http://1.1.1.1:3000/dblwebhook
do I have to enable any settings or just try this in webhooksettings
on topgg? you just need to edit the webhook settings with the url and auth.
ah thanks, was googling for it

could u tell me where to enter this 
You can run the command in the command prompt or use the GUI
That bot wasn't found

