#topgg-api

1 messages · Page 176 of 1

restive otter
#

seriously? thats annoying

woeful hearth
#

hello

#

I have a problem

polar ember
#

Maybe it will match to your problem

woeful hearth
#

what's your problem?

#

@polar ember

polar ember
woeful hearth
polar ember
#

Sry my solution doesnt match to your problem

woeful hearth
#

thx

#

Can you translate this into Turkish for me?

#

@polar ember

tidal idol
orchid flax
#

Hi, is there any function on the @top-gg/sdk, to listen for votes without a webhook?

rain heart
#

in short, no

orchid flax
#

Ah, alright-

#

Uhm, is there any way I can go about it if i dont own a website?

tidal idol
orchid flax
#

Well, i want to make like a "reward type thing" for people who vote

plucky lance
#

You don't need a website, just a webserver listening for the requests

#

Doesn't even need to be a public one as you can whitelist topgg

orchid flax
#

Oh alright

potent rover
#

how to use webhooks for servers?

rain heart
late finch
#

Lets say I wanted to check if a user voted without using webhooks how would I do that

#

Like grabbing info then searching for the user then using that info to determine if you voted in the last 12 hours

rain heart
#

You can make a request to the voted endpoint, which is only a thing on bots though

#

So servers are forced to use webhooks

late finch
#

So I saw this thing on the docs that I can get the last 1000 votes? I tried getting it but it returns an error because the bot is apparently not "Authorised" so see this data. How can I make it see the data?

rain heart
#

by passing the correct authorization, refer to the docs

late finch
#

but how the docs only says to pass it with a token in which I have but there is no library or anything to pass the token to access the info

rain heart
late finch
#

I still dont understand why this is suppose to help there's no library still on how I can access that info?

jaunty plank
#

What library are you looking for?
We do have a few, but it is an api you don't necessarily need one.

late finch
#

right so basically I used nodejs and fetched this link : https://top.gg/api/bots/:botid/votes and it worked for me but when I ran it on a server it says this : { error: 'Unauthorized' } I just don't know how to get authorization when I fetch for things

jaunty plank
#

So the authorization token itself can be found on your bots edit page, in the webhook section.

It goes in an authorization header

#

What are you using to fetch?

late finch
#

node-fetch

#

const file = await fetch("https://top.gg/api/bots/:botId/votes").then((response) => response.json());

#

goes something like this

jaunty plank
#

There's an option for headers

late finch
#

yep

#

really?

late finch
restive otter
#

how to get left vote time
like this

orchid siren
#

client.topgg = new Top.gg.api("") i am trying to use this on index.js but it's not working

rain heart
orchid siren
#

client.topgg = new Top.gg.api("topgg token") error on console

restive otter
#

show me

restive otter
orchid siren
orchid siren
restive otter
orchid siren
#

do you use vote only cmds?

#

@restive otter

restive otter
orchid siren
#

can i see example?

restive otter
#

what you are trying to making tell me clearly

orchid siren
#

dm

restive otter
#

my dms are off

orchid siren
#

ok

restive otter
orchid siren
#

i am trying to make vote only cmd like if you want to use this cmd you have to vote first

orchid siren
plucky lance
orchid siren
#

ok

plucky lance
#

And if a match was found cache it to prevent another database request

orchid siren
#

ok

compact geode
#

What are the rate limits updating server count?

restive otter
#

hi

#

anyone here

#

how do i get api

restive otter
glad merlin
#

is API ok atm?

rain heart
#

Already reported it to our devs, thanks for informing us in #support

glad merlin
summer sparrow
#

Hi

#

/invite

#

!invite @warped ocean

runic horizon
#

Hello I am using top.gg auto poster for node js like its said in docs

#

but I am getting 401 Unauthorized (You need a token for this endpoint)

jaunty plank
jaunty plank
#

Try regenerating your topgg token(your bot page, webhook settings, regen) then using the new one.

warped ocean
stuck socket
#

why does pip install topggpy download all discord.py versions in existence

sullen nymph
#

Huh?

stuck socket
#

had to use --no-dependencies

sullen nymph
#

Wtf

#

What pip and Python version

restive otter
#

hey sometimes after like some time i get this error from posting stats to top.gg about a bot.

const topGGapi = AutoPoster(`token`, client)
topGGapi.on(`posted`, () => {
    console.log(`Posted bot statistics to Top.gg!`);
});
[19:34:40] Posted bot statistics to Top.gg!
[20:04:40] Posted bot statistics to Top.gg!
[20:34:40] Posted bot statistics to Top.gg!
[21:04:40] Posted bot statistics to Top.gg!
[21:34:40] Posted bot statistics to Top.gg!
[22:04:40] Posted bot statistics to Top.gg!
[22:34:40] Posted bot statistics to Top.gg!
[23:04:40] Posted bot statistics to Top.gg!
[23:36:19] TopGGAPIError: 524 undefined
    at Api._request (/froggie/bot/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Api.postStats (/froggie/bot/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: 524,
      statusText: undefined,
      headers: [Headers],
      counter: 0
    }
  }
}
jaunty plank
#

Sometimes the api is down for a bit. That's probably what that error is

restive otter
#

oh okay so this is not something from my side?

jaunty plank
#

Nope

restive otter
#

oh thank you great to know

trail shale
#

how do i get my topgg auth token?

rain heart
#

Read pins

restive otter
#

Are we able to make a command that requires to vote with python? How can we make a command like that?

bitter dome
#

You have to read the docs

#

Its so easy

#

Also depends on where you are hosting but you need to portforward

restive otter
#

I understand nothing from it

bitter dome
#

Copy docs

#

Into ur file

#

Change token

#

And done

restive otter
#

Which one

bitter dome
restive otter
#

No I mean which code

#

To copy

bitter dome
#

The one

#

In

#

Docs > libraries> python

#

3rd section there

#

I think

restive otter
#

But I didn't mean this codes

#

I mean like

#

If you want to use ban command you need to vote the bot from top.gg

#

But I can't found a code does that

bitter dome
#

You have to make that.

#

Just make a role

#

That is given to the user after vote

#

And make the ban command need that role

restive otter
#

ugh

#

I can make it with variables, I think. Thanks

summer sparrow
#

AUTHIC (╯°□°)╯︵ ┻━┻

orchid siren
#

How to make vote only cmd

