#topgg-api

1 messages · Page 144 of 1

sullen nymph
#

Or any webserver framework?

raven pewter
#

i dont have website

#

i wanna add server count thing on my bot page

sullen nymph
#

You don't need a website and Glitch links work, too

#

Then why do you need a webhook URL

#

What have you tried with the autoposter package

raven pewter
#

do this works?

raven pewter
sullen nymph
#

No, that will not work

#

Top.gg does not work with Discord webhooks directly

sullen nymph
raven pewter
#

no

#

i don't know how to setup this thing

sullen nymph
#

Have you tried reading the example?

raven pewter
#

i didn't see example

#

can you send ss?

sullen nymph
raven pewter
#

ooh i didn't see it

#

AutoPoster('token', client)

sullen nymph
#

It's also quite literally on the package page

raven pewter
#

do i have add my token to 'token'?

sullen nymph
raven pewter
#

oh ok

sullen nymph
#

See last pinned message for it

raven pewter
#

i know how to get my token

sullen nymph
raven pewter
#

`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`

#

@sullen nymph now i adding this to my main?

#

('topggauth123') i have to change this?

sullen nymph
#

Why do you need the webhook?

raven pewter
raven pewter
sullen nymph
#

Then you don't need it

#

You want the autoposter package

#

Not the top-gg/dsk

raven pewter
#

`const AutoPoster = require('topgg-autoposter')

const poster = AutoPoster('topggtoken', client) // your djs client/shardingmanager or eris client`

#

i added it

#

but i cant still

#

saw server count thing top gg

#

oh

#

i can saw it now

#

tysm @sullen nymph a

sullen nymph
oblique axle
#

how can i code the bot send a message to a specific channel when someone vote it?

zealous chasm
#

Ñaña

fallen mirage
#

Hello, may I get some help about making a webhook for the votes?

#

It would send a message like {user} just voted!

rain heart
fallen mirage
#

I was actually there, lost tbh, and then I found that

wintry sequoia
#

what should i put as my webhook url

plucky lance
#

Your public IP or FQDN of the device your webhook service is running on.
And make sure to configure the firewall for incoming TCP connections on your specified port

dull thicket
#

How do I also add user count to this?

restive otter
#

Do you guys know what the e-date server link is

twin hedge
potent tusk
#

can you make the name of who vote come out?

feral palm
#

:v

unborn plinth
#

how to gamble?

proud cloud
dull thicket
proud cloud
restive otter
#

python has that too

proud cloud
#

python has autoposter?!

#

cool

shadow eagle
#

Can someone tell me where this bot server count is coming from?

last bay
#

how do i share server count with top.gg

restive otter
#

why this dont work

const express = require('express')
const Topgg = require('@top-gg/sdk')
const app = express()
const webhook = new Topgg.Webhook('...')
app.post('/web', webhook.middleware(), (req, res) => {
  console.log(req.vote.user)
  bot.channels.cache.get("795394146143043584").send(`<@${req.vote.user}> has voted for me on top.gg!`)
});

