#topgg-api

1 messages Β· Page 183 of 1

rain heart
#

express is a webserver

restive otter
#

I see

#

what is the webhook auth?

restive otter
#

I want to send message if he/she voted

tidal idol
calm agate
#

@hearty lintel Hi, sorry for the ping but can you please review the pr?

thorn umbra
#

hello, I'm using the topggpy API for discord.py and this is my code: ```py
class Events(Cog):
"""Events cog"""
def init(self, bot):
self.bot = bot
bot.loop.create_task(self.update_stats())

@tasks.loop(minutes=30)
async def update_stats(self):
    try:
        await self.bot.wait_until_ready()
        self.topggpy = topgg.DBLClient(self, os.getenv("DBL_TOKEN"), autopost=True)
        await self.topggpy.post_guild_count()
        print(f"Posted server count: {self.topggpy.guild_count}")

    except Exception as e:
        print(f"Failed to post server count\n{e.__class__.__name__}: {e}")
neat scroll
#

are there topgg things i can embed on my website

#

like rating or vote etc

rain heart
#

Top.gg provides widgets under the widgets section on your bot page

valid tiger
#

why it is showing cannot GET / while using test webhook?

valid tiger
#

<@&817055174613794826>

plucky lance
#

Where does it show this result?
On the website or …?

fluid venture
#

topgg api wrapper in brainfuck when πŸ‘‰πŸ‘ˆ

scarlet cobalt
fair totem
#

topggpy thingy not working properly with dpy 2.0? mr_kyahua

#

AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook

#

AttributeError: 'ClientSession' object has no attribute '_connector'

#

oh wait

#

its a dpy thingy dwv_pepe_wot sorry my bad

#

No its a topggpy thing OwO