dim kettle
# orchid siren How to make vote only cmd

You store incoming vote webhooks in your database. When someone attempts to use a vote only command, you check your database for when they last voted.
If they voted within X amount of hours/days, grant them access

orchid siren
shy vortex
rain heart
#

Works too, unless they want realtime notifications

#

Though seeing from a practical perspective, collecting webhook requests and storing the vote status is more efficient than making a request to that endpoint on every command usage

shy vortex
#

But if your bot doesn't need a database it would be annoying to setup one just for votes alone

rain heart
#

Either set one up or get ratelimited when your bots gets bigger

median rose
#

where to use?

plucky lance
#

You will receive that data using your own webserver listening to the webhooks coming from topgg

#

Once you told topgg where to send the requests (speaking about your endpoint)

median rose
#

im using it so a user can be given a role when voted

#

where would i get the webhook from

plucky lance
#

Heading on the topgg site > left menu > webhooks

cursive zodiac
median rose
#

what do i put link wise here

plucky lance
#

Once you told topgg where to send the requests (speaking about your endpoint)

#

Your endpoint

#

Of your webhook listener

median rose
#

I am so confused

#

Where do i send the requests assuming my end point is discord ?

plucky lance
#

First of all you receive requests , topgg send a request to your webserver telling you somebody voted

median rose
#

It can’t send a request without a link there so let’s do that first

plucky lance
#

The link to your webserver endpoint where you receive the requests from topgg

median rose
#

and where do I receive the requests

#

Sorry if I’m being difficult here I’m new

plucky lance
#

On your domain/server IP and path you have set up

median rose
#

I haven’t

plucky lance
#

Well you need an endpoint topgg can send it’s webhooks

median rose
#

First what do i need to do on discord

plucky lance
#

Like you need a mailbox to receive a letter

plucky lance
median rose
#

How else do I get the role to the users

cursive zodiac
#

idk if it is still relevant

median rose
#

Thanks I’ll have a look in a second this is quite confusing for me though

pastel drift
# median rose First what do i need to do on **discord**

Think of it as a url where topgg will POST a json request. So you need to give them a url where it can do it.
You need to open a port example port 5000
Then give them webhook as http://ip_address:5000/webhook and it’ll post your data here you will set the port 5000, and /webhook in your python script
Python script needs to be running in order to work

thorn ore
#

What do I understand English?

whole rain
#

we need a host for the voting system?

plucky lance
#

If you wanna receive webhooks then yes, you need an endpoint

#

No matter it’s a (virtual) server or hosting platform

#

You need to setup any endpoint being able to receive those requests

whole rain
#

alr

restive otter
#

I need api of Spotify for my music bot

restive otter
molten void
restive otter
#

Hi, i'm trying to get the dbl api library for dotnet but im getting this error:

#

use @surreal seal-gg/sdk

#

what

plucky lance
#

yeah... suggesting a JS lib for somebody using dotnet oldEyes

#

he's using the "offical" lib

restive otter
#

I realized when I read 😄

#

i thought you were using dbl api js

#

im currently trying to use the official dotnet lib

#

i saw there is some others i might try if not ill have to write my own thing using rest i guess

orchid siren
#

Topgg.api is not a constructor ?

restive otter
orchid siren
#

client.topgg = new Topgg.api(api token)

#

@restive otter

restive otter
minor tusk
robust halo
minor tusk
#

what do I need to put in the place of :-

#

anyone?

minor tusk
tidal idol
#

you set the password

#

make sure that password then matches the authentication field on the webhook page

minor tusk
#

and how to get webhook url?

minor tusk
#

someone pls tell T^T

plucky lance
#

Incl. the port you defined

orchid siren
#

@plucky lance how can i make vote only command

plucky lance
minor tusk
#

my token is appearing empty and I can't type or paste anything here either

minor tusk
#

did

#

How can I send a client.dispatch, I mean from where can I get a sample_vote_data

#

I need to test my vote command

plucky lance
#

There's a test button on the topgg page

gray tendon
#

I make this but it doesn't send message when someone voted

const app = require('express')
const Topgg = require('@top-gg/sdk')
const { MessageEmbed } = require('discord.js');

module.exports = {
    startServer: (authToken, client) => {
        const hook = new Topgg.Webhook(authToken)
        app.post('/dblwebhook', hook.listener(async vote => {
           let chnl = await client.channels.fetch(client.config.channelToSend);
           if (!chnl) return;
          
           let member = await chnl.guild.members.fetch(vote.user);
           let role = await chnl.guild.roles.fetch(client.config.roleId);
            
           if (role && member) {
               let doc = await client.tools.models.votedUser.findOne({ user: vote.user });
               if (!doc) {
                   await new client.tools.models.votedUser({ user: vote.user, givenAt: Date.now() }).save();
               } else {
                   doc.givenAt = Date.now()
                   await doc.save()
               }
               await member.roles.add(role).catch((e) => console.error(e))
           } 
            
           let embed = new MessageEmbed().setTitle('Top.gg | vote logs').setDescription(`<@${vote.user}> | ${member ? member.user.tag : ''} Just Voted for Moozik!.You can Vote Us Again In 12Hours`).setColor('RANDOM').setFooter(`Thanks For The Vote`);
           if (member) embed.setThumbnail(member.user.displayAvatarURL({ dynamic: true }));
            
           return chnl.send({ embeds: [embed] }) 
        }))
        app.get('/', (req, res) => res.sendStatus(200))
        app.listen(process.env.PORT ?? 8080)
        console.log('Server online!')
    }
}```
rain heart
#

is the webhook also set on the webhooks section on top.gg?

#

Also try an actual vote than a test one

gray tendon
#

In topp gg what webhook should i set

rain heart
#

Your webhook url containing the protocol, hostname and port if applicable, and the path

gray tendon
#

What is authorization key and where i get it

rain heart
tidal idol
#

in simple non techy terms, you set the auth key

#

make sure that auth key matches the password you set in your code (not sure why 2 different terms are used)

gray tendon
#

is this authorization key

#

And it must be same in topgg and in code

violet sun
#

data["user"]
does this give the user id?

tidal idol
tidal idol
violet sun
#

python

#

@tidal idol

tidal idol
#

then yes

violet sun
#

ok

#

thx

restive otter
#

Hi guys, im still having this issue where i cant install DiscordBotsList.Api to my project

#

Is thewre any way I can fix this, is there any other libs you guys can recommend for this or am i better off writing my own rest stuff to deal with posting server count and voting.

tidal idol
#

it says discordbotslist.api which isn't top.gg

restive otter
#

no the dotnet one

tidal idol
#

ohhhh

#

i see

restive otter
#

its liked in the documantation on top.gg

tidal idol
#

yeah its just said discordbotslist api which confused me

#

cc @jaunty plank

#

wait for woo to respond, hes a know it all with the api KEKW

restive otter
#

ight thanks

tidal idol
#

ik

#

but discordbotslist

#

bots

#

which sounded like that one api that posts to all

violet sun
#
Ignoring exception in on_dbl_test
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/main.py", line 341, in on_dbl_test
    votedata = await dblpy.get_bot_info()
  File "/home/container/.local/lib/python3.10/site-packages/topgg/client.py", line 271, in get_bot_info
    response = await self.http.get_bot_info(bot_id)
  File "/home/container/.local/lib/python3.10/site-packages/topgg/http.py", line 165, in request
    raise errors.Unauthorized(resp, data)
topgg.errors.Unauthorized: Unauthorized (status code: 401)```
What does this mean?
tidal idol
#