app.listen(1251)```
low quail
#

why don't you do a ratelimit system like discord does? it's mutch more easier

low quail
low quail
rain heart
fast meteor
#

are top.gg vote webhooks tcp or udp?

#

also im confused about this

#

do i need to confirm ive received the webhook or something?

night ingot
#

Yes, you need to respond with a 2xx HTTP response, otherwise it's going to keep re-sending the webhook

fast meteor
#

oh

#

ok

#

what about tcp or udp

#

which oen is it

night ingot
#

I would assume TCP, but I can't say for sure

fast meteor
#

ok thanks

hushed reef
#

Most likely TCP

plucky lance
restive otter
#

hello how to add my bot stats in the top.gg page ?

#

(Guilds and other)

night ingot
restive otter
#

its good ?

night ingot
#

Does it work?

restive otter
#

wait

#

i test

brittle spoke
restive otter
#

uuhhh

#

...

brittle spoke
#

F

#

@hearty lintel

#

idk it installed fine for me earlier

restive otter
#

well I have this error when I install a module

#

but I don't know where to install this simpleText

#

I reinstall Node but nothing changes

vocal robin
#

does top.gg webooks allow query ? like:

#

https://domain.com/test?usage=vote

#

indeed they allow it

normal bolt
#

bereload page

restive otter
#

I recorded it again, it didn't happen

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.

vocal robin
#

How do you listen on many auth keys?

oak orbit
#

error 401 means what?

night ingot
oak orbit
night ingot
#

The request probably had some authentication headers that were incorrect, such as a token

oak orbit
#

okok

vocal robin
hearty lintel
restive otter
#

you

#

but

#

in the website

#

i don't view the stats

#

x/

hearty lintel
#

did it say you posted?

#

and no errors in console

restive otter
#

noo

#

in console

#

i don't view

hearty lintel
#

okay, stats take a bit to update visually so just wait a few minutes and try again probably

restive otter
#

Okay x)

restive otter
#

i don't view

#

the message

hearty lintel
#

hm?

#

look at the console and see if there's an error

restive otter
#

ht++

restive otter
#

error in log

kind mica
#

Yo-yo

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.

kind mica
#

YEET

rain heart
#

read above

tardy junco
#

The Test Webhook button doesn't seem to be working, for some reason I'm seeing nothing on my server logs. When I manually test my webhook from another source I do see server logs

#

Well that's the issue, there is no error, I'm just not getting any confirmation that any request is passing through. When I do curl -X POST https://my-web-address I get confirmation that a request was received, but not when I click Test when providing the exact same web address as my webhook URL

rain heart
#

is your url port-based?

#

like :8080 for example?

tardy junco
#

It used to be, but I just installed nginx to port forward for me

rain heart
#

make sure that https:// is actually valid

#

that there's a valid certificate

tardy junco
#

It is, I spent a few hours getting my certificate set up this morning

#

If you click there you can check my certificate, all the root page says is "We're live!" as confirmation that the web server is working

rain heart
#

so the test button doesn't work, but a manual request does?

#

also don't forget to acknowledge the request with a 2xx to avoid pain later on

tardy junco
#

Right. At the route I have set for webhooks, I immediately have a print('topgg post request received'). That print statement triggers when I manually POST to the full address, but nothing prints when I click Test

#

I had the whole setup working two days ago with my old address, I'm just having problems now that I've moved addresses

#

Does it just take a day or two for my webhook URL to update when I change it? That's the only thing I could imagine. Although the old address should technically still trigger the same POST listener

rain heart
#

make sure to press save before testing weSmart

tardy junco
#

Yeah I have, and closed/reloaded the page multiple times

rain heart
#

bot id?

tardy junco
#

One moment let me try something real quick

#

810918366045798451

#

Yeah still nothing

#

Unrelated but I also noticed that when I try to update the number of servers the bot is in from the website, it isn't saving anything I type even when I click Save on that page

#

Using https://apitester.com/ with {"user":"324273473360887808","isWeekend":false,"type":"test"} as the data it's triggering everything I need it to. I just don't know why the Test button on the website isn't working

rain heart
#

lemme test it on my own bot, one sec

tardy junco
#

What if you change the URL?

rain heart
#

one sec

#

doesn't go through

#

changing back

#

goes through again

tardy junco
#

I'm wondering if maybe it isn't saved correctly on my bot or something. Because I'm directly copy/pasting my URL from the bot webhook settings page into https://apitester.com/ and it's working fine on apitester but not top.gg

#

Let me try another browser or something

rain heart
#

that's why i asked, i thought i was able to check if it saved properly

#

didn't know me as a mod can't siteperms-wise

#

can you dm me the webhook url if you're comfortable with it? I'll try setting it on my bot even if it doesn't sound smart to begin with

#

just to confirm it isn't a bot-page specific issue

fallen mirage
#

Hello, how may I make it working? I got told to come on this channel

tardy junco
#

Yeah let me try this other browser first but then I'll do that

abstract mothBOT
#

@fallen mirage

To have your bot's server count displayed on DBL, please read the documentation on server/shard posting.

fallen mirage
#

thank you, let me read it

#

I'm not sure about how it works, not even sure I'm at the right place

restive otter
#

-token

rain heart
#

read pins

#

also you can't use it when your bot isn't approved

restive otter
#

I know

fallen mirage
#

Sorry but.. I'm lost

rain heart
#

@tardy junco went something through?

tardy junco
#

Nope, nothing

rain heart
#

really weird

tardy junco
#

Still working at apitester with the exact address I gave you though

#

Yeah

#

Well. I guess I'll take a break and come back later and see if I somehow missed something obvious. Thanks for trying, feel free to @ me if you think of something I should try

fallen mirage
#

I've never used any API, not sure about how it works

#

Hmm ok, I feel like you won't answer. I'll come back later. Have a really good day / night.

rain heart
#

Just wait for someone who can help

fallen mirage
#

It's ok, don't worry. + I'm going to sleep soon

tardy junco
#

Hahah well, I changed my address back to the direct IP address + port and it's working again. I guess I'll just leave my webhook URL as the raw IP:port even though the domain name is working fine on apitester

feral palm
#

@rain heart sorry for the ping but

#

I'm using the top.gg API but when someone votes for my bot, the user ID appears but I want the name to appear

#

how can I do that?

old kernel
#

My bot not showing server count on top.gg help please

#

Please 🥺

steady delta
#

autopost?

old kernel
#

@runic night i dont know

#

How to use

#

Can you explain

restive otter
old kernel
#

Yes

#

Our real bot not showing server count on top.gg

restive otter
#

oh

old kernel
#

Ya

fading mica
old kernel
#

No Idea bro @fading mica

#

Please explain

fading mica
#

Do u use node.js or python?

charred magnet
#

guys anyone tried pulling filling from sec.gov

#

is that possible ?

restive otter
#

Anyone help me in post server stats to my bot

#

js

#

posting server count

#

Thanks Alot :D

fading mica
#

The autoposter will post after 30mins from when the bot was started?

steady delta
#

is adding members to development team still broken?

acoustic lark
jaunty plank
#

none.

#

you can use any language which can make http requests

acoustic lark
#

oh yeah sorry

jaunty plank
#

np, thats just how api's work. there is no language. that's true for every rest api, its just an interface.

acoustic lark
#

okay thanks

#

Would this work if i have made a function for my token

#

API is the function

#

variable*

rain heart
#

You're passing it as a string

#

in the screenshot

#

but yes it would work with a variable of course

restive otter
#

-api

steady delta
#

who's the one developing dblpy again? i cant remember

#

wanna know when the autopost's gonna be fixed

rain heart
#

@sullen nymph is

sullen nymph
#

I mean, there's nothing stopping you from cloning the repo from GitHub and using that until I officially releaes v1.0

#

cc @steady delta

calm pulsar
#

what is the problem

#

I'm trying to set the Server Count

teal lava
#

Looks like you're passing the Client class to the auto-poster

#

not the instance of it

swift adder
#

does the ratelimits work on this?

rain heart
#

Yes

#

60 per minute

swift adder
#

and if i pass it i get blocked for 1 hour
ok so is there a webhook tameplate cuz i can't find any in the github

rain heart
swift adder
#

im already there

#

but there is no template

#

video would also work

#

"If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in the #topgg-api channel." - help?

rain heart
#

Just ask and wait for someone who can help

#

The docs is the fastest help you can get

swift adder
acoustic lark
#

Does anyone know why this is not working?

#

TOKEN2 is a variable

#

For the token

#

Is it because I am passing it through as a string?

swift adder
#

possibly

rain heart
#

That is a string yes

acoustic lark
#

What should I data type should I pass it through

#

If I am using a variable

#

for the token

rain heart
#

String

swift adder
#

string?

acoustic lark
#

yeah

rain heart
#

Literally use a variable on your token definition

#

Not an actual string

acoustic lark
#

Yeah my variable is Token2=token>

rain heart
#

You set it as a string tho

#

That's not how py works

acoustic lark
#

Oh okay

swift adder
#

if you have the varible token2 then
replace 'Token2' to Token2

acoustic lark
#

Sorry im new to python

swift adder
#

im not a python developer but ik how strings work

acoustic lark
#

yeah it is just that im New to coding

restive otter
#

-api

acoustic lark
#

-api

#

Does it need the """Handles interactions with the top.gg API"""

restive otter
#

No

next pendant
#

anyone have an issue with the webhooks firing twice?

#

for the votes

#

it just started happening for me in the past few days, doesn't happen always

abstract nacelle
#

my webhooks dont fire at all

hallow zephyr
#

PASEN PORNO

#

pass porn

swift adder
#

i don't have a website how can i use webhooks?

night ingot
#

You don't need a website, you can set up a webhook listener and use the public IP of the machine you're running it on

swift adder
#

so its like sending the request to my network and receive it from my pc?

night ingot
#

It will send the webhook to your network's IP through whatever port you specify

acoustic lark
#

Does my token need to be in a string so like "<token>" or '<token>' I am no longer using a variable

night ingot
#

If you're not using a variable, yes, you need to surround it with quotation marks to make it a string

acoustic lark
#

okay thanks

#

Do I only need the Authorisation and The import dbl
import discord
from discord.ext import commands

class TopGG(commands.Cog):
"""Handles interactions with the top.gg API"""

def __init__(self, bot):
    self.bot = bot
    self.token = 'dbl_token' # set this to your DBL token
    self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes

async def on_guild_post():
    print("Server count posted successfully")

def setup(bot):
bot.add_cog(TopGG(bot))

for the servers counter

rain heart
#

Yes

acoustic lark
#

Okay thanks

#

Sorry I should be fine after this You know the Authorisation does that come before or after the python code

sullen nymph
#

yes

#

Add a Cog listener decorator to on_guild_post

acoustic lark
sullen nymph
#

wdym by Authorization

#

it's the self.token that you pass to DBLClient

old kernel
#

i need help top.gg page edit in css not showing

#

@swift adder

acoustic lark
swift adder
sullen nymph
#

You don't need that with dblpy

old kernel
#

i need help top.gg page edit in css not showing

acoustic lark
sullen nymph
#

dblpy sets the self.token that you pass as an Authorization header

night ingot
wise elbow
#

How do I geo locate

night ingot
#

Geo locate?

old kernel
#

@night ingot help me please

night ingot
acoustic lark
sullen nymph
#

@commands.Cog.listener()

acoustic lark
#

Where do I add that

#

Sorry

sullen nymph
#

Right before the function

#

it's a decorator

acoustic lark
#

Like this right

restive otter
#

It's an instance method, shouldn't it have self parameter? owoThink

sullen nymph
#

Yes

#

I'm currently going over the Python library documentation on the docs repo to rework some stuff

acoustic lark
#

I have gotten this message " * Serving Flask app "" (lazy loading)

  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead."
#

Is this meant to happen?

sullen nymph
#

Where the actual hell did you get a Flask application from

#

Is that repl

acoustic lark
#

Yeah

sullen nymph
#

Are you using keep_alive

acoustic lark
#

yeah

sullen nymph
#

Oh dear Christ

#

Yeah it's expected

acoustic lark
#

Will the API still work?

sullen nymph
#

Should as long as your bot isn't being blocked

#

Since Flask isn't async

acoustic lark
#

Is there anyway i could check

#

I am guessing it is Because of the Use a production WSGI server instead.

#

I might just get repl "hacker edition"

sullen nymph
#

Bleh there's no need

#

Leave it

acoustic lark
#

True

vocal robin
#

@kindred walrus I forked the nodesdk api for top.gg

When I add it to replit (using it as a webhok)
it gives me the error.
Is replit compatible with TS?

kindred walrus
#

you do know TS doesnt run anywhere right?

#

you CANT run ts

#

you need to transpile it first

#

either tsc or ts-node it

#

@vocal robin

vocal robin
vocal robin
next pendant
#

is anyone else having issues with double post requests?

#

I checked my logs, and it shows some people vote, and it's showing 2 different servers

rain heart
#

also you possibly have your url on multiple server webhooks then

next pendant
#

but it's not happening all the time

#

just randomly

#

and it started about a week ago

#

when the update happened I guess

rain heart
#

it is very likely another server using your vote webhook

#

change your vote url

next pendant
#

It started on the 18th, a day after the re-write

#

ok

rain heart
#

yeah probably another server using your webhook

vocal robin
#

@kindred walrus Cant I theoretically compile the full top.gg libary to js?

hasty echo
#

Just curious if anyone has been able to get voting done with sharding and if so how they did it 😅 I am kind of too stupid to solve it

kindred walrus
#

like i said, you use TSC or TS-LIB to run ts files

slender quail
night ingot
slender quail
night ingot
#

What lang are you using?

slender quail
night ingot
#

Hm, sorry can't help you with js

#

someone else might be able to, eventually

slender quail
half shale
#

Is there some boost asio library to the api?

#

(C++ so it works in my bot)

full ruin
#

Just got this from the AutoPoster API

TopGGAPIError [Top.GG API Error]: 429 Too Many Requests
    at Api._request (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Api.postStats (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:96:9) {
  response: '<!DOCTYPE html>\n' +
    '<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->\n' +
    '<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->\n' +
    '<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->\n' +
    '<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->\n' +
    '<head>\n' +
    '<title>Access denied | top.gg used Cloudflare to restrict access</title>\n' +
    '<meta charset="UTF-8" />\n' +
    '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n' +
    '<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />\n' +
    '<meta name="robots" content="noindex, nofollow" />\n' +
    '<meta name="viewport" content="width=device-width,initial-scale=1" />\n' +
    '<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" type="text/css" media="screen,projection" />\n' +
    '\n' +
    '\n' +
    '</head>\n' +
    '<body>\n' +
    '  <div id="cf-wrapper">\n' +
    '    <div class="cf-alert cf-alert-error cf-cookie-error hidden" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>\n' +
    '    <div id="cf-error-details" class="p-0">\n' +
    '      <header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-15 antialiased">\n' +
    '         <h1 class="inline-block md:block mr-2 md:mb-2 font-light text-60 md:text-3xl text-black-dark leading-tight">\n' +
    '           <span data-translate="error">Error</span>\n' +
    '           <span>1015</span>\n' +
    '         </h1>\n' +```