fluid venture
sullen nymph
quartz parrot
#
 fetch('https://top.gg/api/bots/:bot-id/stats', {
  method: 'post',
  headers: {  
        "Authorization":``
    },
  body: { 
      server_count: results[0] 
    }
```  where am i wrong i am getting this error```
status: 401,
statusText: 'Unauthorized',
smoky marten
#

You left it blank

fair totem
sullen nymph
#

Technically?

#

You can also just use aiohttp yourself to send requests

blissful storm
#

Can someone help me ?

#

I put my bot on Topgg 3 weeks ago and I don't know how it works, is it already on the waiting list?

jaunty plank
blissful storm
#

What I have to do?

jaunty plank
#

Your bot needs to be online to be approved on topgg, submit your bot again and make sure it stays online for review.

blissful storm
#

ok

high sierra
#

So I'm using the /api/bots to search the bots, like: api/bots?search=<botname> but the api is totally ignoring the search query string in my requests. That is not the case with the limit query param for example, which is respected and I actually get back the limit I set.

#

I also tried doing api/bots?search=name: <botname> but to no avail either. @ if helping.

rain heart
#

aka bots?search=Luca

high sierra
#

hydra bot is returned as the first

#

basically it everytime returns a predefined set of results

#

which I assume is default or the promoted bots idk

#

this same exact result appears when querying without a query param, hence is why it made me think that the search param is completely ignored?

sullen nymph
#

Cue to search endpoint being broken for years by now

high sierra
#

COOOOOL

#

and like... nobody is gonna fix it or...?

#

because I don't think any other discord list has this many bots

#

if they even have a search endpoint

sullen nymph
high sierra
#

bruuuuuuuh

#

Idc I'm scraping that website

tidal idol
high sierra
#

yeah

#

or anytihng else

tidal idol
high sierra
#

idk ill hit up the api 50000 times and store the data in a local file kekw

#

just literally copy the entire database

tidal idol
#

I mean

high sierra
#

(im jk with that)

tidal idol
#

Cloudflare WILL ratelimit you

#

and chances are you're going to get yourself banned

high sierra
#

expected that

#

so thats why im jk

#

but if you dont wanna have ratelimit problems why not make a working fckn api cryingman

tidal idol
#

As Skydust said, its been broken for years

high sierra
#

well ikr

#

now, anyway

tidal idol
#

But then to be fair, it isn't really a needed feature, as it will just lead to other bot lists scraping Top.gg

high sierra
#

bruh then why even have any search features

#

on any websites

#

why have youtube search api fi you could scrape the entire youtube?

#

(what im saying is this logic is stupid)

tidal idol
#

Websites aren't designed to be scraped, as that usually leads to malicious use of the data scraped

high sierra
#

man i just wanna make a search bots command cryingman

#

is that too much to ask for

tidal idol
#

If the endpoint is ever fixed, then it will be possible

high sierra
#

it will not

tidal idol
#

but unfortunately its not possible at the moment

high sierra
#

if it hasn't been

#

for the past

#

whatever you said

#

it will not be now

#

I can assure you

tidal idol
#

I'd advise you don't add a search bot command then, because there is no legitimate method to do so at the moment

high sierra
#

but I don't have a choice

tidal idol
#

You do, just don't add the command?

high sierra
#

I have, what you could call a client, that wants me to make it

#

.....

tidal idol
#

The API doesn't have a working endpoint for searching, so you won't be able to add a command for searching

high sierra
#

ok

#

in my eyes this conversation leads to a single conclusion: fuck topgg

#

bye

blissful storm
#

I'm sad, I'll have to wait another 2 weeks because I didn't buy the business of leaving the bot online 😒

rain heart
#

-api

abstract mothBOT
#

topgg This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/

If you need help with other development, please use #development.

blissful storm
#

sorry

blissful storm
#

how do i know if my bot went to topgg? Will there be notification or something?

#

???

rain heart
#

-api

abstract mothBOT
#

topgg This channel is for suggestions, help, and bugs related to our official API libraries and documentation found at https://docs.top.gg/

If you need help with other development, please use #development.

rain heart
#

as mentioned

blissful storm
#

ok ok

silent plover
#
const Topgg = require("@top-gg/sdk")
const express = require("express")

const app = express()

const webhook = new Topgg.Webhook("token")

app.post("/dblwebhook", webhook.listener((vote) => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted
  const voteEmbed = new MessageEmbed()
  .setTitle("Thank you for Voting!")
  .setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
  .setColor("AQUA")
  vote.user.send({ embeds: [voteEmbed] })
  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(3000)
``` why won't this work?
tidal idol
#

ANy errors?

silent plover
#

nothing

#

does nothing

tidal idol
#

are you definately sending a request

#

also, how are you hosting this?

silent plover
#

hosting ? how is that related?

tidal idol
#

because the webhook needs to be accessible

#

/dblwebhook

#

its either an IP address, an IP address with a port, or a domain name

jaunty plank
#

A webhook is like a website, it's accessed through the web.
In the code above you're the one hosting it, so topgg needs the url(to your host) to access the webhook.

silent plover
jaunty plank
#

"/dblwebhook" is fine in code.
but when you add the url to your bot/server page on topgg it needs to be a url.
http://YourServerPublicIp:3000/dblwebhook is typically the format

quartz parrot
tidal idol
quartz parrot
#

oh thanks

#

so i replaced the token and now i am getting this

Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://top.gg/api/bots/:886801342239211522/stats',
    status: 403,
    statusText: 'Forbidden',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}```
smoky marten
#

Edit /bots/:886801342239211522/stats
To /bots/886801342239211522/stats

quartz parrot
#

ohh ok

jaunty plank
quartz parrot
quartz parrot
#

yes

blissful storm
#

people if my bot is approved, do they mention me in #mod-logs , or do they only mention if it is disapproved?

#

Is it in this chat that I ask things?

abstract mothBOT
#

@blissful storm

topgg Bot Review Notifications

If your bot is approved:
You'll get a DM from @abstract moth, a ping in #logs and you'll be assigned the <@&265125253443878912> role here.

If your bot is declined:
You'll get a DM from @abstract moth and you'll also get a ping in #mod-logs.

πŸ’‘ Please make sure you have your DMs activated for this server.

sweet folio
#

how do i get bot's token

#

yes

tidal idol
sweet folio
#

oh i got it

sweet folio
#

it wasn't showing

sweet folio
#

why is this error coming?

rain heart
#

The data you're sending not matching the format on the docs

sweet folio
# rain heart The data you're sending not matching the format on the docs

I just downloaded the package and pasted this

const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("top.gg");
const dbl = new DBL('Your top.gg token', client);
 
// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})
 
dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
smoky marten
sweet folio
#

I thought it was official API

near dove
#

/views

smoky marten
knotty garnet
#

you need to supply a token

#

Authentication header

restive otter
knotty garnet
restive otter
#
const top = new Top.api("token")```
knotty garnet
#

or are u passing you bot's token?

restive otter
#

Yes

knotty garnet
#

yes to which question?

restive otter
knotty garnet
#

ok...which website?

limpid magnet
#

There was 2 possible answers to the question there and you still managed to answer ambiguously… lol

restive otter
dim kettle
#

Make sure to refresh the tab after generating the token

restive otter
#
if (command.vote) {
const topgg = new Topgg.Api("")
let voters = await topgg.hasVoted(message.author.id);
if (!voters) return message.reply("you need to vote")
  }
}```
limpid magnet
#

I don’t think you need to create a new topgg api wrapper client every time a certain command is run just so you know, probably better to just create it once and attach it to your discord client

limpid magnet
#

What?

#

It should be the opposite

#

Should be faster than creating an entire new rest client each time you run a command

limpid magnet
#

yes

restive otter
#

Hmm

restive otter
limpid magnet
#

"not working" does not provide any context clues for me to help you, I don't know what you want me to do πŸ€·β€β™‚οΈ

dim kettle
#

Could you show us the code you have now?

limpid magnet
#

seems to me like you changed literally nothing and are expecting it to magically work :p

#

You're probably not passing the right token

restive otter
limpid magnet
#

I'm not trying to being rude, I'm trying to point out that doing the same thing isn't going to change anything

#

And that you need to try to debug the issue or give us more context

dim kettle
sweet folio
#

I just want my bot to update server count on top.gg which npm package should I use?

#

topgg-autoposter or top-gg/sdk

dim kettle
# sweet folio topgg-autoposter or top-gg/sdk

You could use both, top-gg/sdk allows you to access most of the APIs listed in the docs, and allows you to manually post stats
topgg-autoposter runs on top of the sdk and posts stats for you every 30min so you don't need your own scheduler

sweet folio
dim kettle
#

Yeah, it is what many people use. Makes it a bit simpler to integrate and keep stats up to date

dawn mason
#

is it just me or does the top.gg api for java just not work

#

i double checked that the bot id and token are the correct ones

#

it never sets server count

#

and this always returns false even though im 100% sure i voted

#

pls help

jaunty plank
dawn mason
#

no errors at all..

#

wdym response header?

jaunty plank
#

status header*
like, are you getting a 200 ok/204 response?

dawn mason
#

i dont think it says

#

how do i figure out

jaunty plank
#

hmm, it seems the java library doesn't give access to that info. or if it does I dont know java so I cant find it in the source code.

dawn mason
#

yes

rain heart
# dawn mason

"whenComplete" does not throw errors, so it basically never gets executed if it errors

CompletionStage has another method of catching the exception

dawn mason
#

exceptionally()?

jaunty plank
dawn mason
#

i updated it to throw any exceptions but i still dont get any exceptions

rain heart
#

I hate java, used to code in, used to work with the api

dawn mason
#

so i think that means that the url isnt bad its smth else

rain heart
# dawn mason

That won't error either, what happens when you use exceptionally on the getvote one

#

Aka the one you use to check votes on

#

Also, what version are you using? The latest release or what exactly

#

Because refer to this

dawn mason
#

im using v2.0.1

rain heart
#

first of all, that's outdated nonetheless, the current release is 2.1.1, second, try to use the troubleshooting step linked on the message I replied

dawn mason
#

apparently it doesnt work

rain heart
#

Use jitpack if you haven't yet, also refresh your maven afterwards

dawn mason
#

i have

rain heart
#

Remove the :jar:

#

Refer to the exact commit id on the pinned message

dawn mason
#

hmm, it says that v2.1.1 doesnt exist eitehr

rain heart
#

Likely because of 2.1.1 not being fetched by jitpack, one sec

dawn mason
#

i deleted the old jar

#

and i refreshed maven

#

and i still get the same error

#

its the same commit and everything

rain heart
#

What error are you getting

dawn mason
#

Unresolved dependency: 'com.github.top-gg:java-sdk:jar:19abf19'

rain heart
#

Show the section where you're adding that as a dependency

#

Where is the :jar: coming from

dawn mason
#

this thing you mean?

dawn mason
rain heart
#

Has :jar:

#

No clue where that's coming from 02Shrug

dawn mason
#

oh wth

#

i didnt even see that

rain heart
#

what happens when you make a clean install

#

mvn clean

#

And then try it again

dawn mason
#

nope

#

still nothing

rain heart
#

Turns out the :jar: is correct so nvm

dawn mason
#

uhm

#

i think i fixed it

#

it was the :jar:

#

not really

#

it synced without errors this time

#

but nothing from the api exists

#

i think cuz i removed the :jar:

#

this synced but the jar never downloaded i think

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

silent plover
smoky marten
silent plover
smoky marten
#

yes it would

silent plover
#

but it doesn't for me..

smoky marten
#

working for me rn

silent plover
#

let me show code

smoky marten
#

Then the problem is somewhere else,
Not here

#

Did you set it up correctly ?

#

Used the same auth token ?

#

Is your firewall disabled ?

silent plover
#

hm?

silent plover
silent plover
smoky marten
#

Like this

silent plover
#

but where do I need to use the auth?

smoky marten
#

Show full code

#

nvm

#

In your code you have something like this

#
const webhook = new Topgg.Webhook('topggauth123')
fluid venture
smoky marten
jaunty steppe
#

Are there any docs for v1?

jaunty plank
#

v1 isnt released

jaunty steppe
runic ginkgo
#

Hey Guys currently I tested my vote webhook and voted for my bot but the api from me dont get the vote? I tested the webhook per panel and it sended the vote but a real vote dont get sended?

#

Have someone a idea?

rain heart
#

More input: post your code etc, censoring your token

  • add your steps
  • what have you tried
    etc
#

There's also a pinned message describing how to properly post issues for others to understand

runic ginkgo
#

But The test button works why should I post my code? xd

#

I think the page didnt load

#

= it didnt saved

half cargo
#

Hi, i m trying to use top gg python module. do i need to change something here? bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password") cuz rn it doesnt work

jaunty plank
#

did you change "password" to an authorization

#

(the authorization that you filled in on the site)

sullen nymph
#

doesn't work
No errors

silent plover
smoky marten
#

ping: 80580000 ms

quartz parrot
#
[Symbol(Response internals)]: {
    url: 'https://top.gg/api/bots/886801342239211522/stats',
    status: 400,
    statusText: 'Bad Request',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
```  i am getting this error while trying to post stats... whats wrong?
silent plover
smoky marten
#

Like
Is the request even reaching you?

#

or being blocked by the firewall

#

Use a tool like postman (web) to check

#

or send a request with another device

jaunty plank
#

A few questions that I don't think have been answered.

what's your actual host? some hosts limit what ports you can use.
are you performing these tests on your host, or on a pc at home(youll need to change things around to make it function at home)

Another option to check if you're being blocked by a firewall is add a get request to your code.

app.get("/dblwebhook", (req, res) => {
    console.log("test worked")
    res.send("Test worked!")
})

Then paste the url you're using here in your browser https://i.imgur.com/D0mJuxr.png
If it says "Test worked!" in your browser then you're url is working
^ this only helps if you're testing on your host, and not at home.

quartz parrot
# smoky marten request body is invalid
fetch('https://top.gg/api/bots/886801342239211522/stats', {
  method: 'post',
  headers: { 
      "Authorization": ``,  
    },
  body: { 
      "server_count": results[0] 
    }
})```what am i doing wrong? results[0] is an array of guilds
rain heart
#

You post your servercount, not your guilds

#

Depending on what these guilds are, you could literally do results.length

#

Or smth, just use the size of said array

quartz parrot
rain heart
#

Check for errors

plucky lance
fluid venture
dim kettle
fluid venture
#

no i mean

#

intentionally

#

like

dim kettle
#

If we notice abuse we may do corrective action against the bot owner

fluid venture
#

bot is in 60 servers but someone posted 400k

#

or something

#

o

#

i see

restive otter
#

Excuse me.

#

How can i make my own vote tracker

#

I don't need any spoonfeed but can anyone give any example?

dim kettle
restive otter
#

Ok :)

#

I'll read em

dim kettle
restive otter
#
const Topgg = require("@top-gg/sdk")
 const express = require("express") const app = express() 
const webhook = new Topgg.Webhook("your webhook auth")
 app.post("/dblwebhook", webhook.listener(vote => { 
// vote will be your vote object, e.g console.log(vote.user) 
// 395526710101278721 < user who voted\ 
// You can also throw an error to the listener callback in order to resend the webhook after a few seconds })) app.listen(80)
#

Can I use channel.send()
At the place of console.log?

dim kettle
#

Depends if your Discord client is accessible in there

restive otter
#

It is

dim kettle
#

Yeah, then you should be able to send a message πŸ™‚

silent plover
#

console.log doesn't work either

tidal idol
#

What host do you use?

silent plover
tidal idol
#

What hosting company?

#

Or do you self host pterodactyl

silent plover
tidal idol
#

Yes

silent plover
#

ok

#

I use creavite hosting

#

what to do now?

silent plover
#

you just disappeared

jaunty plank
tidal idol
silent plover
#

wait pinged wron person

silent plover
silent plover
jaunty plank
#

Can you show your current code?

silent plover
# jaunty plank Can you show your current code?
const Topgg = require("@top-gg/sdk")
const express = require("express")

const app = express()

const webhook = new Topgg.Webhook("the same auth which I use at top.gg bot webhooks")

app.post("/dblwebhook", webhook.listener((vote) => {
    res.send("Vote rewards working")
    console.log("Vote rewards working (logged)")
  // vote will be your vote object, e.g
 // rewards process
  const voteEmbed = new MessageEmbed()
  .setTitle("Thank you for Voting!")
  .setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
  .setColor("AQUA")
  vote.user.send({ embeds: [voteEmbed] })
  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(3000)
jaunty plank
#
const Topgg = require("@top-gg/sdk")
const express = require("express")

const app = express()

const webhook = new Topgg.Webhook("the same auth which I use at top.gg bot webhooks")

app.post("/dblwebhook", webhook.listener((vote) => {
    res.send("Vote rewards working")
    console.log("Vote rewards working (logged)")
  // vote will be your vote object, e.g
 // rewards process
  const voteEmbed = new MessageEmbed()
  .setTitle("Thank you for Voting!")
  .setDescription("You just got your **`2 Banknotes and 20k Coins`** for voting on top.gg!")
  .setColor("AQUA")
  vote.user.send({ embeds: [voteEmbed] })
  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.get("/dblwebhook", (req, res) => {
    console.log("test worked")
    res.send("Test worked!")
})

app.listen(3000)
tidal idol
#

@dim kettle

#

reporting link to Fishfish now

dim kettle
#

-b 744793808432005130 scam links

abstract mothBOT
#

upvote diyyo#2443 was successfully banned.

dim kettle
#

-ub 744793808432005130 compromised account

abstract mothBOT
#

upvote diyyo#2443 was successfully unban

blissful storm
#

I'm new at this

jaunty plank
#

Or what programming language are you using?

blissful storm
#

From my bot?

#

I don't want from my bot, but from my server.

smoky marten
#

What language do you code in ?

blissful storm
#

For example, a person voted for my server, then the bot mentions the person and says "Nice

@user voted on our server, and won 20k bananas. Come back again in 12 hours"

blissful storm
jaunty plank
blissful storm
#

In Python message bot

jaunty plank
#

You'll need to program that functionality.

It doesn't need to use your bot.

#

But you'll need to program another bot, or forward the webhook.

blissful storm
#

ok, the only problem is that i'm brazilian i'm using a translator to talk to you guys but ok i'll go look thanks

smoky marten
smoky marten
blissful storm
#

now it's gone

dawn mason
#

when top.gg java wrapper gon get fix?

jaunty plank
tidal idol
#

(Also see pins)

plain panther
#

Which api to use for vote logger is it top.gg sdk or dblapi.js

smoky marten
plain panther
#

So what is dblapi.js?

smoky marten
plain panther
#

Hmm...ic thanks :)

smoky marten
smoky marten
silent plover
#

hmm

#

ok

#

wait

silent plover
smoky marten
#

yes you should

silent plover
#

hmm

smoky marten
silent plover
#

but with the current code how?

silent plover
#

not from home

#

creavite company

smoky marten
#

Game management what ?

silent plover
#

its just a server

#

with multi language

#

you can do whatever you want in it

#

host anything

tidal idol
#

Yes it works with discord bots

silent plover
#

yes

tidal idol
#

Chances are, the port you’ve been allocated hasn’t been opened via the firewall

#

You’ll need to ask the company you host with for help with that

tidal idol
#

What did they say

silent plover
#

he sent this

silent plover
tidal idol
#

They get an allocated account with an ip and port

smoky marten
tidal idol
#

A containerised environment

#

Oh that’s not something they can control

smoky marten
#

...........

silent plover
#

so in the current code of mine how can I create the http server?

smoky marten
#

I have no clue
Never used any containers except docker and kube

silent plover
#

oh

fluid venture
#

πŸ’€

jaunty plank
#

Express is an http server

jaunty plank
# silent plover

Sounds like creative does have restricted ports though, as they assigned it a port.
You'll need to find whatever port that is

restive otter
#
Ignoring exception in on_ready
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/bot.py", line 41, in on_ready
    await client.topgg_webhook.run(1222)
  File "/home/container/.local/lib/python3.8/site-packages/topgg/webhook.py", line 145, in _run
    await self._webserver.start()
  File "/home/container/.local/lib/python3.8/site-packages/aiohttp/web_runner.py", line 121, in start
    self._server = await loop.create_server(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
    raise OSError(err.errno, 'error while attempting '
OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 1222): address already in use```

Dows anyone knows what this error means?
#

how i understand it:
top.gg already uses the ports
but he wants to prove it again now
which is not possible because he already occupies it himself

scarlet cobalt
#

One message removed from a suspended account.

restive otter
#

can i use any port i want? i'm hosting on a pterodactyl panel

restive otter
plain panther
#

How do I get link for vote after setting code in replit?

#

Like it is showing normal one

#

Without /dblwebhook

#

What should I do?

#

Nvm got it

scarlet cobalt
blissful storm
#

people my server is on Topgg has 10 votes and when I search the server does not appear, only evaluation by link directly in devotee
Why are you like this ?

worn charm
#

is there any docs to make server vote logs?

#

um-

smoky marten
worn charm
#

oh cool

#

am trying to make it in our server custom bot

smoky marten
worn charm
smoky marten
#

Check the webhook section

worn charm
#

okie thanks thanks, all other people we ignoring me OhMy

worn charm
smoky marten
#

Yes

loud solstice
#

Hello

#

i have question

#

any admin

tidal idol
solar marten
#

Is there an event for when someone votes for my bot

dim kettle
solar marten
#

Since I havent used express with djs ever, could you also maybe share a resource wherein i can implement this in a way that its into my bot code

#

like bot and express both running in the same environment

dim kettle
#

The only example I have is that last link. Maybe someone else may have an example

solar marten
#

alright thanks, ill implement the check till then!

#

[Not sure where to ask, please direct] Is there a link which will "scroll down to the review box" for my bot

smoky marten
solar marten
#

I tried that, it was showing field 26 for me

#

realised its unreliable

dawn mason
jaunty plank
#

neither do we, these are the the current issues we have with that library(most of them should be closed as they are all either old issues, or answered, or incomplete).
https://github.com/top-gg/java-sdk/issues

Right now a handful of other devs are using the library without issue, if you're having an issue and the pin in this channel didn't fix it its likely a new issue no one else has encountered.

GitHub

An API wrapper for https://discordbots.org/api/docs that works in Java - Issues Β· top-gg/java-sdk

dawn mason
#

i cant sync in the other dependency thats in the pins

#

and yea, im using the exact correcy repository

#

i think imma just manually download the jar at that commit if thats even possible

dawn mason
#

uhm pin this if you will:

#
<dependency>
    <groupId>org.discordbots</groupId>
    <artifactId>DBL-Java-Library</artifactId>
    <version>19abf19</version>
</dependency>
#

the other dependency doesnt work for maven atleast

jaunty plank
#

oh, com.github.top-gg:java-sdk:19abf19 is for gradle I thought, I'm guessing that's what you put in?

#

@scarlet cobalt can you update the pin to include both options for gradle and maven?

gradle: com.github.top-gg:java-sdk:19abf19
maven: 19abf19

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.

jaunty plank
#

thank you ❀️

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

dawn mason
#

cool thx

#

oop

dawn mason
scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dawn mason
#

Β―_(ツ)_/Β―

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.

dawn mason
#

i saw that, i dont get why it still doesnt work on my end

#

oh and also

#

is hasVoted() deprecated now?

scarlet cobalt
#

One message removed from a suspended account.

dawn mason
#

or is it only getVoters()

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.

dawn mason
#

hmm lemme try debugging

scarlet cobalt
#

One message removed from a suspended account.

dawn mason
#

cuz ive done this right

#

but it always returns false

#

voted is always null

#

HUHUHUHHHHH

#

how

#

why

jaunty plank
dawn mason
#

nope

#

for some reason

#

you have to use the commit hash

#

and then pin only mentions the gradle dependency to use

#

i sent the maven dependency to use

#

is there no good way to check if somebody voted fast instead of having to do it with threads and completion stages?

jaunty plank
#

I'm not a java dev, so I'm just trying things.
Is it possible this is correct?

found the list of files on: https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/
learning about types here: https://maven.apache.org/pom.html#dependencies

<dependencies>
  <dependency>
    <groupId>com.github.top-gg</groupId>
    <artifactId>java-sdk</artifactId>
    <type>pom</type>
    <version>2.1.1</version>
  </dependency>
</dependencies>

After using that it builds fine, but since I have no idea what I'm doing(I don't even know how to run a program yet) I cant validate its working.

rain heart
#

As said commit contains the fix to that issue

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jaunty plank
#

It builds when I add type pom

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jaunty plank
normal trail
#

...

pulsar lion
#

@jaunty plank

sand dew
#

any can help me to make the cmd which will only work when the author voted on top.gg

tropic moat
jaunty plank
#

@tropic moat so, only approved bots can use the api. I dont see any bots submitted or approved on the account you're asking for help with.

tropic moat
#

Because I am a co owner of a bot

#

that is approved.

#

They own it I develop it.

jaunty plank
#

and you got the token on https://top.gg/bot/:yourbotid/webhooks?

tropic moat
#

Yes.

jaunty plank
#

Try regenerating the token, refreshing the page and copying it.
Then see if the error still exists

tropic moat
#

I have done all that and it still persists.

jaunty plank
#

you've done it from your account? or the owning account?

tropic moat
#

Owning account.

#

They gave me the token, and now I am trying to use it.

jaunty plank
#

is it possible it was copy pasted wrong, either by you or them?

tropic moat
#

I'll ask them to do it again.

jaunty plank
#

it seems silly but we've debugged a users token before for hours and it turned out to be a copy paste issue

#

make sure they refresh after regenerating, then copy it

tropic moat
#

Odd, works now.

jaunty plank
#

Sometimes the token wont refresh in the browser until the page is refreshed, its an annoying issue for sure.

tropic moat
#

Ah, well thanks for the reply.

tropic moat
jaunty plank
#

Did you fill in the webhook url and auth to your webserver?

tropic moat
#

Yes.

jaunty plank
#

Topgg webhooks don't work with discord webhooks

#

You need to host your own webhook server

tropic moat
#

I do not know how to do that.

normal trail
#

mee to

tropic moat
#
const app = express()

    const webhook = new Topgg.Webhook("xxxx_123456")

    app.post("/dblwebhook", webhook.listener(vote => {
      // vote will be your vote object, e.g
      console.log(vote.user) // 395526710101278721 < user who voted\

      // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
    }))

    app.listen(1337)
#

I have this.

jaunty plank
#

What are you using to run that code?
Home/vps/replit/heroku?

tropic moat
#

My ready event.

normal trail
tropic moat
#

And the bots is self hosted.

jaunty plank
#

You'll need to port forward then

#

Your url will also be
http://yourhomeip:1337/dblwebhook

plucky lance
#

You will need a public IPv4 in the first place which is likely unrealistic that you got one nowadays

jaunty plank
#

Is that not common anymore?

#

I've never not had one

plucky lance
#

Nope DSLite due the ipv4 shortage is common these days

#

Which uses IPv6

#

The IPv4 you got assigned in DSLite tunnel is only usable within your ISPs network to identify you

#

It’s no public IPv4 anymore

jaunty plank
#

Strange, I have webservers hosted on my home network, must just be lucky then

plucky lance
#

That’s common nowadays worldwide

jaunty plank
#

Good to know

plucky lance
#

Yeah me too but I ordered a public IPv4

normal trail
#

can Δ± ask a question, woo

jaunty plank
#

Always ^_^

plucky lance
#

Which will only be given out over here to businesses like I have

tropic moat
#

So then how can I do this.

plucky lance
#

Make sure you got a public IPv4 and you’re able to open/forward ports in your router

normal trail
#

@jaunty plank in this code
const webhook = new Topgg.Webhook("xxxx_123456")
You wrote Topgg.webhook
right but what is Topgg

plucky lance
#

You construct the class named Topgg

jaunty plank
tropic moat
plucky lance
jaunty plank
#

Hosting at home is always a pain

tropic moat
#

And sadly I am not made of money πŸ˜‚

plucky lance
#

Your router does forward ports to your devices automatically for security reasons as well as without having an IPv4 you won’t be able to receive a webhook anyways

plucky lance
jaunty plank
#

Yeah

plucky lance
#

Some routers nowadays have inbuilt VPN servers and support at least allowing you a tunneled connection from your mobile devices

#

Which is already quite nice

normal trail
#

I want to make my bot obligatory to vote, can you help with this?

plucky lance
#

Instead of relying and using external services

normal trail
#

@jaunty plank can Δ± get help

plucky lance
#

If you wanna post your stats then use the right method

#

(Post)

smoky marten
plucky lance
#

Well I can’t see the full URL

#

I can only guess

smoky marten
#

Someone tell him that he can copy paste code into discord

#

Instead of taking ss

plucky lance
fluid venture
#

bot developer moment

dim kettle
plucky lance
dim kettle
plucky lance
#

I was thinking about that too when I saw it but then assumed it wouldn’t matter tbh

#

But idk that, too

dim kettle
#

Like it’s kinda stupid if they do it. Pretty sure json is case sensitive

plucky lance
#

Yeah probably

dim kettle
#

Ah nvm the response pic finally loaded for me. Could be lowercases by the lib as you said

#

But something does not seem right. Anyways, just lowercase it to see if it works xD

plucky lance
#

Hmm discord is really greedy with loading user content the last days/weeks

#

Sometimes takes ages for me, too or doesn’t load at all

dim kettle
#

Yeah. I keep seeing that discord failed load β€œpoop icon” thing for a lot of user provided media

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.

brazen zephyr
#

Hey, i try to check if a user(id) voteted for my bot or not, but it always returns 0 (ive checked the user id first from the last 1000 votes endpoint). This is my code so far: ```python
r = requests.get(f"https://top.gg/api/bots/{botid}/check?userId={userid}", headers={"Authorization": TOPGG_TOKEN})
if r.json()["voted"] == 0:
return False
return True

sullen nymph
#

P.S. return r.json()["voted"] == 0 works just fine

#

Does it happen when you vote too?

brazen zephyr
#

yeah, i voted for test and it also returns 0

rain heart
#

A test-vote will not change the state of the check endpoint, you have to make an actual vote

sullen nymph
#

They probably meant voting to test it

brazen zephyr
plain panther
#

When i use api to log it logs same data 2-3 times at one time

valid ravine
#
TopGGAPIError: 401 Unauthorized (You need a token for this endpoint)
    at Api._request (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Api.postStats (C:\Users\wpuser18\Desktop\UrakoBeta\node_modules\@top-gg\sdk\dist\structs\Api.js:99:9) {
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'https://top.gg/api/bots/stats',
      status: 401,
      statusText: 'Unauthorized',
      headers: [Headers],
      counter: 0
    }
  }
}```
#

What did I miss?

#

anyone help plz

rain heart
#

No Auth header

plain panther
smoky marten
#

When I use api to log
You can use api to log ?
Or maybe you mean webhook

#

Anyway show code

#

Also check your process (Using top on linux)

#

Maybe you're running same instances of the code multiple times

plain panther
smoky marten
restive otter
restive otter
#

thx

smoky marten
plain panther
smoky marten
plain panther
#

Paid christmasthink

smoky marten
#

Try restarting

#

Free ones often creates multi instance when you keep them alive by pinging them at a certain duration

#

IDK how always alive works on replit

plain panther
#

Oh IC πŸ‘€ but yeah i use paid one. And always alive would be pretty much same ig. Can't it be solved? Like putting osme restrictions?

smoky marten
#

Like normally when you try to create a webserver it binds to the port you're using
So when you try creating dual instance it'll yeet an error saying "Port in use"
But replit binds your app to the port dynamically and uses the url to access it

My guess is when the repl sleeps and it receives a new request instead of waking the repl it creates a new instance sometimes
IDK much about it tho

plain panther
#

Thanks :) i will check them out

jaunty plank
# scarlet cobalt One message removed from a suspended account.

the commit hash doesn't work without type pom.
Looking at the build log, maven fails.
https://jitpack.io/com/github/top-gg/java-sdk/2.1.1/build.log or
https://jitpack.io/com/github/top-gg/java-sdk/a3a7508/build.log

⚠️ WARNING:
Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
See the documentation and examples: https://docs.jitpack.io

Looking at the docs I think this is what the error is referring to. https://docs.jitpack.io/building/#gradle-projects

Its been so long since anyone last published I'm guessing its changed since then?

restive otter
#

Hi when i vote in top.gg for my bot i dont get rewards but everything is fine even token but idk wht to do for auth

jaunty plank
#

What programming language do you use?

restive otter
jaunty plank
worldly tendon
jaunty plank
#

Webhooks are made with code.
The url is the url to your webserver/endpoint.
The auth you decide.

worldly tendon
#

so if i were for example

#

using railway

#

would i use the railway link as the webhook

#

as in, for this part

modern coral
#

Is there a way to check in how many hours user can vote again?

rain heart
#

There's not, no

#

That's something you'd have to track yourself through the webhook:

  • Collect the timestamp of the vote
    -Have the user check the time
  • Return the current minus the previous
    Get the time left
modern coral
#

vote object which is returns from webhook retuns user id, i should get current time stamp with new Date() right?

gray mantle
#

Please help me using the API

#

How can I interact with it to take event when somebody voted

#

I'm using DiscordJs 13.8

gray mantle
smoky marten
gray mantle
#

Thankyou for supporting

worldly tendon
#

My confusion is where does this url come from

jaunty plank
# worldly tendon My confusion is where does this url come from

the url is a standard http url pointed at your server and code.
https://medium.com/@joseph.pyram/9-parts-of-a-url-that-you-should-know-89fea8e11713

it will depend on your hosting provider, if you have a domain, if you have ssl, your available ports, etc.

for example if you're hosting on a vps it will probably look something like
http://yourServerIp:PORT/PATH
yourServerIp is the ip to your server
Port is the associated port with the webserver/express/etc(set in code typically).
Path is the path to the endpoint you set in code.

jaunty plank
#

Nope, local host just means itself. Topgg's local host is its own servers.
If you really need to perform tests you can use postman, or send yourself requests some other way.

plucky lance
#

@rain heart

#

.ru what a trustable TLD

rain heart
#

begone

royal rampart
#

I'm running a custom wrapper for the Discord API and not the Wrapper which is supported in the Top.gg Python SDK, how can I still post the server count for Top.gg? Can I just do this request-based?

dim kettle
jagged lodge
#

Heh

molten goblet
#

I have my Weebhook not working even though I have configured it correctly

jaunty plank
#

What are you using to host it?

molten goblet
jaunty plank
#

Topgg webhooks do not work directly with discord webhooks

molten goblet
#

Oh okay, so how does it work?

jaunty plank
#

You need to make your own webhook listener(either using a library, or by yourself)

#

Or use a third party tool

tidal idol
molten goblet
#

OK, thank you.

cunning briar
#

Heloo

#

Ψ³Ω„Ψ§Ω…

tidal idol
tulip trail
#

how can i fix this err Error: 401 Unauthorized (You need a token for this endpoint) at Api._request (C:\Users\schad\OneDrive\discord bot\VScode\New folder\dbot\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) i used this token

dim kettle
#

What does the code look like where your calling our API?

#

Just blur out the api token

tulip trail
#
const Discord = require('discord.js');
const Topgg = require(`@top-gg/sdk`);
const moment = require("moment");
require("moment-duration-format");

module.exports = async (client, interaction, args) => {
    const api = new Topgg.Api(process.env.TOPGG_TOKEN)
    
    let row = new Discord.MessageActionRow()
        .addComponents(
            new Discord.MessageButton()
                .setLabel("Vote for me")
                .setURL("https://top.gg/bot/975467042859802635/vote")
                .setStyle("LINK"),
        );
   
    await api.hasVoted(interaction.user.id).then(voted => {
        if (voted) {
            client.embed({
                title: `πŸ“¨γƒ»Vote`,
                desc: `You have voted!`,
                color: client.config.colors.succes,
                components: [row],
                type: 'editreply'
            }, interaction)
        }
        if (!voted) {
            client.embed({
                title: `πŸ“¨γƒ»Vote`,
                desc: `You have not voted!`,
                color: client.config.colors.error,
                components: [row],
                type: 'editreply'
            }, interaction)
        }
    }).catch(error => { client.errNormal({ text: `There was an error by checking this vote!`, editreply: true }, interaction) });
}```
dim kettle
#

If it does, go to your bot webhook page, click the API key regenerate button.
Then before you copy it, clear your browsers cache and refresh the tab. Then copy the new token

tulip trail
dim kettle
#

Console log process.env.TOPGG__TOKEN

#

Just to see if it is there

tulip trail
#

yes it logged

dim kettle
#

Then try the steps above I mentioned

#

go to your bots webhook page, click the API key regenerate button.
Then before you copy it, clear your browsers cache and refresh the tab. Then copy the new token

tulip trail
#

thanks now it worked

dim kettle
#

Nice πŸ‘Œ

verbal geyser
#

How can I setup a vote webhook in my bot? (python)

tidal idol
verbal geyser
#

thanks

opaque kelp
#

Hi, I'm making a node.js receiver for receiving which user votes for the bot. I am currently following the api but it isn't sending the user id to my console. I tried searching up what might be my problem, but I couldn't find anything. Does anyone see any obvious errors in my node.js code?

const express = require('express');
const app = express();
const port = 80;

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

const topggtoken = process.env['topgg']
const webhook = new Topgg.Webhook(topggtoken)

app.post("/dblwebhook", webhook.listener(vote => {
  console.log(vote.user)
}))

app.listen(port, () => console.log('App port online!'));

Thanks for the help!!

plucky lance
#

where do u host this webserver?

opaque kelp
#

repl

plucky lance
#

try a different port, not 80 and hit the save button on topgg before test

#

and make sure the express server is running

opaque kelp
#

sure

#

thanks

#

It still doesn't work. I changed the port to 443 and made sure that the server was running. I also have the topgg webhook set up properly.

plucky lance
#

try non-reserved ports

#

like 3000 or 5000

opaque kelp
#

ok

plucky lance
#

also, what's the URL you entered on topgg?

#

u don't have to expose it

opaque kelp
#

I tried port 3000 and 5000. URL is https://(serverip)/dblwebhook

#

should i try http?

plucky lance
#

don't use the secure protocol

opaque kelp
#

ok

#

still doesnt work... I'm using the send test button, that is fine right?

plucky lance
#

first save, then test, always

#

u changed the URL?

opaque kelp
#

yeah

#

im also hosting my website and discord bot on the same server. That is fine, right? Thanks for the help

plucky lance
#

ehm

#

did you add the port you're listening to, to the URL?

opaque kelp
#

oh

#

ill try that

plucky lance
#

http://serverip:port/dblwebhook

fluid venture
#

πŸ’€

plucky lance
#

actually use your project hostname, not the IP

#

I doubt it's a static IP

opaque kelp
#

yeah

plucky lance
#

Try a testing tool if it's able to send a request to your destination

#

make sure it's a post request as well

opaque kelp
#

ok

#

what should I put for the content of the post request?

plucky lance
#

ehm

#

nothing

opaque kelp
#

ok

plucky lance
#

{}

#

just an empty object

#

oh

#

there's actually content

opaque kelp
#

i see the problem

#

it couldnt connect

plucky lance
#

connection timeout?

opaque kelp
#

oh wait

#

removing the port

#

forbidden

plucky lance
#

the express server should listen to this port only

opaque kelp
#

im not using an ip for the server, im using its URL

#

replit doesnt give me an ip

plucky lance
#

actually use your project hostname, not the IP

opaque kelp
#

ok

#

erm

plucky lance
#

what happens on reqbin?

#

connection timeout or auth error?

opaque kelp
#

It shows 403 forbidden

#

im gonna try to fix it. Never had a forbidden error with replit

#

im gonna go now

#

thanks for the help

plucky lance
#

alr

tepid osprey
#

I'm not going to do this, this is just for the record
Isn't it just really easy to fake the server count by posting a random number you want on it?

tidal idol
#

Yes

safe sandal
#

im getting a 408 code when using @top-gg/sdk

TopGGAPIError: 408 Request Timeout
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'https://top.gg/api/bots/stats',
      status: 408,
      statusText: 'Request Timeout',
      headers: [Headers],
      counter: 0
    }
  }
sterile stirrup
#

what do i put here?

rain heart
#

Your webhooks authorization, something you create yourself and has to be the same on your webhook settings on top.gg

opaque kelp
#

On node.js, how would I find out the weekend multiplier? Assuming that my code works properly, the vote.isWeekend returns with undefined. How would I find out if the weekend multiplier is on?

// (Some code cuts out, assume that packages work correctly)

app.post("/dblwebhook", webhook.listener(vote => {
  const user = vote.user
  console.log(vote.isWeekend)
}))
#

I'll make my question a bit more specific. How would I request the isWeekend parameter when topgg posts?

rain heart
#

The test vote does not return isWeekend

#

An actual vote would

opaque kelp
#

oh

#

ok thanks

steep fulcrum
#

Hello im getting api error when i try to check a user vote status by hasVoted

    at Api._request (C:\Users\SuDhi\Desktop\AlexPremium\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (C:\Users\SuDhi\Desktop\AlexPremium\src\commands\general\profile.js:100:17) {
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'https://top.gg/api//bots/check?userId=781882376790736937',
      status: 408,
      statusText: 'Request Timeout',
      headers: [Headers],
      counter: 0
    }
  }
}```
#

is it is my mistake or your mistake?

#

it was working fine like 1hour before

steep fulcrum
#

thanks

restive otter
#

Aight lol

primal prawn
#

how can I remove the link in webhooks?

jaunty plank
jaunty plank
#

Well, webhook saving is configured to only allow users to save if webhook URL is filled with something.

I'm not sure why its setup like that.

fluid venture
#

πŸ’€

#

i see

kind basalt
#

Hello, I would like to know which country offers top.gg?

jaunty plank
#

Since Topgg started using multiple servers we likely serve data from multiple countries.

knotty path
#

Im getting a Unresolved dependency: com.github.DiscordBotList:DBL-Java-Library:jar:2.1.1 error from maven but my dependency xml structure follows what is on jitpack exactly. I also have the jitpack repository as well
https://paste.ofcode.org/55mcCRchgxRj4tzajjN23U

#

Yeah something is not adding up here, looking at the repo the package structrue isnt even com.github.DiscordBotList

rain heart
#

That's definitely outdated wherever you got that

knotty path
#

It seems not only is the top.gg website wiki using the wrong dependency, but so its the github repo README, AND the jitpack they link to is wrong.

#

If anyone knows the real dependency please ping me!

runic tapir
#

A user voted for our bot after they had a reminder on via top.gg.
That vote caused a major error and didn't go through.
The vote on our server without a reminder worked fine.

No one else experiences this issue and I believe it may have something to do with the reminder thingy. Though I have no idea.

Error handling request
22.06 12:44:13 [Bot] Traceback (most recent call last):
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
22.06 12:44:13 [Bot] resp = await request_handler(request)
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
22.06 12:44:13 [Bot] resp = await handler(request)
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/webhook.py", line 132, in _bot_vote_handler
22.06 12:44:13 [Bot] self.bot.dispatch("dbl_vote", BotVoteData(**data))
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 279, in __init__
22.06 12:44:13 [Bot] super().__init__(**parse_vote_dict(kwargs))
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 19, in parse_vote_dict
22.06 12:44:13 [Bot] query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
22.06 12:44:13 [Bot] File "/.local/lib/python3.9/site-packages/topgg/types.py", line 19, in <dictcomp>
22.06 12:44:13 [Bot] query_dict = {k: v for k, v in [pair.split("=") for pair in query.split("&")]}
22.06 12:44:13 [Bot] ValueError: not enough values to unpack (expected 2, got 1)```
rain heart
#

Are you using query params? it seems like your client gets some sort of malformed query string

edgy merlin
#
        <dependency>
            <groupId>com.github.top-gg</groupId>
            <artifactId>java-sdk</artifactId>
            <version>2.1.1</version>
        </dependency>

That doesnt work

jaunty plank
edgy merlin
#

So.... What do i do? Do i have to keep ignoring Github's emails about a failed compilation

jaunty plank
#

so, I know nothing about java.
this is what i've figured out so far, #topgg-api message

I think we just need someone to push the fix, but I cant validate thats whats needed.

edgy merlin
#

Ik Java but not Maven, rip

jaunty plank
rain heart
#

Thats a warning that can be safely ignored

jaunty plank
#

which I presume .jar is needed for maven

#

from the docs "Projects using Gradle need to have either the maven or maven-publish plugin enabled."

rain heart
#

there were no changes within any of the gradle-related files between the previous 2018 version and the current

jaunty plank
#

jitpack very likely has had updates since then though

rain heart
#

the only changes are changes from the dependencies of the sdk

#

so shrug whats causing it

#

gradle taking a shid

#

prob

jaunty plank
#

yeah, seems applying the fix listed on the jitpack docs solves it.

rain heart
#

pr kthx

tidal idol
#

is there an endpoint on the Top.gg API to get server owner info?

rain heart
#

The top.gg api does not provide an official way to fetch data from servers at all

jaunty plank
#

We dont have any endpoints for se... oh hi hope

rain heart
#

hi

#

and if you're attempting to use non-official endpoints (such as ones obtained through inspect element), likely don't expect official and/or accurate support

jaunty plank
#

If this is for your voting site, iirc you're using oauth to obtain user info, if you include guilds in your scope you'll also obtain the current users owner status for the guild you're interested in.

I presume thats what you're looking for.

tidal idol
#

ah yeah good point

#

ty!

safe stone
#

Uhmm

#

Where to get help

rain heart
#

-maintenance

abstract mothBOT
#

topgg Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.

During this downtime, the following parts of our site will be affected:
topggDotRed API
topggDotRed Voting
topggDotRed Bot / server / DAO pages
topggDotRed All other functionality

Please refer to #site-status for updates! Thank you for your patience and understanding! 🀠

safe stone
#

I tried voting

dim kettle
#

Read the message above

safe stone
#

Why it appeared that I'm banned

dim kettle
#

We are under maintenance for the next 3 hours or so

safe stone
#

That's why I'm concerned xD

dim kettle
#

Come back in a few hours, and you should be good

safe stone
#

Alright. Tysm

tropic moat
#

I do not understand this.

dim kettle
abstract mothBOT
#

@tropic moat

topgg Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.

During this downtime, the following parts of our site will be affected:
topggDotRed API
topggDotRed Voting
topggDotRed Bot / server / DAO pages
topggDotRed All other functionality

Please refer to #site-status for updates! Thank you for your patience and understanding! 🀠

dim kettle
#

The API is down atm

tropic moat
#

A ping would be handy.

teal nymph
#

^^

dim kettle
tropic moat
#

Ping the dev role.

teal nymph
#

then create a reaction role for who wants to ping for status

tropic moat
#

^

teal nymph
#

πŸ€”

dim kettle
teal nymph
#

TNX

tropic moat
#

Oh lovely. How did I even get ratelimited.

dim kettle
tender sky
tropic moat
#

Mkay.

tender sky
#

What happen

dim kettle
abstract mothBOT
#

@tender sky

topgg Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.

During this downtime, the following parts of our site will be affected:
topggDotRed API
topggDotRed Voting
topggDotRed Bot / server / DAO pages
topggDotRed All other functionality

Please refer to #site-status for updates! Thank you for your patience and understanding! 🀠

wraith venture
#

$vote

dim kettle
#

Please keep this channel relevant to Top.gg API issues

dim kettle
wraith venture
dim kettle
prisma oxide
#

Where do I go to talk to ppl

dim kettle
river mango
#

Hello, I can't connect to the site to do the /vote with the BOT Koya, would it be possible to know why please?

#

please?

abstract mothBOT
#

@river mango

topgg Scheduled Site Maintenance
Top.gg is currently undergoing scheduled maintenance from <t:1656072000:F> to <t:1656086400:F>. We expect to be back <t:1656086400:R>.

During this downtime, the following parts of our site will be affected:
topggDotRed API
topggDotRed Voting
topggDotRed Bot / server / DAO pages
topggDotRed All other functionality

Please refer to #site-status for updates! Thank you for your patience and understanding! 🀠

dim kettle
#

Come back in 2 hours time

river mango
#

okay

#

thank

#

you

vast bolt
#

Hi I'm checking the topggpy wrapper and played around with it, using Hikari as my development library, starting with the examples, I've noted that the developer gave some examples with Hikari but when I tried it for myself, it doesn't seem to be working as intended.

Specifically, I've tried to setup the WebhookManager and DBLClient, which both takes the bot as an argument, but it returned this:

AttributeError: 'Yuna' object has no attribute 'loop'

After delving into the source code, it seems apparent that it only accepts discord.Client as the bot argument, I've also searched around and read somewhere that topggpy isn't maintained so there are errors that are very different from the example given, such as the WebhookManager not having set_data method, are there any alternatives if it doesn't work for hikari, considering most of the support are meant for dpy?

hearty sky
#

0

viscid island
#

Hey, I'm trying to test my Top.gg webhook before my bot has been verified on the platform, so I'm using Postman to try and mimic the request top.gg will make to my server, I've managed to get the Authorization header working but I keep getting an Invalid body 400 error, I've tried form-data, x-www-form-urlencoded, and query parameters but none work, I'm using the fields as posted on this documentation article: https://docs.top.gg/resources/webhooks/#data-format. I'm using the node sdk

Top.gg documentation

Webhook integration for receiving vote data

cinder fiber
#

$vote

rain heart
#

just fyi

#

also, you wont need to mess around with the content type if you're using one of the libraries, it does it itself

viscid island
#

Worked, thank you

viscid island
rain heart
#

Cloudflare automatically upgrades the protocol so doesn't matter really

balmy sleet
#

This Resets every 12 horas?

rain heart
#

yes

#

aka when a user can vote again

fluid venture
rain heart
#

yes

#

should've been true or false tbh

fluid venture
#

fr

#

but yea 0 and 1 also indicates false and true

rain heart
#

yeah

pliant gyro
#

How would I set up vote reminders?

jaunty plank
#

Vote reminders will need a database and webhooks.
When someone votes, you'll store the time they voted.
If the vote is 12 hours old you'll remind then and delete the row.
Or have a column with a boolean for if the reminder has been given.

fluid venture
jaunty plank
fluid venture
#

yea thats true

fluid venture
jaunty plank
#

Not necessarily, you can do it every minute or so.

You can also fetch hourly, set timeouts for each one that will happen within the next hour if you really wanted to.

#

But its really not necessary to do something like that until you're getting hundreds or thousands of votes an hour.

fluid venture
#

welp

#

too much work fr

tidal idol
jaunty badger
#

wait should it be

    <dependency>
        <groupId>com.github.DiscordBotList</groupId>
        <artifactId>DBL-Java-Library</artifactId>
        <version>2.1.1</version>
    </dependency>
jaunty badger
#

these are the only one that are working for me

    <dependency>
        <groupId>com.github.top-gg</groupId>
        <artifactId>java-sdk</artifactId>
        <version>2.0.0</version>
    </dependency>
``````xml
    <dependency>
        <groupId>com.github.top-gg</groupId>
        <artifactId>java-sdk</artifactId>
        <version>2.0.1</version>
    </dependency>
jaunty plank
# jaunty badger these are the only one that are working for me ```xml <dependency> <...

Hey! It seems maven doesn't work currently with the java lib.
I think I fixed it in the most recent pull request, but I cant test it(not a java developer).

can you try PR14-SNAPSHOT.
Here's the pr on GitHub: https://github.com/top-gg/java-sdk/pull/14

  <dependency>
    <groupId>com.github.top-gg</groupId>
    <artifactId>java-sdk</artifactId>
    <version>PR14-SNAPSHOT</version>
  </dependency>
GitHub

Added fix to comply with Jitpacks documentation.
https://docs.jitpack.io/building/#gradle-projects
This should fix installation issues for maven users.

jaunty badger
#

@jaunty plank

jaunty plank
jaunty badger
jaunty badger
#

wait

#

YO @jaunty plank IT WORKED

#

i think i messed up the depend

#

when i first tried

jaunty plank
#

sweet ^_^

jaunty badger
#

thx

jaunty plank
#

Thanks for testing, hopefully someone can merge it soon

jaunty badger
#

its xml <groupId>com.github.Top-gg</groupId> not

<groupId>com.github.top-gg</groupId>```
jaunty plank
#

Strange, com.github.top-gg builds for me

jaunty badger
#

thats all i changed

#

ig it works

#

ig their not case sen

jaunty plank
#

not sure ^_^, i'm just glad it works

jaunty badger
#

ye

jaunty badger
#

@jaunty plank are you able to pin a message

#

might want to pin that msg with the api

fluid venture
#

i just tested the webhooks and saw that u dont really need auth to receive webhook data

#

πŸ’€

jaunty plank
#

the auth is for the webhook listener to determine where the webhook came from

#

its not strictly necessary, but it is highly advised.

fluid venture
jaunty plank
#

for the api?
You set the header before you send the request.

#

for webhooks topgg sets the header before sending the request

fluid venture
jaunty plank
#

using express?

fluid venture
#

yes