#topgg-api
1 messages · Page 147 of 1
const webhook = new Topgg.Webhook(...);
const api = new Topgg.Api(...);
how can i get those keys
I put token instead of authorization key and it worked tysm for help
Now answering
const express = require('express');
const Topgg = require('@top-gg/sdk');
const app = express();
const webhook = new Topgg.Webhook('...');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
console.log(`${req.vote.user} has voted`)
})
app.listen(3000)
still same
can i use this
uhmm
Yes
okay
index.js
const express = require('express');
const Topgg = require('@top-gg/sdk');
const app = express();
const webhook = new Topgg.Webhook('');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
console.log(`${req.vote.user} has voted`)
})
app.listen(3000)
i have opened this link
I have this, but It does not send anything to my server when I test it
yeah i dont quite understand webhooks either
sad
never used a webhook before'
I get that part
javascript
node.js
what exactly do i put in the webhook url?
alright i have that
so if i use the code provided it should work right?
alright thanks
no idea :)
oh, yeah
i run my bot through the console atm
guys when someone votes on my bot , it starts spamming
i click on Test button only one time
based on this example, can I put the number of servers on which the bot is, so that it appears on the website? if so, how do i get my api token?
ty... does the token change or will it always be the same?
ty
alright so i found a port that's open
Hmm...So, I am a dev and i still don't know what are shards.Can anyone explain me.
ohk
i went to the settings to open the ports, and i saw a couple that're already open
so im liike "cool imma use these"
hi how do u setup server webhooks n what they actually do?
i did not test each and every number do not worry
anyways, i have my webhook link set up like this
https://myip:openport/dblwebhook
and i hit the test button
and nothing showed up
ahh ok
1030
it's one of the open ones, do i have to use 80?
ah yeah, done that
alright
and the app.post thing looks like this, yeah?
app.post("/dblwebhook", webhook.middleware(), (req, res) =>
i dont know what result im supposed to get, but the console.log for the bot didnt say anything
https://docs.top.gg/resources/webhooks/ all information on how to setup webhooks should be there.
a?
const Topgg = require('@top-gg/sdk');
const express = require('express');
const app = express();
const webhook = new Topgg.Webhook(topggauth);
app.post("/dblwebhook", webhook.middleware(), (req, res) =>
{
console.log(req.vote.user);
});
app.listen(1030);
just copied this straight from the thing
Are webhooks working?
Im receiving no data. Haven't changed the code has been working for weeks and now it's not
I want to show server count and when someone vote the bot send message in my server in the channel
I dont understand this
Because iam bad in english
Can someone tell me step by step
if I use insomnia to test I get 401 "error": "Unauthorized" but if I just go to the url in the browser it works any idea?
yeah the auth is the stuff i put below the webhook url right?
i did that
it says 'topggauth' cuz i put the thing in the config file
..
Can u @shut flume tell me step by step
the token on the webhooks page, or my client id?
can you explain what that would look like
const Topgg = require('@top-gg/sdk');
const express = require('express');
const app = express();
const webhook = new Topgg.Webhook('topgg123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
console.log(req.vote.user)
})
app.listen(3000, () => {
console.log(`App listening at http://`)
})
Not working
the code im using is straight lifted from the doc tho
i swapped it out to this just in case
const webhook = new Topgg.Webhook('waaaaaaaaaaa4i292039q4rujq390');
yes
i did
or give a screenshot example
:)
PASS PORN
ok
btw im running the bot on node.js
if that changes anything
well it's getting late so i'll try again tomorrow
btw using some webhook tester i do get the test thing to show up
so it's not not sending the thing, its just my thing not grabbing it
well whatevs gonna sleep
good night :)
my server is on but there is no server with my public ip
its now working
Write here @shut flume
Pls
:(
Ok send the link of the thing i want
Not the main site
Discord. Js
const Topgg = require('@top-gg/sdk');
const express = require('express');
const app = express();
const webhook = new Topgg.Webhook('topgg123');
app.post('/dblwebhook', webhook.middleware(), (req, res) => {
console.log(req.vote.user)
})
app.listen(3000, () => {
console.log(`App listening at http://......:3000`)
})
Can u tell me what is webhook auth @shut flume and where can i get it
Ok
@shut flume
Hey
I made this webhook
now i copy the webhook and paste it in webhook url ?
googl
This ?
const Topgg = require("@top-gg/sdk");
const express = require("express");
const app = express();
const webhook = new Topgg.Webhook("your webhook auth");
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote will be your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
app.listen(80);
yep, thats the js sdk.
ok
the url will be the url to that webhook.
?
What i put in webhook auth
anything, its like a password, you chose it.
yes
for python, is this the correct one? webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000
so if i put that, that will work?\
you need more than that
Uh
There is something. @Woo#3304
@jaunty plank
When i put the code and the webhook auth
Then where the bot will send the message
nowhere, you have to develop that yourself.
Hey
How can I find out the number of votes for a bot, for example !vote
let voted = await topgg.hasVoted(message.author.id); let votes = await top.gg.hasVoted(message.voted.size);
@jaunty plank
that just tells you if one person voted, not how many votes the bot has
https://docs.top.gg under Library->Javascript
So how do I know the number of votes from the bot @jaunty plank
hope linked the explination
-servercount
To have your bot's server count displayed on Top.gg, please read the documentation on server/shard posting.
go to the section of your preferred language
https://top.gg/api/bots/807984160022069299/check?userId=455829632462356500
I am checking this in the rslov need be {"voted":1}
But the responsive in the page top.gg is:
{"error":"Forbidden"}
Are you passing in an authorization header with your dbl token?
Yes man
And you're sure it's the right token?
Have you recently regenerated your token?
How to get message when someone votes the bot like getting the voter's tag and id?
no one there to help me?
just wait
Ok
Pls help me
hello
i need help in that too
Read docs
I can help you but not spoon feed code
Is this what you mean
ill add you on discord! , i have not started the project yet but i will take some tips from you
please add me
@restive otter yes what to use in that webhook or Api would work?
Check docs
But for that it's a web hook for like fetching who voted ect
Yeah I also thought the webhook would work but just wanted confirmation
@restive otter bro can you help me make webhook?
Like from the channel i have to make or like this
``const Topgg = require("@top-gg/sdk");
const express = require("express");
const app = express();
const webhook = new Topgg.Webhook("your webhook auth");
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote will be your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
app.listen(80);``
Apparently this is the code
So should i just add a message command in it
i am pretty new to this whole coding
O
i am sorry if i am being annoying
how to show number of bot servers?
How to get webhook auth
you create that
means i have one channel id and one long thing so which is the webhook auth @shut flume
what is webhook auth
means that long thing
I m getting this error:<Response [401]> while i am trying to get indivisual user vote of my bot .. can anybody help me how to do this??
i m using discord.py
const Topgg = require("@top-gg/sdk");
const AutoPoster = require('topgg-autoposter');
const express = require("express");
const bot = new Discord.Client();
const topgg = new Topgg.Api("topgg token")
const webhook = new Topgg.Webhook("channel webhook auth code");
const app = express();
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote will be your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
ap.on('posted', () => { // ran when succesfully posted
console.log('Posted stats to top.gg')
})
app.listen(80);```
This is not working for me when i am test voting
What part confuses you?
Just how to get an app on there
I get where you have to go
But how to start the app up to work
can anyone help me with how to check if a user has voted for my bot or not
how to set up that??
Well do you want to set up your own webhook listener, or are you trying to use the one built into the lib?
https://pypi.org/project/dblpy/
Look through this
const Topgg = require("@top-gg/sdk");
const AutoPoster = require('topgg-autoposter');
const express = require("express");
const bot = new Discord.Client();
const topgg = new Topgg.Api("topgg token")
const webhook = new Topgg.Webhook("channel webhook auth code");
const app = express();
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote will be your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
ap.on('posted', () => { // ran when succesfully posted
console.log('Posted stats to top.gg')
})
app.listen(80);```
This is not working for me when i am test voting
Cheers
pls help
You need to replace “topgg token” with the one in your bots edit page under webhook s
i need to print the vote data when a user votes for my bot.. how to do that??
Ok I set up the webhook
But it comes back with a 404
Is this normal for the first time
?
I thinks it's ur ip
And then /
And whatever u set webhook port to
It worked for me
K
but currently on my vsc
Can u make an express?
to?
Cos it says about being between 1061 and 42000 or something like thag
That
Change to 8080
ok
Just for now
and in webhook url?
What is the link for ur express?
U on windows?
@trim pelican yes
should i have to locate the folder also
i got ipv4
Where test 😅
oK
When I did mine it came back with a 404
LOl
I am getting error
In the ip
On the code up above
No
what to write in webhook url on top.gg
Yes
Hey, I am using dan for hosting so what should I add in webhook url?
http://localhost:port/webhook is this right?
i want my own webhook listener also i use discord.py not json
@left mesa webhook /dblwebhook hoga
@restive otter yeah @restive otter @left mesa also indian
nice Me Too
😦
@trim pelican Bro How Did U Setuped Voting Webhook On repl.it
Ok move on to #general-int for chat
you cant use localhost
@left mesa use like mine i use
are you using repl.it
hes not using repl
@left mesa just for now cuz i am not able to do in vsc
Iam using repl
@restive otter have u made a flask?
Ya For The Bot But Not For The Webhook
Ok
Like To Run bot 24/7
Same
webhooks are always specific for your hosting, so you have to check your hosting for the right webhook url
for dan hosting you have to ask them for ip and port
did u code worked and printing vote data?
If you're using python and you really want to set up your own webhooks you can use the aiohttp library
i want to set my own webhooks becoz sometime my bot will be offline so at that time vote data will not be Recieved
anyone?
Not /webhook.
Its /dblwebhook
d
http://localhost:port/dblwebhook will this work?
and here app.listen(3000) i should add my dan server port
right?
yes
kk
i already told you
you cannot use localhost
kk
Does this check whether user voted in the last 12 hours or voted at least one time?
all time i think
but how would I do it
like where would I put the person's user id?
because when I try I get {"error":"Unauthorized"}
You need to pass in your DBL token as an Authorization header
I am so sorry that I am so stoopid but: what?
No you put dbl at the end
So it would be /dbl after your local host
Your request should look similar to this:
"url": "url you are sending request to",
"method": 'method GET, POST, DELETE etc.',
"data": {
"userId": "user id"
},
"headers": {
"Authorization": "your top.gg token"
}
even if I am python?
kk
it's working now
thanks
I used NPM package phin to send this specific request
Np
I just showed you example of a Authorization header, you can try doing similar in python
Hi, I gave up on the webhook a few months ago and am trying again now. How do I get the webhook url to send the data to?
So The ratelimit for using the api is 60 requests per second.
I'm setting an interval of 5 mins and using the api.
Thats not api abuse and I wont get banned right?
So code is
setInterval(() => {
console.log(await api.getVotes())
},
60 * 5 * 1000) //5 minutes``` Not my exact code but the `getVotes()` is the only api usage.
I mean it seems fine
can anyone give me the link to reset my token
?
To me?
Yes
In my situation, the lower the time
the better the bot
So what's the max I can lower?
Idk that

So only serverCount, shardCount and Id?
Ik, but I don't know the answer
Yeah

Yeah?
Yeah is not an answer to that question lol
Lmao
He asked yes or no
Well then, no
Oh
when did I ask s or no?
Silly you
K
That's why I referred to the docs
what is shard btw?
I'm silly wouldn't know
...
Ayo Fr tho
That's a question for google this is a place to get help with Top.gg API
Now who isn't helpful
No it's following the channel rules
Read
No off topic conversations stay on topic
hey
Good morning

lol
Is this related to the API at all? If not, move to #development
^
Could you show your code?
^
Oh I know @night ingot
Look there is says it's already in use
@restive otter your already running a website in that same server or whatever your using
Mhm, but the error says they're using port 5000
If you're using multiple shards, make sure the webhook listener doesn't start twice
^
So are you running a website in there
Such as your dashboard
Was I right Bc if not I'll help you find the right awnser @restive otter
can api track votes?
Read the docs bro this is a question for docs
Just read over the docs and try to understand it more fully bc you will be better off when you write your code trust me
thx
@reference?
Np man I don't want to be a jerk and just say read docs I just want to help you and I think in the long run this will help
There is the reference
If you need any other help just let me know!
Also, you could convert the widget for your bot votes
Ok?
O
code here free to use?
Yeah! Ofc
Also this is what it would look like converting the widget this is from my bot
Also
wah
You can add it to an embed
ok
That's just a command I made for me
ur bot in pure python or discord.py?
You can check out widgets in edit section oh see widgets
DPY
same
Brb
Alright
One of my friends made his bot work without using DPY
idrk how he did it
I think he made his own api
DPY isn't an API
It's a library
And @vast phoenix try to stay on topic if you want to talk with me about this let's head over to #development
how do I make use of people voting for my bot?
Ex. x2 bot currency for voting
Also how do I find out what my API key if for top.gg and do stuff with that?
I'm using the discord.py Lib.
same question, but with discord.js
is there anyway of getting time information on a user's vote via teh API, or would we need to use webhooks and maintain state
/bots/:bot_id/check
is this for the month? or past 12 hours
Can someone help me setup the vote-webhook in my bot?
I can't seem to understand
?
What do you not understand I can help
And what do you want the web hook to do exactly
anyone have examples of code to check if the user voted
discord.js
Send an embed saying hey, this person voted!
oh yeah
so what are you having trouble with exactly
like an error or somthing like that or
Hello
guys how can i make a command that you need to vote for using it
(only 1 command btw)
oh wait wrong channel
The API can be used to check for votes and stuff like that
also used for posting your bot's stats to the page
oh ok thx
And for uploading your server count ect
Oh you said bot stats
Yes, like I said
voting has to be manually done by the user, as init said, it could be abused and vote for users behalf without their knowledge.
oh yea, true
Top.gg Node SDK has been updated
In v3.1.0
The Webhook.middleware() still works, however there's a new method to work with webhooks,
using the Webhook.listener() method
Here's an example
const express = require('express')
const { Webhook } = require('@top-gg/sdk')
const wh = new Webhook('Top.gg webhook password')
const app = express()
app.post('/webhook', wh.listener((vote) => {
console.log(vote.user) // 172075838806818817
}))
app.listen(80)
As you can see Webhook#listener() takes a function that is ran whenever a valid vote is passed
You can also error in this function in order to have the webhook re-queue the payload by passing back a 500 (via the retrial flow https://docs.top.gg/resources/webhooks/#retrial).
Docs for the new listener() method: https://topggjs.rtfd.io/en/latest/Webhook.html#webhook-listener-fn
dont mind if i do
How To Send Embed Msg in A Specific Channel on Discord When Someone Voted My Bot Using webhooks.
Here Is an example what i actually want-
Language - Python
Hi!
I'm building a Discord bot in Java and I am wanting to use your API to check for votes
Your docs state that Official Top.gg libraries acknowledge webhooks automatically.
Yet, in the Java library listed, https://github.com/top-gg/java-sdk, I see no webhook implementation.
the Java library does not have webhook support
use a 3rd party one, like topggwebhooks4j
I am coming back to say two things
A: I couldn't find it, is it possible you gave me the wrong name?
B: I somehow stumbled upon your GitHub profile in my search and I have to say that I absolutely love it
https://github.com/Hopeful-Developers/topggwebhooks4j nah that should be the one
Java Webhook Library for Top.gg. Contribute to Hopeful-Developers/topggwebhooks4j development by creating an account on GitHub.
yeah Google doesn't index it seems like
Do you use the Wii cursor hand for your mouse cursor?
Anyone know the answer to this
you need to use webhooks
Thank you
how can I get logs from 2 bots in 1 bot
Like I have 2 bots on top.gg but I want logs from another bot
Just make a second webhook instance
Hey Why I Am Getting Rate Limited Again And Again I Got yesterday At About 5:12 P.M And Just Now ._.
dblpy = dbl.DBLClient(client,
gg_token,
webhook_path='/dblwebhook',
webhook_auth='password',
webhook_port=5000,
autopost=True)
@client.listen
async def on_dbl_test(data):
print(data)
@client.listen
async def on_dbl_vote(data):
print(data)
this is my code, nothing happens tho?
const app = express();
const webhook = new Topgg.Webhook('topggauth123');
app.post("/dblwebhook", opwebhook.middleware(), async (req, res) => {
const user = await client.users.fetch(req.vote.user);
console.log("Someone voted!")
});
const opwebhook = new Topgg.Webhook('topggauth1234');
app.post("/dblwebhook", opwebhook.middleware(), async (req, res) => {
const user = await client.users.fetch(req.vote.user);
console.log("Someone voted!")
});
app.listen(port);
``` like this?
I don't know too i need help about how to print vote data on discord using webhooks
or
No clue bout js
about python?
No
Not Js Not Python Then?
how
Hey I set up the webhook, but I don't know how to make the bot do something and how to do like a on vote dm/rewards
anyone know how I could do it?
Its discord.py btw
oop dw it crashed
Can someone help me? I am a low-intermediate coder, and I want to make a voter-only command. I have looked at the docs, and have no clue what to do. Can someone help me? (Python)
I suggest using Google on how to create a webserver in your programming language
can anyone help me in settings webhooks for my bot?/
what am I doing here?
What are you trying to do?
I'm trying for my webhook aki but I can't
Well, for the url you should use the IP, port and path of the server you're hosting the webhook listener on
And the for authorization you can enter whatever you want, but it's not necessary to have anything there
how do I do that?
Do what?
I need help to put the webhook
What do you mean by "put the webhook"?
I'm also a bit lost in how to setup a webhook. How do I set up the code for it and track vote data so I can reward users each time they vote? I use Flask on Replit.com to host a web app, so I know the port number, but no clue what IP or path I need to use. Never setup a webhook before.
You can find your DBL token in your bot's edit page under the Webhooks tab
thaaaaaaaaaaanks 🙂
what i need put in it?
I already told you
http://<your IP>:<port>/<webhook path>
ipv6?
from where can i get?
Ok i get
how can i get webhook path
You set that up yourself with whatever way you used to create your webhook listener
Ok ThanX
Can someone help me in setting up webhook for my bot. So that i can reward users for voting. I have hosted my bot on heroku so how do i set up my webhooks
👍
@night ingot
pls help me
Is there a meme api for python?
There is a reddit API, you could get posts from the r/meme and r/memes subreddit
http://<your ip>:<port>/<webhook path>
suppose my ip is 127.0.0.1 then it should be http://127.0.0.1:5000/asdfgh
then i should put /asdfgh in webhook_path in my code
is that what u want me to do??
Yes
Make sure port 5000 is open on your network too
ok
Ok thank you
i put the webhook url and made the code but when i clicked test it didnt do anything
const Topgg = require("@top-gg/sdk")
const app = express();
const webhook = new Topgg.Webhook('anything123');
app.post("/dblwebhook", webhook.middleware(), async (req, res) => {
const user = await client.users.fetch(req.vote.user);
client.channels.cache.get("829103715352838196").send(`${user} voted!`)
});
app.listen(port);```
How do I find my webhook path?
You set that yourself in your code
oh
I've written some code and added my url and webhook to top.gg but nothing happens when someone votes. Have I done something wrong?
How do I know if my webhook is working? I tested it on top.gg where it gives the nofification saying it was tested but don't actually get any output in the console. :?
Same I didnt either. I then got someone to actually vote and it still didnt work
api? oh ok, my api code is...
You shouldn't use port 80 for webhooks
Ah ok. Is there a better port to use or just any?
Make sure that port is open as well
How would I check that
Which protocol?
TCP
ok
Also you might wanna delete this if you don't want people to see your public IP
How can I forward the port 8080 if I don't have access to the router?
Yes thanks
It still says the same thing on the website that it can't see service
Sometimes it tells you that it's closed despite being open, you can try anyways and see if it works
And you set it to port 5000 in your code too?
and clicked save after you changed it in your edit page?
I wasn't supposed to do anything with express was I. Like I just installed it using npm i express and then wrote that code
I'm not sure, I don't use js
I'm also not getting any output from my webhook on port 8080 in python
It's probably an issue with the port not being open then
it says connection refused when I check it on canyouseeme.org
irrelevant to api discussion^ @sacred shell
Is there someone who would know how to do it in js?
I use js
Do u need any help?
I have made it once for someone
I wrote the code for it
and set up the webhook as shown here on top.gg
But nothing happens when someone votes
Vote webhook uses POST?
yes
I had made it with get ig
I was using dblapi.js which is umm
A bit different from the one u are using so ig i cant help.in.this
Ok
I thought dblapi was deprecated?
Hey! Could someone help me setup the vote-webhook thing? I can't seem to understand how to set it up in my code
Which part confuses you? Also what language are you using?
how can i create webhook and Authorization for my bot
Is it possible to create an upvote web hook that sends a message to a text channel when some upvotes my bot?
That is possible, yes
how do I check if a certain user has voted (python) Ping me if you respond
what is the data you get out of on_dbl_vote
You can check that with the API using this url
top.gg/api//bots/<your bot id>/check?userid=<user id to check>
that will return
{"voted": 1 or 0}
The site is having some issues now though, so it's possible that it won't work
https://docs.top.gg/resources/webhooks/#bot-webhooks
This should be all the returned data
so i used
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("received an upvote")
print(data)
as the example, just made it print "received an upvote"
I voted myself, but it didnt print anything, does it have a possible delay?
How did you set up the webhook listener?
oh right you need the webhook listener inside ur bot. Can you send a documentation of how to, or more info about it please?
You're missing the webhook_path, webhook_auth, webhook_port parameters in the DBLClient
well webhook_auth isn't required, but recommended
ahh andd you have to set it up in your top.gg/bot/botid/webhooks?
Correct
sorry for the lots of questions
But how do you get the webhook url, do u need to do something special for it? or?
The webhook url would be
http://<your public ip>:<port>/<webhook path>
or if you're hosting your bot on a server, the ip of said server
{"error":"Unauthorized"}```
You need to pass your DBL token as an authorization header in the request as well
so {"Authorization" : "your dbl token"}
I am so sorry, but I am still really confused
What lib are you using to make the request?
I am just going on the url itself...
How are you making the request, code wise?
I am not. I am just opening a new tab ant typing in https://top.gg/api//bots/[botid]/check?userid=788148692196261960
i am... i think
Probably related to the current site issues then
Either way, it works, you just can't access it
so i said that up with port 5000 and path dblwebhook
And set it up in py
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='/dblwebhook', webhook_port=5000)
And i tested the webhook, but i didnt get anything yet, maybe im doing something wrong?
but how do I have my bot do it? like where do I put {"Authorization" : "your dbl token"}
Is the port 5000 open on your network?
You need to use a lib like requests to get the data from it. If you need help with that you might wanna move to #development
I'd advise you to try to learn it by yourself though
And you hit "save" after putting in the info?
yeah
its prob something with my network tho
My router had trouble before with opening ports too
You're sure the IP is correct? It's your public IP, not the local one. So not the 192.168...
i did that, but eventually gave me this error, had a delay into sending it
internet ip address and lan ip must be in the same network segment
i use my ipv4 ip
You could try, it won't work if that port is being used by anything else though
i tried using an open port which i think isnt being used (i think it was my old mc port, but thats offline lol)
i tried a test webhook
there came a firewall pop up, allowed it
tested again, but still nothing
Try using something like postman to send a webhook and see if it's on our part, or yours
no idea on how to use postman tho
Try just entering your webhook path in the browser and see what response you get
you mean just putting this in browser
ip:port/dblwebhook?
mhm
added this code
@commands.Cog.listener()
async def on_dbl_test(self, data):
print("Received a test upvote:", "\n", data, sep="")
still nothing tho
do you have the required parameter in your dbl constructor?
such as port on context, which are required for the webhook server
you mean the self.dblpy?
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True, webhook_path='/dblwebhook', webhook_port=9000)
this is my dblpy ^^
And port 9000 is open on canyouseeme.org?
have you added your webhook url to your bot page settings aswell?
looks like its not 
yeah yeah
its just a problem with my internet / router
Tried adding a new port, get this error again
Internet IP address and LAN IP must be in the same network segment
i use my public ipv4 ip and want to enable the port on that (port 5000)
but i get that error
What is the webhook url I have to insert on the website gonna be?
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.
checking for open ports, can i use filtered ports?
Cus no idea on how to fix the error...
Hello, what is the listen emitter of @top-gg/sdk?
Aurel
Rate limits for bots is 60 per minute
I'm setting an Interval of 1 api requests per 3 minutes
that's not an api aboos right
I mean, if the limit is 60 per minute, or once a second if you will
1 request every 3 minutes is pretty far off
But think about it as 300 bot doing that at the same time
I don't think he has 300 bots
Lmao
a rate limit is per-client
Just one line in the interval code
let api = await api.getVotes() console.log(votes)
Yeah, then you're safe
@night ingot could u say how can u modify the latency? Some1 in #memes-and-media posted that he worked hard and the latency is low?
How do you mean? Like, the time it takes to make the request?
See #memes-and-media
That's all depending on your connection, how close you are to the servers etc.
I guess you could potentially optimize your code to run faster
but there's only so much optimization you can do
Any guide?
Tuto?
Code?
Github?
Stack?
Optimization depends entirely on how your code looks
there's no general way to do it
I pong my bot 8 times,
220, 98, 46, 44, 127, 39, 33, 46
These r the results
Is that good or bad or not bad or probably good or probably bad?
I mean, lowest is 33ms which is pretty good
Connection speed can vary a lot, so I'd say that's decent
Latency is
send a msg, and observr date,now
Edit the msg
Observed date - Date.now() right?
I believe this should be asked in #development as this channel is meant for Top.gg API questions
Answer this question there then
The API states You may not reward users for voting for another bot other than the one being used. This includes other bots you may own.
Can I reward people FROM a different bot but I wont give them any currency or commands in this different bot?
Receive rewards on bot A for voting on bot B
Receive rewards on bot A for voting on bot A
like the api will be used on bot b but it wont give any bot b rewards
because that bot is there idk
instead of adding it to the public one
so is it ok or no
I will explain it more, The api will be used on bot B and people will get a msg and a role using this bot for voting for bot A which is the public one
Okay.
what was it called, the authorization header? the password needed for my bot to use http://top.gg/api//bots/:id/check?userid=:userid
Yes, you need to pass in a header that looks like this
{"Authorization" : "your-dbl-token"}
ok thanks
so it needs to be r = requests.get('<MY_URI>', headers={'Authorization': 'TOK:<MY_TOKEN>'})
Yeah, looks good
ok!
tysm, @night ingot it works now!
go to the resources -> bots section
then find the section related to guild count posting
also read pins in this channel
have some trouble opening my port on my network, maybe someone can help me here?
"Intranet IP address and LAN IP must be in the same network segment"
Is the error, and i need an open port for the api so uhh maybe someone can help?
How do i make a bot listen to server votes ?
I also want to know how webhooks work. Can I get a python docs
just like bots
You can make bots listen to its own vote without webhooks I guess
I guess I read that on docs
hmm
still i don't know how webhooks works with bots
cause me still waiting for my bot approval
Okay I have read the docs of webhooks. But how do I know my webhook port and webhook auth?
Can someone tell me where exactly logger print the error? And is it the correct pypi project https://pypi.org/project/logging/ ?
I made a webhook, copy pasted the link here, still don't know what the auth code does and uhh help?
The auth code is optional, it's just so you can verify that the webhook comes from Top.gg and not someone else
It's not absolutely necessary, but highly recommended that you put something there
ah ok
well
how do I uh.. make it work? even after I paste the webhook link in there and test it nothing happens
Is the port you're using open on your network?
How did you set up your webhook listener?

so many words I do not understand (sorry I'm really new to webhooks)
do you have any tutorials on setting it up?
What language do you use?
English and Swedish (preferably english)
I highly doubt you made your bot with json
oh ;_; well I don't have a bot
I just uh copy paste json bodies or whatever you call them into webhook maker thingies and then everything just works out. I thought I just had to post the webhook link in the server and it would send a premade message thanking whoever voted but if there's a bunch of programming shenanigans then uh guess I'ma go
You will need to use programming shenanigans to thank a user for voting, yes
how do I check user votes using discord.py and dblpy
Do you have tutorials for js ?
oh
i just dont know
@night ingot Isn't it?
where to start
Hm?
mm
Chocolar is off?
is this for server votes ?
This is Top.gg support, you've got the wrong server
O sorry
yes
what is a webhook auth ?
Can Someone tell me this?
I wanna know that too :/
like where do i find it ?
https://top.gg/bot/<your bot>/webhooks
client id ?
you make it
client id ?
I think
for what
what am i supposed to do here ?
lol k
write authorization you want to use
which tutorial ?
WTF that dosen't answer even one part
I read the docs
yikes
thats not my question
I want to know how do i know my open port
if I am hosting the bot
Idk.
and also is auth the one that I make by my own?
I followed the docs exactly and it doesn't work
is they anyone here who can tell me what a webhook auth is ?
The webhook auth is used to make sure the webhook is coming from Top.gg and not someone else
You set it up yourself in the Webhook edit page on your bot
It means your auth token is incorrect
Yes
ok so i think i have some trouble with opening my port
so in the router settings (check ss below) i set up my port forwarding with my public ipv4 first. This gave error message:
Intranet IP address and LAN IP must be in the same network segment
I contacted some other ppl and they said i needed to take my computers private ip address (so a 192.xxx.x.xxx)
I did and opened the port on the local ip, as you can see on the photo
In the top.gg webhook page i use my ipv4 ip
still nothing comes through and doesnt print the data, anyone that can help?
https://cdn.discordapp.com/attachments/782034872830918666/832352329725378610/unknown.png
You pointed the port to your device, correct?
Try resetting the top.gg token
the bot is not yet approved