#

    '         <span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">Ray ID: 6387103e58800e4a &bull;</span>\n' +
    '         <span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">2021-03-31 05:09:04 UTC</span>\n' +
    '        <h2 class="text-gray-600 leading-1.3 text-3xl lg:text-2xl font-light">You are being rate limited</h2>\n' +
    '      </header>\n' +
    '\n' +
    '      <section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">\n' +
    '          <div id="what-happened-section" class="w-1/2 md:w-full">\n' +
    '            <h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>\n' +
    '            <p>The owner of this website (top.gg) has banned you temporarily from accessing this website.</p>\n' +
    '            \n' +
    '          </div>\n' +
    '\n' +
    '          \n' +
    '      </section>\n' +
    '\n' +
    '      <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">\n' +
    '  <p class="text-13">\n' +
    '    <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">6387103e58800e4a</strong></span>\n' +
    '    <span class="cf-footer-separator sm:hidden">&bull;</span>\n' +
    '    <span class="cf-footer-item sm:block sm:mb-1"><span>Your IP</span>: 66.11.118.47</span>\n' +
    '    <span class="cf-footer-separator sm:hidden">&bull;</span>\n' +
    '    <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>\n' +
    '    \n' +
    '  </p>\n' +
    '</div><!-- /.error-footer -->\n' +
    '\n' +
    '\n' +```
#

    '    </div><!-- /#cf-error-details -->\n' +
    '  </div><!-- /#cf-wrapper -->\n' +
    '\n' +
    '  <script type="text/javascript">\n' +
    '  window._cf_translation = {};\n' +
    '  \n' +
    '  \n' +
    '</script>\n' +
    '\n' +
    '</body>\n' +
    '</html>\n'
}
candid vale
#

I've got the same thing

willow spindle
#

@full ruin what is your post interval

full ruin
#

oops soz i got it fixed. I had to regenerate my api token.

#

should've mentioned this sooner, soz for the late update.

vestal quartz
#

and checking whether the person has voted

sullen nymph
#

get_user_upvote in dblpy or a manual GET request

next pendant
willow spindle
vocal robin
next pendant
#

is it supposed to be doing duplicate requests?

willow spindle
#

you should respond with 2XX

#

or it will spam your server iirc

vocal robin
kindred walrus
kindred walrus
vocal robin
#

hmm, thats suspicous

kindred walrus
#

its relative to where your source folder is

full ruin
#

How do I do the voting command in Discord.js-Commando. The faq doesn't show anything about it for javascript.

#

ok yeah this guide doesnt help much for explaining how to actually build the commands. i think ima just gonna forgoe this.

sullen nymph
#

Those docs only explain how to work with the top.gg API. How to build commands isn't on top.gg, but on discord.js commando documentation

full ruin
#

Yeah unfortunately their documentation is a tad garbage so it's not very useful when trying to utilize something that isn't part of discord.js-commando sadly.

#

hmm i think i know a simpler way to do this actually. without needing to utilize the api at all lmfao

rain heart
#

Manually making requests to it then

old kernel
#

my bot not showing in search of top.gg

#

?

rain heart
full ruin
#

I think this should actually work fine for what I'm trying to get:

const { MessageEmbed } = require('discord.js');
const { Command } = require('discord.js-commando');
const config = require('../../config.json')

module.exports = class BumpCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'bump',
            aliases: ['upvote'],
            memberName: 'bump',
            group: 'other',
            description: "Vote for TwitchBot on Top.GG"
        });
    }

    run(message) {
        let embed = new MessageEmbed()
            .setTitle('TwitchBot')
            .setDescription('Vote for TwitchBot.\nYou can vote once every 12 hours.')
            .addField('Top.GG', '[Link](https://top.gg/bot/' + config.topgg_client_id + '/vote)', false)
            .setThumbnail(this.client.user.displayAvatarURL())
            .setColor('RANDOM')
            .setTimestamp(new Date().toISOString())
            .setFooter(this.client.user.username, this.client.user.displayAvatarURL())
        message.channel.send(embed)
    } catch (err) {
        console.error(err)
        channel.send(
            '...'
        )
    }
};
#

alas my error handler is weird to discord lmfao

sullen nymph
#

I mean, if it works

full ruin
#

yip should be fine 🙂

sullen nymph
full ruin
#

just need to add some config variables and it should be good 🙂

#

and violla

old kernel
#

please anyone can tell me how to work on webhook for bot

#

node.js

full ruin
#

yip, works perfectly 🙂

stiff imp
#

Would I have to use this every time a shard from my bot turns on?

sullen nymph
#

You can either post via individual shards or just send a list where each element is each shard's guild count

old kernel
#

@sullen nymph please can you help me in top.gg webhook coding

sullen nymph
#

What exactly do you need help with

#

Which part are you stuck on

old kernel
#

in live stream i tell you come

#

please

#

link in your dm

sullen nymph
#

Oh you're the guy from yesterday

#

I'm not joining the server you sent me in DMs

#

You can perfectly work with just screenshots

old kernel
#

i coded all

#

but need checks '

#

like

sullen nymph
#

What checks

old kernel
#

wait

normal isle
#
const AutoPoster = require('topgg-autoposter')
const Topgg = require(`@top-gg/sdk`)```

