#topgg-api

1 messages · Page 12 of 1

deft moss
#

XD

proper roost
deft moss
#

XDD it's not long finally...

proper roost
#

Now you just need the votes and you're ready xd

supple fable
#

i love this one commit

agile quail
#

There's many like it

supple fable
#

there's moments where I forget everything

#

and do 5 commits in 5 minutes

#

like forgetting to remove debug purpose console.log

agile quail
#

lel

sinful lark
#

How come sometimes when users vote, it doesn't get sent to my webhook? I think it started happening recently.

sinful lark
#

also, does this show if user voted in the past 12 hours?

atomic nacelle
#

I'm using this code but is not working

const express = require("express");
const Topgg = require("@top-gg/sdk");

const app = express(); // Your express app

const webhook = new Topgg.Webhook("my auth is here"); // add your Top.gg webhook authorization (not bot token)

app.post(
"/dblwebhook",
webhook.listener((vote) => {

console.log(vote.user);
const channel = client.guilds.channel.cache.get('1102644556190716025')
channel.send(`${vote.user} Voted Treo`)

})
);

app.listen(2022);

fierce zenith
atomic nacelle
#

Bro when I clicked on send test it didn't logged in the console

#

@fierce zenith

#

Ok now it is work

atomic nacelle
#

Hey what is the variable of getting monthly bot votes, weekly bot votes, total votes, voters total vote, when that voter voted !

rain heart
#

what do you mean with variable

#

that information is not provided in a webhook

#

weekly bot votes [..] ,voters total vote
is also not provided by the api

atomic nacelle
#

@rain heart brother how can I get them?

rain heart
tidal idol
#

@signal hawk multiple channels

open bear
#

error: } reason: Error: 504 Gateway Timeout

