#topgg-api
1 messages · Page 165 of 1
Alright, have a good one
does anyone over here use heroku
@coarse rune i do
ty!!!
how works this @dull thunder
does anyone know this
pls
euh
i need the webhook URL
It’s your endpoint topgg sends requests to.
i have never used webhooks but
you have to make webhook first then get the url
but how to make a webhook
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.listener(vote => {
// vote is your vote object
console.log(vote.user) // 221221226561929217
})) // attach the middleware
app.listen(3000)
tysm
then the link should be https://test.herokuapp.com/dblwebhook
np
const express = require('epress');
const Topgg = require('@top-gg/sdk');
const app = express();
const webhook = new Topgg.webhook('');
app.post('/voted', webhook.listener(=> vote {
let channel = client.channels.cashe.get(874591442805334026)
let user = client.users.cashe.get(vote.user)
channel.send(`<@${user.id}> has voted for ${client.user.username}!`)
}));```
why this dont work
cashe ??
it should be cache
shouldn't it be /dblwebhook
ow 😂
dosen't matter
Path doesn’t matter as it’s no physical path
You just copy and pasted that right into your existing code…
it is my second time that use js
It was just an example to use, Akio gave you.
it should be "express" not epress
*epress moment
You forgor the app.listen part
nvm
at=error code=H10 desc="App crashed" method=POST path="/dblweb" host=test.herokuapp.com request_id=482cbf55-796f-420a-8ceb-319796339914 fwd="159.203.205.187" dyno= connect= service= status=503 bytes= protocol=https``` this is the error in the logs
the path was /dblwebhook If I remember (The official code)
and you've put /dblweb
yea i know i changed that
then change the url
test.herokuapp.com/dblweb
u mean like this?
i already did it
at=error code=H10 desc="App crashed" method=POST path="/dblweb" host=test.herokuapp.com request_id=482cbf55-796f-420a-8ceb-319796339914 fwd="159.203.205.187" dyno= connect= service= status=503 bytes= protocol=https``` still same error
Show the code
and the actual error
not that one
there should be another one like Unexpected blah at position blah:69
const express = require('express')
const app = express();
const Topgg = require("@top-gg/sdk")
const webhook = new Topgg.Webhook('my auth token')
app.post("/dblweb", webhook.listener(vote => {
console.log(`${vote.user} has voted for me!`)
app.listen('3000')```
@smoky marten
is this an error
show the line where you did app.listen()
you should do app.listen(process.env.port)
ok...
thats why it crashes btw
put an empty line and make it 69
then do what rais told you to do
so in my env file i should put port=3000
why did you put app.listen within the app.post ?
app.listen() requires an integer value
You passed the port number as a string
ok
what do u mean
Is should be app.listen(3000) not app.listen('3000')
btw it would still not work because heroku stink
This is also facts
app's name is moderatorhosting for hosting my bot for moderation
I yeeted heroku 2 months after starting bot development. Got a cheap VPS instead.
btw mb but it was process.env.PORT
do this
const port = process.env.PORT || 3000
app.listen(port)
```@coarse rune
ok
is there a way to send vote message through the bot instead of webhook
idk how to use a webhook soooo...
top.gg webhooks != discord webhooks
yes set up a top.gg webhook
i'm not able to make the on_dbl_vote thing
i've been trying since yesterday
One message removed from a suspended account.
One message removed from a suspended account.
so you know how to get votes?
One message removed from a suspended account.
idk how to even get votes T_T
Thanks it works now thanks a lot
hi can someone help me adding async to webhook listener
How do I edit the api?
It's not supposed to post into your Discord channel if you're speaking about you added your Discord channel webhook URL to topgg.
so where it supposed to POST
To your endpoint and your endpoint will then deal with the data you got posted.
can i use IFTTT to do that
(webhook service aka. webserver listening to POST requests)
never heard of IFTTT, no clue
its the best one
You can manage that yourself and receive requests yourself or a third-party serivce. However you like.
can i do it inside the bot\
like listen to a port
and then check the data i received
using while True:
well heroku wont let me lol
You can create a webhook service within your bot and listen to the POST requests or simply using a seconds instance of your bot.
Whatever you prefer.
Take a look at the docs being pinned in here.
They actually provide code examples for webhooks and how to integrate them.
Then what is webhooks used for
Receiving POST requests from topgg at the moment the event's getting fired, e.g. someone votes for example
So it doesn’t send it to a discord channel?
Sorry never used api’s before I’m confused
As I explained above, no it does not interact with the Discord webhooks
It does only interact with your own endpoint.
And your own endpoint will handle the data you received.
I don't think so, that wouldn't make any sense for topgg.
Why should it interact with Discord webhooks?
What is it supposed to send to Discord channnels?
How does topgg know which channel to send a message to?
Etc.
It basically sends a letter, SMS, whatever telling you user X has voted.
And you will decide what to do with that information.
Saving it in a database, posting a message on your Discord server pinging user X etc.
Hola bienvenidos a CHI LE
const Top = require('@top-gg/sdk');
const express = require('express');
module.exports = client => {
this.top_gg = null;
if (process.env.TOP_GG) {
const app = express();
this.top_gg = {
api: new Top.Api(process.env.TOP_GG),
webhook: new Top.Webhook('Demon12345')
};
app.post('/dblwebhook', this.top_gg.webhook.middleware(), (req, res) => {
client.emit('userVoted', req, res);
if (res && res.status(200)) {
res.send('OK');
}
});
app.listen(3000, () => {
console.log('[dbl] Connected!');
});
}
function _post() {
const serverCount = client.guilds.cache.size;
this.dbl ? this.dbl.post() : null;
this.top_gg ? this.top_gg.api.postStats({ serverCount }) : null;
}
function init(loop) {
if (loop) {
this._post();
setInterval(() => this._post(), 1800000);
} else {
this._post();
}
return;
}
_post();
};
Why its not working 😕
what isnt working
hi
what is defAvatar used for? how can i turn it into a cdn link?
its the hash of the users avatar. https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
whenever i try to do send test webhook
it returns this
its been for a few days, my webhook url is right and webhook auth too so ee idk the problem
can i get the roblox scripter here
known issue 
is dblapi.js library still compatible with discord.js 13
My problem is when I vote for any bot after voting when I claim reward it doesn't give me any reward it only show me vote link
I added the dsl bot like 5 times and its still showing to add the bot to the server..... 
#support is a better place for this issue
umm......
Excuse me,
wtf
bots/:bot_id/check do this check for all time vote ?
or monthly
should i make webhook to check for daily vote ?
<ul>
<li>pog</li>
<li>poog</li>
<li>
<li>smol pog</li>
<li>big pog</li>
</li>
<li>your mom</li>
</li>
last 12 hours
require('dotenv').config();
const Topgg = require("@top-gg/sdk");
const TopggApi = new Topgg.Api(process.env.TOPGG_TOKEN);
module.exports = async (Discord, client) => {
console.log('🤖Ekko Bot is online!🤖');
client.user.setActivity(`${process.env.PREFIX}help`);
let votes
let monthlyVotes
await TopggApi.getBot(client.user.id).then(bot => {
votes = bot.points
monthlyVotes = bot.monthlyPoints
})
const structDatas = [
{ key: 'Username', value: `${client.user.username}`},
{ key: 'Joined Guilds', value: `${client.guilds.cache.size}`},
{ key: 'Total Votes', value: `${votes}`},
{ key: 'Monthly Votes', value: `${monthlyVotes}`},
];
console.table(structDatas);
}
im getting this error:
TopGGAPIError: 520 undefined
at Api._request (C:\Users\lucam\Desktop\Ekko Bot\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async module.exports (C:\Users\lucam\Desktop\Ekko Bot\events\client\ready.js:12:2) {
response: Response {
// a bunch of weird things here
}
can anyone tell me whats wrong with this?
the site is down
oh
is there a way i can check if the site is down before checking for votes?
just so i dont get errors/my bot stops
Just make a request and see if it returns 504
Website is down right??
Yep #site-status
do a trycatch function.
try{
// Your code
} catch(err) {
console.log(err)
}
Hi, what i have to put here ?
the url that you are posting the information to
why r u awaiting when ur doing .then 
hey how do i get my bot to disply as online?
wait
nvm
remembered the docs
with the autoposter it says unsupported client, whats going on?
Where can i fund id
?
the url that you are posting the information to
I want send the vote message with my bot
a discord webhook ?
no
it's like setting up your own api
If you have no idea about what that is please refer to these
https://www.freecodecamp.org/news/apis-for-beginners-full-course
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Introduction
https://www.mulesoft.com/resources/api/what-is-an-api
https://snipcart.com/blog/integrating-apis-introduction
https://blog.hubspot.com/website/application-programming-interface-api
https://www.w3schools.com/js/js_api_intro.asp
https://medium.com/the-era-of-apis/how-to-use-an-api-the-complete-guide-d701e32c7c9f
-_-
Just go and read (if ur using JavaScript) node.js express documentation. They will litilery give you a code snippet of a basic webhook.
is there a part of the api where you can fetch your bots reviews? e.g. for a /reviews command that allows people to see the average star rating and based on how many reviews, alongside also being able to for example get a random review that gives a certain star rating or any and then show that review as like a /showrandomreview command
I see the part where it could be abusive, but the reviews fetched could be completely anonymous, sending the bot no userid, username, or anything else that may help identified who the review was made by so that bots can't break the rules by telling people to review for a reward
but then again, people could still just scrap the page and then do the same thing anyway
You can use this API endpoint to get the reviews:
https://top.gg/api/client/entities/:bot_id/reviews
You can also use page query like this:
https://top.gg/api/client/entities/:bot_id/reviews?page=1
alright, thank you
is there also a webhook for reviews?
That endpoint isn't official
Webhooks might come later
Previously used top.gg's java lib to update my bot's server count just fine, but decided to try out updating both shards and server count. According to the docs this should work but it doesn't seem to, anyone got a clue what I'm doing wrong?
https://upload.livaco.dev/u/kh0YVvSdw4.png
https://upload.livaco.dev/u/iCtWoAINdy.png
Heya! I'm unsure where i could Fix the vote logger for my bot, it has been sending so many upvote messages 12 times everytime someone votes (it has been awhile since I've made the webhook)
I've checked the https://docs.top.gg/resources/webhooks/ site but it didn't help much
you need to return a 200 status code on a valid vote.
we repeat webhook attempts until a valid status code is given. this is just incase one fails.
ah, thank you
How do you post it?
If you use the topgg SDK then posts happen only frequently not in real time
(every 30 min I believe)
Update on my post: The server count has magically popped back into existance but the shard count still doesn't seem to be there?
I asked a question about wheter i can find out if someeonee voted my bot and someone told me 2 come here for further help
What lib do u use?
python
Then go to https://topggpy.readthedocs.io/en/latest/
thanks
Np
is it posting successfully?
check your logs
hey hi for some reason it wont let me setup the webhook in topgg
like
i click save
but nothin happens then refresh its gon
its like the button dont work
i even voted to see if it was workin b ut nah
hi so can someone link me to the docs, i want to know when a user votes for a particular server.
vote tracker bot
i mean, can I get to know who voted for a particular server?
uhhh
oh nvm found it
aight
your bot will need to be approved first
however https://docs.top.gg/
where can i find my bots topgg token
you dont have one yet, as your bot isnt approved.
however it will show in the webhooks section of your bot once approved
hmm k
how works this api?
#credits @A Moto 100
top.gg.api does not exist
check the docs
I didn't got from docs😅 sorry
hey how can i get the password for the webhook?
or the Authorization
pls tag when answer
The authorization is a value you can specify to make sure the request is coming from topgg checking it in your script (like a general password check).
It’s not necessary needed to use it.
"a value you can specify"
u mean token ? check the pins
Can I have 2 Webhook URLs for a discord bot.
I guess not
But you can forward the request
Yeah, didn't think that
Tq
np
Ok i'll look
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
What to write in yourDBLTokenHere and password
yourDBLTokenhere
Yes what to write top.gg token ?
thats your choice
how am i supposed to know its reason if you don't show the error
const dbl = new DBL(token, { webhookPort: 5000, webhookAuth: 'password' });
^
ReferenceError: token is not defined
at Object.<anonymous> (E:\C) Developing\Wolfy\index.js:47:21)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
I replaced top.gg token with token
@willow spindle
learn basics of javascript before making a bot
Bruh
^^
Know basic Js , Read Docs and Use your brain
const topgg = require("@top-gg/sdk")
client.topgg = new Topgg.api("my token") ```
I replaced my token with token
Why it didn't worked
topgg and Topgg
know the difference
^^
please learn js basics before copypasting some code
Didn't copy pasted if copy pasted then why it would e wrong 🙄
Ok but thx it started working 👍🏻@smoky marten @hearty vortex
Hi, I'm using this code:
const fetch = require('node-fetch')
fetch(`https://top.gg/api/bots/my-bot-id-yes-the-right-one/stats`, {
method: 'POST',
headers: {
"Authorization": "My-token-yes-it's-the-right-one"
},
body: JSON.stringify({
server_count: 3273,
shard_count: 2
})
})
.then(res => {
console.log(res)
})
But I'm getting a 403 response. Does anyone know what I'm doing wrong?
yes but ever since I switched to discord.js-light it told me I was using an invalid client
also, i think the correct syntax is serverCount, shardId, shardCount, but not entirely sure
oh ok
I copied the docs
ok ok, i was not sure
are you actually sure you are using the right token?
https://top.gg/bot/my-bot-id-yes-the-right-one/webhooks
^ your token is found on this page
not your bots discord token
I could check again, I'm sure enough it's the right token tho
👀 i just copy pasted the code into my own env and it didnt auth error, until i put the wrong token in.
ohhhhh wait I'm a bit dumb, I used my test bot ID not the actual one 🤦♂️
thanks for trying to help tho lol, my bad
hmm, would have expected the site to 403 that, not 401
ill poke the dev team about that.
oh you got a 403
smh
I got a 403
my-bot-id-yes-the-right-one
im a goof
the 401 was when I forgot the auth, but I figured that one out.
that makes two of us 🤷
i join
how do i get if a certain member votes for my bot in python
How do i track top gg votes in my bot
like an event? youll want to use webhooks
Yes i want to give prizes who vote my bot
an event, or just want to check if they have voted within the past 12 hours?
yeah just webhooks then
How do i set this weebhook like @someone just voted
check if they voted
https://docs.top.gg/api/bot/#individual-user-vote
There are libraries that may help listed on the left menu too.
youll need to receive the webhook and then send that message in a channel.
im somewhat afk, ping me if im not responding
what does this mean {"error":"Forbidden"}
it means you're not allowed to do that
enable voting in your bot? like a command to vote?
yes
we dont allow that. you can just link to the voting page
ban]
ban that fellow
bro no ,like botprefix-vote
@jaunty plank
we dont allow voting from bots. all you can do is link to the voting page
not voting from bots
voting for my bot
i need to implement
like dank memer
mudae
pls vote command
how ?
like
like whati get from top .gg ?
in backend
oh you want a webhook?
yes
let vote =client.topgg.hasvoted(message.aurthor.id)
if(!voted){
message.reply('first vote me on top.gg') ```
Is it ok
As it is showing type error
let vote =client.topgg.hasvoted(message.aurthor.id)
message.aurthor.id ??
I had to make a commamd vote require from top.gg api so the command where i use this code showing type error
It's showing type error cannot read property hasvoted not defined
ازاي اجيب api token من توب جي جي حق بوت حقي
Is there an error here?
const DBL = require('dblapi.js');```
Did you install the package?
No
Ok
Please also note that package is deprecated. Please check the pins here for the new packages.
It gave me the same problem @golden adder
Are you hosting on a VPS ?
guys i need help
i vote for my bot
and code isn'not working
😦
const DBL_TOKEN = "api token"
const DBL = require('dblapi.js')
const dbl = new DBL(DBL_TOKEN, { webhookPort: 5000, webhookAuth: 'pass' });
dbl.webhook.on('vote', (vote) => {
console.log(vote)
});
vote webhooks need an approved bot to function
how can i make it ?
and its approved?
I dont see any bots on that account
ah, they will need to add a webhook url and auth to the sites webhook section
for where to send the webhook to
and dblapi.js is deprecated
webhooks get sent to a URL, that url needs to be filled in, otherwise top.gg servers dont know where to send the webhook to.
you must make a webhook receiver, not fetch. you are the one receiving the data with a webhook
it may help to know how to use webhooks before trying to use top.gg webhooks
webhook discord ?
the code for a webhook receiver, or use a library for it.
is there any arabic supporter ?
so what u support ? 😦
yes i think this better than dblapi
const DBL_TOKEN = "api token"
const Topgg = require("@top-gg/sdk")
const webhook = new Topgg.Webhook(DBL_TOKEN)
app.post("/dblwebhook", webhook.listener(vote => {
console.log(vote)
}))```
is this wrong ?
nothing happen
youll need to fill in the webhook url and auth on top.gg, the webhook auth also doesnt use the api token.
const DBL_TOKEN = "api token"```
i write it but i can't share it here 🙂
the webhook auth also doesnt use the api token.
so what ?
pass ?
yeah its like a password, you get to chose it since you are the one receiving the webhooks
yes i have the pass
ok
and api token?? what should it do ?
api token is only used with the api, not with webhooks
oh ok
o will try
const Topgg = require("@top-gg/sdk")
const webhook = new Topgg.Webhook("webhookAuth")
app.post("/dblwebhook", webhook.listener(vote => {
console.log(vote)
}))
and not working 😦
and you filled in the webhook and auth on the website correct?
my friend gives me the infos yup
the auth that you decide.
i get the webhookAuth again and same
so your friend set these?
https://i.woo.pics/0180e74576.webp
ok, and would the webhook url be smth such as http://localhost:8080 ?
it will need to be publicly accessible, as top.gg servers need to be able to reach it
so localhost wont work
yes i typed the authorization code
i must type the link of project in webhook url ?
🙂
https://Number:5000/dblwebhook
we written this
Number = many Numbers
I was trying to make a way to find out when my bot is voted and i used the examplee code on tthe docs but it wasnt working. Is there anything else Im not doing?
did you fill in the webhook url and auth?
👀
do you have ssl for https?
iam using repl.it so yes
- i must type what in webhook url
my express link ?
and /dblwebhook
?
yourentirereplurl/dblwebhook
oh okk
you do not need to put the port in the url
I'm a bit confused on what to put on here-
your the one who decides it, as you are the one verifying the requests.

what exactly would i put in the webhook URL area in the dashboard
it depends on your hosting location.
its the url to the web hook receiver, what you exactly put depends on your hosting location, and if you are using a domain.
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL/mdn-url-all.png
client.on("messageCreate", async(message) => {
if(!message.guild) return;
if(message.author.bot) return;
const topgg = require('@top-gg/sdk')
const vote = new topgg.Api("")
let voted = await vote.hasVoted(message.author.id)
if(message.content.startsWith("!vote")) {
if(!voted) return message.channel.send("You didnt vote")
if(voted) return message.channel.send("You Voted")
}
});
How do i make it auto for example vote naficiton
use webhooks
Look up on YT
Thanks. I forget it, Youtube... 
@shy vortex can you explain more clearly ?
Already i didnt understand so asking on here
if you can't understand the docs then I can't help you sorry
ok fine I will try
basically ur supposed to use the code like shown in the docs
to make a webhook
and then u enter the reference to ur webhook into ur bot settings
and uh idk I give up
Just tell me how to i use auto poster
Oh, it worked, thanks Link! My bot page shows server count. It's easy!
Hi, I'm trying to run a server with my bot in a vps to log the votes from webhooks but without success, the code starts, but when I press "Test" (which is supposed to return my ID as it is in the code), nothing happens...no error, nothing
Here is the code below:
import { Webhook } from "@top-gg/sdk";
import express from "express";
async startWebhookServer () {
const app = express();
const webhook = new Webhook("my webhook auth");
app.post("/dblwebhook", webhook.listener(vote => console.log(vote.user)));
app.listen(4433, () => this.logger.info("Successfully Connected", { tag: ["Webhook"], color: "white" }));
}
When I run the bot, the message "Successfully Connected" is returned in the console, meaning that theoretically the server is running...
I am using the correct webhook auth (just changed it to show here), the webhook URL looks like this:
https://<IP Primary of My VPS in Numbers>:4433/dblwebhook
Any help?
do you have ssl for https?
otherwise you need to use http
Oh alright
I don't have
Well, I changed it here on the site, saved it and clicked the test button, nothing was alerted on the console
I'm using http instead https now
the test button is broken iirc
So I have to test with a real account?
you will have to vote in order for the event to trigger
np!
ghost ping
Well, I logged into top.gg through a secondary account (I had already voted in my main account), voted, waited 5 to 10 seconds to see if the account ID would log in, and nothing...probably still has something that makes it impossible for the system to work 🤔
I would say the problem is with the VPS IP, I may be using the wrong IP, I used curl ifconfig.me to return the numeric IP
I need to use other? Like forwarded?
use the vps ip that you use to ssh into the vps.
or the one they provide in the dashboard
👀 do our webhooks not work with ipv6?
The IP I am using is the same one I use to log into the VPS via SSH and is the same ip that returned in curl ifconfig.me
http://<IP>/dblwebhook
your missing the port
http://<IP>:<port>/dblwebhook
the test button should work for bots
Well the user above said it's broken 🤔
it works, just not for servers.
Okay
ive been using it consistently for the past few days and have had no issues tbh.
I just saved and pressed the button, it still didn't send the user ID on the console 🤔
can you dm me the url you are using?
i tried both cf workers and https://webhook.site
Instantly generate a free, unique URL and email address to test, inspect, and automate (with a visual workflow editor and scripts) incoming HTTP requests and emails
Yes
(heads up btw, cloudflare supports ipv6 incase you're using a host that doesn't provide you a ipv4 but a ipv6)
Is there any easy way to get notifications in disc channel when someone votes or leaves a review?
im doing top.gg --> cf worker
yeah, working on the same setup, but more public focused.
will have to leave cf workers eventually though.
console.log(vote.user) // => 395526710101278721
}))```
Is that number a discord ID? top.gg user id number?
@willow spindle ^
discord id
i can make a webhook write the vote without insert the code on the bot?
currently, top.gg webhooks expect to go to your bot, which means adding code.
votetracker may be able to help with not adding code to your bot, but they just track.
There are like examples?
https://docs.top.gg/ < libraries may be helpful.
https://docs.top.gg/resources/webhooks/ for webhook help
Thanks
Is there something like a webhook I can use so that when someone leaves a review on my bot it puts it in a channel via webhook?
I was wondering if there was a way to get the webhooks to work so that way the votes can be tracked?
I've been having problems with it for almost a month
I can save changes to the webhooks but when I send test, it says there was an error
👀
server test button doesnt function
hmm so is there another way to get the votes to track?
it should work, just the test button doesnt.
hmm then why doesn't it track the votes😭
i tried using a different tracker bot but that didn't work
Which language do use ?
One message removed from a suspended account.
im trying to use the api i got ```js
bot.shard
.broadcastEval((bot) => bot.guilds.cache.size)
.then(async (results) => {
const body = {
server_count: results.reduce((prev, val) => prev + val, 0),
shard_count: client.shard.totalShards,
};
let {} = await fetch(
`https://top.gg/api/bots/${client.user.id}/stats`,
{
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization:
"token here",
},
}
);
});
but its not working?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
bc they keep getting discontinued
One message removed from a suspended account.
One message removed from a suspended account.
so i rather tie in m yself
One message removed from a suspended account.
the last one i used stoped working
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
how do I invite nuoumeon to my server?
what’s the command
!invite
it’s not working
@scarlet cobalt 🙏🏼
One message removed from a suspended account.
it happened at a time i never had a restart bc i was a vacation from development
One message removed from a suspended account.
now im getteing Error: Cannot find module 'topgg-autoposter'
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
right above the example that uses it shows to install it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
yeah bc it said it posted but it haddnt updated yet
it updated
but the server count is wrong
hey the ip that i used here, should be the same ip that i put in port forwarding?
its not in 345 its in 264
Cloudflare cache might be fucking up
Give it an hour or two at max
ah
... or you can fetch values directly from the API to make sure
how? you can learn me?
One message removed from a suspended account.
get user has voted in top.gg
a few minutes to up to half an hour
have to let top.gg cache update
in what world smh
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
What all properties does the vote have in the listener?
good question
ok ty
do we not get isWeekend for server webhooks?
cuz it doesnt show isWeekend in server webhooks
:|
ah i just logged a vote, it does give isWeekend
docs are incorrect?
the docs succ
ikr
e
no I guess
Which language ?
python
I wish you good luck