it says @top-gg/sdk or topgg-autoposter module not found idk why and i cant fix it!
normal isle
spiral bay
#

you probably mistyped the names then

normal isle
#

i did not mistyped the name

spiral bay
#

run npm i @top-gg/sdk topgg-autoposter just in case

sleek dune
#

if it's works

normal isle
spiral bay
#

then add those to the dependencies property in the package.json file

restive otter
#

Hello everyone, it is definitely the most asked question that I am definitely asking here. Nevertheless, I put it up, how is that done with the vote. I have a global chat bot that communicates via several servers. And would like to use it in the chat to always show who is voting. Who has what in stock? My bot is written in Python admin

rain heart
restive otter
#

I know the docs are there, but this time I really don't understand what to do 😄

rain heart
white valve
#

Okay! Sorry

honest jungle
#

So if I have multiple shards (say 3), do i post {server_count: [1000,1000,1000], shard_count:3} ?

#

or do I need to pass shards too?

rain heart
#

that would post your server count to 3k as far as i know

#

if that's correct

#

but yes it would do so

sullen nymph
#

No need for the shard count technically

#

Just the server count array is fine

honest jungle
#

Ight, its just internal sharding, so I guess its better to pass shard_count rather than filtering servers per shard

sullen nymph
acoustic lark
#

Does anyone know why this is not working? have put in my token I have took it out so No one can see it in the screen shot

#

I have*