invalid api key

restive otter
#

looks like you did not use your token right

violet sun
#

ah okey

#

fixed it

#

thx

#

and what does my nickname mean? xD

tidal idol
#

you have ! in your name

violet sun
#

haha ok

tidal idol
#

which hoists you to the top of the member list

restive otter
#

another question since im pretty much set on making my own thing now

#

does this reset whenever the user can vote again?

#

so like if i vote will it return 1 until i can vote again and then return 0 until i vote again?

#

or will i need to track that manually on my end?

jaunty plank
#

It's 1 if they have voted in the last 12 hours.
0 if they havent.

restive otter
#

ok thanks

#

i wish i could use webhooks but my isp does not give me a real ipv4 address

restive otter
#

ah

#

i saw that but that just posts in a discord channel right?

#

if i want to do vote rewards off of that that would be a dumb ass workaround wouldnt it?

#

right now im just thinking of doing a claim rewards system where a user, once voted can claim the reward

#

so i just do a rest check to see if the user has voted and check with my db if he has already claimed the reward

#

can someone help me make the HttpContent object in c# dotnet for this? i cant figure it out

#
        public static async void PostGuildCount(int count)
        {
            HttpClient hc = new HttpClient();
            hc.DefaultRequestHeaders.Add("Authorization", auth);
            HttpContent content = ????;
            await hc.PostAsync($"https://top.gg/api/bots/{Defaults.CLIENT.CurrentUser.Id}/stats", content);
        }
#

this is what i currently have

rain heart
#

the stats are posted in json

restive otter
#

ok so how do i create a json object? ive never done this before xD

#

also is the other stuff im doing correct? because im kinda just going off of asumptions

rain heart
#

Should be correct, no clue about c#

restive otter
#

ah thanks

#

im assuming i make a "string" http content and feed a json string in

rain heart
#

basically yeah

restive otter
#

got this now im gonna see if it works

#

btw ive been wondering how do they verify if the guild count you submit is correct?

#

smh im getting a bad request

#

response

#

maybe i should not use http i should use rest

#

thats probably the issue

restive otter
#

ight i got it to work using restsharp

#

ill post my solution if anyone else needs it

#

since i think a lot of c# developers like me have no idea how rest requests work in c#

#
        public static async void PostGuildCount(int count)
        {
            RestClient client = new RestClient(new Uri("https://top.gg/api/"));
            RestRequest request = new RestRequest($"bots/{Defaults.CLIENT.CurrentUser.Id}/stats", Method.Post);
            request.AddHeader("Authorization", auth);
            request.RequestFormat = DataFormat.Json;
            request.AddParameter("server_count", count);
            RestResponse response = await client.ExecuteAsync(request);

            if (response.IsSuccessful)
            {
                await Program.Log(new Discord.LogMessage(Discord.LogSeverity.Info, "DBLRestClient", $"Successfully posted guild count! ({count})"));
            } else
            {
                await Program.Log(new Discord.LogMessage(Discord.LogSeverity.Error, "DBLRestClient", $"Posting guild count failed: {response.ErrorException.Message}"));
            }
        }
#

ill provide some more context... the bottom part is just logging success or error with custom stuff i have, count is the server count as passed into the function, Defaults.CLIENT.CurrentUser.Id represents the bot user id (i did this so my test bot that i use before deploying will not be able to post but im sure there is better solutions to this), auth is a string that contains my bots dbl token

steady burrow
#

how do i get a topgg api key

tidal idol
split blade
#

How can I connect that when one votes my bot in the # vote-logs channel in the support server it sends me the embed that I created programming it in node.js, because I didn't understand much in the top.gg docs

violet sun
#

data["user"] displays the userid. but what displays the username and the tag?

restive otter
#

you fetch the user yourself

violet sun
#

i cant fetch the user, when my bot doesnt shares a server with the voter

#

is there a alternative?

#

@restive otter

restive otter
#

the discord api allows you to do that

violet sun
#

but it doesnt work

#

bot.get_user right?

restive otter
#

idk

#

see the docs of the lib you are using

violet sun
#

python, ok

plucky lance
#

the discord api allows you to do that

Yes, you can indeed fetch basic user informations like the username, tag etc. based on the user ID

sullen nymph
gray tendon
#

Getting this error when someone voted who is not in server

plucky lance
#

You’re trying to fetch a guild member

#

An user does not represent a guild member

#

You need to fetch an (API) user

gray tendon
#

How