Topgg python api is trásh , no offense , it’s still amazing tho and i like it
But it’s tough ig ye don’t have any experience with using them
You don't have a verified bot
So, you can't
interesting. Yep, seems its been false for me too.
Will add a note for dev team internally.
isWeekend is only true on:
Friday
Saturday
Sunday
regarding the utc timezone
as these 3 days are considered the weekend
i also was getting false over the weekend
Yea and it isn’t on those days
I know what weekend means
added it to the notes for devs.
applications for?
Support?
anyone can help in support channels, you dont require a role to do it.
We dont have a dedicated role for it either.
okay so i can help anytime and noone is gonna mute me?
yep
so its been a whole day and it says 345 servers even tho my bot is in 264 servers
how to know if the user has voted for a bot pls
https://top.gg/bot/BOTID/check?userId=userid
doesn't work
are you sending authorization header ?

Hi, Can you also use other bots (I would like to use a bot where you can enter a command that it should send a message for someone else's bot possible with the top.gg API?)
Nope. You cannot use the API to send over messages.. tho it would be cool if it was ngl
But you can with discord API... its called... The DMs...
(Its in the api it self, no packages)
No thats Not my question
I mean can I call a Event when its voted for a Other bot
That's against ToS if I remember correctly
You can give vote rewards but not in other bots
You can... but that can only be extra rewards
if what u said was true than ban dank memer lol
oh wait
wait wait
I didnt see onather bot
dank memer dosen't give reward for voting other bots
No i will only print
then that's fine
How can i do that ?
How do I show the library my bot is using
?
As I couldn’t find it on the bots edit page ig it’s using the api?
you cant
Bruh it’s the bot info command
You can show version of a library...
Ty
:/
@restive otter please dont ghostping mods
yes sorry
i pinged for dm you but finally i not dm you
Hello, so im trying to use webhooks with my bot and when someone votes for a certain server i want to give them a reward on the server like a role reward, I know there are other bots but I would like to learn how these webhooks are used. Im looking into one of docs on a different website now.
Do you know how http requests work?
From what i've seen these should work right?
youll want to use on_dsl_vote for servers.
https://topggpy.readthedocs.io/en/latest/api.html?highlight=dsl_vote#topgg.on_dsl_vote
oh wait its for a bot?
well i want servers yeah
ah yeah, dsl vote
so instead of import dblpy import dsl?
same library, just different method
you shouldnt need a token at all, as you are just using webhooks
servers dont get tokens anyway.
Alright so i just need to click edit on the server and find the webhook, or do i need to make a webhook of my own?
There is an example here
https://docs.top.gg/libraries/python/#examples
A webhook usually is just http://yourServerIP:port/route
dont forget the protocol 👀
Oh i was thinking of it differently.
A webhook is just a post http request
If you learn about those it will be easier to understand
is there a way in js to change the Autoposter interval?
in docs i didnt find anything
pretty sure the autoposter is at the recommended value anyway.
but you can change it with the interval option.
Trying to import topgg
And I get this error:
ImportError: cannot import name 'TypedDict']
Google hasn't been helping either... anyone know? :/
3.6.4
Huh
my python version is 3.6.4
Try installing typing-extensions, ig topggpy fallbacks to it if it can't import from typing.
hmpf... says it's already installed :/
Mind posting the traceback?
Why arent you using a newer version?
no reason tbh.
i've fucked up so much with these versions...
i have py, python, and python3 commands.. all with different versions
i have no idea how to manage/organize them all lol
Uninstall the versions that you dont need
idek how to do that nor how to list the ones i have
but that's ok; that's for another day and unrelated to this chat ;p
So I just downloaded the new version.. and it showed me "no module discord found" so i had to reinstall all libraries..
is there a fast way to delete all other python versions?
Yes. Thats normal.
Just uninstall them
.-.
The get_user_vote()... How does that work?
Does it return True if user voted within 24 hours? or if the user has ever voted for ur server at least once
Last 12 hours
Do global ratelimits apply to get requests or are they just for post?
Also I don't have a proper web server that has a static IP... So I can't get the webhooks on my bot... Should I check for votes every time a user uses a command (for the first time after maybe 10 minutes of inactivity) and has not voted, if he has, the vote will be cached in my bot? or is that just spam?
As long as you respect the rate limits it’s not spamming.
It's a bit tough to do but it's possible, yeah. What you described should be somewhat alright
If can’t or don’t want to use webhooks, requesting the API instead is absolutely okay
Yea but what are the ratelimits?
This is only for post or everything?
For sending a request to the API
The method doesn’t matter
@spice dust
Sending a request to the API to get the voters of the last 12 hours every minute for example might be a good interval
If somebody votes surely there’s a small delay until he can use "vote-only" commands etc. but that’s what I would call acceptable
@floral spade
Does anyone know how to handle the post requests in python?
my bots server count isnt updating, we use python requests to post it
the server returns 200 after posting the request
Try to press the refresh data on your bot's site. The value might by cached.
nope, still the same
Check if somebody else can see the same amount on the page after clearing the cache
If so you need to ask in support I guess
(or check site-news, maybe there’s an issue again, I’m not up to date)
I only sent 1 request why is it like this? How to fix it
@full arch i know why
how?
servercount
yes
You are ratelimited
for server count i have a video to help
Cuz you are sending too many requests for the api in a minute
where are you running the code ?
your pc, vps, heroku, replit ???
its repl
no
ohk
hm.. i told the truth only 1,2 times
@full arch i sent a working video to you in dms
thanks , i will watch it
hm.. you have an avatar like my bot..
When using the official SDK for javascript to setup a webhook listener, is the "your webhook auth" argument meant to be the Authorization section on the top.gg site? (picture showing what I mean)
I'll take that as a complement
It's not like 70% of all bots have anime profile pictures 
yes 
Kthx 
are there any api present using which i can get response once someone votes for my server
you have to set up webhooks
When the secret gets included in the Authorization field while sending a request to the webhook, what's the format? Just Authorization: %SECRET%?
or any prefixes/suffixes?
Referring to this:
https://docs.top.gg/resources/webhooks/#security
It's passed as is
Can you give any help link from where I can learn how to do that?
how to use webhooks? or documentation specific to top.gg webhooks.
https://docs.top.gg/resources/webhooks
^ top.gg webhooks.
theres no prefixes or suffixes, its just an authorization header.
aye gotcha, thank you
can any1 give a python code that uses api and post webhooks about the servers in which the bot is and who voted
I feel personally attacked 
it is true
anyone?
sus link
amogus link,
airdrop discord nitro lmao
private window with vpn
and i didnt download or click any sus button, so i guess im safe
Ip adress ?
i thought a vpn would protect from that
but whatever, its too late for me anywy if they got anything from me
You did not attach the api token
I didn't need an api token a few days ago
how do i check for bot vote on topgg
vote count?
How do i refresh stats once per 1min? (60000ms)
nvm got it
for sum reason i didnt put any stat refresh interval but it gets refreshed on its own lmao
@restive otter
So i have commands with slow modes and i would like to remove the slow mode for my voters is that possible ?
Oh okay
Guys if i use AutoPoster do i need interval?
yes that's possible
any repo or smh for the reference for it ? cause the api got updated recently and i dont know about it
Documentation for @top-gg/sdk
Wait it updated recently ?
idk about that
gonna see the new docs
it was smh else before now its toppy
they changed it
nah still the same
Send a GET request to https://top.gg/api/bots/:bot_id/check?userId=SomethingHere
Should work for 1000+ votes
i dont even get 100 lol
It's better to use a webhook
like im starting a new bot
Hello darkness my old friend
my older now gets around 80 or smh
you should check if b is actually a value
like
if(!b){ return "bot not found" }
otherwise good

