#topgg-api

1 messages · Page 157 of 1

sullen nymph
#

Hahahaha

shell shuttle
#

@rain heart it works now tysm

sullen nymph
#

https://Akaza-1.ace6002.repl.co/Akaza-1.ace6002.repl.co/ :D

shell shuttle
#

pls do CB_hehe

covert crescent
#

pls give me the vote api discord.js

coarse rune
maiden snow
#

Guys can somebody help

balmy hamlet
#

don't ask2ask

maiden snow
#

I use discord.js and my bot is for economy how can I make it when someone vote my bot it's give him coins? How can I do it really

#

Like dank memer or other bots

balmy hamlet
maiden snow
#

But iam asking help on topgg Api Bec that's need topgg Api

balmy hamlet
#

as I said, that's not related to top.gg api at all, ask that in #development you're most likely to get help there than here, read this channel's description

sullen nymph
#

@pastel raptor uh

pastel raptor
#

uh

#

-m @signal portal

abstract mothBOT
#

tickNo I may be blind, but I don't see that user here.

pastel raptor
#

sadge

sullen nymph
#

Pepega

sand viper
#

@pastel raptor I need api script or workbook script
I am use node.js
I need node.js api script

pastel raptor
#

dont ping me for this

#

thanks

sand viper
#

Why

#

I need help

pastel raptor
#

then ask and wait

sand viper
#

Ok

#

-api Discord.js

#

-api

willow spindle
#

???

sand viper
#

@rain heart

#

Sir give me api script of Discord.js

rain heart
#

this is api, not sure what your goal is with asking to be spoonfed

sand viper
#

Oh

#

const express = require('express')

const app = express() // Your express app

const webhook = new Topgg.Webhook('auth') // add your top.gg webhook authorization (not bot token)

app.post('myapp.herokuapp.com/dblwebhook', webhook.listener(vote => {
// vote is your vote object
console.log(vote.user) // 221221226561929217
})) // attach the middleware

app.listen('8000', () => {
console.log('App listening on port 8000');
});

#

This is ??

willow spindle
#

read pinned messages

sand viper
#

In this script vote.user
paste whose I'd

willow spindle
#

do you know basic javascript

willow spindle
#

it seems that you don't

sand viper
willow spindle
#

learn basics of language before making bot

sand viper
#

Ok but pls tell me what i do

willow spindle
#

read my message again

bleak cypress
#

Why is Top.gg sending multiple requests once voted?

willow spindle
#

do you send 2XX back

bleak cypress
#

OMG how did i forget this

#

Thanks

terse salmon
#

can i fetch votes of a user by top.gg-core package??

willow spindle
#

you can check whether or not a user has voted

#

but you can't fetch votes of user

#

you can get last 1000 votes of bot

terse salmon
willow spindle
#

you have to do yourself

terse salmon
#

ok

willow spindle
topaz mural
#

What is the property name for total votes for my bot in the API

#

Or is that not a understandable question?

sullen nymph
#

points field, /bots/:bot_id endpount

stable helm
#

can anyone help me to do this?

#

which one/

#

I am confused

rain heart
#

the one for your language

stable helm
restive otter
#

its just a 404

vestal field
#

it is saying not found

sullen nymph
#

/api/bots

vestal field
#

ok

#

now it worked

#

ty

solid crest
#

and if i would do a postman test it gives this

restive otter
#

that looks like its working

#

try to vote your bot

#

also save the changes first

thick topaz
#

Hi how to use api

misty wind
#

How to get voters ID? Are we supposed to use on_dbl_vote or webhooks?
Any helpful guides on it?

misty wind
sharp oasis
#

@smoky marten Hello

#

You here too

smoky marten
smoky marten
misty wind
#

Github right?

#

👍 Thanks

smoky marten
# misty wind Github right?
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.listener(vote => {
  // vote is your vote object
  console.log(vote.user) // 221221226561929217
})) // attach the middleware

app.listen(3000)

in GitHub: https://github.com/top-gg/node-sdk
Docs: https://topggjs.readthedocs.io/en/latest/Webhook.html

fiery wraith
#

do i need a webhook to use on_dbl_vote?

fiery wraith
#

can anyone help me set up a webhook inside my bot?

restive otter
#

can i with topgg's api check if someone has voted for the bot or not

#

do ping me if you reply

wicked granite
#

which is why they provide a webhook to retrieve into your own database and collect that information

restive otter
#

i figured it out

wicked granite
#

oh nice

#

where

restive otter
#

thats my bots id

#

you gotta replace it with urs

wicked granite
#

incredible

restive otter
#

ikr

#

very useful

fiery wraith
#

soo how do i implement this?

solid crest
#

that's the thing that is weird, my code looks fine, settings are good everything is saved, but it just doesn't do it jj_shrug

#

made sure my cog is loaded etc etc but still...

cosmic fog
#

How to create a api

fiery wraith
smoky marten
fiery wraith
sullen nymph
#

Yada dee let's go through this

#

How do you think on_dbl_vote is called in the first place

cosmic fog
fiery wraith
#

the only tiny bit problem is im in python

sullen nymph
#

topggpy

#

or dblpy

fiery wraith
fiery wraith
#

do i need javascript to implement this?

#

cant we do it in python?

smoky marten
fiery wraith
#

i have flask

#

can you send me some links for that? that'd be a great help!

sullen nymph
#

For fuck's sake I gave you a library name

#

Use topggpy's WebhookManager

smoky marten
# fiery wraith can you send me some links for that? that'd be a great help!

O figured out you don't need flask.
Just do

import topgg

# This example uses topggpy's webhook system.
# The port must be a number between 1024 and 49151.

dbl_token = 'Top.gg token'  # set this to your bot's Top.gg token
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
bot.topgg_webhook.run(5000)  # this method can be awaited as well