#
let member = await chnl.guild.members.fetch(vote.user)```
plucky lance
#

<client>.users.fetch(…)

plucky lance
#

(you gonna pass the user ID as argument)

plucky lance
#

Well it does require basic knowledge how to work with webhooks

#

It’s simply a webserver listening to post requests

#

Aka. webhook

#

Yeah the docs for the topgg API is pinned in this channel

#

The docs do explain which data is send with the webhook and how to interact with the API

#

How to setup a webhook listener (webserver listening to POST requests) is up to you

#

The URL is your endpoint, it’s IP/hostname (port) and path

#

Take at look at the docs if you don’t know where to start

#

Assuming you’re using JS

late finch
#

So I made a webhook on discord and another webhook and it seems to be working fine but the ID's that I am receiving are not the same as the actual user when voting how can I fix this?

plucky lance
#

Wut? Topgg sends a wrong user ID when somebody votes?

late finch
#

yeah

#

713445949439213640 this is the ID I got from top.gg vs. 522609261961019411 the actual ID

rain heart
#

The webhooks return the discord based id

#

which should be correct

late finch
#

Well it isnt

#

I also just got another vote in

#

@shy hearth

#

It only works with a few people

rain heart
#

310288931721576450 is the discord id

late finch
#

Ik but it doesnt exists that user

rain heart
#

713445949439213640 same with that one

#

They do exist on discord

late finch
#

Ye but my friend voted and hes Id was 522609261961019411 and instead I got 713445949439213640

#

So why is it changing user thingy?

rain heart
#

There's 2 IDs, a Top.gg based user id and a discord based user id

#

the webhook returns the discord one

late finch
#

522609261961019411

rain heart
#

And the name

late finch
#

Boullellama#7532

rain heart
#

the ID top.gg is providing you is the correct one

#

is a different account apparently?

late finch
#

Wth?

#

Why 2 ID????

rain heart
#

Top.gg provides the discord id is what I can only tell you, not sure why you have several different IDs

#

Ask them if they perhaps have voted with an alt account

#

because the ID it returns IS the user that is logged in and voting

late finch
#

Alright

#

Thanks for helping btw!

plucky lance
#

Make sure port 80 isn't in use already

#

And opened up

#

Where do you run the code? On your local PC or on a server?

rain heart
#

and :80 does not make any sense

#

80 is the default http port, aka does not require to be present since http:// is the protocol

plucky lance
#

Well that's your issue.

#

You would have to open up your local firewall for the request, set up your router to forward requests on the port to your PC and it also requires a real public IPv4 address.

#

If you wanna test something, then on a server.

#

Yeah

plucky lance
#

You pressed save before hitting the test button?

#

Auth is correct... etc?

restive otter
#

hey, when i install dblpy it mucks up my pycord for some reason which means my bot doesn't run, is there a way to fix this?

sullen nymph
#

install latest version of topggpy from GitHub

restive otter
restive otter
sullen nymph
#

Probs

#

I don't remember

#

Try it

restive otter
#

alright

sullen nymph
#

Last time I did Python was when dinosaurs were hanging out just outside my window

restive otter
#

lmfaoo

tidal idol
#

it works

restive otter
#

ye i was just about to say it worked

#

thanks!

restive otter
#

for listening for upvotes does it have to be in a cog?

violet sun
restive otter
violet sun
#

i will use pycord

#

what must I change to use pycord and topggpy?

restive otter
#

i had problems doing it so i did pip uninstall py-cord and uninstalled dblpy cause i already had it installed then i installed dblpy with pip install dblpy then i made sure i didnt have discord.py with pip uninstall discord.py then i reinstalled pycord with pip install git+https://github.com/Pycord-Development/pycord

violet sun
#

ok ok thx

#

i will try

restive otter
#

:))

violet sun
#

@restive otter

restive otter
violet sun
#

everytime i try to start my bot it says:

#

Requirement already satisfied: discord.py in ./.local/lib/python3.10/site-packages (from dblpy->-r requirements.txt (line 2)) (1.7.3)

restive otter
#

try

#

do

#

pip uninstall dblpy

#

then do

#

pip3 install git+https://github.com/top-gg/python-sdk/

#

you will need git

violet sun
#

ok

scarlet whale
#

I keep getting: 'topgg' has no attribute 'endpoint'
when trying to use @surreal sealgg.endpoint

On python btw
Am I missing something

rigid roost
#

Is the API supposed to return an empty object when I update a bot's stats?

rigid roost
#

I am making a cURL request.

late finch
#

I see

cursive zodiac
plucky lance
sullen nymph
#

@restive otter @violet sun the current package is topggpy not dblpy

sullen nymph
umbral garden
#

To connect top gg to the bot with the cog what do I do

muted viper
#
et!eval const fetch = require('node-fetch');
fetch(https://top.gg/api/bots/880317355627016232/check, { headers: { 'Authorization': "MY TOKEN IS HERE" } }).then(res => res.json()).then(data => {
  if(data.voted == true) {
    return message.channel.send("voted")
  } else {
message.channel.send("not voted")
}
}).catch(console.error);```

This sends not voted even tho i voted for it
nova sierra
#

why can't I search for my bot on the website

rigid roost
plucky lance
#

Also the URL needs to be a string

#

And make sure node-fetch is on version 2.5.x

#

Or you will have to include the package asynchronous

#

Oh… and you’re missing the content type

molten imp
#

Can you use the API to listen for Guild votes instead of bot votes?

tidal idol
#

yes

#

you just don't get an api key for guilds, which you don't need for webhooks

molten imp
#

Awesome, thank you!