umm
so like if blah link == 1 : await ctx.resetblahblah
Is there a way to query the CD for a user before the next vote on a particular bot?
using the Python client
cd?
cooldown
ohh
not through the api, no
you'll have to check that yourself, store the timestamp from the moment of the vote and add 12 hours to it
That should really be a thing tbh, given how common the use case is
lemme see if I could make a PR for it
@rain heart Are SDKs open source, but the API itself is not?
Is there docs for server votes webhook?
@restive otter
🦇

Is it appropereat to use your API as searching on the website? Like looking at stats for Dank Memer ?
Can we programatically edit our bot's Detailed Description using the Rest API?
Basically, I want to sync it with the Readme.md on my GitHub repo using Github Actions.
nope
I dont think that will be added/allowed, but you can make a request on the github.
https://github.com/top-gg/issues
I dont think that will be added/allowed
What's your reasoning behind it? 🤔
well, its kind of pointless. if you have time to update your readme, you have time to copy paste it to top.gg. pretty much no use will use it.
Well, if it's a part of a CI-CD pipeline, it makes more sense to be automated
Let's say, the Readme is being generated dynamically using some template and data from external sources
And if it's being run as a CRON job
If you really wanted to, use an iframe for it then.
I dont think dynamic descriptions is what we want to do however.
especially with how much descriptions are cached.
iFrames don't work in GitHub Readmes, so it will be two separate readmes
it will be two separate readme's anyway, you are just updating one from the other, the same thing can be done with iframes.
Yeah, wanted consistency between both but I get your point. I think mine is a too specific use case
thanks anyways
np
How long does it take for the webhook to send?
I've confirmed my URL is listening for post requests and I've clicked test and nothing is coming through
I've even gone so far as to send a request from my remote server to the API listening for the POST request and it does work
But nothing from top.gg when I click test
LOL
Embarassing
My bad for assuming Test would also save 😆
O
Might sound silly, I want to add the autoposter on ready event. Do I need to make it setInterval or the original ```js
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const { AutoPoster } = require('topgg-autoposter')
const ap = AutoPoster('Your Top.gg Token', client)
ap.on('posted', () => {
console.log('Posted stats to Top.gg!')
})
no response. sadge
ig its enough
never used the module tho
Just visited the npm page, it auto post every 30min, so original code is the only thing needed
Hello, I would like to add webhooks to my bot but I couldn't find any docs on discord.js on getting started with webhooks
do any of you know any docs for discord.js on getting started on webhooks? I should be able to do the rest from there
Sorry I have no idea
Like idk how to send or recive http webhooks
where do you host your bot
what do you mean by connecting to d.js?
like getting a webhook and executing a function on discord.js
like an exclusive role when people vote
host the webhook server on the same code with your bot ig
ok tnx I will try make nods.js webhook server
tnx for pointing me in the right direction I had no idea
https://ckeditor.com/docs/cs/latest/examples/webhooks/webhooks-server-nodejs.html ok I found this looks simple enougth
I am trying to make the webhook to work
in the options I put a domain that is linked to my ip and that token nthing but when I click test webhook button it doesn't work
I don't get anything logged in console
pls help
Check if your firewall is blocking the request