@bot.event
async def on_dbl_vote(data):
    """An event that is called whenever someone votes for the bot on Top.gg."""
    if data["type"] == "test":
        # this is roughly equivalent to
        # return await on_dbl_test(data) in this case
        return bot.dispatch('dbl_test', data)

    print(f"Received a vote:\n{data}")

@bot.event
async def on_dbl_test(data):
    """An event that is called whenever someone tests the webhook system for your bot on Top.gg."""
    print(f"Received a test vote:\n{data}")
fiery wraith
smoky marten
fiery wraith
#

i did try this

#

okay one last thing

smoky marten
fiery wraith
#

what do i replace ``/dblwebhook` with?

#

the password is the auth key

smoky marten
fiery wraith
#

like what does it do?

#

the path

smoky marten
fiery wraith
#

soo i can put my webhook's url?

#

like server webhook

smoky marten
#

like if 69.69.69.69 is my ip and the port is 4200 and my path is /dontcuddleher then the request should be sent to
http://69.69.69.69:4200/dontcuddleher

fiery wraith
#

ohhh i got it!

smoky marten
#

good then I'm going to sleep

#

gn

fiery wraith
#

thank you soo much

#

gn

fiery wraith
#

okayy sad but it doesnt work

fiery wraith
#

it finally worked. im so emotionally im gonna cry

#

jk

#

but it worked

thick marsh
#

Hi, I am trying to make my discord bot dm a user when it is voted on top.gg, I'm using python and all I need is how to define what to name the user I am trying to dm them when they have voted. I've got the on_dlb_vote part for the event. Thanks

cyan portal
#

Hi! Whenever i test the Webhook i get multiple request even if i press the button once. if there some error on your side?

plucky lance
#

You need to response with a 2xx

cyan portal
#

Ah Alright. Is that new?

plucky lance
#

aka. successful

cyan portal
#

It worked the last couple of weeks

plucky lance
#

Not as far as I know

#

Maybe I’m not up to date tho

fiery wraith
cyan portal
#

I fixed it and yeah i need to respond with OK

#

Seems to have fixed it

cyan portal
fiery wraith
#

Ohh well mine worked after smashing my head onto the wall for 3 hours but still happy

restive otter
#

Can someone help me with this

jaunty plank
#

what did the votetracker support team say

restive otter
jaunty plank
#

I have never used votetracker, I really have no idea how it works. its kinda their side, we just send the request to them if you use their urls.

restive otter
#

Their support team is retarded as fuck and won’t help me

#

So I came to you guys

jaunty plank
#

then we are sending the requests to them, and we have nothing else to do with it.
their support would have to help you the rest of the way.

#

we cant help, we dont have any control over their software.

restive otter
plucky lance
restive otter
plucky lance
#

Like you would answer with “Ok, I got it.”

fiery wraith
jaunty plank
fiery wraith
#

I can help you set it up

restive otter
fiery wraith
#

I want you to note that it can only send a message in your channel about some basic info about the voters

#

Sure

gentle lark
#

Hello, I have my bot hosted on Heroku and I have noticed that I need the 2 dynos activated for the webhooks. The problem is that when I activate both the bot executes me 2 times and duplicates the messages. Someone help me?

terse salmon
#

hi

#

i used topgg.isVoted fuction of top.gg-core package but it is showing true even after 12hr

#

pls help me

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.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

terse salmon
#

ok

terse salmon
scarlet cobalt
#

One message removed from a suspended account.

terse salmon
#

kk

scarlet cobalt
#

One message removed from a suspended account.

terse salmon
#

ty

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

terse salmon
heady fiber
#

can any one tell how can i see server count for my bot
it shows N/A

#

is there any expert to help

smoky marten
#

How to post stats ?

const client = Discord.Client() // Your discord.js client

const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
    shardId: client.shard.ids[0], // if you're sharding
    shardCount: client.options.shardCount
  })
}, 1800000) // post every 30 minutes
heady fiber
smoky marten
heady fiber
#

what to chnage here

#

@smoky marten

smoky marten
#

nothing
and please don't ping top

heady fiber
#

how to bring server count can anyone help me...

#

is there anyone who can help

#

how to solve..

#

any one

untold kindle
#

все англечане

#

Python

heady fiber
#

why no server count is showing ....in top.gg website any staff pls help.....

fiery wraith
#

I think your code is not properly posting the data

heady fiber
fiery wraith
#

I wish i could but i am not familiar with javascript

heady fiber
#

ok

lapis pond
restive otter
#

yeah put it in index

graceful lily
#

depending on the interval that you put

restive otter
thick marsh
lean gyro
#

Can someone send the link to the api docs? i cant find them

#

nvm im blind asf

willow spindle
heady fiber
#

@lapis pond@graceful lily@restive otterthanks to all who tried to help me the problem is sorted ..

graceful lily
#

Nps

lapis pond
gentle lark
fiery wraith
#

Yeah sure

formal sparrow
#

Is there a reason why I get ratelimited for posting stats once per minute while it allows once per second? hyperThonk

#

The retry-after header also doesn't change, it's being 3173 every time it gets a 429. That is, I'm seeing the same number every minute once

#

Oh this time I actually see 2933, 1 minute over but only like 200 ms has changed, isn't it a 1 hour block though, if it's being ratelimited, shouldn't numbers he high and decrease by 60000 every minute, instead of decreasing by 200 every minute hyperThonk

jaunty plank
#

the overall every endpoint is 60 a minute. specific endpoints have different rate limits.

#

since the website is heavily cached, posting stats more than once every 30 minutes is kinda useless anyway.

verbal geyser
#

Person voted 4 times within few mins. How is this possible?

jaunty plank
verbal geyser
#

How do I run 200 status?

jaunty plank
#

depends on the language and library.

verbal geyser
#

Python

#

Anyways I'll check for the solution on internet. Thank you

jaunty plank
#

no, but thats pretty common. not even discord documents ratelimits.

formal sparrow
#

And when it's ratelimited from posting, won't retry-after be 1 hour at least at first?

jaunty plank
#

if you hit 60/minute yes

formal sparrow
#

I don't think it hit that

#

But it's somehow ratelimited

#

So every minute sending requests results in 429

jaunty plank
#

👀

formal sparrow
#

With retry-after being just like 2 - 5 seconds

jaunty plank
#

the overall every endpoint is 60 a minute. specific endpoints have different rate limits.

formal sparrow
#

But what about retry-after

jaunty plank
#

retry after is when your ratelimit ends.

#

which the length of the ratelimit depends on the endpoint.

formal sparrow
#

I mean I don't get why it's always under 5 seconds

jaunty plank
#

because the ratelimit length is low for that endpoint.

formal sparrow
sullen nymph
#

100/second inb4

jaunty plank
#

there is an overall ratelimit, and an endpoint specific endpoint

formal sparrow
#

Does it provide x-ratelimit- headers btw?

#

I gotta look at it then ig

jaunty plank
#

no idea tbh

sullen nymph
#

Nah not yet

formal sparrow
#

It's designed to post only once per min

#

And getting ratelimited

sullen nymph
#

You can implement a local ratelimiter for this still

jaunty plank
#

you should be posting at once every 30 minutes anyway.

formal sparrow
#

I mean sure, but question is when it allows that much, why is it suddenly getting ratelimited while for the past months it didn't hyperThonk

jaunty plank
#

the sites not actually updating every 30 minutes with you posting so fast.
caching and whatnot, itll show the old result still for longer than you are posting.

formal sparrow
#

It actually shows instantly

#

In search page at least

jaunty plank
#

for you, the number jumps around for awhile.

formal sparrow
#

Did anything change in the API today though? I never saw it getting ratelimited but today I am hyperThonk

jolly swallow
#

how do i use topgg api to get the amount of votes on a bot

#

and see who voted

#

@lean gyro

formal sparrow
#

In bot pages, it's not right count, yes

#

But in search pages, it's always right ones

#

At least for me

jaunty plank
#

not sure what else you want me to say.
your spamming the api more than you need to.

formal sparrow
#

I'm just expecting an answer to why today out of all days it did the same thing tbh

jaunty plank
#

well, the ratelimit maybe was fixed? shrug

sullen nymph
#

Probs try logging when you send requests and what data you send

#

Maybe you have whatever hell of a loop that accidentally yells at top.gg more than it needs to

formal sparrow
#

Thing is I only see it once per minute lol

#

But I'll consider logging

sullen nymph
#

Best way to debug shit is to log shit ezpz

sullen nymph
#

Even of you're confident it only sends one

#

Better be confident x2

formal sparrow
#

lol aight

jaunty plank
formal sparrow
#

Tried sending requests myself, every request ends in a 429 ThonkSpin

#

And retry after being like 1500

jaunty plank
#

are you still sending requests every minute?

formal sparrow
#

I am, but I also changed token this time so I guess it shouldn't throw 429 for invalid token ones?

#

Tried from another system, it posted but my server seems to be weirdly ratelimited tho ThonkSpin

jaunty plank
#

maybe being ip ratelimited?

formal sparrow
#

Like idk if it prioritizes 429 over 401, if it were spam sending requests, I should see 401 in my logs in any case if it's really spamming

formal sparrow
jaunty plank
#

👀 if you try decreasing the rate to our minimum suggested rate of 15 minutes, or the suggested rate of 30 minutes does the ratelimit stop?
or even just decreasing the rate to a few minutes.

formal sparrow
#

Might work, idk, I just didn't code it like I could change it without having to restart the bot, that's why don't wanna restart it yet

jolly swallow
#

are there any discord bots that make giveaways and the requirement is to vote on topgg

formal sparrow
#

After mins of testing stuff, found that retry-after actually returns seconds and not milliseconds

#

So it was a 1 hour ban this whole time, decrementing from 3600 (seconds in 1 hour) to 0 instead of 3600000 (milliseconds in 1 hour)

lean gyro
#

is it reccomended to POST server count in on_ready or is there a more appropriate place to do that

spice helm
lean gyro
#

true. ive yet to encounter one of those tho

plucky lance
plucky lance
#

You can safely post your stats in the ready event or better great an interval

#

In cases you manually restart your bot a lot of times it doesn’t post the data until the interval reaches it’s value

plucky lance
#

Btw. one interval should be enough.
Also sending the count again if a guild was added can end in a rate limit.
All missed events will be passed if your bot comes online again.

Just sending the server count every hour or 30 min should be enough.

icy oracle
kindred viper
#

Anyone know how to catch the dark Pokémon that appear wild?

#

Appear in the wild *

#

Missed a few , keeps saying typing wrong pokemon

rain heart
#

-api

abstract mothBOT
#

This channel is ONLY for the Top.gg API!
This channel is only for: suggestions/help/bugs to do with official API libraries and API docs found at: https://docs.top.gg
Any Off-Topic conversation may get deleted and muted.

If you need help with development about your bot or development in general, feel free to use #development.

crisp hound
#

how to get started with using the topgg api?(python)

rain heart
crisp hound
#

the real question was this

How to set this up? (webhook URL)
For now free options preferred

wheat lotus
#

read this

restive otter
rain heart
#

@restive otter not on this server

smoky marten
#

nvm

tidal peak
#

smh

heady fiber
#

how to solve this error anyone pls help

#

any person who knows pls help

heady fiber
#

pls hel[ anyone..

rain heart
#

you cant post stats without server count

#

read the error

willow spindle
#

just read the error smh

heady fiber
rain heart
#

Cannot post stats without server count undefined

#

re-read the docs please

heady fiber
#

this is api problem i think api ping high,...

rain heart
#

no

#

you're not providing authorization

heady fiber
#

what can i do

rain heart
#

please properly read the documentation before jumping into coding, as you're missing alot of important things you need to interact with it

heady fiber
#

@rain heartcan you tell which doc

rain heart
sullen nymph
heady fiber
#
Server count posted.
Server count posted for disbot
401 Unauthorized
(node:2134) UnhandledPromiseRejectionWarning: TopGGApiError: 401
    at request (/home/runner/JAM-1/node_modules/top.gg-core/util/request.js:46:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Client.post (/home/runner/JAM-1/node_modules/top.gg-core/lib/TopClient.js:51:9)
(node:2134) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2134) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
401 Unauthorized
(node:2134) UnhandledPromiseRejectionWarning: TopGGApiError: 401
    at request (/home/runner/JAM-1/node_modules/top.gg-core/util/request.js:46:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Client.post (/home/runner/JAM-1/node_modules/top.gg-core/lib/TopClient.js:51:9)
(node:2134) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)```
heady fiber
rain heart
#