scarlet whale
#
Error handling request
Traceback (most recent call last):
  File "/home/Discord/.venvs/discord/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/home/Discord/.venvs/discord/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/home/Discord/.venvs/discord/lib/python3.8/site-packages/topgg/webhook.py", line 161, in _handler
    await self._invoke_callback(
  File "/home/Discord/.venvs/discord/lib/python3.8/site-packages/topgg/data.py", line 136, in _invoke_callback
    signatures[k] = self._resolve_data(v.type)
  File "/home/Discord/.venvs/discord/lib/python3.8/site-packages/topgg/data.py", line 145, in _resolve_data
    return self._data[type_]
KeyError: <class 'nextcord.client.Client'>

When trying to do:

@topgg.endpoint("/dblwebhook", topgg.WebhookType.BOT, "secret")
    async def endpoint(vote_data: topgg.BotVoteData,
        Client: nextcord.Client = topgg.data(nextcord.Client),
    ):

(I also tried to pass my bot.client)

rain heart
#

Is the client initialised already?

scarlet whale
tidal idol
#

I don't think its nextcord.client

#

try just nextcord maybe

muted viper
scarlet whale
plucky lance
scarlet whale
rigid roost
# muted viper how to do it properly?

You could try this: ```js
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://top.gg/api/bots/<BOT_ID>/check?userId=<USER_ID>',
'headers': {
'Authorization': 'Bearer <TOP.GG_TOKEN>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

plucky lance
#

Your authorization header is wrong.

#

And you might wanna add the expected content type

rigid roost
plucky lance
#

You should take a look into the docs.

rigid roost
#

I did, and this works for me. I see no issues with it.

late finch
#

Just use topgg-autoposter its very simple to set up

dim kettle
late finch
#

Oh wait ik what you need

rigid roost
late finch
#
    const fetch = require("node-fetch");

    var headers = 
    {
      "Authorization": "Something hear not token"
    }
    const file = await fetch("https://top.gg/api/bots/<BOT_ID>/check?userId=<USER_ID>", { method: 'GET', headers: headers}).then((response) => response.json());
    file["voted"] //This is the amount of votes
#

Something like this

#

Oh wait

restive otter
#

how do i get my bot's top.gg token?

late finch
#

Go to edit - webhooks

restive otter
#

nvm got it

#

still thnx

late finch
#

Np

zealous vine
restive otter
restive otter
#

@rain heart sorry to ping but you seem to be the one to go for this: I followed your bot's tutorial for making the webhook listener (https://github.com/Hopefuls/LoggersBro-ExampleBot). When I run the test webhook event using Postman it returns the 200 code to the program but does not fire an event in the code (same result when I try to send a test webhook push from the top.gg settings page).

Is there some obvious step I am missing? or-

#

I tried to collect as much of the relevant code I use and send it, if there's something you're missing to make an informed opinion lmk...

rain heart
#

Try an actual vote instead of a test

restive otter
#

Alright- when it resets in the morning or sometime I’ll see if it accepts a vote. Cause for the life of me I cannot figure it out.

Even if it was a rest one, I figured it would set off the event in some way. But maybe not.

late finch
rain heart
#

it is not officially made by top.gg devs, but made by a moderator from top.gg

rigid roost
#

You have to write the code yourself to receive payloads from Top.gg.

rigid roost
#

Since the public URL of your project is reverse proxied to any port you bind; Just put in the public URL of your project.

zealous vine
plucky lance
#

Yes, you can require it a synchronously to use the latest versions or simply going with 2.6.x

#

It’s still a maintained version

#

Whatever you prefer

restive otter
#

Made my day.

naive anvil
sullen mortar
#

i dont undestand fully how can i do authorization thing with java
anyone can help me

#
public static boolean isVotedToBot(String id) {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder().uri(URI.create("https://top.gg/api/bots/mybotid/check?userId=" + id)).build();
        JSONObject json = null;
        try {
            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
            json = new JSONObject(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(json);
        assert json != null;
        int value = json.getInt("voted");
        return value == 1;
    }```
#

always getting
{"error":"Unauthorized"}

jaunty plank
#

looks like you are not including the authorization header

sullen mortar
#

i am not good at rest apis

jaunty plank
sullen mortar
sullen mortar
jaunty plank
#

yep

sullen mortar
#

but sometime its very slow to get result why?

rain heart
#

Related to your own connection likely

sullen mortar
#

hmm

#

i have bad connection 😄

#

i want give my method to here

#

if you want pin it for other peoples

#
public static boolean isVotedToBot(String id) {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://top.gg/api/bots/yourBotId/check?userId=" + id))
                .header("Authorization", "topGgToken")
                .build();
        JSONObject json = null;
        try {
            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
            json = new JSONObject(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
        assert json != null;
        int value = json.getInt("voted");
        return value == 1;
    }```
#

this for java developers

rain heart
#

There's also a Library for that so you don't have to go through the hassle of that

rain heart
sullen mortar
#

@rain heartis token topgg token ?

rain heart
#

Yes

sullen mortar
sullen mortar
#

@rain hearthow can i use return hasVoted in lambda

#

i am little beginner

rain heart
#

Should work, try it

sullen mortar
#

dont working

sullen mortar
rain heart
#

Hover over the red

sullen mortar
rain heart
sullen mortar
#

but i want do it with easy method

rain heart
#

Can't help then

sullen mortar
#

okey

pastel rune
#

why java

woven venture
#

How do I send a message to a channel when someone votes for my bot?

latent narwhal
#

Is there something like user.isVoted or hasVoted that can tell me if a user has voted in last x hours

rain heart
#

Only voted in the last 12 hours

latent narwhal
#

Ohokay, thanks

#

also is there a problem with TOPGG@SDK npm module

rain heart
#

Is it a testvote or an actual vote?

woven venture
#

thanks

wary gazelle
#

if anyone wants the code for top.gg webhook, can check my Github repo, from my discord profile; it works completely fine.

bitter basin
#

Hi!

#

Well, i implemented the Topgg api into my bot's code.
I'm using an interval to use the api api.postStats() function every 2.5 hours. It works just fine for some hours but then suddenly the console logs this error.

throw new ApiError_1.default(response.status, response.statusText, response);

TopGGAPIError: 524 undefined

at Api._request(/app/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)

at runMicrotasks(<anonymous>)

...... and lots of lines more
#

I already tried with the { AutoPoster } example but it is the same after some hours.

#

This is my the section i post the bot's data

#
setInterval(async () => {
    try{
      await Data.TopGG.postStats({
        serverCount: Client.guilds.cache.size,
        shardCount:  1
      }).then(stats => { console.log('Top.gg Stats Updated | %i Servers.', stats.serverCount) });
    }catch(err){
      console.error('Topgg API Error: ' + err);
    }
  }, 21600000);
steady mango
#

is that from today? you might have run into downtime we had, as that's a cloudflare error code

steady mango
#

discord was down for a bit too kek

bitter basin
#

Yeah i had some problems because i was updating my bot when that happened lol

#

Okay then, thank you for the help and support! :)

steady mango
#

yeah that's frustrating when you're already debugging networking stuff iara_hehe

#

no worries!

bitter basin
bitter basin
late finch
#

And set it up as it says to setup

#

much easier and post frequently

hazy hedge
#

is there a way to get the number of votes from the api? I used this but the number is not the same as on the top.gg website

let vots = await api.getVotes()
console.log(vots.length)
#

oh know why... on weekend votes counts double and a single user can vote multiple times

rain heart
#

Correct

#

If you want unique votes, use webhooks

hazy hedge
#

I just wanted to display some stats but I leave out votes ;)

thorny fable
#

From the docs:

#

const webhook = new Topgg.Webhook("your webhook auth")

#

what is my webhook auth?

#

the long token thing or the webhook pass?

#

damn im stupid

#

nvm

covert lark
#

is there data sent in the body

late finch
#

So does anyone have an alternative from www.integromat.com where it can generate a free webhook! But I also want it to work on other platforms and not just top.gg (ping when respond)

jaunty plank
#

Pretty much any bot host works with webhooks anyway.
I'm not sure of any alternatives but I would expect they exist

late finch
#

Webhooks on bots only work with localHost which makes it not being able to make a connection with top.gg

jaunty plank
#

localhost only means "me"
everything has a localhost, its not something that matters when using webhooks

#

all you really need is a public url, or ip.

late finch
#

ik how to make a public IP but I am using replit as a host

#

is there a webhook npm package that you can recommend me?

jaunty plank
#

replit comes with a public url

late finch
#

it does with express yes

#

but idk how you could use that link in order to receive info

jaunty plank
#

express is just a webserver, it can be a webhook, or any http stuff

late finch
#

yes ik I use uptimerbot to keep it running but how can you receive info and what info would it look like? And how can I use it to post?

jaunty plank
#

its pretty much the exact same to receive a webhook, just a post request which you look in the body.

late finch
#

"just a post request which you look in the body" and how exactly do I do that?

jaunty plank
late finch
#

So basicly like this?

#

But how would I change it for other providers

jaunty plank
#

that uses our library, you can just use express

#

make an endpoint for each webhook

late finch
#

I need to do research cause half of the words your saying dosen't make since to me 😅

vale snow
#

Hey so

#

how can I get the Webhook url?

#

in example it's like ```bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")

low oracle
#

Hi, how can I create an vote tracker with discord.js when someone voted a server?

low oracle
tidal idol
#

do you have a way of hosting the code?

low oracle
#

yes

tidal idol
#

How are you hosting it?

low oracle
#

In heroku.

tidal idol
#

http://<heroku url>/dblwebhook

low oracle
#

oh ok, let me try it

low oracle
low oracle
#

It's not working

#

Can someone help, How can I create a vote tracker with discord.js when someone voted a server?

rain heart
tidal idol
low oracle
tidal idol
#

its simple to setup, no hosting required

tropic ocean
#

how to get a token?

tropic ocean
#

thanks tho

low oracle
tropic ocean
#

how to like send a message to the user who voted?

rain heart
#

Use webhooks, use the id to fetch the user

#

Remember you cannot DM users that the bot does not have in mutual

simple shore
#

How do I find out if the user really voted for my bot?

jaunty plank
worldly aspen
tidal idol
leaden heath
#

Cant I access the webhooks before my bot gets approved?

jaunty plank
#

Nope

grave canopy
#

hey, how do i make a webhook?

jaunty plank
#

Programming language?

grave canopy
#

python

jaunty plank
#

Middle example shows how to make a webhook receiver

grave canopy
#

ive seen the doc, just cant figure out hot to make a webhook

#

like what should the webhook be

jaunty plank
#

Like the url?

grave canopy
#

just to the server or the topgg bot?

jaunty plank
#

Nope, it needs to be the url to your bots host

grave canopy
#

alr ty

jaunty plank
#

Typically http://yourbotsserverip:port/path

grave canopy
#

ok tysm!

restive otter
#

hey, how do i make a webhook?

grave canopy
#

language?

restive otter
#

Js

jaunty plank
covert lark
#

whats the api endpoint for getting the count of votes on a bot?

#

please ping me!

rain heart
#

should be the basic bots endpoint

#

aka api/bots/botid

covert lark
#

let me try

#

thanks!

thorny fable
#

ok boys

#

i need help

#

or girls

#

i've now tried for 5+ hours to get the vote receiver to work

#

but it doesnt

#

would this work without the express part?

dim kettle
thorny fable
#

no error

#

no response at all

dim kettle
dim kettle
thorny fable
#

yes

#

im only wanting it to send a simple message on discord

dim kettle
tidal idol
#

Made by Woo :)

dim kettle
# thorny fable yes

Could you try creating another POST route to check if the server accepting any calls?

thorny fable
#

sure

#

ok

#

so

thorny fable
#

but i kinda need my bot to register the vote

tropic ocean
tropic ocean
#

I accidentally added this now i can't remove it

restive otter
#

how long does it usually take for topgg to approve a bot submission

rain heart
tropic ocean
rain heart
#

Where does it say that

tropic ocean
#

wait

#

lemme send ss

tropic ocean
rain heart
#

Try putting something random then idk

tropic ocean
#

bruh

trail shale
#
let voted = 0;
      await fetch(`https://top.gg/api/bots/905134681199104020/check?userId=${message.author.id}`, {
        Headers: {
          "Authorization": "myAuthToken"
        }
      }).then(res => console.log(res))

Getting unauthorized

tidal idol
#

Not another bots

trail shale
#

yep, it's mine

rain heart
#

And the token being valid as well? Regenerate it and try again

restive otter
#

i just need a dummy bot so i can try out how the api wrapper works

wise ember
#

hi

restive otter
trail shale
#

Of course lol

verbal wyvern
#

So how do I use the API to increase the number of users/servers my bot is in?

rain heart
#

-servercount

abstract mothBOT
smoky jackal
#

-serverinfo

tidal idol
violet sun
#

hello. I wanna switch from discord.py to nextcord. But this doesnt work because I import topggpy and this import requires discord.py and discord packages

#

is there a alternative? PING ME ON REPLY PLS

cursive zodiac
#

do pip install --no-deps topggpy

#

that will install topggpy without needing to install discord and discord.py

violet sun
#

And will it work too?

cursive zodiac
#

try it lemme know if there is an error

fluid venture
#

💀

cursive zodiac
violet sun
#

its working

#

thx so much

cursive zodiac
#

np

restive otter
#
const Discord = require('discord.js');
//-----------------------------------------------\\
const client = new Discord.Client({
    intents: [new Discord.Intents('32767')],
    allowedMentions: { repliedUser: false }
})

client.conf = require("./config.json");;
client.login(process.env.token || client.conf.token);

const { AutoPoster } = require('topgg-autoposter')
const express = require('express')
const app = express() // Your express app
const Topgg = require('@top-gg/sdk')


AutoPoster(process.env.topggToken || client.conf.topggToken, client).on('posted', () => {
    console.log('Posted stats to Top.gg!')
})

const webhook = new Topgg.Webhook(process.env.topggAuth || client.conf.topggAuth)

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

    console.log(vote.user.id);
    
    let embed = new Discord.MessageEmbed()
        .setColor("BLUE")
        .setTimestamp()
        .setFooter({ text: client.user.username, iconURL: client.user.displayAvatarURL() })
        .setDescription(`**Thanks for the vote now you are boosted for 12 hours!**
            \n[Invite](https://discord.com/oauth2/authorize?client_id=${client.user.id}&permissions=1342185502&scope=bot%20applications.commands) ${client.user.username} to your server!`)

    vote.user.send({ embeds: [embed] }).catch(() => { })
}))