night ingot
#

Does it give you any errors?

acoustic lark
#

no

night ingot
#

Did you try leaving it on for a while, since it only posts every 30 minutes?

acoustic lark
#

I will try that now

#

well i will wait 30 mins now

#

I only just posted it

acoustic lark
#

I have done some changes to the code

#

ima wait a other half an hour

#

wait do I need Privileged Gateway Intents

night ingot
#

For posting the server count? No, you don't

acoustic lark
#

Oh okay thanks

night ingot
#

Privileged intents are only presences and server members

acoustic lark
#

Okay ty

acoustic lark
night ingot
#

As long as you're loading that cog, yes, that should be all

acoustic lark
#

So like this?

night ingot
#

That event isn't absolutely necessary, it's just there to tell you that it actually posted the count

#

it's the stuff in the init method that sets up the autoposter

acoustic lark
night ingot
#

Well, that's just a description of the class, which also isn't necessary.

#

This is what matters

acoustic lark
#

Yeah I have all of that

#

With the token and everything

night ingot
#

Then it should be fine

acoustic lark
#

Okay thanks for the help

#

I have some errors but not in my code

restive otter
#

Missing Permissions

sullen nymph
#

Oh dear

#

I wonder why

vocal robin
#

How do I know if a vote is a test vote?

#

req.vote gives this

sullen nymph
#

req.vote.type will be test

vocal robin
sullen nymph
vocal robin
sullen nymph
#

The suer

#

fuck

#

The user key/field should send ID of who pressed the Test button

acoustic lark
#

My api still not working for some reason

#

Idk why I am missing permissions tho?

vocal robin
#

or in the query?

sullen nymph
#

req.vote

sullen nymph
acoustic lark
#

Yeah I have

#

Not the discord one

#

kk

vocal robin
acoustic lark
#

I have regend my token Now, But I will but in the new one after. @shut flume

#

brb

sullen nymph
vocal robin
#

I want to change a thing in the nodesdk libary
the libary has "this.authorization === req.headers.authorization"
Although I want to allow to listen to many auth keys

#

I forked the repo

Solved:

#

but I have no Idea how to compile it for node.js since its typescript

#

I am using tsc

#

compiling it gives this error

acoustic lark
#

It is this token right?

upbeat hare
#

Hello, What is the "webhookAuth" ? It's my password ?

delicate badge
#

I'm trying to add the Top.gg AutoPoster but it won't work

night ingot
#

@jaunty plank here as well

jaunty plank
#

hek

kind obsidian
#

hii

#

so im wondering how do i use the webhook on top.gg?

#

this thing

night ingot
#

You need to set up your own webhook listener with whatever language you're using

kind obsidian
#

how about the authoration?

kind obsidian
night ingot
#

You can put something in that field so that you can make sure the webhook comes from Top.gg. It's not required to have it though

kind obsidian
#

about the webhook thing im confuzed

#

the webhook url

#

is it a channel webhook or what

night ingot
#

You don't use a discord webhook, you need to actually code your own

kind obsidian
#

ty

acoustic lark
#

Is this the token for the API

#

for the def init

sullen nymph
#

Yes

acoustic lark
#

No clue why it is telling me why i do not have permissions

night ingot
#

The forbidden error you posted before is seemingly an exception with Discord, not Top.gg

#

And it comes from the on_message event

kind obsidian
#
DBLWebhook {
  _events: [Object: null prototype] { ready: [Function], vote: [AsyncFunction] },
  _eventsCount: 2,
  _maxListeners: undefined,
  port: 5000,
  path: '/dblwebhook',
  auth: '5000',
  _server: Server {
    insecureHTTPParser: undefined,
    _events: [Object: null prototype] {
      request: [Function: bound _handleRequest],
      connection: [Function: connectionListener],
      listening: [Function]
    },
    _eventsCount: 3,
    _maxListeners: undefined,
    _connections: 0,
    _handle: TCP {
      reading: false,
      onconnection: [Function: onconnection],
      [Symbol(owner_symbol)]: [Circular]
    },
    _usingWorkers: false,
    _workers: [],
    _unref: false,
    allowHalfOpen: true,
    pauseOnConnect: false,
    httpAllowHalfOpen: false,
    timeout: 120000,
    keepAliveTimeout: 5000,
    maxHeadersCount: null,
    headersTimeout: 60000,
    _connectionKey: '6::::5000',
    [Symbol(IncomingMessage)]: [Function: IncomingMessage],
    [Symbol(ServerResponse)]: [Function: ServerResponse],
    [Symbol(kCapture)]: false,
    [Symbol(asyncId)]: 3
  },
  attached: false,
  [Symbol(kCapture)]: false
}
Webhook running at http://0.0.0.0:5000/dblwebhook```
#

is that good?

#

im using a guide from google since im dumb

restive otter
#

How is Webhook being made ?

#

I am using google translate may be the mistake

restive otter
#

how do i get the api

jaunty plank
#

you need an approved bot to get an api token

dusky monolith
#

My servers count is bugged, the bot is in 91 servers and it shows it is in 70.

night ingot
#

It only updates every 30 minutes

dusky monolith
#

It's been like that since a month or so

night ingot
#

if it doesn't update properly then there's something wrong with your code

dusky monolith
#

It's the same as it is

#

It was working before, now it isn't

rain heart
#

make sure you're posting correctly

dusky monolith
#
import dbl
import discord
from discord.ext import commands

class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token' # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes

    async def on_guild_post(self):
        print("Server count posted successfully")

def setup(bot):
    bot.add_cog(TopGG(bot))

This is my code

#

I replaced dbl_token with my token

rain heart
#

does it still say "Server count posted successfully?"

#

because this can only be the cause of bad code as posting works perfectly for me

dusky monolith
#

As I said, it was working weeks ago

rain heart
#

i mean if your logs aren't saying anything, then it is your code

dusky monolith
#
import dbl
import discord
from discord.ext import commands


class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, client):
        self.client = client
        self.token = "token"
        # Autopost will post your guild count every 30 minutes
        self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)

    async def on_guild_post(self):
        channel = self.client.get_channel(781665482033725450)

        await channel.send("Updated servers count on top.gg successfully")


def setup(client):
    client.add_cog(TopGG(client))

@rain heart I changed it to that, I believe this would be more recognizable.