Unauthorized

#

What does that tell you

heady fiber
rain heart
#

What do you think Unauthorized means

heady fiber
#

after abouve code the bot start

#

but wont give the correct server count

sullen nymph
#

Good lord

#

Show your fucking code

heady fiber
#

@sullen nymphare you saying to mee

shadow wigeon
#

Hey guys, I've been looking over the topggpy documentation, and I'm looking at the on_dbl_test event.
How do you trigger this event?

heady fiber
#

help anyone

#

plss

restive otter
#

show your code

sullen nymph
#

if it's test it's a test request

#

if it's upvote then it's a vote

shadow wigeon
sullen nymph
#

Oh

heady fiber
sullen nymph
#

Test button on your bot's Edit page's webhooks section

restive otter
heady fiber
restive otter
#

👍

heady fiber
# restive otter 👍

one friend suggest that regenerate the token and thats all my code dont have any error

left egret
#

😐

willow spindle
#

@heady fiber learn basics of language before making bot

heady fiber
#

#dont become gyani baba

willow spindle
#

thats the reason

heady fiber
grave sundial
#

is there a server api? for getting server votes and things like that

sullen nymph
#

No

grave sundial
#

unfortunate, is there a plan to?

sullen nymph
#

Not that I've heard of

tired glen
sullen nymph
#