app.listen(8000)
#

why it doesnt work

restive otter
#

whats not working

#

Everything but autoposter works

#

any errors?

#

It doesnt send me voted user

#

because vote.user is a id

#

not a d.js user object

#

you have to fetch them

#

It doesnt send me even undefined

#

remove the .id from there

restive otter
#

where do you host your bot?

#

In my computer

#

you have to port forward

#

and test it somewhere else

#

Cannot Get /

#

localhost:8000

#

thats not port forwarding

#

google it™️

#

Can i ask where are you from?

#

turkey?

#

Türkçe anlatsana şunu :D

#

well cant speak turkish here so

#

dms

rustic stirrup
#

Test webhook does not seem to be working

tidal idol
#

is your webhook a discord webhook by any chance?

rustic stirrup
#

No

tidal idol
#

oh ok good

rustic stirrup
#
const webhook = new Topgg.Webhook('**code is here**')

app.post('/webhook', webhook.listener(vote => {
    bot.logWebhook.send(`${vote.user} has voted!`)
    console.log(vote.user)
}))

app.listen(80)

My code

tidal idol
#

make sure you did http and not https on the topgg page

rustic stirrup
#

Port is correct. Ip is correct

tidal idol
#

Try sending a request through Postman or something

rustic stirrup
#

Postman?