rain heart
#

well are you getting the message that it was successfully posted?

dusky monolith
#

Will it wait for 30 minutes after last post or after running the bot?

rain heart
#

30 minutes after running

dusky monolith
#

Okay I will wait for 30 minutes then let you know

fading mica
#

Basicly i have a script for an html website to fetch the api url then return a json file to get and use the server count, i am getting a 401 error in the console why?

night ingot
#

401 means unauthorized, you probably have the incorrect token in the headers

fading mica
night ingot
fading mica
#

Okay, thank you for your help😄

sullen nymph
dusky monolith
sullen nymph
#

Nah my dumb ass forgot to include it

dusky monolith
sullen nymph
#

Yup

dusky monolith
#

In the self part I was like "Oh maybe they just forgot, it's okay" but in the event itself I thought it doesn't need a decorator because a whole decorator? xD

#

Anyways, hope you have a good day!

#

And thanks for the help!

sullen nymph
#

AlfaThumbsUp didn't think twice when writing that example, my apologies

vast oriole
#

Hey guys where to get the DBLbot token

#

for use dblapi.js

sullen nymph
#

Use the top-gg/sdk package

#

See last pin on how to get your bot's DBL token

cinder cape
#

re-apply

#

-apply

old kernel
#
from discord.ext import commands
import aiohttp
import dbl
import discordlists.py # imports (must be over the code) 

class discordbotlists(commands.Cog):
 def init(self, bot):
  self.bot = bot
  self.token = 'api-token' # botsfordiscord
  self.token2 = 'api-token' # discord bot list
  self.dblpy = dbl.DBLClient(self.bot, self.token2, autopost=True) ## passed in the api token of the discord bot list bot
  self.api = discordlists.Client(self.bot) ## creates an instance of a discordlists client
  self.api.set_auth("botsfordiscord.com", self.token) ## passed in the api token of the botsfordiscord bot
  self.api.start_loop() ## loops every 30 mins

def setup(bot):
    bot.add_cog(discordbotlists(bot))
#

is that sufficient for server count on top.gg?

#

please tell me help us

#

@sullen nymph

sullen nymph
#

Yes

old kernel
#

guild count in my bot

#

@sullen nymph

sullen nymph
#

It should work

old kernel
#

@sullen nymph
self.token = 'api-token' # botsfordiscord
self.token2 = 'api-token' # discord bot list
where i get

#

api token

sullen nymph
#

See last pinned message

acoustic lark
#

class TopGG(commands.Cog):

def __init__(self, bot):
    self.bot = bot
    self.token = "<my dbl token>" 
    self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) 

@commands.Cog.listener()
async def on_guild_post(self):
    print("Server count posted successfully")

def setup(bot):
bot.add_cog(TopGG(bot))

#

Should this work?

#

yeah I have posted it, just waiting

#

30 mins

steady delta
#

@acoustic lark did it work?

acoustic lark
#

no

#

ima check for errors

#

these are all the errors

#

For some reason my token refreshed Ima wait a other 30 mins

#

I put in the new one

restive otter
#

The error has nothing to do with you posting the guild count, and tbh you don't need to wait for 30 minutes, because it tries to post before sleeping for 30 minutes and keep repeating it. I'd suggest you test it by manually calling the post_guild_count method because the loop suppresses any HTTP exceptions.

acoustic lark
#

So just do post_guild_count()

restive otter
#

yesn't

sullen nymph
#
    async def _auto_post(self):
        await self._ensure_bot_user()
        while not self.bot.is_closed():
            try:
                log.debug(f'Attempting')
                await self.post_guild_count(shard_count=self.bot.shard_count if self._post_shard_count else None)
                event_name = 'autopost_success'
                log.debug(f'Dispatching {event_name} event')
                self.bot.dispatch(event_name)
            except Exception as e:
                event_name = 'autopost_error'
                self.bot.dispatch(event_name, e)
            await asyncio.sleep(1800)
#

@restive otter 👀

restive otter
#

noice, when is v1 rolling out?

vague pollen
#

can anyone help me in java

rain heart
stark lion
#

Read the Docs, u noob

#

Read the docs

stark lion
wind glade
#

is it possible to make "on vote" in node.js

willow spindle
wind glade
#

thanks

wind glade
willow spindle
#

yes

wind glade
#

alright thank you

wind glade
#

do it must be port 80?

#

so i can open any port?

wind glade
#

where i can find authorization for Topgg.Webhook()

rain heart
#

You create that yourself

restive otter
#

hi

#

1 wait pls

#

I made an Economy bot and it is uptime but how do I get it confirmed?

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.

rain heart
#

-faq 1

abstract mothBOT
restive otter
#

ok sorry

frigid gorge
#

how can I tell when someone votes for my bot on TOP.GG and the bot responds not even a text channel that TAL users voted for it?

jaunty plank
#

you can use webhooks

shut wharf
#

how do i send a message to my server when someone votes for the server

sullen nymph
#

Probably next week since I've got some college work piled up xd

shut wharf
#

the docs explains it for bots, how would you do this for a server

sullen nymph
#

See pins for data format

#

Since DSL doesn't have an API other than webhooks

worthy kraken
#

Does anyone know how to make a vote check command?

#

discord.js

#

ok

hollow owl
#

how 2 top gg webhook

fluid condor
#

With the uh, autoPoster thing
What are you meant to put in place of "client"?

#

I can't figure out if you just leave it as client

sharp totem
#

Hey I am new to webhooks
I want to do a command in my bot which shows them if they have voted in top.gg
So how do I create a webhook which interacts with top.gg
I saw the place to input the webhook URL and auth code in top.gg

#

I am using python coding language

abstract nacelle
#

dblapi.js was deprecated. Am i able to still use it or not?

sullen nymph
#

Preferred that you use top-gg/sdk in case a breaking change happens

crystal quest
#

-help

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.

rain heart
gusty hamlet
#

Does someone know, how to make a "voting reward" thing in JS?

#

All the videos are deprecated

rain heart
#

https://docs.top.gg is the best you could get, or wait for someone who may know in your programming language

Top.gg documentation

Welcome to Top.gg

ember swan
#

hi, i was coding something to send a message when someone vote for my bot and i was wondering how can i "try" my code

restive otter
#