@jolly hornet what do you say

jolly hornet
#

?

tame kestrel
#

Is there a way I can tell when the last time someone voted for my bot was?

rain heart
#

Nope, unless you track votes yourself using webhooks, then storing the time

tame kestrel
#

I found HasVoted in the DotNET API. Does that check if the user has voted ever or in the past 12 hours?

jaunty plank
#

past 12 hours.

tame kestrel
#

Thanks

wintry tartan
tame kestrel
#

I've only just started exploring it

vast minnow
#

AutoPoster is not a function ```js
const { AutoPoster } = require('topgg-autoposter')
const post = AutoPoster("topgg token", client)

poster.on('posted', (stats) => {
console.log(Posted stats to Top.gg | ${stats.serverCount} servers)
})```

smoky swift
vast minnow
#

it was in the readme of the package

#

:/

smoky swift
#

@vast minnow if it works let me know and I'll ping Berry to let him know.

vast minnow
#

ok

smoky swift
#

Looking at the repo code the above should work.

vast minnow
#

thanks works now

#

the readme was wrong

languid plaza
#

When i voted for my the object shows up empty in console

#

{}

dense shale
#

what happens if you run a test? does the webhook also recive a empty object?

languid plaza
#

Yes

#
const { Webhook } = require("@top-gg/sdk");
const wk = new Webhook(config.topAuth);