tidal idol
#

If using VisualStudio, try Thunder client (free extension)

rain heart
#

test vote may not work, try an actual vote

rustic stirrup
#

I don't have anyone to test 💀

rustic stirrup
rustic stirrup
#

It is working now all of a sudden??? Oh well

#

Does the bot only ever send the post for a vote once?

rain heart
#

it only sends the request on unique votes

#

it counts as 2 during the weekend, but still makes only one request

rustic stirrup
rain heart
#

thats what the main intention of the webhook is, yes

rustic stirrup
#

Also whats the weekend boolean stored as

#

Or is it not part of the post data anymore

rain heart
#

it is, just not on the test votes

rustic stirrup
#

Is it vote.weekend?

rain heart
#

isWeekend

#

refer to the docs

clever dust
#

HAhaa i just want to ask who had the great idea of installing dpy automatically with topgg package on python ver, all my files getting mixed with the fork and original dpy , now the question is how to install the topgg alone (i installed it first via pip)

clever dust
thin nova
#

it said to look here

#

like the website

tidal idol
thin nova
#

k thx

wispy jetty
#

hello how can i post the guild count for my bot to my bots page

#

is there library or can i use the raw api

restive otter
tidal idol
#

look there

restive otter
tidal idol
wispy jetty
#

okay my server count posting works, but on the website its not visible. can i do anything, that it is visible?

fluid venture
#

prolly server cached

wispy jetty
#

yes now its there

rustic stirrup
#

Can you get how many votes your bot has?

rustic stirrup
fluid venture
#

just fetch that endpoint and store data in a variable?

pastel rune
#

when using this

#
    dbl.postStats({
        serverCount: client.guilds.size,
        shardCount: client.shards.size
    });```
tidal idol
#

Yes

pastel rune
#

ok, guessing it takes sometime to update then? getting 401

restive otter
#

anyone else noticed certain votes registering twice? ever since the API became unstable we've been receiving double vote events randomly

jaunty plank
restive otter
#

it's not like it's a common thing

#

most of these aren't duplicates, i just found it strange so i figured i'd ask in case anyone else had noticed it

jaunty plank
#

its possible the response isnt being received in rare cases? not seen it happen before.

restive otter
pastel rune
#

how long does it take for top.gg bot tokens to be valid and not get a 401 response, after verification?

restive otter
jaunty plank
teal river
#

is @top-gg/sdk the official nodejs library for top.gg?

tidal idol
#

yes

teal river
#

ok, is there a way I can check if the user voted and maybe send a message on a specific channel?

jaunty plank
#

Best to use webhooks for that

teal river
#

what do i have to put on your webhook auth?

pastel rune
# teal river thanks

webhook or

const TOP_GG = require('@top-gg/sdk');
const TOP_GG_API = new TOP_GG.Api('YOUR-TOKEN');

async function didUserVote(USERID) {
  const voted = await TOP_GG_API.hasVoted(USERID);
  return voted ? 'Thanks for voting!' : 'Please vote';
}
#

https://top.gg/bot/BOTID/webhooks

#

the token in there

teal river
#

ok

#

thx

#

and on the authorization field (on the website?)

jaunty plank
old kernel
#

I need to set vote log and reminder for my bot too

restive otter
#

i might as well post a template on github for people to use

#

i'll do it when i have the time

old kernel
#

Oh sure

restive otter
#

it's on my to-do list now, i'll post it here when i do it

jaunty plank
#

We do have examples on the docs too

restive otter
#

^^^^

jaunty plank
old kernel
#

But its complicated on topgg docs

thorn hearth
jaunty plank
thorn hearth
jaunty plank
#

are you posting stats for the same bot you got the token from?

jaunty plank
#

try going to your bots webhook page and regenerating the token and using the new one

jaunty plank
old kernel
#

👍

thorn hearth
jaunty plank
#

it can take some time to update

thorn hearth
#

It more than 20min dn

#

@jaunty plank

jaunty plank
#

30 minutes to a few hours is typically how long it can take to update

ebon panther
#

what is the http link for this?

rain heart
#

See the title of the code block

ebon panther
tulip sinew
#

Ello I am having a little issue with vote webhooks.
I coded it and when i used the "send test" button, it logs the test vote object but when a user actually votes, it doesn't log anything.

#

tried to vote several times asking different users. But no luck

#

trying to make the bot give rewards when a user votes automatically

late finch
#

Have you tried saving the webhook?

#

Like when you sent a test and the button right beside it "Save"

#

You clicked that to apply the webhook to your bot

wild jewel
#

How can I fix this error
Error

    at Api._request (D:\Downloads\Rovotic\Rovotic v13 orignal tester\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)```