why the website url doesn't disappear after i refresh when i remove it

sullen nymph
#

@ember swan test button in webhooks section

ember swan
#

thanks you !

#

also, if i dont have a website to post the Webhook what can i put in the "Webhook URL" section ?

willow spindle
#

it is url for your webserver

#

so it is probably http://serverip:port/dblwebhook

ember swan
#

ok thanks

#

can i use the ip of my bot's host ? @willow spindle

rapid kettle
#

yes

willow spindle
#

yes thats what im talking about

ember swan
#

so i do something like this ?

restive otter
#

it should be only /dblwebhook

ember swan
#

ok thanks

golden adder
willow spindle
#

you can do whatever you want

restive otter
#

o

willow spindle
#

mine is /topgg-bot

restive otter
#

i mean

#

they putted their domain etc

#

in there

willow spindle
#

/dblwebhook is for example

ember swan
#

and is this correct ?

restive otter
#

or the ip for their webhook

restive otter
ember swan
#

ok thanks

#

so if i try now it should work

whole iron
#

How can I get DBL api?

restive otter
#

save it first

#

then press test

restive otter
ember swan
whole iron
ember swan
#

after i should have an id in my console ?

restive otter
#

yes

ember swan
#

why have i nothing x)

restive otter
#

maybe the port isnt forwarded?

ember swan
#

forwarded ? (sorry im french) x)

whole iron
#

What do I have to do after going to My Bot's webhook section for DBL api?

#

@willow spindle

rain heart
#

Read it

whole iron
restive otter
#

-api

#

@proud cloud odin abi

restive otter
proud cloud
restive otter
#

sorunu çözdm

rain heart
#

-notr

abstract mothBOT
#

İngilizceden başka dillerde sohbet etmek için #general-int kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.

fast hornet
#

Hey does anyone know how to setup the how many servers your bot is in?

#

pretty confused.

mortal ore
#

I tried testing the webhook but i didnt receive a POST req, i tried 5 times in the past 30 mins and havent received anything. Can someone please help

#

nvm it worked now

#

idk how there was such a long delay

fast hornet
#

thanks tommyinit

jade birch
#

how to show server count

restive otter
#

show server count glitch ?

tropic idol
rain heart
#

-servercount

abstract mothBOT
rain heart
#

you need to continuously post yourself

tropic idol
#

where can i get dbl api key for my bot ;-;

sullen nymph
#

see last pin

tropic idol
#

okay, ty

jade birch
#

i still not know how to show server count

willow spindle
jade birch
#

iam bad at english

#

iam from egypt

hazy iris
#

Hi, good afternoon, I'm testing the webhooks but I don't receive any post request... I have been trying some hours, but I hasn't received anything; Can someone help me?

rain heart
#

have you pressed save before using the test button?

#

make sure it isn't a discord webhook, as we don't support them

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.

restive cloak
#

wtf was that

wet coral
#

where do i do cmds

rain heart
wet coral
#

-starboard

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.

restive cloak
rain heart
#

change channels though, thanks

fluid condor
#

I'm sort of having trouble getting my bot to say how many top.gg votes it has

fierce storm
#

-api

rain heart
silent berry
#

so i was looking at the documenttation and for the on_dbl_vote event, do i get user information. such as who voted? or do i only recieve vote counts

restive otter
#

-help

sick canyon
#

hey, could i get some help setting up a webhook 🙂 my 2nd bot just got verified\

#

┬─┬ ノ( ゜-゜ノ)

next pendant
#

I'm still having issues with the webhooks being sent multiple times. Here are the logs showing I am responding with 200

 - - [02/Apr/2021:19:48:04 +0000] "POST /api/votes/topgg HTTP/1.1" 200 24 "-" "Top.gg Webhook/1.0.0"
 - - [02/Apr/2021:19:48:04 +0000] "POST /api/votes/topgg HTTP/1.1" 200 24 "-" "Top.gg Webhook/1.0.0"
 - - [02/Apr/2021:19:48:06 +0000] "POST /api/votes/topgg HTTP/1.1" 200 24 "-" "Top.gg Webhook/1.0.0"
#

thing is, I been using the same code for the webhooks for the past year

#

and it just started doing it once they changed it

#

like 2 weeks ago

#

and it never did it once before up until after the 18th

upper valley
#

hi webhook what should i write to url

restive otter
#

Bruh are you kidding me I had to do http bruhhhhhhhhh

upper valley
#

ı do not understand

tiny pike
#

how i post shard count to topgg?

tardy dirge
#

Hello, does anyone know how to use POST REQUEST to make a vote checker on the site? I wanted to give prizes to those who vote for my bot here but I don't know how to do that.

restive otter
#

how do i setup webhook??

tardy dirge
#

javascript

restive otter
#

i have tried to use the manual posting code for python for the server count and i have done it right but it has not worked can anyone help

#

i have used this exact code and i have put my token in and even tried re generating multiple times and have also waited over an hour just to make sure

#

there is no error

#

and the code is above lmfao

#

it dosent work

#

there is no error or i would be able to fix

#

its the exact code from the docs...

#

wtf isnt it working

#

i have loaded the cog

#

everything is fine

#

lmfao

#

i know

night ingot
#

And you're sure the token matches? There's an issue where sometimes it won't save if you regen your token

restive otter
#

i have waited hours

restive otter
#

i have tried waited an hour

#

regened the token

#

put the new one in

#

waited another hour

#

it dosent work

#

...

#

its not my first day coding i know what i am doing and this shouldnt be happining

night ingot
#

I'm fairly certain the on_guild_post needs an event listener decorator, it's just not in the docs. But that shouldn't affect whether it actually posts it or not

restive otter
#

does it need a decorator?

#

i dont think it does

#

acctually it does

#

but thats just to print it

#

it wont effect if its posting

night ingot
#

I know someone else had a problem where their new, regenerated token didn't work, despite it showing the new one on their page

restive otter
#

...

#

i have tried it multiple times

#

re generating

#

ok

#

can you send some example code

#

damn

#

its so easy

#

i know js

#

no

#

js and py are so easy

#

...

night ingot
#

indentation

restive otter
#

yeah

#

bru

#

spaxter can you send me some example code

#

for calling the api to check

night ingot
#

I'll see if I can find something

restive otter
#