app.post("/dblwebhook", wk.listener(vote=>{
   	console.log(vote);
}))```
dense shale
#

you also added the correct url to the webpage? http://yourip:port/dblwebhook

dense shale
#

did you use a proxy to point the webhook corectly?

void obsidian
#

so at the end of day

#

what is the api

#

lmao

#

oh.

coarse rune
#

Hi so if i use repl.it what should i put

#

?

void obsidian
#

mmmmmmmmmmmmmmmmmmmmmmmmmmmmm

#

monke

rain heart
#

-api

abstract mothBOT
#

This channel is ONLY for the Top.gg API!
This channel is only for: suggestions/help/bugs to do with official API libraries and API docs found at: https://docs.top.gg
Any Off-Topic conversation may get deleted and muted.

If you need help with development about your bot or development in general, feel free to use #development.

void obsidian
#

stop the spam

smoky marten
coarse rune
smoky marten
#

actually it's more like

sour sequoia
#
const webhook = new Topgg.Webhook("webhook's auth")


app.post("/dblwebhook", webhook.listener(vote => {
  const wc = new WebhookClient('id', 'password')
  const votembed2 = new Discord.MessageEmbed()
    .setTitle('Thank you for voting for Global Economy:money_with_wings:')
    .setDescription(`User: ${vote.username} just voted!\nand got 10,000 coins!`)
  wc.send(
              votembed2
          )
  db.add(`money_${vote.user.id}`, 10000)
}))

app.listen(port)

any idea why isnt it working?

#

i want that everytime someone votes for the bot it will send a message in a specific channel that i made a webhook for, and its not sending nor doing anything

#

it is open

smoky swift
#

Is it open on your computer though?

#

If you're on an ubuntu server you can use ufw to allow specific ports.

#

sudo ufw allow 25565 (Minecraft default port)

sour sequoia
#

it looks like:
https://discord.com/api/webhooks/id here/lots of numbers and letters

#

then what?

formal sparrow
#

Does anyone know if ratelimits in stats posting endpoint changed or not recently?

rain heart
#

they're still the same documented one

#

60 per minute

formal sparrow
#

I was posting stats every minute once which obviously isn't suggested to do but still, it was working fine but still getting ratelimited from like 2 days when it posts once per minute ThonkSpin

rain heart
#

just post every 30 minutes, there's no need to post every minute

formal sparrow
#

I do understand, I'm honestly wondering like why since 2 days instead of this whole time

#

I guess the number of allowed requests are lowered then hyperThonk

#

Or is it a bug maybe hyperThonk

hollow flicker
hollow flicker
# hollow flicker

This error only appears a few times, and the api works as normal, but why does the error appear?

sullen nymph
#

502

#

five o' two server done a boo

#

5 ecks ecks servers met its ex

#

Seriously though it's 5xx meaning it's on top.gg side

hidden ice
#

Hi, I'm trying to use the Python dbl module to keep my guild count up-to-date on top.gg. I'm using the autopost method shown in the API. Specifically, what I'm doing:

bot.dblpy = dbl.DBLClient(bot, dbl_token, autopost=True)
bot.run(bot_token)

However, top.gg never updates, even after half an hour has elapsed, and no error messages are logged

#

I also tried the @bot.event on_guild_post() asynchronous function, and it never gets called, either

restive otter
#

Use topggpy instead

hidden ice
#

Okay, I've done that. It looks like I should change to on_autopost_success(), as well, which I've also done. How long after launch until that function is supposed to be called?

#

Whoops, never mind, just posted

#

Thank you!

restive otter
raven kettle
#

How can i make a bot that will track votes of my server?

#

i cant find one for servers there is only for bots?

#

then?

#

nvm i found out

#

thanks

nocturne magnet
#

is there a way to make a downtime notification with the api

plucky lance
#

What downtime?

raven kettle
#

are there any code samples?

#

or wikis

urban pebble
#

guys

#

do you want to see something cool

#

who listening kpop

#

blackpink

#

see this..

sullen nymph
#

@jolly hornet

jolly hornet
#

man

#

-api @urban pebble

abstract mothBOT
#

@urban pebble

This channel is ONLY for the Top.gg API!
This channel is only for: suggestions/help/bugs to do with official API libraries and API docs found at: https://docs.top.gg
Any Off-Topic conversation may get deleted and muted.

If you need help with development about your bot or development in general, feel free to use #development.

midnight vapor
#

Dies the java api get any updates anymore?

bleak jacinth
#

what am i supposed to put here??

#

i think im gonna be waiting for a while to get a reply

plucky lance
bleak jacinth
plucky lance
#

Sure the FQDN will be resolved to the IP anyways

#

That’s how the internet works okeh

bleak jacinth
#

ok. one last question. does it matter if i have a website hosted on the machine using the same subdomain??

plucky lance
#

No

bleak jacinth
#

ok

plucky lance
#

But

#

Make sure to define a path the webhook service will listen to, which is not already in use by your webserver

bleak jacinth
#

ok

bleak jacinth
#

why is the webhook test not working. i believe i have set eveything up correctly. here is the code

bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook('/dblwebhook', "aPassword")
bot.topgg_webhook.run(5000)

@bot.event
async def on_dbl_test(data):
  print(data)
restive otter
#

There's no such event

bleak jacinth
#

this is from the topggpy PyPi page

restive otter
#

Because there's also this.

keen arch
#

Is having a reward system which increases the more you vote for the bot allowed? i just wanna make sure before i implement such thing.

balmy hamlet
#

yeah, as long as you don't share rewards between bots, for example, voting for one bot to get rewards on another

keen arch
#

alr, ty <3

midnight vapor
rain heart
#

No it doesn't as there's no active maintainers

#

if you wish to maintain it, feel free to dm veld

#

though the java one is still working with the current api features

craggy sentinel
#

or at least the person who used to maintain it still has a role

#

no idea if hes actually planning to maintain it though

mystic oak
#

Does the top.gg js api still get updates?

scarlet cobalt
#

One message removed from a suspended account.

scarlet cobalt
#

One message removed from a suspended account.

tall dawn
#

idk if im allowed to say this here

#

but i need help

#

with the api

#

i put this

#

but i get this error

#

you can ping me if you want

reef star
#

Hello! How do I get a token?

#

Forget it I found it.

sullen nymph
#

uh what

#

@tall dawn can you post full traceback

gusty hamlet
#

Why does this happen? It worked before, but now it just doesn't

rain heart
gusty hamlet
#

Oh, my bad

limber socket
#

my bot is not updating and is not joining my sever

restive otter
sullen nymph
#

Oh my dumb tired ass

restive otter
#

Kinda fixed it, I'll make a PR if you haven't worked on it

sullen nymph
#

Yeah my laptop hasn't been doing well for the past week and I can't really fix it

#

Would appreciate a PR 🙏

sick igloo
#

quick question: can i try the vote api while my bot is in the approval queue?

rain heart
#

your bot needs to be approved first in order to get access to the api

#

so no

sick igloo
#

ight thanks

wintry tartan
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.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

scarlet cobalt
wintry tartan
#

Yup

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wintry tartan
#

Lemme test that rn

scarlet cobalt
#

One message removed from a suspended account.

wintry tartan
#

yea i got it done with no errors but how would i know if it is working

scarlet cobalt
#

One message removed from a suspended account.

wintry tartan
#

alright

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.

wintry tartan
#

of course, thanks for the help

hidden ice
#

top.gg had a 504 error when my bot tried to post, and the message printed to my logs as strings of HTML. How can I suppress these messages?

fallow apex
#

which one should i use?

fallow apex
#

do i need to anything else besides

dbl_token = os.getenv('TopGG')  # set this to your bot's Top.gg token
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
bot.topgg_webhook.run(5000)  # this method can be awaited as well

@bot.event
async def on_dbl_vote(data):
    """An event that is called whenever someone votes for the bot on Top.gg."""
    if data["type"] == "test":
        # this is roughly equivalent to
        # return await on_dbl_test(data) in this case
        return bot.dispatch('dbl_test', data)

    print(f"Received a vote:\n{data}")

@bot.event
async def on_dbl_test(data):
    """An event that is called whenever someone tests the webhook system for your bot on Top.gg."""
    print(f"Received a test vote:\n{data}")

because when i did a test vote, nothing printed.

keen agate
#

hi, im trying to send a test vote webhook to myself, however i'm not receiving anything. anyone have any idea?

toxic pendant
#

Hi, my easy application bot is offline and will not come back online. Any ideas?

plucky lance
#

If your default inbound policy is DROP

#

Make sure to add the actual public IP of the machine the webhook service is running on

keen agate
#

thanks !

plucky lance
#

👍

restive otter
# tall dawn

List git+https://github.com/top-gg/python-sdk@9782796b869144b24dc58526f89048ecdfdf1b26#egg=topggpy in your requirements.txt instead or pip install it until the PR is merged (which then you can install the master branch instead) or it gets released to pypi.

tall dawn
#

what is requirements.txt

#

never used it before

restive otter
#

Ah, then just pip install it

tall dawn
#

also what is pr

restive otter
#

PR -> Pull Request

tall dawn
#

what do i install

#

pip install what

restive otter
#

Pip install this git+https://github.com/top-gg/python-sdk@9782796b869144b24dc58526f89048ecdfdf1b26#egg=topggpy which is the PR's commit

tall dawn
#

ok

#

hmm

#

its not showing up on replit

#

oh i will brb

coarse rune
#

Can someone help me i use relit

shy vortex
#

provide code

#

if u don't provide any no one can and will help you

tall dawn
restive otter
tall dawn
#

yes

#

i did pip install git+https://github.com/top-gg/python-sdk@9782796b869144b24dc58526f89048ecdfdf1b26#egg=topggpy

#

the page doesnt exist on github tho

restive otter
#

Ofc, it's not the tree URL

tall dawn
#

ok

#

i dont use github that much

restive otter
tall dawn
#

ok

#

well idk what the problem is then

#

i think it might be the library

restive otter
#

It's indeed on the lib side, that's why I told you to install the patch

tall dawn
#

well the patch doesnt work...

#

lemme try something

restive otter
tall dawn
#

well i still get the same error

#

even after i installed it

#

oh wait

#

now it works

#

so

#

originally i had the topggpy and the patch

#

but i uninstalled topggpy so i only had the patch

#

it works now

restive otter
#

Cool, this is the workaround until it gets pushed to pypi

tall dawn
#

thanks

#

lol this isnt working either

#

i get the post thing

#

but the function isnt being called

#

lol

restive otter
#

POST should be an allowed method, are you sure you entered the right path?

tall dawn
#

which path

#

im not good at all this web stuff

rain heart
#

to what are you making a request to

restive otter
#

e.g., /dblwebhook, it's currently requesting to the root path

tall dawn
#

um

#

i just put this

#

this is in replit

restive otter
#

Mind sending how you set WebhookManager up?

rain heart
#

you probably forgot the path

tall dawn
#

what is webhook manager

restive otter
#

The topgg.WebhookManager class

tall dawn
#

oh i never did

#

i just did this

#

btw thats not the real webhook auth

restive otter
#

DBLClient doesn't take in such parameters

#

It's prob your keep_alive thing or whatever it is to keep the repl alive then

tall dawn
#

thats what it said on the docs

rain heart
#

that's a wrong path

restive otter
rain heart
#

only have /dblwebhook there

#

or read the docs yeah

tall dawn
#

wait these arguments are completely different in the docs

restive otter
#

dblpy which is what you see on docs.top.gg is deprecated, this one is what you should use

tall dawn
#

ok

#

so all i need is this?

restive otter
#

If you doesn't need it to autopost, yes

tall dawn
#

oh ok

#

yeah i dont need to autopost

craggy sentinel
#

(someone should probably update the link on docs.top.gg in that case)

restive otter
#

I'm not sure if shiv has made a PR

tall dawn
#

what is this for

#

oh

#

port 5000

#

nvm

restive otter
sullen nymph
#

I haven't

#

I've been very busy and my laptop isn't in good condition + I'm on a vacation

restive otter
#

Yeah, I kinda mixed it up, turned out it was a PR about examples without cogs xd. Take your time, shiv

sullen nymph
#

I believe it would be appreciated if someone did it soon 🤣

restive otter
#

Well, I think I might do it

sullen nymph
#

If you think you have time, I'm not stopping you 👀

restive otter
#

The replacements aren't really correct though, such as the way it still has some deprecated parameters

sullen nymph
#

Yeah that's a no

restive otter
#

So, make a new one?

sullen nymph
#

Mhm

#

@willow sphinx mind closing the above PR?

#

ty

restive otter
#

Kindly review it when you got time topggWink

tall dawn
#

hmm its still not working

#

i think i did it right here

rain heart
#

what's your webhook url now

tall dawn
rain heart
#

again, path

#

add dblwebhook to the end of your url

tall dawn
#

oh ok

rain heart
#

try it and see

tall dawn
#

i did

#

didnt work

#

now it just says this

#

so this is everything i have

restive otter
#

The URL doesn't seem to point to port 5000

tall dawn
#

is it 80?

#

oh it worked

#

yay

#

thank you

high wing
# tall dawn

I don't get why so many people try to host bots on replit

#

it seems like a bad idea, doesn't it go down all the time or something?

#

it just doesn't make sense to me for something that needs to be up all the time

sullen nymph
#

Reverse proxy

high wing
#

I saw people saying stuff about pinging it every so often to wake it up or something, is it a great value or something? I just don't understand why it would be worthwhile to setup a ping system and deal with all that when you can get a real server pretty cheap these days

sullen nymph
#

It3free

#

It's free and is fine for small projects

high wing
#

huh

#

oh yeah I guess

#

0.2 vCPU

#

yikes

#

I guess for a single simple bot it could work

#

I thought it was more of an IDE than a hosting system

restive otter
#

hi

high wing
#

like the hosting was just designed for you to test and you have a production system for real hosting

#

idk just doesn't make much sense to me...even for free, you can get a basic EC2 system that can run your bot and you won't have to constantly be waking it up

sullen nymph
#

🤷

misty wind
#

What will be my webhook url if I am running my bot on computer ?

restive otter
misty wind
high wing
#

@misty wind your public ip but you'll need to host a webserver

#

and setup port forwarding

#

a webhook is just them sending you a POST req whenever someone votes or whatever

eternal crater
#

Hey! I don't understand what should I put on "Authorization" on my bot edit form, webhook. And how for me to get the things that I should put in it?

misty wind
#

Would a Hosting server do the job? thinkfused

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

misty wind
#

Yeah. Sure 👍
Thanks.

coarse rune
#

Hey can someone help mr

#

Me

#

I use discord.js, replit.com and i want to make a system where when a person votes, there is message in the console giving the name of the user

#

If possible pls can u provide the source code

#

Pls mention my username if u can help

fiery wraith
#

Helps me from running out of memory

coarse rune
#

See i am new to coding

sullen nymph
#

You have fucking examples in the docs

fiery wraith
#

The docs has example

#

Copy paste

coarse rune
#

So i kinda dont understand the docs

fiery wraith
#

It will work

#

Just copy paste

coarse rune
sullen nymph
#

If you can use common sense or if you have it you'll know where to put the examples

fiery wraith
#

Well you still have to change some factors

coarse rune
fiery wraith
#

Ay im just lucky it works😂

coarse rune
#

This is my code

sullen nymph
#

🤣

#

if it works it's not bad

#

Do you know what a path is

coarse rune
#

Um no

sullen nymph
#

https://yeehaw.xyz/THIS_IS_MY_PATH

coarse rune
#

Can u tell

sullen nymph
#

Guess what the path is

#

And whether it includes a slash

#

You have Google mate why are you all so stubborn on having everything given to you personally

fiery wraith
#

Js looks much difficult than py

sullen nymph
#

In a way

#

Then again, Python is just built different.

#

😉

coarse rune
#

?

sullen nymph
sullen nymph
coarse rune
#

See if the repl name is test

sullen nymph
#

I don't care what the repl's name is

coarse rune
#

So it will be replname/Path right ?

coarse rune
sullen nymph
#

well, yes

coarse rune
#

Ok

craggy anchor
#

hey shivaco, what's the proper way to post guild count for top.gg when running multiple instances of the bot (multiprocess w python)?

sullen nymph
coarse rune
sullen nymph
#

with /something_path appended to it

coarse rune
#

I will try

fiery wraith
coarse rune
#

So according to the code the path is repl.co/dblwebhook right ?

sullen nymph
craggy anchor
#

yeah I don't

#

do I need one?

sullen nymph
#

In your case /dblwebhook

#

Nothing ELSE

craggy anchor
#

what im doing rn is just having 1 of the instances handling top.gg so I only get 1/process of the amt of guilds

#

makes sense ofc

sullen nymph
craggy anchor
#

so is there no other way but to make an empty master process ig?

coarse rune
sullen nymph
#

You can have a local API that receives information from all shards and once that's done, posts it as a list to top.gg. Only needs requests or aiohttp, whichever you prefer

fiery wraith
sullen nymph
#

Say, 1st shard said "start" and last shard said "stop and post", if you see what I mean

restive otter
#

Or you can inherit DBLClient and override its guild_count property so that it fetches from your local API instead

sullen nymph
#

That's possible too

#

I'm in an area with bad cell service so don't expect me to be online for long kekw

restive otter
#

Actually, I think we should go back to make it method exdee, just for the sake making the sense out

#

And, we could utilize d.py's utils.maybe_coroutine, so that it can be a coroutine, perhaps we can add get_shard_count as well.

median tulip
#

Hi, how can I log into the top.gg API?
When I make a request he replies with "Not authorized"

#
let {body} = await superagent.get(`http://top.gg/api/bots/766631717078564886`);
console.log(${body.monthlyPoints})```
rain heart
#

you need to also provide authorization through the Authorization header with your top.gg token

kindred yew
#

Hi

restive otter
#

I mean, topggpy depends on it anyway mmLol

sullen nymph
glossy spear
#

A huge thankyou to comhad for providing us with this method.

Important links mentioned in the video

  1. Integromato :- https://www.integromat.com/en

Comhad github tutorial with code snippet:-
https://gist.github.com/comhad/bd42b56a0399dbfa645aa83fe3cf4c8a

Support me by upvoting my bot here :- https://top.gg/bot/819838809318621184/vote

Joi...

▶ Play video
#

third party service called integromat is being used

smoky marten
smoky marten
#

Yea they might not be the same

#

but similar I guess

#

anyway it's getting off topic

restive otter
#

Discord messages based webhook bloblul

median tulip
rain heart
#

authorization header

median tulip
#

Okk

#

Thanks

high wing
#

couldn't you literally just use the webhook?

#

I don't see why anyone needs a third party to parse a JSON request...

rain heart
#

you can't use discord webhooks

fiery wraith
#

Discords webhooks are focussed only to a specific channel

high wing
#

I mean for vote rewards

#

discord api is gateway/wss

bronze glen
#

oi

restive otter
#

@high wing nice pfp you have there

high wing
#

lmao

boreal totem
#

What is the API link

restive otter
boreal totem
restive otter
#

Because... that's the base URL

crisp socket
#
ERROR: Could not find a version that satisfies the requirement topgg (from versions: none)
ERROR: No matching distribution found for topgg
#

I get this

#

When I do pip3 install topgg

restive otter
#

You install topggpy, but the package name is topgg

crisp socket
#

Oh

#

My bad

restive otter
#

All good

crisp socket
#

I don't really understand the webhook part tbh

restive otter
#

To check if the user has voted or what?

crisp socket
#

Yes

#

Upvoted

full walrus
#

Do you want to check if a user has voted (eg votelocked command) or do something when a user votes?

crisp socket
#

Something like Thank you for voting

#

(A bot btw, not server)

full walrus
#

You need a simple webserver running next to your bot to recieve the webhooks

#

And make sure it is accessible externally

crisp socket
#

Could be dbl one right?

restive otter
crisp socket
#

Where do I get the webhook

#

Is my question

full walrus
#

You mean your IP address?

crisp socket
#

Uh

#

I don't understand

#

I have a webserver

#

And I have the password to it

#

I know the IP

#

Where is the webhook

full walrus
crisp socket
#

Oh okay

#

thank you

mellow peak
#

I repost here : Hi ! I have frequently this problem with my bot, written in Kotlin with JDA and the java top.gg library and the webhook library. When i try to fetch the user to top.gg api, I got this :/

rain heart
#

seems to get timed out while making the request, make sure your token is correct and your firewall lets your connection through

mellow peak
#

i have this too :/

#

uh everything is correct, my vm have all the access he need

rain heart
#

what url are you making a request to

mellow peak
#

when a person vote i retrieve the name of the user with the topgg api, so i make a request to users/:user_id

rain heart
#

post your code you're using to make a request

mellow peak
rain heart
#

guess that user doesn't exist on top.gg then (?)

#

what's the id

mellow peak
#

635551799058890773

rain heart
#

https://top.gg/api/users/635551799058890773

#

yeah returns a 404 when trying to get them

mellow peak
#

they exist and not, i can add a vote token to them but can't get his name iwith topgg

#

i have this issue for few people

rain heart
#

is 669452973755072524 their discord id or top.gg id?

mellow peak
#

discordid

rain heart
#

yeah really weird then

mellow peak
#

uh no its topgg id excuse me

rain heart
#

try to get their discord id

mellow peak
#

i retrive the id i retrive with the webhook

rain heart
#

or one sec

#

635551799058890773 is their discord id

#

yeah nah that's weird

#

hey @vital anvil quick question about the api, not sure if you're the one working on it:

Since you can both use the discord id and top.gg id of a user to go to their profile, does that apply to the api aswell?

vital anvil
#

no

#

api/v0 isn't being updated

rain heart
#

ohh so that would be a thing on the next api version then?

mellow peak
#

so actually new users don't appear in the api ? oo

rain heart
#

I assume they do, just not through their discord id

#

or not at all, shrug

loud ore
#

hellow

#

i saw some people talk about me lol

#

how can i help ?

restive otter
#

how do i create a webhook?

tepid osprey
#

So I can't make 4 vote required commands?

young copper
#

Where can i find my auth token in topgg?

spice helm
young copper
young copper
#

The api wont work it would still say user did not vote

tidal peak
#

Why you dont use normal top gg api

tidal peak
#

Yea

young copper
#

I dont know why it didnt work

#

Too

smoky marten
#

Also what's the response ?

young copper
young copper
smoky marten
#

like a POST request

#

with Auth Header

young copper
#

Hmm ill try

silk reef
sullen nymph
#

Yes

misty wind
#

Any examples for using VoteDataDict ?
Ping me if anyone replies

sullen nymph
#

the data you have is listed on the docs page

#

You can access it either via data.someattr or data['somekey'], both work

restive otter
#

What's the rate limit on getting all bot votes?

tacit phoenix
#

i think

restive otter
#

t

#

thank ya

vital anvil
#

@jovial kiln added some comments to your PR

restive otter
#

@vital anvil Sorry for this ping.
I'm new here, What do i do?
Just asking, Please don't mute.

vital anvil
misty wind
#
import topgg
dbl_token = 'TOKEN'  # set this to your bot's Top.gg token
bot.topgg_webhook=topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
bot.topgg_webhook.run(5000)  # this method can be awaited as well

@bot.event
async def on_dbl_vote(data):
    if data["type"] == "test":
        return bot.dispatch('dbl_test', data)
    print(f"Received a vote:\n{data}")

@bot.event
async def on_dbl_test(data):
    print(f"Received a test vote:\n{data}")
```To what values, should I change in the "`/dblwebhook`,`password` and in `PORT` ?" I am pretty confused, since I am new to it.
tacit phoenix
#

i think thats right

misty wind
tacit phoenix
misty wind
tacit phoenix
#

yes

misty wind
#

So, will the values change if I run it on computer ?

tacit phoenix
#

no

#

other than your bot settings

#

if you want it to send post requests to your pc

misty wind
#

So, I must change the webhook url in top.gg webhooks section, right?

tacit phoenix
#

yes

#

should be http://ip:port/endpoint

misty wind
#

http://ip:port/dblwebhook 🙃

tacit phoenix
#

and then Authorization should be your 'password'

misty wind
#

Also, how to get the IP?

tacit phoenix
misty wind
tacit phoenix
#

what os is your bot running on

misty wind
#

Windows

tacit phoenix
#

you could prob just google 'what is my ip' KEKW

misty wind