code: js const pre = await db.fetch(`premium_${message.author.id}`, 'pre') const Topgg = require("@top-gg/sdk"); const topgg = new Topgg.Api("token is here"); const oy = await topgg.hasVoted(message.author.id) if (!oy && !pre) {

rain heart
#

Try again

open bear
runic creek
#

You can't, it's top.gg side error

#

Such errors are inevitable

#

You can try to catch them and tell the user that the top.gg api has temporary problems, but you won't get rid of them completely.

rain heart
#

Try catch

#

Essentially

radiant olive
#

How to fix

#

@rain heart

rain heart
#

ask and wait for someone who can help

proud eagle
# radiant olive

if you read the error, you'd see you'd need a token, and if you do have a token, you probably have a malformed one

random plank
#

what ???

runic creek
#

What do you mean "what"

untold sparrow
# random plank what ???

Looks to be an issue where you are unable to connect to top.gg. Could have been a temporary internet issue on your end or on top.ggs end

random plank
rain heart
#

looks like an issue on your end though

#

if you're the only one experiencing it

#

make sure your server is able to reach it

stray crow
#

Why did it say something like that? I didn't understand.

broken sequoia
icy aurora
uneven elm
tidal idol
#

what

stable bay
#

Why my this bot has 403 err while others can check if user has voted or not

rain heart
#

Refer to my previous answer I gave you

stable bay
rain heart
#

Making the API client yourself, as the current one uses the logged in bots user id, which is a section of the API path

#

You can't use the token on a different bot than it was generated for, nor can use any other bots id and still receive the same data

slim falcon
#

whys it still erroring for me?

#

im using this to test and its not working

#

"error": "Required parameter shard_count missing or invalid value"

#

in the bot's code, i just need to specify the server count for that shard and it'll add it up for me right? why is it saying the parmter shard_coiunt isnt there

rain heart
#

remember to set the content type to application/json

#

and no, shard_count is required

wide ember
#

how could i listen to vote events(discord.js)

fresh oriole
atomic stirrup
#

hi
To put the servers where the bot is in a github readme, i use:

    <a href="https://top.gg/bot/1041159026324545566">
      <img src="https://top.gg/api/widget/servers/1041159026324545566.svg">
    </a>```
but it comes out *undefined*. any ideas?
rain heart
#

Then you did not post any server count

#

-servercount

abstract mothBOT
slim falcon
#

but how would i know shard_count if, for instance, the bot isnt fully started yet

#

if i update it to different values of shard_count will it take the highest one? im so confused

runic creek
#

I don't quite understand. If you are afraid that the bot will not start before the statistics are sent, set it so that, for example, it posts statistics 30 minutes after the bot is turned on.

#

It doesn't have to be an exact number, an approximate number is fine too.

deft hollow
#

Hi there Topgg webhook how it work?

solid imp
hallow knoll
#

Guys in js, how do u send the request to the api to update server count

#

What data do I send to it

halcyon wind
#

shut up

velvet stirrup
halcyon wind
velvet stirrup
#

so you wanted to be a low life then?

#

Make sense I guess

halcyon wind
#

yea cry abt it

velvet stirrup
#

Why would I?

halcyon wind
velvet stirrup
#

im not?

halcyon wind
#

ermmmm

#

r u lying mr. void

velvet stirrup
#

So me asking you a question is bitching?

halcyon wind
#

yes

#

cs stfu

velvet stirrup
#

I think you need to touch grass

halcyon wind
#

??

#

dont u make discord bots for a living

#

LMAO

#

u go touch grass mf

velvet stirrup
#

Lmao Timed out

rain heart
#

-b @halcyon wind racism

abstract mothBOT
#

upvote xlsr#0 was successfully banned.

rain heart
#

Good luck getting your server unlocked now lol

velvet stirrup
#

Thanks

deft hollow
velvet stirrup
deft hollow
#
this my code 
const Topgg = require("@top-gg/sdk");
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("auth");
console.log(webhook.listener);

app.post(
  "/dblwebhook",
  webhook.listener(async (vote) => {
    // vote will be your vote object, e.g

    console.log(vote.user); // 395526710101278721 < user who voted\

    // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
  })
);```i replaced my auth on webhook auth but idk why not workin i use server ip
rain heart
#

Setting 127.0.0.1 on top.gg will not work

deft hollow
rain heart
#

A publicly accessible url

#

A publicly accessible webserver

deft hollow
#

I use local host to test it is accessible url?

tidal idol
#

the key is in the name, you can only access localhost locally, only your PC can access it right now

deft hollow
#

What if I test in repl it Does it work ?

tidal idol
#

should do

deft hollow
#

can i get vote count via webhook?

rain heart
#

no

#

only by tracking it yourself

hallow knoll
#

im submitting an api request to see how many times a user has voted for my bot, and even if they have voted it says 0, any ideas?

#
async function checkUser(user) {
  const BOT_ID = 'REDACTED';

 try {
    const response = await axios.get(
      `https://top.gg/api/bots/${BOT_ID}/check?userId=${user}`,
      {
        headers: {
          'Content-Type': 'application/json',
          'Authorization': "REDACTED",
        },
      }
    );

const votes = response.data.voted
console.log(response.data)

console.log(`${user} has voted ${votes} times.`)

  } catch (error) {
    console.error('Error checking votes:', error.message);
  }
}
#

when calling the function, user is the id of a user

#

as a string

unreal spire
#

hey, i've got a question...
will Individual User Vote check whether a user voted or not in the last 12 hours or is it timeless?

#

i mean if it's just saying if the user ever voted or not?

restive otter
#

how i have the api?

rain heart
#

??

quick quiver
#

hi

#

how can i get that for mi top.gg page?

rain heart
#

-servercount

abstract mothBOT
rain heart
#

Read

#

the message

ebon trout
#

Why is "bot" underlined in red?
Does it need py bot = commands.Bot(command_prefix=prefix, intents=intents)

stiff quiver
#

did u ever get yours working, having issues trying to get mien working

hollow willow
#

it never worked

stiff quiver
#

their docs is outdated btw ive noticed for python

#

i had it setup right on my non cog bot but struggling to get it to setup with my new one ive made with cogs

hollow willow
#

yeah that’s what happened to me aswell

#

don’t know how cogs interfered

stiff quiver
#

lol, i have to get this working so ima work on it osm emore

#

was just hoping you may of got it done

viral socket
#

So, haven't looked much into the API yet, are you able to set a embed displaying things like votes, server count, ect.

tidal idol
#

yes

#

what the API responds with

viral socket
#

Your a absolute legend. Ty very much

tidal idol
#

no worries

stiff quiver
#

ended up getting it working

visual ridge
#

Hey, um... I'm sorry to disturb you but could you please help with autoposter? I mean cause when im using this code in bot.js file, it's not working but when im using it in a command, it works as it should... If you have any ideas, please let me know, i would be grateful pleading

const { AutoPoster } = require('topgg-autoposter')
const poster = AutoPoster(token, client)

poster.on('posted', (stats) => {
  console.log(`Posted stats to Top.gg | ${stats.serverCount} servers`)
});```
runic creek
visual ridge
dark sierra
#

/generate water

rain heart
#

Successfully generated Water (took 4 Minutes and 35 Seconds)

Please use a different channel next time

#

ah left anyways, rip joke

velvet stirrup
#

Makes u feel better @rain heart I thought it was funny 😁

viral socket
#

Any more experienced developers out there that could help me with the Vote Rewards API?

runic creek
runic creek
tawny aspen
#

uh, that is normal ? i click one time on send test and i got that

#

and continue receive new

#

ah fixed

#

i just forgot do return in the app.post and topgg retry send again

tawny aspen
#

hey, is it normal api refuse return my user when specify my discord id ?

#

if i try with id of my friend, i got correct awnser

warm atlas
tawny aspen
#

?

opal solar
#

Is there a way to use the API without it installing discord.py directly with it? Because I'm using discord4py and that's just a fork of d.py but not exactly the same.

#

Or how can I update my bot's servercount without using the API?

golden adder
#

Just don't use the package and use the raw API

viral socket
#

Anyone host their bot with Sparkedhost.us and successfully used the top-gg/sdk to do vote rewards?

jaunty plank
#

Does SparkedHost have unique limitations compared to a VPS?

velvet stirrup
#

Sounds like a shared game panel host, like paradactyl so I presume so

jaunty plank
#

Looks like they may not provide dedicated IPs unless you pay extra, so you'll likely need to do that, and you may also need to request them to open a port.

restive otter
#

whats up y'all

#

am new here

velvet stirrup
woven coral
opal solar
#

Or can I just use a normal HTTP-Client and do a request with a url, a header and a body?

#

Like

header = {
    "???": "???"
}
body = {
    "???": "???"
}

client.post("https://top.gg/api/AUTH_TOKEN/???", header=header, body=body)
 
#

I haven't done this kind of HTTP before

restive otter
#

y'all just ignoring my text

velvet stirrup
#

Magical thing called maybe people can't help as they don't know how to fix it yet?

knotty pulsar
#

there's a way to count the upvotes with the API?

lusty lion
#

How can we update the webhook url on top.gg via Nodejs? Is there a specific API or something?

desert mauve
#

Helou

runic creek
amber topaz
#

Hi, how can I receive an API key ?

rain heart
#

check the pinned messages

novel yoke
#

how do i fix this issue?

#
app.post(
  "/dblwebhook",
  webhook.listener((vote) => {
    // vote is your vote object
    console.log(vote.user); // 221221226561929217
  })
);```
amber topaz
rain heart
#

literally the first pinned message

restive otter
#

This not working, console clear

#

:v

runic creek
#

And you are not testing it locally right?

rich gorge
#

Hi my vote problem

rain heart
#

?

rich gorge
#

Owo vote problem

rain heart
#

I cant help with that info

rich gorge
#

Owo vote

rain heart
#

???

#

-wrongserver

abstract mothBOT
#

topggDotRed Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord Support Server" button on the bot's page of the bot you need support for. If there isn't a button that says "Discord Support Server" or nothing else mentioned about a support server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(

rain heart
#

ask their support with whatever you're trying to ask

rich gorge
#

Okey thank you

opal solar
#

Can I somehow do a http-request to update the guild-count of my bot on the website?

runic creek
#

Have you ever sent any request to any API?

#

The second link specifies the adress to which you should send the request and what may be in the body. The first one tells you what header you need to provide during the request

merry path
opal solar
opal solar
#

I suppose I do

await my_http_client.post(
    url="https:top.gg/api/AUTH-KEY/???",
    header={some dictionary?},
    body={
        "server_count": len(self.bot.guilds)
    }
)
#

But that's just an idea and nothing precise.

tardy ferry
#

Hi there, for topggpy, why is the old package (topggpy 1.4.0) on pypi not being updated, and why is the last commit for the python sdk on 2021?

#

topggpy 1.4.0 was released Nov 6, 2021. Latest commit using 2.0.0a1 on master from top-gg/python-sdk is Nov 26, 2021

lapis forge
#

also topggpy how do i use .autopost?

woven coral
lapis forge
#

what are people supposed to use instead, then?

woven coral
#

both maintainers have either got banned or left

#

other than that, what are the things to add/change?

#

the API hasn't been updated in years

lapis forge
#

different question, in DBLClient.post_guild_count is guild_count meant to be per-shard count or entire count?

tardy ferry
tardy ferry
woven coral
#

the library's only dependence on discord.py (especially older versions) is a problem

#

hopefully new maintainers like @restive otter can resolve it

#

otherwise you can also make a pull request if you want

woven coral
restive otter
#

oh topggpy? I’m sorry I’ve been busy these days. Will do alot of pr tho once I’m done

tardy ferry
#

i see

#

i'll make prs for topggpy if i have the time to later

woven coral
#

@tardy ferry just saw your github and portfolio

#

looks really good

tardy ferry
woven coral
#

though your blog needs more content

#

besides just focusing on your discord bot

#

like learning new things, thoughts on new technology, etc

tardy ferry
#

true thanks for the suggestion

opal solar
#

I have this here, how long does the website need to update the new server-count?

httpx.post(
    url=f"https://top.gg/api/bots/{self.bot.user.id}/stats",
    headers={"Authorization": self.load_token("config.json", True)},
    json={
        "server_count": len(self.bot.guilds)
    }
)
jaunty plank
opal solar
#

nope

#

I even did this

#

So it would send an error message into a channel

jaunty plank
#

does httpException include status code errors?

#

it looks like you may be missing the content type header, which is why I ask

#

or Exception.

opal solar
#

It got the header 😅

#

at least, it says "headers"

#

I have to check real quick

#

Okay, I changed it to "header" and "json" to "body" ...

#

nope, doesn't work

#

nevermind.

#

Found the issue

jaunty plank
#

~~I dont use python/know how httpx works, which is why I was asking about it. Httpx might handle ~~ Good ^-^

opal solar
#

😂 I forgot to provide "topgg"

#

buuuut it still doesn't work :/

jaunty plank
#

Whats the status code on response?

opal solar
#

ah well

#

After I have clicked on "Refresh data" for about 200 times and once on "Edit" and then only on "Save", it worked. KEKW

fiery wave
#

which webhook do I put there and what is this authorization? What do I need to put?

runic creek
#

Webhook url is the url of your webserver. This is usually http://yourvpsip:port/dblwebhook. Authorization is your string thanks to which you can be sure that top.gg is sending you the request and not someone else

stark relic
tardy ferry
#

@restive otter sorry for the ping, but are there any plans in order to get topggpy up to date?

#

The list of tasks that needs to be done are the following:

  • Move configurations to pyproject.toml, as recommended and addressed by PEP 518
  • Migrate from mypy to pyright, as mypy's type checking results in inaccurate types and is not recommended due to various reasons
  • Merge requirements-dev.txt and requirements-docs.txt into extra groups to ease the installation process
  • Update the severely outdated examples
craggy sentinel
#

looks like some masked links are slipping through Thonk

tardy ferry
#

so it seems like supressing embeds using <> doesn't work here...

craggy sentinel
#

correct, the intention is to block all URLs that are masked like this as they've been abused too much

Top.gg

Spice up your Discord experience with our diverse range of Discord Bots and Servers as well as other spaces to discover DAOs.

restive otter
tardy ferry
frigid stirrup
#

Why am i getting 401 unauthorized even when i am using correct token 🙃

rain heart
#

Are you using the content type json

frigid stirrup
#

yes

#
const api = new Topgg.Api(`my top.gg api key/ bot webhook token`);
rain heart
#

Not what I meant, but if you're using a library, you're using the wrong token

#

Press regenerate, refresh the page, then copy the token

#

It will initially show the incorrect one, and the one it shows is always the same on the first section

rain heart
#

Are you using your token on a different bot?

#

Keep in mind that you cannot use it for other bots

frigid stirrup
rain heart
#

Then your API token is likely invalid yeah, can't help really

#

Ensure you're correctly loading it from your environment variables or however you're using it

frigid stirrup
#

its not

#

Token is matching with what is showed in the webhook page

#
const Topgg = require("@top-gg/sdk");
const api = new Topgg.Api('my token');```
#

this is how i am using it like in documentation

jaunty plank
#

Try regenerating the token, then refreshing the page before copying it.

frigid stirrup
#

done

#

still same error

#

new bug?

jaunty plank
#

To clarify, you're using the token inside the blue box, and are copying the whole thing?

#

The token is wider than the text area

frigid stirrup
rain heart
#

and you are reloading the page after regenerating it?

rain heart
#

is that even an official library?

#

and where does it tell you "unauthorized"

#

you're trying to call something somewhere that tells you unauthorized

#

can you send the actual error stack trace you're getting

scarlet cobalt
rain heart
#

Yeah saw it on the docs now

scarlet cobalt
#

One message removed from a suspended account.

rain heart
#

Works fine on my end to make a simple request using a freshly generated token and making a request to a bot that I own

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

rain heart
#

java stinks

scarlet cobalt
#

One message removed from a suspended account.

rain heart
#

same on other bots

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

rain heart
#

their token is invalid, unauthorized should only happen when the token is invalid

#

trying to post stats would say forbidden

scarlet cobalt
#

One message removed from a suspended account.

rain heart
#

deez nu

frigid stirrup
rain heart
#

Dont need one, when does the error show up?

#

how does it show up?

frigid stirrup
#

Console

rain heart
#

Yes but what does your console say? Where does the error originate from?

#

a stack trace could help

frigid stirrup
#

wait making paste bin

rain heart
#

contains some important headers you shouldn't share, so I'll delete it

#

but will look into it in a sec

#

Exactly what I assumed, you're not even providing a token in the library

frigid stirrup
#

Looks like going to lose the single brain cell i was left with :)

#
api = new Topgg.Api('TOKEN');
//token replaced with the webhook page token```
scarlet cobalt
#

One message removed from a suspended account.

rain heart
#

or a recent commit on the library managed to break everything

frigid stirrup
#

now what can i do more to provide in library ;-;

rain heart
#

cc @restive otter if you wanna look into it

frigid stirrup
#

Let me restart my code editor 😮‍💨

#

NVM

#

@restive otter Please see

rain heart
#

nah its an issue on your end

#

Even tried it with the newest version of the library

#

works fine

#

ensure you're properly copying the token

frigid stirrup
#

bro imma DM you a recording wait

rain heart
#

a recording still would not help

#

as long as you do it the following way:

regenerate it
refresh the page
then copy the token there

#

doing that, I have no problems at all

frigid stirrup
#

I did everything

#

Still same

#

i have 2 more bots on top.gg and this is the first time i am facing this problem

rain heart
#

where are you trying to even call the api

#

since the error only shows up when you actually try fetching something from the api

frigid stirrup
#

i calling the api to check if a user has voted or not

rain heart
#

post your code

#

censor out the token

frigid stirrup
#

const userID = interaction.member.id
return console.log(api.hasVoted(`${userID}`))```
rain heart
#

hasVoted requires you to input your bot id somewhere

#

where have you done that

#

wait

#

how the fuck is that library supposed to work

frigid stirrup
rain heart
#

this is so far understandable

#

then you have this

#

but top.gg requires the actual bot id

#

??????????????????????

frigid stirrup
#

Token provides that

rain heart
#

yes and no

frigid stirrup
rain heart
#

you still need to provide the bot ID in the url

frigid stirrup
#

they don't need url

#

only the Token

rain heart
frigid stirrup
#

Where will i put the url

#

and my other 2 bots are working fine

#

with this same code

rain heart
#

welp cant help you otherwise

frigid stirrup
#

...

rain heart
#

consider just doing it manually through a request client

frigid stirrup
#

I will but can you make sure that they check if there is any problem with the library?

rain heart
#

theres not

#

it works fine on my end

#

you're using an invalid token

#

try testing it manually through for example postman

#

it works fine on my end with a freshly generated token

frigid stirrup
#

Alr

#

Post is working fine

#

its the npm package

rain heart
#

what do you mean with "post is working fine"

frigid stirrup
#

i mean "GET"

rain heart
#

or you're incorrectly passing your token onto the library

#

echo out the token and see if it is the same as what you have pasted in

frigid stirrup
#

i fixed the error with fetch and got the result but few seconds later still got the error and then i removed the package and now its working fine

#

Need a smoke after this mindfuck

hot sail
#

How can I connect my bot to server webhook on topgg?

hearty lintel
#

funny undocumented top.gg api behavior

#

/bot/check fills in the bot id

hearty lintel
woven coral
#

honestly there is no reason to use other people's bot IDs in /bot/check anyway

hallow knoll
#

does anyone know if its possible/has code for having logs for when people vote for the bot

#

in js

velvet stirrup
#

Ehy not just use the web hooks they provide

abstract mothBOT
#

@hallow knoll

Your question is likely answered by one of pinned messages.
Please take time to read the pinned messages by clicking on this icon.

fiery spear
#

Hello, can anyone else confirm they've experienced errors with the DBLApi? For some reason, DBL API also seemed to fail at the import of the package in my Node.JS backend.

In summary:

  • Operation timeouts had a trickle down effect for sharding which is another issue with my application.

  • The shards have NOT been spawning regularly for some reason since shard #4, and we are now at over 10k servers (so we should approximately be at 12 shards).

2023-10-28T12:16:01: DBL.hasVoted failed, skipping. Error:  Operation timed out after 1500 ms
2023-10-28T12:16:43: /root/Euphony/node_modules/dblapi.js/src/index.js:114
2023-10-28T12:16:43:           response.body = res.headers['content-type'].includes('application/json') ? JSON.parse(response.raw) : response.raw;
2023-10-28T12:16:43:                                                       ^
2023-10-28T12:16:43: 
2023-10-28T12:16:43: TypeError: Cannot read properties of undefined (reading 'includes')
2023-10-28T12:16:43:     at IncomingMessage.<anonymous> (/root/Euphony/node_modules/dblapi.js/src/index.js:114:55)
2023-10-28T12:16:43:     at IncomingMessage.emit (node:events:525:35)
2023-10-28T12:16:43:     at endReadableNT (node:internal/streams/readable:1359:12)
2023-10-28T12:16:43:     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2023-10-28T12:16:43: 
2023-10-28T12:16:43: Node.js v18.13.0
2023-10-28T12:16:45: /root/Euphony/node_modules/@discordjs/ws/dist/index.js:1114
2023-10-28T12:16:45:           error: new Error("Sharding is required")
hearty lintel
# fiery spear Hello, can anyone else confirm they've experienced errors with the DBLApi? For s...

Hey! Appreciate all the details. dblapi.js has been deprecated for awhile, check out https://npmjs.com/@top-gg/sdk let me know if you have any issues with this one too. It should be more obvious what’s going on if the error doesn’t go away.

fiery spear
#

Awesome, thank you @hearty lintel that was the solution! You're a life saver 🙏

hearty lintel
#

👍

ebon marlin
#

So this will automatically get your guild count and post it to the stats?

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!')
})```
jaunty plank
#

Once the client is logged in yes.

ebon marlin
#

I made a minor adjustment to it

#
if (client.id === '1092249040558751866') {
  ap.on('posted', () => {
    console.log('Posted stats to Top.gg!');
  });
} else {
  console.log('Client is testing application. Not posting stats.');
}```
solid imp
#

you're just adding an event listener only if the client id is the one you provided

#

unless that's what you want, it will still post stats

open bear
#

what is this error and how to fix

rain heart
#

Your server can't resolve top.gg

frank tapir
#

I have this:
` manager = new ShardingManager('./src/music_bot_v2.js', { token: discordToken });

// Have auto stat updater for top.gg page
const ap = AutoPoster(topGGApiKey, manager);
ap.on('posted', () => {
  console.log('Posted stats to Top.gg!')
});`

But then I check the top gg page and the proper shard/server count is still not updated 😢

frank tapir
#

Nevermind, it just needed time to update

#

we good now

quick quiver
#

hi

#

Does anyone have a vote verification example for Python?

inland wyvern
#

how can i track my bot votes ?

wise raven
inland wyvern
#

wtf

#

ok 1 sec

#

how can i post the server number on top.gg

wise raven
#

oh well that's different than bot votes

inland wyvern
wise raven
#

well you don't have to post bot votes, so what did you want to do with them

#

if you just want to have the number outside of topgg, something like how I said before works for that

inland wyvern
#

you have a ready code ?

wise raven
#

no

inland wyvern
#

can you tell me step by step what i do ?

wise raven
#

I don't remember from way back when I did it

https://docs.top.gg/ check out the docs and I actually think I used a youtube video. Otherwise im sure someone else will be able to help frogNod

Top.gg documentation

Welcome to Top.gg

#

i thought you just needed to track the number of votes to save it

inland wyvern
wise raven
#

yup that's all stuff you can do with the topgg api, I just don't want to incorrectly guide you

inland wyvern
#

why this is not working !

#

it say Posted stats to Top.gg! but nothing happen

wise raven
#

id edit out ur topgg token. Also, try refreshing the page/ clearing cookies ect

rain heart
#

Reset your token @inland wyvern

wise raven
inland wyvern
rain heart
#

That's something you create yourself

inland wyvern
rain heart
#

And make sure that's the same in the authorization field on top.gg

inland wyvern
#

and put it in top.gg website and in the code

#

and i vote nothing will be in the console.log

rain heart
#

You also need to update your webhook settings on top.gg to your Webserver endpoint

rain heart
#

Where the path is on

inland wyvern
#

this ?

rain heart
#

Read the pins

#

Cant explain

inland wyvern
rain heart
#

The one that is talking about webhooks

inland wyvern
rain heart
#

Server count of 110

inland wyvern
#

before now i can't

inland wyvern
# rain heart Server count of 110
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123')

app.post('/dblwebhook', webhook.middleware(), (req, res) => {
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 121919449996460033
}) // attach the middleware

app.listen(3000) // your port
#

this will work ?

#

replace topggauth123 with the one i get it from https://webhook-topgg.com/ ?

rain heart
#

I cannot help you

inland wyvern
#

this is related with top.gg api

rain heart
#

Correct

quick quiver
#

Does anyone have a vote verification example for Python?

jaunty plank
#

vote verification?

oblique crystal
#

Hello

fossil spire
#

How do you make it so that when someone votes for Booty, it is sent that someone voted for Booty?

oblique sluice
oblique sluice
empty urchin
#

In /check do you give me the daily data or monthly?

rain heart
#

returns 1 if the user has voted in the last 12 hours

quick quiver
#

i need help plz

inland wyvern
#

b

inland wyvern
#

can i please get the code to post the server count on top.gg

warm niche
#

example

const { AutoPoster } = require('topgg-autoposter');
const ap = AutoPoster(client.config.basic.TopGG, client);

ap.on('posted', () => {
    console.log('Posted stats to Top.gg! 🟢 SUCCESSFUL');
});

ap.on('error', (err) => {
    console.error(`Posted stats to Top.gg! 🟢 FAILED - ${err}`);
});
inland wyvern
#

thank you

inland wyvern
warm niche
#

the token form the topgg website

inland wyvern
#

sure

warm niche
#

i just have mine in client.config = require('config.json') then call it from there

inland wyvern
warm niche
#

i do but its broken atm

inland wyvern
warm niche
#

#development having issues with it only working on test and myself

#

const betterlog = require('betterlog.js'); if you wanna use it

#

i changed the example to use console.log instead

inland wyvern
#

oww

inland wyvern
warm niche
#

doesnt really matter but .env if using something like repl

inland wyvern
#

i use .env

warm niche
#

i use a vps so doesnt matter to me

inland wyvern
#

lik diva

#

or silly

warm niche
#

i use a paid service

inland wyvern
#

yea but what should i use for it

#

what is better

warm niche
#

oracle cloud tbh

#

but if you wanna scale its useless

#

free is never good if you wanna grow

inland wyvern
warm niche
#

brb

inland wyvern
#

yea when the bot get popular i will change

warm niche
#

ok that failed

warm niche
restive otter
fierce zenith
#

I have 64gb and 1tb woops

tidal idol
#

same

icy aurora
#

I got 16 GB with 3TB

#

jk that’s my pc

slate halo
#

can i get the code for take my bot vote count

warm niche
sharp moat
#

recommended stats upload interval? its 5min right now

jaunty plank
#

30 minutes I would reccomend as a minimum.

slate halo
#

can i get the code for take my bot vote count

sharp moat
#

Is this like 1 = true and 0 = false?

sharp moat
inland wyvern
#

server count not updating

#
//-------------------------------------------------------------------------
const { AutoPoster } = require('topgg-autoposter');
const betterlog = require('betterlog.js');
const ap = AutoPoster(topgg, client);

ap.on('posted', () => {
    betterlog.event('Posted stats to Top.gg! 🟢 SUCCESSFUL');
});

ap.on('error', (err) => {
    betterlog.error(`Posted stats to Top.gg! 🔴 FAILED - ${err}`);
});
//-------------------------------------------------------------------------
inland wyvern
#

<@&817055174613794826>

hearty lintel
# inland wyvern

the server count can take a bit to update on the website, want to check now?

atomic nacelle
#

Why this err coming in my code

tidal idol
atomic nacelle
#

So I need to defined guild first ?

tidal idol
#
const guild = client.guilds.cache.get("GUILDID")
const roleToAdd = guild.roles.cache.get("ROLEID")```
#

yes

atomic nacelle
#

Yeah now working

stark relic
#

why does it say i’m forbidden??

rocky bough
#

are u sure u added the header properly?

granite lance
#

How to setup vote requested command?

lucid nova
#

why am I getting 504: Gateway time-out sometimes.

solid imp
lucid nova
solid imp
lucid nova
solid imp
lucid nova
solid imp
lucid nova
#

I just noticed this error:

stark relic
toxic mauve
#

How can I setup a command for discord bot that is enabled once he/she votes on top.gg in python?

dapper copper
#

site down?

#

503 and 504 errors

tardy ferry
hazy hedge
#

Are there any rules except ratelimits on how to use the api?

desert haven
#

hi

#

trying to setup vote logs on my discord bot was wondering how i go about doing that

#

instead of thru webhook it goes thru the bot?

#

using discord.js v14

#

using

#

ApplicationCommandOptionType bot not slashcommandbuilder

misty mica
#

why is my app not receiving the webhooks?

runic creek
#

Good question, we don't know the answer unless you give us more information

desert haven
#

can someone help me

runic creek
#

I don't really understand what you want to do. Votes can only be received via webhooks. If you want to check whether someone voted for your bot while using the command, you must use the API

toxic mauve
#
Traceback (most recent call last):
  File "/Users/fizzy/Desktop/Bots/nword/Anzu.py", line 56, in <module>
    dbl_client = topgg.DBLClient(bot, topggtoken) 
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fizzy/Desktop/Bots/nword/.venv/lib/python3.11/site-packages/topgg/client.py", line 98, in __init__
    self.http = HTTPClient(token, loop=self.loop, session=kwargs.get("session"))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fizzy/Desktop/Bots/nword/.venv/lib/python3.11/site-packages/topgg/http.py", line 84, in __init__
    self.session = kwargs.get("session") or aiohttp.ClientSession(loop=self.loop)
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fizzy/Desktop/Bots/nword/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 252, in __init__
    loop = get_running_loop(loop)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fizzy/Desktop/Bots/nword/.venv/lib/python3.11/site-packages/aiohttp/helpers.py", line 293, in get_running_loop
    if not loop.is_running():
           ^^^^^^^^^^^^^^^
  File "/Users/fizzy/Desktop/Bots/nword/.venv/lib/python3.11/site-packages/discord/client.py", line 140, in __getattr__
    raise AttributeError(msg)
AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook```

I am using topggpy. I cant get it up running.  I would really appreciate any help.
desert haven
#

by integrating in to ur bot

#

how to make the embed look like this (example from my friends bot but they use webhook)

#

using package topgg-votes

runic creek
#

I don't understand what you mean "through a bot". A webhook listener is nothing more than an http server that receives POST requests. You can implement something like this as long as your bot is located on a publicly available and has static IP address

desert haven
#

yes i figured that out but how to make my embed using topgg-votes package like tha

runic creek
#

Everything is explained in their README

#

This is probably not the official top.gg library so we are not helping with that

desert haven
#

is @top-gg/sdk the offical 1? @runic creek

#

@subtle pulsar is topgg-votes an official one made by top.gg?

desert haven
runic creek
#

It's a regular embed. You do it as you normally would with a bot, except that some of the information here comes from the Discord API/database

desert haven
#

?

#

how do i do the can vote again at:

runic creek
#

You take the time in which you received the vote, add 12 hours to it and you have it

#

There are probably plenty of ways to do something like this

desert haven
#

idk how to do that 😦

runic creek
#

Then you need to educate yourself. Read stackoverflow or look for answers on reddit. I don't even mean any courses, just look for an answer on how to add x hours to a date

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

desert haven
#

@runic creek it is topgg official the package toppp-votes

#

on there website uses exact same code

runic creek
#

What data?

desert haven
#

i need the monthlyPoints data

runic creek
desert haven
#

?

#

i did

#

i tryed

#

data.monthlyPoints does not work

#

using axiso

desert haven
runic creek
#

Did you even add the "authorization" header to your request?

#

Also what kind of error

desert haven
#

ah

#

i just did this

runic creek
#

As I thought, there is no "authorization" header here

desert haven
#

can help fix it?

#

yea i can see the website my self tho

runic creek
desert haven
#

i have

#

my bots connected to it rn

#

be right back

#

back

#

@runic creek my bot has it connected to it rn

#

defined as client.topgg

runic creek
#

Well, then use this token as the "authorization" header in the request you are making

desert haven
#

axios is just like me viewing the website we see the same thing

runic creek
#

No, it's not

#

You need to provide authorization header to make requests via api

desert haven
#

ok

#

give me an example for it

runic creek
#

You can google it

desert haven
#

we dont need token to see this as i can see it rn

runic creek
#

Nah, man

#

Listen

#

Try to make request to this link via postman

#

And you are gonna see the error

desert haven
#

?

runic creek
#

Yes, because you are opening it on browser

desert haven
#

ok

hazy hedge
#

Clear cookies and it won’t work

azure coral
#

how to see if a user is voting for your bot using topggpy lib

tidal idol
#

what

#

thats like the purpose of this channel lmfao

median valve
#

is there a way to check if the user voted for a discord server instead for a bot (also via webhooks) preferably using topgg sdk

#

or is it just the same

#

actually nvm

midnight escarp
#

h

stark relic
abstract copper
#

Can I make my discord.js discord bot have vote only commands?

crude timber
abstract copper
#

Alright, thanks.

crude timber
#

Np

azure coral
restive otter
#

any fix?

icy aurora
#

You have to change that in developer portal

restive otter
#

i have this on

icy aurora
#

i don’t know then.

potent lagoon
restive otter
potent lagoon
dire lake
#

How do I get my botid?

signal hawk
#

-id

abstract mothBOT
#

An ID is a unique number which is used to identify a user, bot, channel, or message. To obtain an ID, right click on it and click "Copy ID"; this can be done from mobile by holding down.

Should you not see the option to acquire an ID, you need to enable "Developer Mode" which can be done from your user settings, under "appearance".

How to get a user's ID on Discord

potent lagoon
bright stag
potent lagoon
bright stag
potent lagoon
bright stag
potent lagoon
#

I don't think so but you can search online for multiple tools which change a text font into stylish ones

bright stag
potent lagoon
#

Yes you can like for example double asterisk on both side mean bold , single asterisk on both side mean italic and triple asterisk on both side mean bold italic

bright stag
potent lagoon
boreal salmon
#

@ me if you respond

#

ahhhhh nvm its /stats

next spear
#

i have a question
hello everyone
does the api of the bot in the vote using the checkuserid
like go from when voted back to 0 when the user didnt vote after the 12 hours?
i just voted and the json changed to
{"voted":1}
after 12 hopurs will it got to 0?
or just adds a number?

potent lagoon
next spear
#

if it was + each time then i would need new tables for db so THANKS top.gg

next spear
potent lagoon
#

Yes I have one

next spear
potent lagoon
next spear
toxic mauve
#

I need my bot to detect when someone votes on Topgg. I can't setup the Topgg client and the on_dbl_vote event is not working. I would appreicate any kind of help. Thank you in advance

from discord.ext import commands 
from topgg import DBLClient


class TopGGCog(commands.Cog):

    def __init__(self, bot: commands.Bot):
        self.bot = bot
        self.topggtoken = "TOKEN"
        self.topgg_client = DBLClient(self.bot, self.topggtoken, autopost=True)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(f"Received a vote: {data}")

async def setup(bot):
    await bot.add_cog(TopGGCog(bot))```
restive otter
toxic mauve
#

I'm new to this.

restive otter
restive otter
toxic mauve
#

my bot is hosted on Google console and it is coded in discord.py

next spear
#

hello devs

#

question is there a way to see the reviews with api?

#

because i can check the votes

#

or something like it

unkempt prism
#

Hello

next spear
#

hey

next spear
next spear
tardy ferry
# toxic mauve I'm looking for a video or someone who can explain me the steps in setting up th...

Tutorials are fundamentally flawed in concept when it comes to teaching you something like a programming language. The simple reason for this is a programming language is how you create whatever you want, a tutorial is something that teaches you how to do what the tutorial is teaching.
I recommend reading through all of these points if you want to understand why
A couple of points against tutorials...especially video tutorials:

  • Tutorials teach you how to create a project, a specific program, a specific script, etc. This causes many many people to only know how to do this one specific thing.

  • A programming language is an entire language itself, this is obvious in of itself but for this point think of this compared to a real language...people have accents, there's multiple ways to say the same thing, there's multiple pronunciations for some words. This same kind of concept applies to programming languages, there are many ways to achieve the same thing, there are code styles which people pick up from learning. Sometimes...these practices can be bad and if you're just learning, how would you know if the tutorial is using some bad practice? Trust me...this happens a lot

  • Tutorials are made for that specific version of whatever it's using...whether this be python, the discord.py library, some other library it's using...etc. As time goes on that can very quickly become outdated

  • Sometimes there are "advanced" or hard concepts that are covered in a tutorial, you're not guaranteed to understand all of it right off the bat. It is extremely hard to provide the relevant documentation for every single concept covered....there would be so much.

  • Specifically for this library, the people who look for tutorials are typically new to the language...this library is not meant for beginners, there are some advanced concepts (EG asyncio) that are covered, and jumping straight into that as a beginner is very bad.

agile isle
#
const Topgg = require("@top-gg/sdk");

const webhook = new Topgg.Webhook("webhook fine and working here");

app.post(
    "/dblwebhook",
    webhook.listener((vote) => {
        console.log("Recived a vote!", vote); //this is empty in console
        // vote will be your vote object, e.g
        const user = client.users.cache.get(vote.user);
        if (!user) {
            return;
        } else {
            const embedE = new MessageEmbed()
                .setTitle("VOTING SYSTEM")
                .addField(
                    `Thanks <@!${vote.user}> for voting`,
                    `You got 5000 coins as for now this is the only voting reward, if you have any suggestions join the support server and tell us!`,
                );
            user.send({ embeds: [embedE] });
            db.add(`money_${vote.user}`, 5000);

            // console.log(vote) // 395526710101278721 < user who voted\
        } // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
    }),
);

console: Recived a vote! {}

#

whenever i vote

next spear
agile isle
#

ill check

next spear
next spear
agile isle
next spear
# agile isle same

thats the bad thing because i would like to give people some awards if they reviewed

agile isle
#

and its dumbd what if they gave a bad review?

#

do it for voting

next spear
#

is i can create code that gets in the website sees the stars and the user id but i will not do it because i dont know if it is legal

agile isle
next spear
#

nice css...

agile isle
#

ty

next spear
#
 @keyframes glow {
0% {
box-shadow: 0 0 5px red;
 }
100% {
box-shadow: 0 0 5px red, 0 0 10px red, 0 0 20px red;
}
 }

#

is it allowed??

agile isle
#

yup it works fine and i asked the team its allowed as long as there is no harm such as very high light or too much blinking ect... and please move the chat somewhere other than here

agile isle
knotty fiber
agile isle
knotty fiber
agile isle
knotty fiber
#

he is my homie dont worry

next spear
knotty fiber
#

k

agile isle
knotty fiber
#

the code yea im not using it

agile isle
knotty fiber
#

i aint using these things

agile isle
knotty fiber
toxic mauve
next spear
opal parcel
#

I feel like that if someone is going to a tutorial to just copy the code for example and not actually learning from it, so it will not give any good for him, but i think tutorials can be useful for ppl who want to learn and checking what do what and why and how.

and the tutorials do need to be good and not just someone not explaining anything and just type cuz it will not help someone to actually learn what is he doing and why is he doing it.

jaunty plank
#

What are you looking for in a tutorial?

icy aurora
#

what's is topgg api?

untold sparrow
untold sparrow
icy aurora
coarse snow
#

On top.gg site my bot guild stats are bugged like it show only 1 cluster guilds not other 4 guilds like it shows very less guild count how I can fix that

shrewd turtle
#

Why would the topgg autoposter be sending me Unsupported Client if I am sending it a discord.js v13 client? I tried with v14 as well just in case

shrewd turtle
#

and how quickly does the serverCount update on the website

untold sparrow
full mesa
#
setInterval(async () => {
    if (!isProd) return;
    await topGGAPI.postStats({
      serverCount: globalBotInfo.guildCount,
      shardCount: bot.gateway.shards.size,
    });
    
  }, 600000);```
```Unhandled rejection:
PromiseRejectionEvent {
  bubbles: false,
  cancelable: true,
  composed: false,
  currentTarget: Window {},
  defaultPrevented: false,
  eventPhase: 2,
  srcElement: null,
  target: Window {},
  returnValue: true,
  timeStamp: 0,
  type: "unhandledrejection",
  promise: Promise {
    <rejected> AssertionError [ERR_ASSERTION]
        at new AssertionError (ext:deno_node/assertion_error.ts:414:11)
        at toNode (node:assert:44:15)
        at assert (node:assert:61:3)
        at new Parser (file:///root/.cache/deno/npm/registry.npmjs.org/undici/5.27.2/lib/client.js:568:5)
        at connect (file:///root/.cache/deno/npm/registry.npmjs.org/undici/5.27.2/lib/client.js:1271:25)
        at eventLoopTick (ext:core/01_core.js:178:11) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: undefined
    }
  },
  reason: AssertionError [ERR_ASSERTION]
      at new AssertionError (ext:deno_node/assertion_error.ts:414:11)
      at toNode (node:assert:44:15)
      at assert (node:assert:61:3)
      at new Parser (file:///root/.cache/deno/npm/registry.npmjs.org/undici/5.27.2/lib/client.js:568:5)
      at connect (file:///root/.cache/deno/npm/registry.npmjs.org/undici/5.27.2/lib/client.js:1271:25)
      at eventLoopTick (ext:core/01_core.js:178:11) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: false,
    expected: true,
    operator: undefined
  }
}```
I'm not sure if this is a Deno issue or a top.gg library issue
wise raven
full mesa
#

Why is updating the stats every 10min wrong?

wise raven
#

what's your full setup for this function? (remember to remove tokens/ sensitive info)

full mesa
#

Only other thing that I'm not showing is the instance of topGGAPI

#

You want that?

wise raven
#

yeah show everything involved in this context, but again make sure to remove tokens n stuff

full mesa
#
export const topGGAPI = new Api(environment_variables.topGGAPIToken);
#

isProd is true

#

Hm, maybe do you think one of the values may be undefined?

#

Let me check

wise raven
#

mm I don't quite know. I don't want to say your setup is wrong because it looks like you're just going about it differently than I am (I'm using js btw)

full mesa
#

Yeah no, they are not undefined

wise raven
#

but ive just never seen the setInterval use for it. i thought all the ways to do autoposting,, well autoposts it on its own

full mesa
#

Do you use Node.js or Deno?

wise raven
#

just node js. I suspect that's why it's different and I just haven't seen anyone use deno and the autoposter

full mesa
#

Deno needs to use a compatibility layer to work with npm modules. I suspect there is an issue with the top.gg library <-> Deno compatibility

wise raven
#

perhaps. could I ask why you're using deno? searching through messages here it's a similar idea as like bun or other node alternatives. im just curious why you picked that over node?

full mesa
#

I picked it because it has a built-in formatter (deno fmt), and I do not have to transpile my code into JS before running (with the tsc command). Deno accepts raw TS code and can run it.

#

Which means less time wasted waiting for TS -> JS compilation

wise raven
#

oh, did you write your bot originally in ts?

full mesa
#

Python -> TS -> TS -> F# -> PureScript -> F# -> Dart -> TS (I'm never rewriting again)

#

Those were all my rewrites

wise raven
#

wow

#

ok now I'm curious, why all the changes between ts (after python)?

#

sorry im like grilling u lol im just super intrigued

full mesa
#

Well after I made the first version in Python (I was like 13/14 at the time), I wanted to learn a new language. I saw other people using TS, so I just learned that next. First iteration in TS was sloppy because it was my first time using TS, so I started over again, this time with better TS skills. And then I got intrigued with functional programming (and I wanted to be special), so I rewrote my bot in F#. That rewrite was an absolute flop. I never got it to work, so I scrapped it entirely. I then used PureScript to write my bot on another platform (Guilded). I wrote it in F# again because the previous F# version didn't work. The code was messy, so I picked Dart because it had a lot of Rust features + I didn't have to deal with a borrow checker. But the library I used when making the Dart version had a lot of issues. So, I just gave up on my special languages and "did it right" with TS.

wise raven
#

interesting

full mesa
#

Yeah... I just like rewriting xD

#

But I'm done now

wise raven
#

not enough to do it one more time charmSingleTear

full mesa
#

Well at least I have a lot of exp with weird languages

wise raven
#

i was gonna say, it could be one heck of a resume

inland wyvern
runic creek
#

As far as I know, you need to add your credit card there

lunar ridge
#

Their free tier is looks like 24gb ram with 4x aarch64 cores

#

I don't recall their x86-64 free tier

#

Even then you have to be lucky to get a free tier vps because of how popular they are

icy laurel
#

so how do we check if the user has voted for the last 12 hours, I only could find how to check if the user has voted in general

jaunty plank
bright stag
#

Is there a way to allow tokens to a development version of a bot? Or is the only solution creating a new page for the development version of the bot?

For context, I have 2 bots with different IDs, one for production and one for development, I would like to test some features on my development bot before releasing it to prod

inland wyvern
uncut hedge
#

Invite-Role Bot

#

May I ask why this bot is offline in the server

icy aurora
uncut hedge
#

Yes.Can't execute instructions

#

Is there any way to fix this

icy aurora
#

no, this isn’t invite-role bot support server

icy aurora
velvet pier
#

Hi, I'm trying to create a functionality in python within my discord bot that when someone votes for my bot sends an announcement to the server but I don't know how to do it

ruby thicket
icy aurora
#

@old forge this look funny to scan

velvet pier
#

Hi, I'm trying to create a functionality in python within my discord bot that when someone votes for my bot sends an announcement to the server but I don't know how to do it

pallid pivot
#

hey how can i make my bot to listen to vote event? like I wanna send a message to a channel if someone votes for my bot

icy aurora
hallow scarab
#

top.gg giving error code 504 when fetching if user has voted or not, only stopped working in the past 30 mins

hallow scarab
tidal idol
#

thats why you got the error

pearl owl
#

hey, how would I go about getting the webhook data for a server vote, formatting it then posting it to a Discord webhook via a website?

limpid plover
#

Hi friends. My bot is on DiscordJS V14. How can I get the user to vote for the bot on TopGG in a command I specify? I just couldn't do it. Even though I reviewed the TopGG Api Documentation, I couldn't do it. Can you help? Thanks :)

restive otter
#

in that app.post you can see the user of each votes and make a database of the voters, and check if the user is in that database

turbid siren
#

I want to give some coins to users when they vote for our bot. How can I do this?

restive otter
#

can some one help how to set vote logs using webhook

#

@old forge

old forge
#

dont ping me please thanks

#

be patient for a response, post a message here or in #development and make sure you refer to the docs too

restive otter
#

thanks

inner arch
#

Has anyone implemented a function where if a user votes for a bot, they will be given some gifts?

willow spindle
hallow scarab
tidal idol
#

Ok

#

It’ll be back soon

hallow scarab
tidal idol
#

What wrote

hallow scarab
#

saying website gave 504

tidal idol
#

Errors*

#

Then site is down

#

504 is a server error

hallow scarab
tidal idol
#

Some pages are intentionally cached

#

Looks like it came back up within about 10 minutes

pearl owl
#

i would also like the ability to use it for multiple different listing sites

jaunty plank
pearl owl
#

since i want it going through a website

agile isle
limber dawn
#

How can I get my top.gg api key???

scarlet cobalt
#

One message removed from a suspended account.

limber dawn
#

Yes help me please 🥲

untold sparrow
limber dawn
#

Op poggythumbsup

#

Ok*

scarlet cobalt
#

One message removed from a suspended account.

untold sparrow
abstract mothBOT
#

yeah what luca thing? I was sleeping

scarlet cobalt
#

One message removed from a suspended account.

untold sparrow
#

uhhh probably

#

there are a lot of luca tags but my memory is rather bad

reef shore
pearl owl
tidal aurora
#

Why this?

icy aurora
#

you haven’t loaded your servers count yet

#

@tidal aurora

tidal aurora
#

Why that??

fringe pier
#

Someone can help me?

icy aurora
tidal aurora
#

How??

icy aurora
tidal aurora
#

Js

icy aurora
tidal aurora
#

This package is in my code what to do?

inner arch
#

Can I use localhost to test votes?

runic creek
#

No, no one from outside can access your localhost unless you do a port forwarding on your router

twilit sapphire
#

How do I get my webhook auth?

inner arch
inner arch
twilit sapphire
#

Discord webhook?

inner arch
#

use @topgg/sdk and express\

runic creek
#

Discord webhook won't work

runic creek
twilit sapphire
runic creek
#

It depends on where you host your bot

#

Most VPS IPs are listed in the panel

inner arch
#

I wrote code like this, when I click on the test to vote, it is repeated continuously?

runic creek
#

Read the documentation carefully. success is probably not what top.gg expects in response

jaunty plank
#

return console.log('Invalid request!');

will also cause repeated requests, assuming the auth is incorrect.

unkempt stirrup
tidal aurora
limber dawn
#

How can I give members reward instantly when they vote without running any command?

limber dawn
#

Why is this happening??

runic creek
#

As for question number one, a webhook is used for this purpose, i.e. a web server thanks to which you will receive information from top.gg if someone votes

#

As for the second message, it is probably due to the fact that your bot does not have an avatar on the website. At least in these cases I have observed this error

limber dawn
long comet
#

how to chek if the user has voted rn or not

smoky marten
restive otter
#

How do I integrate a system that announces votes on my discord bot?

boreal salmon
inner arch
#

I use the users api to check the topgg user but it still gives me a 404 error while that person still votes for the bot.

icy aurora
#

this is top.gg not Pokémon bot support

agile isle
#

How can i show vote and guilds count in a widget of top.gg in a embed?

jaunty plank
#

guild count you should realistically be pulling from your bots gateway connection. Vote data can be pulled from https://docs.top.gg/api/bot/#find-one-bot

Top.gg documentation

API resource for a bots or apps on a platform like Discord

#

Ideally that data should be cached, otherwise you risk getting a ratelimit.

agile isle
#

Hmm, and how am I able to put them in one image?

agile isle
#

@jaunty plank ?

jaunty plank
#

In an image or embed?

Either way it would depend on your programming language, library used etc.

jaunty plank
#

Image generation isnt something I can really give an answer to. It's really out of the scope of an API question. #development might be able to help you with image generation.

frank arch
#

How often does the autoposter send stats, just wondering bc my console doesn't have timestamps

frank arch
cold tapir
#

Hello, I want to know the IDs of the people who voted and commented on my bot. How can I do it?

jaunty plank
cold tapir
jaunty plank
#

Youll want webhooks, as that will give you an event to give xp with

icy aurora
#

@jaunty plank this looks fun to click

knotty pulsar
#

can I see the vote count with the api?

solid imp
knotty pulsar
#

k but i was reading but i didn't find the vote count

jaunty plank
#

points & monthlypoints

eternal stump
#

For the endpoint that checks if an individual user upvoted your bot, will it return 1 if the user voted for your bot in the past month or past 12 hours?

eternal stump
#

Thx

sand pendant
#

can i post stats to my bot on top.gg while its not verified?

scarlet cobalt
#

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.

restive otter
warm latch
#

I need it

#

For a vote thing

icy aurora
warm latch
icy aurora
celest hill
#

how can I download the new pegasus bros

#

gdc2023

#

in

#

yea

#

yea

#

then text me early

#

my bad

#

wow

#

happy early birthday

#

f computers

#

kkkkkkkk

#

NO

#

how quikl can i get a response?