ok

#

bc i dont know how to do it with topgg

#

everyone i know has problems with this api

#

¯_(ツ)_/¯

#

yes

#

but this api is weird

#

atleast in py it is

#

its not in js

#

but its still buggy in js

#

LOL

#

you havent had problems with it

#

your lucky lol

#

everyone i know has problems with it

#

js and py coders

#

¯_(ツ)_/¯

#

i mean i get it but its buggy

#

it just needs some work

#

¯_(ツ)_/¯

#

ye

#

thats wut i said lel

#

hopefully he comes back with something good to call the api and test the key

#

...

#

no.

#

this api is just confusing in py

#

ask anyone that codes in py

#

i do

#

the code is perfect

#

ive never had problems with any code from the official docs of anything LOL

#

¯_(ツ)_/¯

#

yes

#

ik i dont know how to with this async wrapper

#

and the docs dont explain

#

¯_(ツ)_/¯

#

no.

#

let me look again

#

-api

#

i have

#

but it shouldnt be this hard

#

ik

#

the library on GitHub

#

yup

#

where did spax go lol

night ingot
# restive otter where did spax go lol

Sorry that it took so long, you can try it with this

import requests

url = 'https://top.gg/api//bots/your-bot-id/votes'

auth = {"Authorization": 'your-token-here'}

response = requests.get(url=url, headers=auth)

print(response.status_code)
#

of course replacing your-bot-id with your ID, but I'm assuming you already know that Wink

restive otter
#

thx

#

ima try

#

so for the auth i put the token right

#

yeah @night ingot

night ingot
#

Yeah

restive otter
#

oh

#

it says your token here

#

ima dumbass

night ingot
#

All good

#

If it returns 401, the token is incorrect

restive otter
#

it says 200

night ingot
#

Well, then you know the token is correct at least

#

but I have no idea why it wouldn't post

#

Yeah, 200 means OK

#

Which in this case, is a little troubling

restive otter
#

ye

#

what should the decorator be

#

for the on guild post

night ingot
#

should just be @commands.Cog.listener

restive otter
#

lemme see if it posts but topgg

restive otter
#

ima do that and give it 30 more mins

#

and see if it prints

night ingot
#

Yeah, if anything it might print an error if it fails

restive otter
#

@night ingot

night ingot
#

sorry, @commands.Cog.listener()*

restive otter
#

oh shit

#

yeah

#

LOL

#

@night ingot

night ingot
#

Are you passing any arguments to the event?

#

uhhh

restive otter
#

lel

night ingot
#

@sullen nymph sorry for the ping but I'm at a loss

restive otter
#

🐸

#

@sullen nymph if you awnser can you ping me

hollow flax
#

Hello i use the python DBL API for the a VOTE Check on my bot site on TOP.GG...

I use the command : get_user_vote(user_id: int) to check the vote...
But if i test it, then i gives me every time FALSE back....and i voted. So...it is buggy ?

#

AFTER 5 MINUTES ???
I think it is realtime, when voted ?hmm... :/ okay...thx for the tip.

hollow flax
#

Sure ? The 5 Minutes are over.. 😂 And its False... 😦

#

absolutly not. My Code is running fine.
And it works without any errors or something. The only thing is the vote status.

The Top.GG page also does not load the values correctly.

I had 4 votes...of which I have voted 2 times with 2 accounts,...so I should then have 6 votes.
But suddenly have 8 VOTES at my bot although I have no Voter users....this is extremely strange the Internet page...

If I then reload the page, I have again 4 votes without my 2 new votes. I come on it just not clear...

#

i use this...
hook = dbl.DBLClient(token=token, bot=bot, webhook_path=path)

and ctrl+f5 dont work...

#

is use it... 😄 and it works. 😄 😄 😄
But the VOTES are not processed...

#

uh....wait a second i take a look. 😉

#

im on it... 😄

sullen nymph
#

@restive otter you forgot the self parameter

restive otter
#

where @sullen nymph

sullen nymph
#

In your on_guild_post event

hollow flax
#

okay,...i give up for today. 😄
i use the same codes in 2 scripts....and one of them works, but not the other...strange strange strange...its late today. but thx for help, im sure that i will get it tomorrow.^^

restive otter
sullen nymph
#

egh

#

on_guild_post(self)

restive otter
#

lol ok

#

it worked finnaly

#

thanks

hollow flax
#

YES I HAVE IT ! 😄
The problem was, that i use 2 bots in one script....for testing and so on...
And in the test mode i use a OTHER Token...so the bot dont see whats going on on top.gg because the bot istn on the website.^^
Now all its running,... :>

thick bobcat
#

Hey, what does this error means?
object Lock can't be used in 'await' expression

sullen nymph
#

Yada yada an error that will be fixed in v1.0

thick bobcat
#

Oh, I need to downgrade to python 3.8, right?

sullen nymph
#

Yeah, unfortunately

thick bobcat
#

Is there some kind of system to avoid users taking advantage of this?

#

Like, Instead of guild count my bot just posts "5000"

scarlet cobalt
#

One message removed from a suspended account.

thick bobcat
#

Like, when I post the server count

#

Instead of client.dblpy.guild_count

#

I just do "1000"

sullen nymph
#

No real system other than... well, user reports

analog mason
thick bobcat
#

damn

crisp stream
#

how do I use the api

restive otter
calm agate
#

how do we fetch server

sullen nymph
#

Fetch which server?

calm agate
#

right

#

to display the server

#

what do we do?

sullen nymph
#

What library do you use?

calm agate
sullen nymph
#

Feel free to use the @top-gg/sdk package

calm agate
calm agate
#

?

sullen nymph
#

what

calm agate
#

cani fetch it again using top.gg api?

#

like can we get the server count of the bot from the top.gg api after we pushed it from @top-gg/sdk package

sullen nymph
#

Yes, but why

calm agate
#

its still

#

N/A

restive otter
calm agate
restive otter
#

Yes

calm agate
#

okay 20more mins

crisp stream
#

how do I make it when somebody votes it sends to the webhook

calm agate
#

@restive otter

#

why 5 servers when i have 330?

#
const Topgg = require("@top-gg/sdk");
const api = new Topgg.Api(config.toptoken);
setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
  });
}, 1800000);```
shy vortex
#

lol