#topgg-api
1 messages · Page 134 of 1
getting the user voted ip in python wrapper would be data['user'] right ?
Is there supposed to be a major delay in the stats posting? Thought it was cache but its been 10 minutes and its still reading old values
yeah sorry
I think the API may be broken 
Using the docs from the SDK to post the serverCount and shards
Finally managed to fix it
Does anyone has a command in discord.js which will be triggered every time a user votes for a bot?
Yeah I know but im new to discord.js so that's why im asking if someone has it and if they could share it with me
Yes I currently use that, but I'll like my own custom message, I use DBL Vote bot
Either I can't explain myself well or you're not understanding
Yeah
Not using discord webhooks 🙄
Ok were getting to specific
Then I can't ty for ur help tho
I guess I gotta learn discord.js one day....
npm init command in cmd doesn't work. any suggestions?
#development pls, this is for only top.gg api
How do I make that my bot will show its vote of top.gg site...
Like when I type !votes it will show its vote..
This I know
Ok
Do you know... How to do this
Of knowing how many vote bot has

Ok
Very hard
Ok
This i don't understand
Ok
Ok
How can I add the server count in python?
`import discord
import os
token = os.getenv('TOKEN')
client = discord.Client()
@client.event
async def on_message(message):
#do something
client.run(token)`
How can I add the server count
??
hello how to test a vote system without waiting 12 hours
there is no limit with the webhook testing, what do you mean?
can i test without a webhook ?
im not sure what exactly your asking for, you can’t test a webhook without a webhook lol
i already make in a cog but the code is not triggered
you used the example cog?
yeah
if i do a request at the https://top.gg/api/bots/:botID/check
Does 0 mean not voted, and 1 means has voted?
Or it's how many votes the user has?
it will check if the user voted or no
i guess
Oh, so, 0 is no and 1 is yes? Thanks.
never tried it ngl, but probably yes
Thanks.
Thanks.
How can I add the server count in python?
You can read the docs on how to add server count in python in this link https://docs.top.gg/libraries/python/
how can i add bot votes count in js
Why can't you? It doesn't matter whatsoever.
hi so in the bot webhooks page what url am i supposed to be entering? im confused on how to set those up and, i use repl.it for hosting my bot
having some issues if someone could help
API failed: Votes request returned HTTP status code Unauthorized while fetching upvotes for bot
keep getting this error out of the blue
Make sure you're authorized
how would i check that?
have a authorization header with the correct top.gg token
which you can get under your bot page settings -> webhooks
i've double checked both api token and auth, they both seem fine checking with the webhooks
i click test and it seems to be working fine too but when it comes to processing votes it comes up unauthorized
there's a way to add server count without discord py cogs?
What exactly are you trying to do? Interact with top.gg's api or working with webhooks?
interact with API
are you sure you're using the correct api key?
sorry i'm still a bit new to all of this so i might be being dumb haha
i'm pretty sure i am, the one at the top of the page "token for this bot"
I need it too
Ofc, assuming you're using the sdk, just instantiate DBLClient and pass True to autopost parameter. Having it inside a cog or not makes 0 differences. Otherwise make the post request on your own, again, it makes no differences whatsoever despite the cog.
Ok now that I've got an actual server to host my bot which has set ip and port. In order to use dblwebhooks I'll have to put the dblwebhook this way right?
12.345.67.89/:0.0.0.0
I maybe wrote it wrong lol
What to wrote in path? Like the actual path where my bot files are?
The route you set
If you set it to /dblwebhook, then it's http://ip:port/dblwebhook
Ty
how do i use the webhook im confused
what do i put in the url thing
here
shouldnt i put the discord webhook url? what should i put there
You need to make your own webhook by hosting it yourself
discord webhooks do not work
ok how would i host it (if thats something i shouldnt ask here or something that takes a while to explain thats fine i can figure it out)
https://docs.top.gg may be able to help you with that
hello I wanted help setting up webhooks inside my bot
you can read the docs
yes but I am not totally
Hi, there seems to be a bug with top.gg API, it seems to also do a GET request to the webhook that is added for votes.
Our Servers are getting a GET request for the webhook, to which they are responding with a 404.
and also getting a POST
so i am on top.gg at my bot webhooks page https://top.gg/bot/805260079423160382/webhooks. how do i get the webhook url
your bot isn't approved yet, you wont be able to use webhooks yet
ok
also i think there is something wrong with the auto message that we get when our bots are in more than 75 servers
do you need a website domain with backend setup to use topgg ewbhooks?
webhooks*
You don't need a Domain, but you need something to host the webhook on
such as
Any webhost, any vps host
It is better to host the webhook together with your bot using express for example
any tutorial documentation im able to follow?
what would the webhook URL be
http://serverip:port/path
Something like http://123.45.67.89:5000/dblwebhook would be valid
Yes afaik
thankyou
Can't help you with it though, as I don't code in js
imma find express docs
where is the api options on my bot page?
i mean how to find my topgg token
bot page settings -> webhooks
click generate token
I believe there is a problem with the python library docs, I tried looking for the get_bot_votes() function but I couldn't find it in the client class, which is where it says it is in the docs, I listed out all the functions of the class and this is what I got
['annotations', 'class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_auto_post', '_ensure_bot_user', '_is_closed', '_webhook', '_webserver', 'autopost', 'bot', 'bot_id', 'close', 'generate_widget_large', 'generate_widget_small', 'get_bot_info', 'get_bot_upvotes', 'get_bots', 'get_guild_count', 'get_user_info', 'get_user_vote', 'get_weekend_status', 'get_widget_large', 'get_widget_small', 'guild_count', 'http', 'loop', 'post_guild_count', 'webhook_auth', 'webhook_path', 'webhook_port']
Nothing that includes get_bot_votes, and get_bot_upvotes is different
it does the same thing.
What version are you on though?
ig get_bot_votes exists on v1 which isn't out yet
yeah, but it's v1 on github
alright then I'll install that version
There's a breaking change on how it manages the webhook though, it's now a separate class
alright
I think I'll just end up using a webhook
It's more accurate for what I'm doing
I just find it annoying how you have to set up a webhook system just to be able to know when someone has voted for your bot
What do you mean? It's either you make a GET request or they make a POST request (webhook) which is required if you got more than a thousand votes monthly or wanna track the votes in real time. It's not a need to setup a webhook even on v0.4.0, if you don't pass anything to webhook_port parameter, there will be no webserver running.
Oh welp, I think I got what you mean, disregard my prior message then.
How do I get auth? and do i put my DISCORD webhook in the webhook url?
No, don’t put your discord webhook, you need to host your own bot with a webhook to receive voters data, and auth is the password you put inside the webhook you are hosting.
if u dont know abt this better use the votereminder bot
the site is down
its not there
veld said site down
?
Sooo, idk if this is related to the current voting page issue, but top.gg autoposter is returning 502 errors
https://devnoah.me/cdn/cqzMr.txt
Also, I think the issue is fixed:
https://devnoah.me/cdn/dwE1i.png
I can vote for my bot
how can i get my total votes for month ? JS
Bot Info endpoint
@rain heart can you check for this please, this is the third time I have mentioned about this. And I've even sent an email.
It does not do a get request, top.gg only makes post requests, something else (or someone else) is making these requests
Compare the IP you get with the test button with the IP from the get requests, though am not really sure if top.gg also uses cloudflare for making requests
The IP is Same, I can share screenshots from our logs.
The first is a 404ed GET request.
The second is a 201 POST request.
Same IP!
and we are getting a lot of them, all from the same IP!
Yeah i don't seem to be able to reproduce it on my end, i'd suggest making a bug report about it on https://github.com/top-gg/issues
though the DBL useragent with the ip does confirm that it is indeed coming from top.gg
Maybe redirects on your end or something like that?
Nope, there are no redirects at our end.
Though there is no useragent on the GET request
There's none? I see one on the screenshot though
oh nvm
yeah i see it
Still weird, don't seem to be able to reproduce it
the only way i could explain it is that the api is either making a test request to see if the url is valid or something else
I mean if it does a GET request to a POST endpoint for testing liveliness, that is not elegant.
Hello guys, I have a Turkish fun bot. I want to get this bot approved. How can I get it?
This question has probably been asked a million times over, but how do I show server count for my bot?
https://docs.top.gg/ here is the documentation
thank you
const Topgg = require("@top-gg/sdk");
const webhook = new Topgg.Webhook("TOKEN FROM WEBHOOKS PAGE");
app.post('/topgg', webhook.middleware(), async(req, res) => {
console.log(req.vote.user);
});
``` I don't understand why I'm getting 403 from whatever attempt is made whether it be evaling like below```js
require('axios').post('https://mydomain.com/topgg')
``` or using the "TEST" button on the webhooks page, the only one that has made a successful request so far is reqbin but that has no OBJECT for that purpose of testing
Extension 'dbl' raised an error: AttributeError: module 'dbl' has no attribute 'DBLClient' dpy any ideas
Are you using old version?
nop
Make sure lib is up to date and your files and slash or folders aren't named dbl
yeah you might somehow shadow the module
So my server has apparently two IPs: one public IPv4 (which is called elastic IP) and one private IP. I guess im supposed to put the public elastic IP?
mhm
Could I have some help with the Top.gg API?
It's telling me that dbl has no DBLClient member
import asyncio
import logging
import discord
from discord.ext import commands, tasks
import dbl
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.token = 'token'
self.dblpy = dbl.DBLClient(self.bot, self.token)```
i wish but i know 0 discord.py
heh
discord.js for me
other people I talked to in other servers said they had no clue why this was happening
how can i get my authorisation token? https://docs.top.gg/api/@reference/ says it can be obtained from the "my bots" page. where can i find that? i can't see it anywhere on https://top.gg/user/634776327299399721
and i get this error when going to https://top.gg/api/docs#mybots: {"error":"Failed to lookup view \"docs\" in views directory \"/var/botlist/views\""}
neat, tysm
@chilly spire
so the filename was dbl, but now i have a new problem
pip install dblpy doesn't let me import dbl, and pip install dbl doesn't give me a package
try pip3
nope
Can someone helpo me setup Express with TopGG voting webhooks?
yep
what does the url look like? you can also dm it if you dont feel comfortable just sending it here
I can't
now?
but its okay here
Alright
replace https with http
if it doesn't work, then there's most likely something wrong with your code or it isn't running or your post isn't open
what do you mean by my post issn't open?
port i mean
20005
though are you sure the webhook is running? no response on that port
oh wait
js?
I think it's working
Hey there, I'm trying to make a vote command and people can see if they voted and how much time is left till their new vote. I know you can do that with the discord api and i read the docs at least 300 times but still can't understand how to take a certain action when a user has voted. Can someone explain this to me ? Thanks
The API is not responding correctly, I defined dbl but it says it can not read dbl of undefined.
How I defined it: const dbl = new DBL(config.apikeys.dbl, client);
And it says it can't ready dbl
Nevermind I found it....
It couldn't ready my API key to save its life in v12.5
const client = new Discord.Client()
const AutoPoster = require('topgg-autoposter')
const ap = AutoPoster('Your Top.gg Token', client) ap.on('posted', () => { console.log('Posted stats to Top.gg!') })
If I put just this it Will send the shard count too?
Thanks
And if I shard my bot is const client = new ShardManager()
Instead of Discord.Client()?
Or it still the same?
how do i change the buttons' colours for vote and invite and the other stuff ?
please use #development, this is not related with top.gg api
sorry
Is it ok to use flask to manage webhooks?
Because I'm not too keen on learning how to use express.js when I already know how to use flask
In the DBLClient where you have to specify the webhook path, would it work if you already specified the webhook path in the webhook URL on the top.gg bot page?
That is the path that the DBL client will be listening on
So I should keep it as that?
Yes
alright
I tried it and I got nothing
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("Received an upvote!")
Both URLs must match
So it has to be the URL of where the client is listening to
Works with an IP
http://IP/restOfPath
yeah I use an IP
So it will be something like
http://123.345.567.789/
ok
🙏
i am having some problems with voting sir, like rpg games. i cant click the vote button, neither with pc nor android. what should i do sir?
where can i get help with this...........T-T
thanks sir
i have some problem in voting system i already using webhook but the bot not respon for a new vote
Remember you cannot use a discord webhook
i using flask for the webhook
Did you test it with a Rest client (such as postman)?
i already test in top.gg webhook
and the result
but in the bot still no response
you used the test button to test it?
yup
i tried voting but not response too
Did you enter the vote url into the correct bot?
http://ip:port/dblwebhook if you set dblwebhook as your path
oh wait
only have dblwebhook on it
on the webhook_path parameter
Though that tells you that your flask server does work correctly
just wrong webhook path
the flask server should return the data or not ?
well it should return a 2xx status code
Your webhook path is just wrong, replace it with dblwebhook or /dblwebhook
not sure if you define it with the / or not
ok let i try first
With
Yes
but the bot still not response it means the flask server is wrong ?
hi i have api Error
What's the error
"Failed to lookup view "docs" in views directory "/var/botlist/views""
new docs are located at https://docs.top.gg
- combine the / and dblwebhook
Just have /dblwebhook on your webhook path
ok thx for your time
and the webhook still doesn't work on the dblwebhook path?
try opening the url on your browser
yup
or make a manual request with postman
how to get the api in the new located
Something your code seems to cause the 500
use some dummy data to test it
{
"bot": "12345",
"user": "123456",
"type": "test",
"isWeekend": true,
"query?": "test&test2=2"
}
From the webhooks schema
the result of the postman in that picture
i dont think get any request
Is there some sort of tutorial on how to create vote reward commands on discord.py ? I'm totally new to webhooks so can someone help?
Can you send me the url in dms or if you're comfortable, just in here?
Oh also, is your request authorized?
With a Auth header?
yep wait i send u a dms the url
the bot not get the data i think
i using this code
but the bot not printed the xvote if user voting
or i test in webhook
That's correct already
if you want to use dblwebhook as http://ip:port/dblwebhook
Yup
if you defined 5000 as the port
Yes
in your bot page settings on webhooks
what language and web server are you using
Express
ok
do you use bodyparser
are you using the json parser
app.use(express.json())
yep
const bodyParser = require("body-parser")
const express = require("express")
module.exports = async (req, res, app) => {
app.use(express.json())
let check = req.body
console.log(check)
}```
Doesn't works
use in your main file
app.post("/", async (req, res) => {
require("./api/main.js")(req, res, app)
})```
Oh ok
Hi my voting webhook isn't working and I literally don't know why. I am using d.py and here is the code:
# __init__
self.dbl = self.config.keys.dbl_api_token
self.dblpy = dbl.DBLClient(self.client, self.dbl, webhook_path='/dblwebhook', webhook_auth='no', webhook_port=1024, autopost=True)
@commands.Cog.listener()
async def on_dbl_test(self, data):
c = self.client.get_channel(739931876872945775)
user = self.client.fetch_user(int(data['user']))
e = discord.Embed(
title="Test Upvote",
description=f"{user.mention} `{user}` has test voted for me on [Top.gg](https://top.gg/bot/{self.client.user.id})!",
color=0xfffff
)
await c.send(embed=e)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
c = self.client.get_channel(739931876872945775)
user = self.client.fetch_user(int(data['user']))
e = discord.Embed(
title="New Upvote",
description=f"{user.mention} `{user}` has voted for me on [Top.gg](https://top.gg/bot/{self.client.user.id})!",
color=0xfffff
)
await c.send(embed=e)
All of the data is correct on the site too
Finally worked
That too
Maybe check the port, also fetch_user method is a coroutine
Unrelated, but since you're using fetch_user which is gonna cast the id as string later, you don't need to cast it as int.
what is the webhook Auth?
um where can i view the authorisation value
...im unaware of how to do that
i heard that you have to do it with a cog?
how would i do that
Is there an endpoint to check if a user has voted for the server?
I know you can check for bot but for server?
what should i enter in webhook_path if i use port 5000 and repl.it
@rain heart could you perhaps help me ?
this is my code but the server count isnt updating and the print isnt working
oh wait i matched the port number
this is an older screenshot
that isnt a problem
when i test it with the test button it sends me a post as it should
that's painful to read ngl
im currently trying this code
`
class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""
def __init__(self, client):
self.client = client
self.token = 'token'
self.dblpy = dbl.DBLClient(self.client, self.token, webhook_path='ip:5000/dblwebhook', webhook_auth='yeahok', webhook_port=5000)
@tasks.loop(minutes=1.0)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
@commands.Cog.listener()
async def on_dbl_vote(self, data):
logger.info('Received an upvote')
print(data)
def setup(client):
global logger
logger = logging.getLogger('client')
bot.add_cog(TopGG(client))
`
@balmy hamlet
I can't help with this tho
is there no one else 😫
well shiv could help but he's probably busy with something
just do something else for the time being
somebody will eventually answer
yeah ive changed that, but it still doesnt work?
does anyone know how to put the amount of server my bot is on?
ok
so @rain heart any solution on my case ?
Don't know python unfortunately
use a different port
Yeah, that means that port might be already in use
what are you using for your webhook server? what language
use port 8080 or 8000 or something else
can someone help my problem too ?
what is the token requested by the api?
i haven't actually, i'll check it out. thanks!
no problem
@proud cloud curious if i can get the username and tag of the user who upvoted?
???
you can get the ids so basically yes you can get the username and tag too
thanks again
you can do it with Last 1000 Votes method or just webhook thingy (this will return the id everytime a user votes)
i generally suggest using webhooks from the start on than relying on the last 1000 votes
yea i am working on the webhook thing
i agree 'cause i'm gonna be giving rewards every time a user votes
thanks!
this isn't the bot token right? what is it? @rain heart
top.gg token
found in your the Webhooks section on your bot's Edit page
That absolutely doesn't explain what the exact problem is
found it! thank you
are you using py?
oh
im not much of any help then
Sa
#general-int @quiet saffron
...
bot page > edit > webhooks section
if you go to localhost:5500/dblwebhook
it wont work
because you are doing an get request
you need to use something like postman to send the request
^
to simulate the POST request
?
this
¯_(ツ)_/¯
i think you can ignore it if it doesnt repeat
I'm trying to put how many servers this bot is, but I'm not getting
you need to put your dbl token
already did that
top.gg isnt an official module btw
use topgg-autoposter
how do i get the username of someone who just voted?
const AutoPoster = require('topgg-autoposter')
const poster = AutoPoster('topggtoken', client)
ok
is it something like req.vote.username?
it worked
ok
Thanks!
@restive otter are you using dblapi.js?
whatever in https://docs.top.gg/libraries/javascript
Not 100% sure if its cause your bot is not approved yet or mot
ok
@brittle spoke got the issue bot is not verified bcoz i have a bot which is verified and topgg-autoposter successfully ran thanks you
and yeah sorry for ping
Is cool
When I try to use https://top.gg/api//bots/:bot_id/check?userId= I get an "unauthorized" response. Is there some authentication I need to use?
perfect, thanks
Is the api compatible with python 3.9?
the api is compatible with any Programming language that supports http requests and parsing of json objects
like any other api does
lol
so TL;DR yes it is
does anyone know how the bot sends a message on a channel when someone votes for my bot?
they probably use the last channel the user sent a message on or something
I just saw the top.gg docs but I dont know where I can get the ID
I do see the part where we have to use the discord bot list token but I cant find the My bots page
this doesnt work
It is at your bot page settings -> webhooks
have made a pull request that changes the explanation of where you can find your discord list token
just need veld to approve it
THANKS
@rain heart Quick Question when they talk about stats in general, what is included?
where exactly?
stats such as your server count ofc and shard count
Ah server count too
if shardingmanager is used, then it will also send the corresponding shardids i think
not sure
Ahh ok. Thx
How would I access the dbl api in my actual bot
cause I know you can use curl and authenticate
but how do you actually fetch the stats of the bot in json
weird
I was trying to use node-fetch to get the number of votes
you can check whether if shows when you try to search your bot btw
dbl-stats 790985487107620865
oops sry
where do I put the authorization thing```js
const {Webhook} = require("@top-gg/sdk");
const express = require("express");
const app = express();
const webhook = new Webhook(process.env.topggToken);
app.post("/dblwebhook", webhook.middleware(), (req, res) => {
// req.vote wil lbe your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
app.listen(80);
Aaaah
-bots @abstract moth
Bots don't have bots, silly

Hey I want to publish my bot's server count via a command instead of a event
How can I do that?
why would you want it to be a command?
-bots
This user has no bots
https://docs.top.gg/resources/webhooks/#schema if that's what you mean
-bots 724671971316596756
This user has no bots
-bots @carmine vessel
Ok
does anyone know how to get my bot to show on the console the id of who voted for him?
-bots @dull hedge
bruh
hook = Webhook(tokenhere)
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print("Received an upvote:", "\n", data, sep="")
hook.send(data)
on_dbl_vote doesn't fire
@sullen nymph help?
-bots
-bots
-bots
@neon sphinx @restive otter @harsh wadi @dull hedge @carmine vessel @foggy sigil @cedar arch @uncut granite use #commands for any commands you use
Ok sorry
oh sorry
aight
🙏
this doesn't work when someone votes
-bots
-bots
lmao not again
srr
Sowwy
-BOTS
This user has no bots
-bots
omg can you read above @brave quiver
?
Oh, I am sorry
@willow spindle Site Çalışmıyormu ?
english, #general-int for turkish
@steady delta I suggest not leaking webhook URLs
thanks. i have a question though. which ip address should i put in the webhook url? the public ipv4 address or the ip address in the terminal
Anyhoo, have a closer look at this https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook
The public IPv4 one
so http://<publicip>:<port>/<path>?
yup
@restive otter you're getting ratelimited that's why
can I learn which methods you're using?
yes ratelimit but like this since last night and as soon as i opened the bot i ran into this problem
I get the data with the snekfetch module
^^
I don't know the name of the method
Can you understand if I send a sample piece?
get
https://i.imgur.com/PauPKQw.png yellow ones
the method i use
snekfetch.get(`https://top.gg/api/bots/784697814298263572/votes`)
.set("Authorization", dbltoken)
.then(async response => {
let usrnm = response.body[0].username.replace(/[^a-zA-ZığüşöçĞÜŞİÖÇ ]+/g, ``)
console.log(usrnm)
})
you can request this 60 times in a min, you know that right?
yes i know and i demand 1 time per minute to avoid risk
how can i get Total Upvotes
Thanks
Isn't there a solution for this?
https://docs.top.gg @grave river
eyw
Use webhooks instead if you're facing this issue
Why voting for bot doesn't fires
on_dbl_vote event
Lol
Which port
I used code on main page
You need a webhook in order to receive on_dbl_vote events
read the pinned messages for that
That is not how the webhooks work, you have to choose between using vote tracker and not being able to receive on_dbl_vote events, or you use your own webhook
only one is possible
Read the pinned messages for the webhook documentation
From where I'll get URL
it is mostly http://yourserverip:port/path
Hey could u tell me how to start my api poject?
like should i make a folder?
or do it in main.js
#development if you're not referring to the top.gg api
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 wil lbe your vote object, e.g
console.log(req.vote.user); // 395526710101278721 < user who voted
});
app.listen(80);```
how to use this?
what should i put for webhook auth?
You cannot use 80 for your webhook, unless that port is not used
what should i put for the webhook and wdym by 80
80 is the port used by the webhook, if that port is used already (most likely occupied by a website through the http port 80), it wont work
replace your webhook auth with whatever auth you want to have for your webhook
idk which auth i have
You define that yourself
wdmy
It is like a password you can set
pls explain
12345 would be a auth password
maybe WebhookPassword123
It is just like a password you have to set on your bot page settings on your webhooks
top,gg?
o
You can define that authorization there, it has to be the same as your your webhook auth
i already have one
since i made it using dbl bot
You cannot have 2 webhooks, if you have one already then you're good to go
or what are you trying to do?
yea i will use the same one
@rain heart when does the server count update? does it update instantly?
If you're using the API to post it, it should update in up to 30 Minutes to an hour
again, is there any webserver running on your host?
heroku?
replace the 80 with 5000 for example
not sure how heroku's webhook url looks like though
made it 5000
go ahead, you already got the layout for the webhook, it should log the user ID on your console
k
and for sending a DM to a user when you concluded the main part works, https://discord.js.org/#/docs/main/stable/class/User?scrollTo=send
Remember that the user has to be on the same server and dms enabled
@rain heart when i voted it did not log my id
Did you enter the webhook url in your webhook settings?
can i send u in dm?
again i never used heroku and never will, i can't help with the heroku url
do u know anyone who knows
btw why wont u use heroku? its free
Because hosting a bot on a vps is more efficient and more safe
i wish if i could buy lmao
hello, where can I get the api token? I had one token before, but I think it expired and I don't know where to find it now.
bot page settings -> webhooks
oh yes ty
no
we have a forward option with retry
and auth
but well its their issue for questioning topgg about this and not us
Hey can someone explain me how the upvote system in python works? i did replace the self.token to my webhook token but nothing happens when i test it Code: https://pastebin.com/gyqQm5tc
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
any idea why this would return with status code 400
im aware what the status code means
im asking why
turns out i needed to include the content type
In the client class do I need to specify the port number if I already have it included in the link. example: 12.34.56.789:5000
I am having the exact same issue
how do i send message in the dm of those who vote for my bot?
Any property to see how long a user has to vote again?
what language
the on_dbl_vote() worked once but now it still shows the 404
so how can i access these https://docs.top.gg/resources/webhooks/#schema
how can i access the variables
@burnt trellis maybe you can help 👉👈
also why is it so inconsistent
one time it works the other it sends the 404
I believe I'm getting 500 errors when posting bot statistics
anyone else having this issue?
statistics as in sever count and stuff? works fine for me
how do i format the data sent by top gg? the one it sends when one votes
exaclty my question, is it like a list and can we access it like data[0] , data[1]?
@mellow flame thanks man
thank shiv lmao
man i thank shiv everyday
haha ive been doing that lately too
@mellow flame what did you do with the data? you sent it to a discord webhook?
umm no we can just access the values by doing that
for examle print(data["user"]) will print the user id
you use .py right?
yes, but i'm trying to make it be sent to a channel where users can see who voted. to reward them
ahh im trying to figure that out rn too
ill tell ya once i do
i already did actually, but it returns None when i try to print user even after i use get_user
hmmmm i honestly dont know what would solve that since it actually changes each time a different user votes?
so i think we can include the command within the cog itself?
its either genius or a trrible idea
In dblpy how do I use post_guild_count with manual sharding? Does each shard have to connect with dbl?
Convert the ID to int and then use it
You can pass a list of ints to post_guild_count
list of shard id's or shard's guilds
Shards' guild counts
On top of this, @mellow flame @steady delta make sure you are actually caching users
im making my code so that it instantly gives the reward so i dont see a need for that
Ah
i just left the id as it is and i change get_user to fetch_user and it worked!
Eh
because fetch_user is an API request so it's a string sent to Discord API in the end
thanks shiv, as always lol
same
aye np
Use your public IPv4 address and make sure your network allows port 5000
Api noluy
P.S. read the channel topic
-notr
İngilizceden başka dillerde sohbet etmek için #general-int kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.
shoud i hide the api key?
I mean the API "Key" is a secret, so yes
ok ty
what is the minimum rate of posting server count ?
there is no minimum rate
we can do as fast we can?
How do I make it so if you vote for my bot it messages you
Also ps I have no idea how to use webhooks lmao
You need webhooks to use it, if you have no idea then https://docs.top.gg
did i got pinged?
@restive otter please don't ghostping users
dblpy does support a webhook system, yes
Can I make a system for the bot to notify me when someone votes?
JavaScript
You can use top.gg webhook for that ^^ check the docs
plural webhooks
is the python library compatible with 3.9?
v1.0.0 is but it has some breaking changes
that's fine, i haven't written any code yet i just wanted to check
when i view the docs it says more evnts available in v1 but i cant find its docs? is it unreleased?
It's not out yet
hi
What events will be in it?👀
Is there a limit for using of the test button when setting up webhooks?
no afaik
Do you need to save to test?
hm?
Yea you do - I have been troubleshooting this code for too long and you need to save to press test
thanks
My code finally worked when I clicked save so idk
ah yes you have to save webhook settings
Is there a server api similar to bot api that lets you grab server stats? And where would I find docs for that
oh ok thanks
Bot page settings -> webhooks
lol
How to receive webhooks for discord server webhooks?
It's not webhook. I wanna setup a webhook that top.gg sends data to url if someone votes my server
a url is just a destination for the webhook to go to
you need to make a webhook receiver, and put the url to that webhook.
Are there any npm modules for that? Or i have to make my own?
yeah, pins or https://docs.top.gg/libraries/javascript/
Hey Everyone know how can create a webhook and say the votes of my server? Like this (If you know please send me a tutorial here with pin or In My dms, ty)
Theres no tutorial, but there is documentation.
https://docs.top.gg/
This is the documentation? https://docs.top.gg/resources/voting/
thats guidelines for voting
dbl.postStats(bot.guilds.size, bot.ws.totalShards) is this the correct way to post shard counts to the website
the dbl library is deprecated, I would suggest using the auto poster
what is the auto poster
pins
thanks
What it means Shards?
does the autoposter still get voter data or is that just the dblapi.js
yea it can get vote data too
How do i do this? ^^^
i have read the docs
but still don't understand
@knotty garnet if you're going to answer, pls do here
ik
thx
dlbclient = dbl = only for dbl
anyone going to awnser my question?
webservers aren't hard to setup, once you have one running all u need to do is use it for all HTTP stuff
wat that
@knotty garnet yea how to i listen to kofi events? isn't there a wrapper like dbl for kofi too?
use dblpy
very few stuff have wrappers, esp. regarding webhooks
you use py. Period.
dblpy is a lib
you need a solution for python, not dblpy
const dbl = new DBL('my api token', {webhook: 80, webhookAuth: 'my_very_secure_password'})
is this right?
oh he's using js lol
yes
ok