**code in a command file**
```js
let voted = client.topgg.hasVoted(message.author.id);

        if(!voted){
            message.channel.send({content: "You need to first vote me on top.gg"})
        } else{}```
**Index.js code**
```js
const Topgg = require ("@top-gg/sdk")
client.topgg = new Topgg.api("top.gg token here")```
jaunty plank
wild jewel
#

after putting and when i run my command it shows this error

jaunty plank
#

Try regenerating the token and using the new one.

wild jewel
jaunty plank
#

I'm not sure why it would give a 401.
My experience with the sdk is out of date, so I'm not really sure how to help further.

wild jewel
#

oh k

#

idk some one also reported before me abt this 401 error

last geyser
#

I couldnt get what I supposed to put in here

jaunty plank
#

It depends on your host

wild jewel
last geyser
#

I made the bot on glitch?

jaunty plank
#

Hosting bots is against glitch tos

last geyser
#

no no i mean i coded the bot on glitch not hosting

#

my hosting site is named goveri

#

so what am i going to write there

jaunty plank
#

Like a vps? Which you get a private ip?
Or is it a webhost

last geyser
#

webhost

jaunty plank
#

Do they provide a public url to your project?

last geyser
#

I am not sure need to ask

jaunty plank
#

It's probably going to be 'projecturl/path'

ebon panther
#

Do you guys know what the http link for this is?

tulip sinew
jaunty plank
#

A copy url button exists above that part

ebon panther
jaunty plank
#

the search via api is probably just not reliable right now.

tidal idol
#

i remember a few months ago trying to use, still same results

grizzled wasp
#

what is the voting api?

plucky lance
#

You can’t vote using the API

#

Only clients can vote themselves

grizzled wasp
#

not

#

the api that outputs a message after the vote

plucky lance
#

The API docs are pinned in this channel

old kernel
#
const express = require('express')
const { Webhook } = require('@top-gg/sdk')

const wh = new Webhook('anyPassword')
const app = express()

app.post('/webhook', wh.listener((vote) => {
  console.log(vote.user) // 172075838806818817
}))

app.listen(80)
#

is there any way to put token and send a test

restive otter
old kernel
#

I am unable to get vote user id in console log

restive otter
old kernel
#

am test through pc at this time

#

after that i put this in galaxy gate

restive otter
old kernel
#

if have a port?

restive otter
#

what

old kernel
#

i have a vps

#

and port

#

too

restive otter
#

then do your testing in your vps

old kernel
#

oh and then?

restive otter
#

put your vps ip and port

#

like this: http://ip:port/dblwebhook

#

and put the password in too

old kernel
#

after that ?

restive otter
#

then test it...?

old kernel
#

i didn't get it voter id

restive otter
#

did you even save it first

old kernel
#

yes

restive otter
#

did you even put your webhook code in your vps

old kernel
#

yes

#

and its running too on my port

restive otter
#

can you give me your vps link in dms?

dusk swan
#

what's the api limit for vote checking

old kernel
#

how can i get a user details by discord api?

jaunty plank
bitter basin
# jaunty plank Use your bot library

Is there a way to catch the api errors outside functions? Like, i know i can catch errors when posting or requesting some data, but what about cloudflare errors and stuff. Is there a way to catch them on like, an 'error' event?

#

I looked around but couldn't find anything on docs

rain heart
#

The API doesn't have that iirc, do that yourself by making your own API wrapper and checking if the status code is alright

old kernel
#

How can we get total number of votes for a user

#

?

restive otter
old kernel
#

Ok

#

Then what topgg give us

#

Only id of user?

restive otter
#

¯_(ツ)_/¯

grizzled wasp
#

how do I do that

restive otter
#

i cant read

grizzled wasp
junior lintel
lofty talon
#

Trying to setup the api on my bot, when I try to get my token from the webhooks page there is no token when I click reveal

#

Is the token my bots token from the dev portal or does top.gg have their own special one

lofty talon
#

I have

rain heart
#

Refresh after doing so

haughty peak
#

Guyzzz

#

Whats the url

#

for

#

v1 of docs

jaunty plank
#

v1 isnt released yet

haughty peak
#

Oh

jaunty plank
#

still on v0

haughty peak
#

Oky

haughty peak
#

when release v1

restive otter
#

hello
I want help with the top.gg API
can we change the API cooldown
like changing 12-hour vote to 24 hour?

restive otter
#

umm ok

tulip jolt
#

Is there an évent emitted when someone's vote expires ?

rain heart
#

There's not, no

#

you have to track that yourself using the webhooks

tulip jolt
#

Ok

#

Ty

misty hazel
#

Help

#

Literally vote is bs

tidal idol
misty hazel
#

Vote works on mobile right?

tidal idol
misty hazel
#

Ok it worked

haughty peak
#

my webhook isnt receiving events :/

#

twas receiving yesterday tho

rain heart
#

test your webhook by using a request client such as postman

#

the test vote button may not work or get through very late

grave ridge
#

how can i get the vote count of my bot?

merry epoch
restive otter
hearty ore
#

can i have the example POST data sent to a webhook?

hearty ore
#

perfect, thanks

urban vapor
#

im so lost

#

lol

#

can someone help me

jaunty plank
#

so what are you lost on?

urban vapor
#

this whole form im lost

jaunty plank
#

webhook url is the url to your server

#

http://yourIP:port/path
^ if your hosting on a vps or home

#

or anything that provides an ip

urban vapor
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

its this

#

coz i use javascript

jaunty plank
#

thats the code for a webhook listener yes

urban vapor
#

ohhhh

#

so what does that do

#

xD

#

it checks the user voteedd

#

and sends user has voted

jaunty plank
#

it listens for incoming webhooks, as an event that you can then add code to

#

yeah

urban vapor
#

oh ok

jaunty plank
#

it doesnt check anything really, top.gg sends the request to you

#

its effectively a website, but made for servers to send data to each other hence the name webhook