#topgg-api

1 messages · Page 158 of 1

misty wind
#

Thanks for the help 👍

tacit phoenix
#

np

misty wind
#

Will port be a random number between 1024 and 49000 ? OR it should also be extracted like IP?

#

ValueError: path should be started with / or be empty
Its says ^
Should I just do /dblwebhook ?

tacit phoenix
#

show the line where you create the webhook

misty wind
#

Hmm 👍

#
client.topggpy = topgg.DBLClient(client, dbl_token)
client.topgg_webhook = topgg.WebhookManager(client).dbl_webhook("/dblwebhook", "The Auth token I added from the webhooks page")
client.topgg_webhook.run(3000)  # this method can be awaited as well
tacit phoenix
misty wind
#

Same, trying again and again.

#
import topgg
import discord
from discord.ext import commands
# This example uses topggpy's webhook system.
# The port must be a number between 1024 and 49151.

bot = commands.Bot(command_prefix=">")

dbl_token = 'BOT TOP.GG TOKEN HERE'  # set this to your bot's Top.gg token
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "AUTH PASSWORD HERE")
bot.topgg_webhook.run(3000)  # this method can be awaited as well

@bot.event
async def on_ready():
    print("Working.")

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

@bot.event
async def on_dbl_test(data):
    print(f"Received a test vote:\n{data}")

bot.run("BOT TOKEN HERE")
misty wind
#

Btw are we supposted to run the bot as we usually do or go check at the webhook url for the printed statements?

frigid hornet
#

👍

misty wind
sullen nymph
#

Gods of webhooks do not like you

restive otter
#

You probably put the wrong URL/authorization or the port is not open

#

Make sure to hit the save button bloblul

misty wind
restive otter
#

Are you self-hosting it?

misty wind
restive otter
misty wind
#

I tried opening a port through windows firewall, eventhough it was added.
The code is not responding to that port neither does the website canyouseeme.org!

sullen nymph
#

Have you redirected your port to your device in your router settings

misty wind
sullen nymph
#

I'd suggest asking Google and specifying your router model

misty wind
#

Oof. Confused 😕 now! Are you talking about port forwarding or take change settings in router settings?

coarse rune
#
webhook.listener is not a function``` this is my error pls help
misty wind
sullen nymph
#

Mhm

misty wind
# sullen nymph Mhm

I dont exactly understand from which port to which port i must forward 😖

sullen nymph
#

Port range?

#

3000 in both min and max 👀

misty wind
sullen nymph
#

Uhhhhhh

#

Probably

sullen nymph
#

What's your node SDK version

obsidian robin
#

@rain heart

coarse rune
restive otter
#

How can we setup vote rewards for my bot on discord.js

coarse rune
restive otter
#

Can anyone help me with setting up of vote rewards to my bot verified on top.gg

vale folio
#

I have little problem with @top-gg/sdk npm module,

#

when I substract 1000 server, top.gg server count too

#

I need to set "2800" to have the good server count

willow sphinx
#

fyi you will get banned if you're faking bot stats. This should be very obvious

lunar helm
rain heart
#

Well not illegal to manually post your server count

#

Just illegal to wrongly post it in the sense of showing up as having more servers than the actual count

vale folio
#

8143

#

¯_(ツ)_/¯

rain heart
#

Are you getting any errors?

vale folio
#

No

#

But in the top.gg server count it’s 13k

#

I don’t send 13k

#

And when i send 2,5k, this is 8k on top.gg

#

This is glitched

rain heart
#

Remove your shard count posting

vale folio
vale folio
vale folio
vale folio
# vale folio

I have set shardCount to 1 and the real count are posted

plucky lance
#

Take a look at the docs which are pinned in the channel.

polar birch
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.

jolly hornet
#

?

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jolly hornet
#

o

scarlet cobalt
#

One message removed from a suspended account.

vale folio
#

But I don't post top.gg stats with the bot but with another process

scarlet cobalt
#

One message removed from a suspended account.

vale folio
scarlet cobalt
#

One message removed from a suspended account.

vale folio
#

I using clusters

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

vale folio
#

(All of my shards are not on the same vps, so I using my own api to post stats)

scarlet cobalt
#

One message removed from a suspended account.

vale folio
#

@scarlet cobalt on 2 differents shards

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

uncut granite
restive otter
restive otter
#

can some one help i have done this but i wont work

ruby grotto
#

can some one help its not working

@commands.Cog.listener()
async def on_dbl_test(self):
  print("A vote test has ran succesfully!")
#
from inspect import currentframe
import dbl
import discord
import aiohttp
from config import config
from datetime import datetime, timedelta
from discord.ext import commands, tasks
from discord import Webhook, AsyncWebhookAdapter


class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = config.dbl_token
        self.auth = config.dbl_auth
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook',webhook_auth=self.auth, webhook_port=5000, autopost=True)



    @commands.Cog.listener()
    async def on_dbl_test(self):
        print("A vote test has ran succesfully!")

    @commands.Cog.listener()
    async def on_guild_post(self):
        c = self.bot.get_channel(853929631459573788)
        await c.send(f"Posted guild count: {len(self.bot.guilds)}")

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print("A vote test has ran succesfully!")
        user = await self.bot.fetch_user(int(data['user']))

        embed = discord.Embed(description=f"**{user} `[{data['user']}]`** just voted for **Alpha**", colour=config.colour)
        async with aiohttp.ClientSession() as session:
            url = "url"
            webhook = Webhook.from_url(url, adapter=AsyncWebhookAdapter(session))
            await webhook.send(embed= embed,avatar_url=self.bot.user.avatar_url)

def setup(bot):
    bot.add_cog(TopGG(bot))
sullen nymph
#

Any errors?

ruby grotto
#

nope

twin oxide
#

How do i find total vote counts of my bot?? Im using @top-gg/sdk for posting and vote logging

brave pumice
#

Is it ok to make stats update every second?

restive otter
#

How can I setup vote rewards for my bot

brave pumice
#

Just don’t wanna make another interval for redis

plucky lance
#

I mean 60/min requests is the API limit for /bots

hoary briar
#

it was my bad ok

safe comet
#

what does "your webhook auth" means???

#

how do i setup webhooks for server with the api bonk

#

oh wait nvm checked pins

coarse rune
#

Go to your bots page. Click edit. Click on webhooks. And there will be auth. Copy that. Done

safe comet
#

im not using a bot im using a server bonk

#

anyways i figured it out

coarse rune
#

Oh

#

Ok

#

@safe comet Do u use js or py?

safe comet
#

js

safe comet
#

does testing ur webhook frequently count as api spam

safe comet
#

can anyone help?

scarlet cobalt
#

One message removed from a suspended account.

safe comet
#

henlo, anyways if a lot ppl votes at the same time would i get ratelimited noobthonk

twin oxide
safe comet
#

is there a way for the api to check if the user's cd for voting is finished for server/bot if so how

ruby grotto
sullen nymph
#

Do you have any error handlers

ruby grotto
#

yep

sullen nymph
#

Show them

restive otter
#

can anyone example guilds stat

ruby grotto
# sullen nymph Show them
@commands.Cog.listener()
    async def on_command_error(self,ctx,error):
        """ error-handeler for commands"""
        if isinstance(error, commands.BotMissingPermissions):
            permissions = '\n'.join(
                [f'> {permission}' for permission in error.missing_perms])
            message = f'{config.xmark} | I am missing **`{permissions}`** permissions to run the command `{ctx.command}`.\n'
            try:
                await ctx.send(message)
            except discord.Forbidden:
                try:
                    await ctx.author.send(f"Hey It looks like, I can't send messages in that channel.\nAlso I am misssing **`{permissions}`** permissions to run the command.")
                except discord.Forbidden:
                    pass
            return

        elif isinstance(error, commands.DisabledCommand):
            await ctx.send(f'{config.xmark}| This command has been disabled.')
            return

        elif isinstance(error, commands.MemberNotFound):
            return await ctx.send(f"{config.xmark} | Mention user properly.")
        elif isinstance(error, commands.ChannelNotFound):
            return await ctx.send(f"{config.xmark} | Mention channel properly.")

        elif isinstance(error, commands.MissingPermissions):
            missing = [perm.replace('_', ' ').replace('guild', 'server').title() for perm in error.missing_perms]
            if len(missing) > 2:
                fmt = '{}, and {}'.format("`, `".join(missing[:-1]), missing[-1])
            else:
                fmt = ' and '.join(missing)
            _message = f'{config.xmark}| You need the `{fmt}` permission(s) to use this command.'
            await ctx.send(_message)
            return
        
        elif isinstance(error, exceptions.AlphaError):
            return await ctx.send(error.__str__().format(ctx=ctx))

        elif isinstance(error, errors.MissingRequiredArgument):
            await ctx.send(f'{config.xmark} | You missed the `{error.param.name}` argument.')
            helper = str(ctx.invoked_subcommand) if ctx.invoked_subcommand else str(ctx.command)
            return await ctx.send_help(helper)

        elif isinstance(error, commands.CommandNotFound):
            return
        
        else:
            raise error
ruby grotto
#

@sullen nymph

sullen nymph
#

That's commands, not general errors

crisp socket
#

Hey! So I hit the test button on the webhook page, but I don't see anything

#

Am I looking in the wrong place?

#

I was trying to see if the webhook is working

crisp socket
#

Receiving votes

#

I did that

#

What's with code here?

#

I haven't set anything yet

#

I only clicked test

#

Should I put the code and then this?

ruby grotto
#
class TopGG(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = config.dbl_token
        self.auth = config.dbl_auth
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook',webhook_auth=self.auth, webhook_port=5000, autopost=True)

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print("A vote test has ran succesfully!")
        user = await self.bot.fetch_user(int(data['user']))

        embed = discord.Embed(description=f"**{user} `[{data['user']}]`** just voted", colour=config.colour)
        async with aiohttp.ClientSession() as session:
            url = "url"
            webhook = Webhook.from_url(url, adapter=AsyncWebhookAdapter(session))
            await webhook.send(embed= embed,avatar_url=self.bot.user.avatar_url)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print("A vote test has ran succesfully!")
        user = await self.bot.fetch_user(int(data['user']))

        embed = discord.Embed(description=f"**{user} `[{data['user']}]`** just voted", colour=config.colour)
        async with aiohttp.ClientSession() as session:
            url = "url"
            webhook = Webhook.from_url(url, adapter=AsyncWebhookAdapter(session))
            await webhook.send(embed= embed,avatar_url=self.bot.user.avatar_url)
#

vps

#

url of webhook created in channel

sullen nymph
#

Good job

#

Do you know what a webhook is in general

ruby grotto
#

HTTP push api?

sullen nymph
#

That's one way of putting it

#

Now, why do you think dblpy wants you to use a port

#

Anyhow, you need your VPS' IP and the port you use

crisp socket
#

Where does the IP go?

sullen nymph
#

In the URL

crisp socket
ruby grotto
sullen nymph
crisp socket
sullen nymph
#

Most popular Top.gg libraries handle that for you with abstracted webhook helpers, like Webhook the JS SDK and WebhookManager in Python SDK

crisp socket
#

Is there a documentation on this?

ruby grotto
# ruby grotto

@sullen nymph i have done this.
on_guild_post is working
but on_dbl_test is not working

sullen nymph
#

All libraries have appropriate documentations, which you can find in top.gg docs

sullen nymph
#

If it's a Discord one you failed

crisp socket
#

Then where would I get a webhook URL?

#

I got my IP

sullen nymph
#

http://yourip:yourport/yourpath

ruby grotto
crisp socket
#

That makes more sense. Sorry I was just a bit too confused about this.

sullen nymph
crisp socket
#

Wait so I'd be required to create dblwebhook (or whatever), and run that server?

sullen nymph
#

Essentially, you would run a webserver on some port, where it would handle a specific route (/dblwebhook)

sullen nymph
#

And then keep your virtual server on 24/7

ruby grotto
#

yep as bot is also hosted there

crisp socket
#

I do have a vps, I have one path for my bot. I would require a separate path for the webhooks?

sullen nymph
#

It's a specific route handled by your webserver, no folders or that kind of crap if that's what you mean

#

aka ip:port/oneroute and ip:port/anotherroute would be handled differently

crisp socket
#

Yeah okay, but I'm not required to create anything on my vps right?

#

I checked for an open port

#

I got one

sullen nymph
#

Not anything too complex I'd say

crisp socket
#

Uh okay

sullen nymph
#

Open port in your firewall, make sure your webhook is running

#

That's aboutnit

crisp socket
#

make sure your webhook is running
That's what I'm still a bit confused about

sullen nymph
#

The definition of a webhook?

#

Just a webserver that does whatever on a received request

crisp socket
#

How do I know if it's running

ruby grotto
#

@sullen nymph

sullen nymph
#

You have your browser and your INTERNET poggythumbsup

crisp socket
sullen nymph
#

ip:port/whateverpathyouhandle in your browser and you'll get some response if it works

sullen nymph
crisp socket
sullen nymph
#

Mmmm that's not good

#

What does your code look like

crisp socket
#

Wait the port should be between 1024 and 49151?

sullen nymph
#

Eh it can be below 1024 but not advised

crisp socket
#

HTTP takes 80

sullen nymph
#

5000 and 3000 are most commonly used

crisp socket
#

That's what's open for me

sullen nymph
#

No open 5000 or 3000?

crisp socket
sullen nymph
#

Are you able to open them?

crisp socket
#

Lemme try

crisp socket
sullen nymph
#

F

#

I host my idiotic webserver on port 80 since I shut down my Apache server so shrug

ruby grotto
#

...

crisp socket
#

So 80 works?

#

oop okay

crisp socket
ruby grotto
#

can someone help me???

sullen nymph
crisp socket
#

welp

sullen nymph
#

@ruby grotto DM me what your entered Authorization and URL values are

crisp socket
#

That's like the one open port I found

#

Smh

sullen nymph
#

Just turn it off KEKW

crisp socket
#

How

sullen nymph
#

Visit its main page, it should say something

crisp socket
#

I tried going to that page

#

Wait

#

It's the apache default page

sullen nymph
#

Yeah

#

Google can help you with that

crisp socket
restive otter
#

what is topgg api?

rain heart
surreal wren
#

the top.gg/api/bots/botID/check?userId= endpoint is being so slow
it almost takes 15 seconds when I do a get request from the bot or open it in my browser

can u check if its a problem on ur side

#

here's the url i was using https://top.gg/api/bots/751100444188737617/check?userId=558861606063308822

rain heart
#

to be honest, kinda expecting that on 373 monthly votes

#

though shouldn't be that long

tight oyster
#

I would like to send a direct message to anyone who votes for my bot.

elfin ore
#

i declined the first time top gg asked to send voting notif. now i want to enable them. how do i do that? (redirected here)

safe comet
#

what does the api do bonk

#

also how do i know if i get ratelimited

surreal wren
primal kindle
#

when my bot will aprove plz tell anyone

crisp socket
primal kindle
#

oo

#

thx

restive otter
#

is there a api that can access top.gg database?
(Read)

thorny fractal
#

whats a webhook path

#

where can i get that ?

spice helm
thorny fractal
spice helm
#

ok, then your webhook URL will probably be http://<ip>:<port>/dblwebhook, the dblwebhook part might change depending on which path you chose

spice helm
#

the ip of the machine your running the code on

thorny fractal
#

kk

spice helm
#

if its your own pc you might need to open a port on your router, and you should check if you have a static or dynamic IP

thorny fractal
#

and that dblwebhook ?

spice helm
#

yeah

thorny fractal
#

"if its your own pc" lost me after this

spice helm
#

i assume you're using a router at home?

thorny fractal
spice helm
#

alright, well by default those routers don't allow connections from the internet directly to your computer, you'll have to open the port on the router in the router settings

#

and you need to check if you have a static or dynamic ip, because if its dynamic it will change and top.gg won't be able to send webhooks to you

balmy hamlet
spice helm
# balmy hamlet ?

the process is different if using a home computer or something like a vps

balmy hamlet
#

I know

spice helm
#

oh

balmy hamlet
#

I'm asking bc they said "lost me after this"

spice helm
#

ah right

spice helm
thorny fractal
#

i just need a way to make some commands only for voters

spice helm
#

its a pain, how many votes are you getting per month? i have a server less solution that works provided you get less than 500 votes per month

thorny fractal
#

i get 80 approx

#

may be 100 sometime and sometimes not

spice helm
thorny fractal
#

kk

thorny fractal
#

am i doing it right ?

spice helm
#

i don't understand what you mean

#

are you using the intergromat URL?

thorny fractal
spice helm
#

that's odd, did you save it?

thorny fractal
spice helm
thorny fractal
spice helm
#

oh right, well i can't see why it doesn't work

thorny fractal
spice helm
#

I dont understand

thorny fractal
#
Once a webhook has been delivered, you can perform actions with this data, just put your mouse over the right of the webhook icon so it highlights the little circle and click it, you'll see another question mark. Press add another module and search through to see what you would like to do, if it does not exist, you can use the HTTP module and use an API for the service.
#

http module ?

spice helm
#

Oh, see if the pictures help ypu

thorny fractal
spice helm
#

Im not sure, see if theres a picture for the step you are on

thorny fractal
spice helm
#

Hmm, let me find something

thorny fractal
#

oo ty ty

gray vault
#

@spice helmwhat to fill in here?

spice helm
gray vault
#

alright, thanks

gray vault
spice helm
#

Ah, it should still work, i think

gray vault
#

okay, do u know one here who did that and is 100% sure?

spice helm
#

I dont know sorry

gray vault
#

okay.
........................

who knows how to set up a bot to track voting for a server?

plucky lance
#

You gonna setup a webhook service and listen to the POSTs from topgg

#

You have to enter the public IP or DNS of your webhook service in topgg as well in order to receive webhooks

#

That’s pretty much all

#

Oh and make sure your firewall is setup properly.
The webhook service needs an open TCP port (you choose)

pseudo junco
vital sphinx
livid lynx
#

.nw egirl_pex

restive otter
#

Someone pls send the docs for py ty on and ping me pls

rain heart
restive otter
#

@rain heart thx 🙏

#

Can I use this : ```import topgg

This example uses topggpy's webhook system.

The port must be a number between 1024 and 49151.

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

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

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

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

restive otter
#

So do I put the server token ?

#

Pls ping me if I get a reply

crisp hound
#

can someone help me setup webhooks inside of my bot?

coarse rune
#

How to check the amount of votes of a server discord.js

sullen nymph
#

Either scraping or webhooks

#

DSL doesn't have an API to retrieve information about servers

coarse rune
#

Ok

#

And can someone help me with webhooks discord.js

crisp hound
#

bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password") what's "/dblwebhook", "password" values here?

rocky nacelle
#

yo , the reward role thing isn't working for me

#

it says the dsl cannot manager roles

vale snow
#

hey uh

#

to test something should i just reboot my main bot(which is bad) or can i use another bot to test out the api and stuff

#

okay i guess i'll run the main bot on my pc with a new file

sullen nymph
#

route/path is first, auth is second

crisp hound
#

can the discord webhook url be provided in path?

sullen nymph
#

Negative

#

It's a route on YOUR VPS

crisp hound
#

I got heroku so won't work for me it seems

sullen nymph
#

Since you host a webserver yourself and make it the middleman

crisp hound
#

heroku no constant IP

sullen nymph
#

It will. Your port will be whatever os.environ['PORT'] returns.

As for the IPx you literally get a URL to your app, not an IP

crisp hound
#

can u help me set that up in the dm?

sullen nymph
#

@pastel raptor

#

Multiple channels

chilly junco
#

Toto

bright maple
#

Error in voting?

rain heart
#

that information doesn't help much

#

what's the issue you're facing

restive otter
#

How to get my server token?

rain heart
#

servers do not have an api

fiery wraith
sudden pier
#

You can use ${vote.user} to obtain the voter’s ID but are we able to obtain how many votes the user has(per month & lifetime)?

willow sphinx
#

you have to keep track of that on your own with webhooks

sudden pier
#

Okay.

gray vault
#

I need help from a pro bot dev please

#

@willow sphinxmaybe u, since it's about voting.

#

how to add a vote-tracking feature for a server using a bot?

gray vault
#

@rain heartthat has nothing I could see to help me

spice helm
random elm
stable helm
#

Will anyone help me to do this...

crisp socket
#

What's Shards?

rain heart
#

-servercount

abstract mothBOT
rain heart
#

Aka a full vote cycle, which is 12 hours

random elm
#

Thanks 👍

sullen nymph
#

Of course the only time I forget to scroll down

mighty plinth
#

-servercount

rain heart
#

read the message above

ebon shale
#

hi guys, can you give me a vote notification code for top.gg that will work in the virtual machine?

spice helm
# ebon shale hi guys, can you give me a vote notification code for top.gg that will work in t...

i'm not sure what you mean by vote notification code, and any code that works on a regular machine should work on a virtual machine, if you want to be notified when someone votes, you can set up a voting webhook and forward it to discord everytime using this : https://comhad.github.io/webhook.html?page=serverless

Two simple tutorials for setting up webhooks, both with or without a server

gray vault
#

@spice helmdoes it need any special things? or any bot dev can do it?

spice helm
gray vault
#

okay, thanks bro:)

random elm
#

Can top.gg send webhooks to ipv6 adresses?

random elm
#

And I was wondering, how does top.gg knows that the server count is real, as anyone could state that their bot is in 100M servers?

weak wyvern
#

hi guys, so i was using top.gg, died for like 3 month, retured and everything changed. can someone tell me how to use the server count thing?

slow coral
#

rs 6888940316

#

Rs 6888940316

carmine ridge
#

hello. i want to make a webhook that will give a vote role , any video guide or something (thank you 🙏 )

spice helm
restive otter
#

is the event on_dbl_vote immediately called when someone votes? (python)

terse elbow
#

Every time I try and do

await ctx.send(f"I have {await self.bot.topggpy.get_bot_votes()} votes on top.gg!")

I get

Ignoring exception in command votes:
Traceback (most recent call last):
  File "/home/the1calc/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot.py", line 122, in votes
    await ctx.send(f"I have {await self.bot.topggpy.get_bot_votes()} votes on top.gg!",
  File "/home/the1calc/.local/lib/python3.8/site-packages/topgg/client.py", line 250, in get_bot_votes
    response = await self.http.get_bot_votes(self.bot_id)
  File "/home/the1calc/.local/lib/python3.8/site-packages/topgg/http.py", line 191, in get_bot_votes
    return await self.request("GET", f"/bots/{bot_id}/votes")
  File "/home/the1calc/.local/lib/python3.8/site-packages/topgg/http.py", line 121, in request
    data = await _json_or_text(resp)
  File "/home/the1calc/.local/lib/python3.8/site-packages/topgg/http.py", line 59, in _json_or_text
    return DataDict(**json.loads(text))
TypeError: type object argument after ** must be a mapping, not list```
terse elbow
#

damn

restive otter
#

@terse elbow I don't have the solution but you can maybe do a request to https://top.gg/api/bots/(bot ID)/votes/ and don't forget to put header "Authorization" with your dbl token

restive otter
terse elbow
restive otter
#

How Do I Count Library

#

Using Top-gg Autoposter

jaunty scaffold
#

?

pure jackal
#

is there a way to get the Ratings & Reviews of a bot from top,gg api ?

#

or will have to manually scrape it ?

sharp hollow
#

@Dɾαɠσɳιȥҽԃριȥȥα

#

@keen lava

keen lava
sharp hollow
#

nothing

old kernel
#

how to create webhook for post vote

shy vortex
#

deno support when

#

actually duck it im doing it myself

#

Ik they will refuse to add support for deno

#

so im just doing it myself cya

#

lol

raven cypress
#

how can I create webhook?

smoky marten
frigid gorge
#

create a WEBHOOK with the top.gg api for a server and the same thing as creating a WEBHOOK for a bot?

fiery wraith
#

Nope

#

I think it’s dsl and dbl

#

The difference

rain heart
#

They're technically the same, just different data formats

#

Check the docs about the webhook schema

narrow vector
#

what is the base link to the API?

restive otter
keen kindle
#

I got a question. Can anybody here teach me how to link a voting site to a bot? Like when you vote for dank memer, it gives you daily boxes.

lone sun
#

How to check if someone actually voted for my bot?

brittle grove
lone sun
#

How do i setup the webhook?

keen kindle
brittle grove
#

np

lone sun
#

What should my webhook url be?

smoky marten
lone sun
#

If its not a vps? @smoky marten

smoky marten
#

where is the server hosted ?

#

Your PC ?
AWS Lambda ?
GCP ?
AZURE ?
REPL IT ?
HEROKU ?

tidal peak
#

İt should give an url

smoky marten
# raven cypress Replit

the url in the top bar in the browser preview window. it looks like
https://project_name.username.repl.co/dblwebhook

random elm
#

Are ipv6 VPS adresses supported?

smoky marten
#

Guess so
(didn't try it out myself)

neat quarry
#

Hey how can i get the server count thing?

#

like
its from server_count
bit how do i take into actions?

#

looks like im too dum to know how it works lamfo

restive otter
#

(node:33248) UnhandledPromiseRejectionWarning: Top.GG API Error: 401 Unauthorized (You need a token for this endpoint)

#

const Topgg = require("@top-gg/sdk") const api = new Topgg.Api("")


if (u) {

    await api.hasVoted(u.id).then(voted => {

    console.log(voted)
     if (voted === false) rozets.push(`**[${lang.badge}](https://top.gg/bot/817473313793376266/vote)**`)
     if (voted === true) rozets.push(`:dbl:`)

    })
}```
smoky marten
#

now

#

before anyone gets the token

restive otter
smoky marten
#

the fucking code

smoky marten
sullen nymph
#

You put your Top.gg token in the code snippet you sent above

#

It's strongly suggested that you reset it as soon as possible

restive otter
#

i deleted

sullen nymph
#

Reset it as well

restive otter
#

ok

sullen nymph
#

Regenerate*

neat quarry
#
  "server_count": 10
}```

Where do i use this info on?
sullen nymph
#

in body of the POST request that you send to top.gg

sullen nymph
#

Do you know how POST requests work?

neat quarry
sullen nymph
restive otter
neat quarry
#

alr ill try too look on that

#

ty

sullen nymph
#

The error sometimes happens even with valid tokens

restive otter
#

it is valid but still returns the error

sullen nymph
#

Regenerate again KEKW

restive otter
#

but it always wants topggPensive

unique summit
#

How To Get The API Key??

sullen nymph
#

Read The Channel Pins!!

unique summit
#

Ok

restive otter
#

sometimes it works but %96 returns error

left egret
#

Bro

#

Really

pastel raptor
#

-b @restive otter

abstract mothBOT
#

dblMod Banned UltPOG#0001 (@drowsy willow)

restive otter
#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

#

<@&304313580025544704>

pastel raptor
#

-b @restive otter

abstract mothBOT
#

dblMod Banned BlackBoy#9393 (@steep escarp)

dense basalt
#

damn

empty gazelle
#

pain

restive otter
#

wtf

jaunty plank
#

Children being childish. :(

rain heart
#

cringe

sacred shell
#

lmao wtf

rain heart
#

Still getting phone notifications ffs

brittle spoke
#

I was too when off discord

opal kettle
#

F

neat quarry
unique summit
#

Where Is The Webhooks Button

sullen nymph
sullen nymph
plucky wigeon
#

how use the api dblapi.js for webhook rewards?

opal kettle
#

like i wanna know what the vote object contains apart from the user who voted

#

please ping when replying

plucky wigeon
#

without the express

jagged pine
#

It would be really nice if you guys added support to the openAPI specification for top.gg API

hushed linden
#

Hey I been waiting over 3 weeks for my bot to be approved and I never applied for a bot before so I don’t know how it works so can someone help me out here please

brittle spoke
#

you added it 2 weeks ago

#

plus not API related

hushed linden
#

oh okay thanks

#

My mistake

shy vortex
#

here is also the link to the docs

#

the structure is also defined here

restive otter
#

Hi, the site is for some reason sending two requests to my Webserver, which then gives the user instead of 500, 1000 Zeros (bot-economy), also sends them two DMs and adds two votes to their vote count

#

Ping me once you reply, please!

shy vortex
#

on weekends your bot when it gets a vote actually gets 2 votes instead of one

hearty lintel
shy vortex
#

and this above

hearty lintel
#

if you dont respond with 2xx the event will be requeued and resent

hearty lintel
shy vortex
#

I see

#

btw question

#

does it make sense to have a seperate event for the webhook class that I have
for when its an upvote for a server

#

or should I keep both in the same event

hearty lintel
#

same event

shy vortex
#

hmmm

#

all over the same interfaces or am I just gonna have 2 interfaces

#

lol

hearty lintel
#
export interface WebhookPayload {
  /**
   * If webhook is a bot: ID of the bot that received a vote
   */
  bot?: Snowflake;
  /**
   * If webhook is a server: ID of the server that received a vote
   */
  guild?: Snowflake;
  /**
   * ID of the user who voted
   */
  user: Snowflake;
  /**
   * The type of the vote (should always be "upvote" except when using the test button it's "test")
   */
  type: string;
  /**
   * Whether the weekend multiplier is in effect, meaning users votes count as two
   */
  isWeekend?: boolean;
  /**
   * Query parameters in vote page in a key to value object
   */
  query:
    | {
        [key: string]: string;
      }
    | string;
}```
#

its best to just leave it how it is and maybe add separate events in the future

#

especially because v1 is planning on adding many more events

shy vortex
#

many? I see

#

im just gonna keep it simmilar to the node sdk as possible

hearty lintel
#

reviews, announcements, etc

shy vortex
#

and in some edge cases make my own solutions

#

lol

shy vortex
#

I will do it like this then

shy vortex
hearty lintel
#

ye

shy vortex
#

epic

#

announcements would also be a cool way to just make it post the announcement to discord channels

#

anyways cya thanks for the help

bold mortar
signal igloo
mossy pulsar
#

Hohooo

#

Steam scam

#

@craggy sentinel

restive otter
#

thanks

restive otter
#

Oops, sorry for the pings

paper crane
#

what are all the events?

#

how do i detect a vote and stuff?

rain heart
paper crane
paper crane
#

because i don't see any example code

stuck forge
#

How do i get webhook url for this? Im using heroku to host my bot

#

How do you do that?

willow spindle
#

no

#

you can use heroku

willow spindle
#

i know what is heroku

#

you don't need vps for hosting a webhook

#

kinda

stuck forge
#

@manic duneHey, so i got the webhook now and its a long code, what do i do now?

smoky marten
#

umm how ?

stuck forge
#

Do i have to create any file in the folder to paste the webhook code?

plucky lance
#

The webhook path is a imaginary path you choose the webhook service is listening to.

#

There are no folders/files needed in/to the root path.

#

It’s cloud usage not a VPS.
There’s a major difference between a VPS (virtual machine) or just cloud resources you can use in a non-os environment.

twin oxide
#
const { get } = require("request-promise-native");
let t = await get({
    url:     "https://top.gg/api/bots/830102447614853153/votes", 
    Json: true,
    qs: {
      access_token: 'censored key'
    }
 });
return t.length```
Getting Unauthorized...
Isnt this how we get votes using request-promise-native
balmy hamlet
#

your bot needs to be approved to get access to the api

#

you also need an api key

balmy hamlet
twin oxide
#

I have api key

#

Tried using but still unauthorized

balmy hamlet
#

how come

#

you don't even have the role

twin oxide
#

Couldnt claim Nitro in that acc made new acc

balmy hamlet
#

weird

twin oxide
#

Hm

twin oxide
torpid gate
#

hi
I want a few of my commands to work with votes what can I do

sturdy patio
#

I'm getting a bunch of spam for 401 unauthorized. Is there any way to turn that off? (I'm using the npm package @top-gg/sdk)

restive otter
#

you can't turn off a http request, but you can change your code to hopefully get another different request

sturdy patio
#

I'm not the one producing the console.error I think it's coming from the middleware for the webhook.listener

restive otter
#

either file a issue on their github or start a pr

#

but mostly if it's the middleware, it might be your code that it's complaining about

#

first thing you should do is troubleshoot the action itself, then look at everything it interacts with for problems

#

don't be afraid to console.log regularly

sturdy patio
#

Yeah this is the error:
TopGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint)
at Api._request (node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Api.postStats {
response: { error: 'Unauthorized' }
}

#

unless I'm using the wrong token

torpid gate
#

hi
I want a few of my commands to work with votes what can I do

sturdy patio
#

nevermind I figured it out.

sturdy patio
torpid gate
#

okey

paper crane
#

Error: 401 Unauthorized?

rain heart
#

your bot needs to be approved first

#

in order to use the api

paper crane
rain heart
#

it isn't

paper crane
#

i mean it worked once and when i restarted the bot it stopped working

rain heart
#

You never submitted a bot to begin with

#

according to our logs

#

what's your bot id

paper crane
#

i am helping a friend that doesn't know much about apis

#

798633979515371561

paper crane
knotty plover
#

@rain heart hi, is about me! I have a bot on your website and i have a problem with api, all the time eerror: 401 unauthorized

#

Work only 1 time and after, this error

#

And is not only for me, a friend have same problem

#

If you can verify the api or idk :-?

#

@paper crane is my second developer on my bot and this is why ask about that btw

knotty plover
#

after 35 min, no answer? 😕

jaunty plank
knotty plover
#

I use the correct token, like i click on "regen"

#

i use "relase token" and i copied it

#

After i put it where is needed, work for one time and after doesn;t work anymore

#

@paper crane can explain more, he work on api's for my bot 😕

paper crane
#

yup

knotty plover
#

Work only one time

tight nexus
knotty plover
#

After that

tight nexus
#

its so hard to make a website D:

paper crane
knotty plover
#

Sooo what do you think, @jaunty plank?

paper crane
#

so i made a test command

jaunty plank
#

hmm, not seen that happen before.
double check you are sending the right token by logging it.

knotty plover
#

i test it for 9 or 12 times

#

:))

paper crane
#

and this is the dbl.js

knotty plover
#

with the same token (verified) or other token (regen)

jaunty plank
#

dbl-api isnt our library

#

^ this is ours

paper crane
#

oh

knotty plover
#

We will try, thx ^^

tight nexus
#

@jaunty plank im waiting for a approval for my bot how long those it take??

paper crane
#

@jaunty plank

#

wait i think i fixed it

#

nope

jaunty plank
#

whats the new code look like?

paper crane
jaunty plank
#

so it looks like your making a new dbl client each time you run the command. you dont need to do that.

paper crane
#

oh

jaunty plank
#

const Topgg = require(`@top-gg/sdk`) // this part can go above the command export
const api = new Topgg.Api('Your top.gg token') // this part can go above the command export


await api.hasVoted(dbwVars.CommandAuthor.id) // this can replace the require/token part

paper crane
#

okay

jaunty plank
#

did you fill in Your top.gg token

paper crane
#

yes

jaunty plank
#

are you filling in the correct token?

#

your token can only check the bot its for.

paper crane
paper crane
jaunty plank
knotty plover
#

Yes!

#

and i checked again, same code!

#

With what i send to @paper crane

jaunty plank
knotty plover
#

Work for one time and after BUM error

jaunty plank
#

and it still works once then not again?

paper crane
#

keeps saying the unauthorized thing

jaunty plank
#

I have no idea then

blazing quartz
#

every time i try it says wrong token

knotty plover
#

So, @jaunty plank, new member with the same problem :))

paper crane
#

:))

#

well, F

jaunty plank
#

hmm, seems to be working for me fine.

paper crane
#

wait

#

now it works

blazing quartz
paper crane
#

wait

#

now it doesn't work

paper crane
knotty plover
#

Yes, it's fluctuant

#

Work and not work, it's about luck xD

orchid stag
#

Hey this is more related to the vote webhook, we use a UFW firewall on our VPS is there anyway we can whitelist the IP that sends posts to us?

plucky lance
#

Sure just add an inbound rule for top.gg for the TCP port you selected

orchid stag
#

How can I do that? Never done it before

plucky lance
#

sudo ufw allow 9999

#

Just replace the port with the actual one you choosed

orchid stag
#

ahh thats great

#

Thank you sm

plucky lance
#

It doesn’t filter the source IP but that shouldn’t matter for a random port

#

sudo ufw allow from 1.2.3.4/32 to any port 9999

#

If you wanna filter the source the request is coming from

old kernel
#

Any one need tutorial for top gg bot stats count then ping i can help you 😊

#

.js

smoky marten
old kernel
#

😋

old kernel
smoky marten
old kernel
fierce dove
#

hmm

#

hey

#

how I can make webhook authorization url ?

old kernel
#
TopGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint)
    at Api._request (/home/ubuntu/real/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Api.postStats (/home/ubuntu/real/node_modules/@top-gg/sdk/dist/structs/Api.js:96:9) {
  response: { error: 'Unauthorized' }
}
#

please help fast

#

i need to host my bot again

#

its crash by this error

rain heart
#

your token isn't valid

#

make sure that it is

old kernel
old kernel
#

also am making tutorial for this

restive otter
# old kernel its valid

You must be forgetting to use headers since the response was clearly an unauthorized error

spark mulch
#

Is there any way of checking how many votes someone has in total for your bot & how many for that month?

hot locust
#

Hi, how to get voter username python?

old kernel
#
module.exports = {
  name: `grab`,
  category: `🎶 Music`,
  aliases: [`save`, `yoink`],
  description: `Saves the current playing song to your Direct Messages`,
  usage: `grab`,
  parameters: {"type":"music", "activeplayer": true, "previoussong": false},
  run: async (client, message, args, cmduser, text, prefix, player) => {
    if(!voted) {
      return message.channel.send(new MessageEmbed()
        .setColor(ee.wrongcolor)
        .setDescription(`This is Command is Vote Required Please [vote me](https://top.gg/bot/802812378558889994/vote) First `)
      )
     } else {
      return message.author.send(new MessageEmbed()
  .setAuthor(`Saved Song:`, message.author.displayAvatarURL({dynamic: true}))
  .setThumbnail(`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`)
  .setURL(player.queue.current.uri)
  .setColor(ee.color)
  .setFooter(ee.footertext, ee.footericon)
  .setTitle(`${player.playing ? `${emoji.msg.resume}` : `${emoji.msg.pause}`} **${player.queue.current.title}**`)
  .addField(`${emoji.msg.time} Duration: `, `\`${format(player.queue.current.duration)}\``, true)
  .addField(`${emoji.msg.song_by} Song By: `, `\`${player.queue.current.author}\``, true)
  .addField(`${emoji.msg.repeat_mode} Queue length: `, `\`${player.queue.length} Songs\``, true)
  .addField(`${emoji.msg.playing} Play it:`, `\`${prefix}play ${player.queue.current.uri}\``)
  .addField(`${emoji.msg.search} Saved in:`, `<#${message.channel.id}>`)
  .setFooter(`Requested by: ${player.queue.current.requester.tag} | in: ${message.guild.name}`, player.queue.current.requester.displayAvatarURL({dynamic: true}))
  ).catch(e=>{
      return message.channel.send("**Your Dm's are disabled**")
  
    })
          message.react(emoji.react.SUCCESS).catch(e=>console.log("Could not react"))
  
    }
}
#

syntax error

#

but i cant find

#

i am looking 4 time but i cant get it

#

anyone can help me

old kernel
smoky marten
#

good then

restive otter
#

Guys npm is showing 404 not found for @waxen widget-gg/sdk

#

Whats the reason?

#

how do i use the topgg api to show the guild count of my bot on the website

restive otter
#

will this one work to show the guild count on the website

#
const { AutoPoster } = require('topgg-autoposter')

const ap = AutoPoster('Your Top.gg Token', client)

ap.on('posted', () => {
  console.log('Posted stats to Top.gg!')
})```
restive otter
balmy hamlet
#

if vote.user gives you the user id then fetch it from cache

#

client.users.cache.get(id)

#

something like that

restive otter
#

Ok thanks

smoky marten
restive otter
#

lol

restive otter
balmy hamlet
#

yeah I'm not going too in depth here

#

but could you explain more

restive otter
#

I mean, The bot needs to send a dm to user after 12 hours reminding them about the vote

#

Like dank memer sends a dm right

balmy hamlet
#

you gotta do that on your end

#

when an user votes, save that somewhere and then 12 hours later send that message

#

as easy as that

#

how you save it and how u send the message after 12 hrs have passed is not my problem

restive otter
#

how to save?

old kernel
#

You need a tutorial you can see this https://youtu.be/ydJbPG_dyHc

#discord #discord.js #realcoder
Hey am official member of realbot

Source Code - https://github.com/RealPukhraj/Stats-Count-For-topgg
Github - https://github.com/RealPukhraj

If you need any help join
Discord Server - https://discord.gg/k9zFcucTKp
Thank You
Regarding Real e-Sports
Always We are waiting for your joining.

Social Links :
✔ We...

▶ Play video
#

This video can help you how to use top.gg api

#

Also you can read npm package for top.gg api

#

😂

restive otter
hearty glen
#

Top.gg api works with python right?

restive otter
#

tysm man

#

it helped me

old kernel
#

bro

hearty glen
#

Does top.gg api work with python

#

So no?

#

welp

#

oh

#

I just been seeing a lot of js so i thought it didn’t

#

ok

restive otter
#

it will help you

#

ALOT

sullen nymph
#

description mentions d.js

#

LMFAO

#

Token not added via secrets

#

Yeah no chief

#

All that tutorial does is literally just use top.gg's node autoposter on repl.it

#

And what the fuck does "instantly" even mean in that case

#

As if top.gg delays requests coming from users

hearty glen
sullen nymph
#

Hint: it won't if you're not using JS

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.

sullen nymph
#

you are

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sullen nymph
#

Oh right I should release a new version with the deserialization patch

scarlet cobalt
#

One message removed from a suspended account.

restive otter
#

Imagine encouraging people to leak their token

scarlet cobalt
#

One message removed from a suspended account.

sullen nymph
#

It's a low-effort tutorial

scarlet cobalt
#

One message removed from a suspended account.

sullen nymph
#

I'm fine with it since you can post stats with just the token

restive otter
sullen nymph
#

Yup

restive otter
#

Oh well, did I misunderstand that

sullen nymph
#

Kinda

#

It's okay

restive otter
#

I read it as "You can only post stats with the token" 😩

sullen nymph
spark mulch
#

Is there any way of checking how many votes someone has in total for your bot & how many for that month?

sullen nymph
#

Only via storing all votes locally

hearty glen
#

So there’s an event for when someone votes for ur bot right?

#

And there an arguments that’s passed thought it called “data”

sullen nymph
#

Correct. The WebhookManager class provides those events if you use the helper methods

hearty glen
#

ah ok

restive otter
sullen nymph
#

Should run instantly after bot start, don't know

restive otter
#

Yeah, My console is showing error

restive otter
#

Why my console is showing this^^?

sullen nymph
#

🤔

restive otter
#

cat_yes idk why it is showing that

restive otter
sullen nymph
#

🤷 I'm not proficient in JS

restive otter
#

Ohk

#

Thank god worked now

spark mulch
#

How often does GET bots/:bot_id/votes take to update - For example if I want to add up everyones votes could I check for a change then get the latest bit in the list? What if 2 people vote in the same proximity of one another?

sullen nymph
#

There's a possibility that you might find days-old votes due to the fact that that endpoint returns last 1000 votes for the current month

old kernel
#

See this

#

Its a tutorial

#

Only

sullen nymph
#

If you could kindly stop fucking sending this

#

No one literally needed it there

old kernel
#

Oh sorry

restive otter
#

worked bro no need

scarlet cobalt
#

One message removed from a suspended account.

craggy sentinel
#

@old kernel no ads

spark mulch
sullen nymph
#

It is. I don't remember if it goes first-to-last or vice versa

uncut granite
spark mulch
lone sun
#

How do i check if someone has voted for my bot?

#

Please give detailed answers

#

And examples

uncut granite
#

Read docs

willow spindle
lone sun
#

I alr did

uncut granite
#

And be creative XiaoNani

lone sun
#

The docs literally only shows how to setup the webhook

#

What next?

#

What do i do?

#

Atleast provide some examples

uncut granite
#

Thats up to you

lone sun
#

What if i dont know what do to?

uncut granite
#

Then read docs

lone sun
#

Omfg....

#

I alr did and still dont know anything

uncut granite
#

Instead of asking others for it

uncut granite
#

Really.

lone sun
#

I dont know what to do fr

#

I've never made a webhook before

willow spindle
#

its not webhook

#

its endpoint

lone sun
#

Never done an endpoint too

willow spindle
#

okay

#

what language

#

or lib

lone sun
#

Python

willow spindle
#

@trail sigil

#

ads in every channel

trail sigil
#

ty

lone sun
willow spindle
#

yeah because this is py lib's docs

lean comet
#

Which event is invoked when an upvote occurs? (I using javascript API)

willow spindle
#

vote iirc

tight osprey
#

How can you make a vote Tracking system?

coarse rune
#

@tight osprey do u use js ? ||Sorry for the ping||

tight osprey
#

yeah

#

@coarse rune||Sorry for the ping lol||

coarse rune
#

Can u dm me pls

restive otter
#

when will my bot verefy

#

?

restive otter
restive otter
#

Hey, How can I save a user who voted for my bot in last 12 hrs in discord.js?

#

I want add vote reminders so yeah

restive otter
jaunty plank
#

if you want to save that information youll need a database.

restive otter
jaunty plank
#

depends on the database

restive otter
#

It's quick.db tho

#

Like it will save to the database and after 12hrs it will send a vote reminder to the user who enabled it.

jaunty plank
#

you may want to use a more proper database, or youll want to build your own ttl system(as quickdb doesnt have ttl)

restive otter
#

I am trying for mongoose. But idk how to setup it.

jaunty plank
#

saving the info is quite easy with quickdb, but using it in this way is a bit harder since quickdb doesnt have a lot of features.

restive otter
#

Oh

#

Do you know any tutorial on how to setup Mongoose?

jaunty plank
#

what OS is your bot hosted on?

restive otter
#

Windows 10

jaunty plank
restive otter
#

Ohk thanks

jaunty plank
restive otter
#

Oh ty

#

and..

#

Btw I am not using vsc

#

Will it work?

jaunty plank
#

i dont see why it wouldnt. vsc is just a text editor

restive otter
#

Oh Ok

restive otter
jaunty plank
#

kittens is just an example

#

you can call it kittens if you want, or whatever you want.

restive otter
noble lintel
#

How can I save a user who voted for my bot in last 12 hrs in discord.py

narrow vector
#

How would I set authorization header in my code with my API token?

twin reef
#

how can i fix this? it only happens if i try to reply to a user and like the comment

spice helm
twin reef
#

no i dont have any

#

ive tried three browsers by now

spice helm
#

oh, it must be something on top.ggs part then, best to go to support and ask what to do now

twin reef
#

they dont answer me tho

spice helm
#

oh right

rain heart
twin reef
#

O

soft marsh
#

I am sorry I am kind of a noob and idk why this is not working I am useing python I am trying to make it is my bot can tell if someone has voted
@client.command()
async def vote(ctx):
if client.topggpy.get_user_vote(ctx.author.id) == True:
await ctx.send("thanks for voteing!")
else:
await ctx.send("plz vote")

#

I can not find any examples for of get_user_vote online

#

the command works but it allways returns false

#

can someone plz help

restive otter
#

It's a coroutine

#

Never equals True

soft marsh
restive otter
#

In short, await it.

soft marsh
#

can I await a if statement?

restive otter
#

No, the coroutine

soft marsh
#

so like this?
if await client.topggpy.get_user_vote(ctx.author.id):

restive otter
soft marsh
#

yay it worked thanks now I just need to wait 12 hours to see if it will return false

restive otter
#

Could've used an alt account to test mmulu

pure condor
#

hi

old kernel
#

Hey any one can tell me how can i set a reminder for vote in dm

restive otter
#

Someone help me, because that comes out when I use the vote command, I know little English

restive otter
restive otter
restive otter
#

ok

restive otter
restive otter
restive otter
restive otter
#

one moment

restive otter
noble lintel
#
        print(b)```
I am trying to print the last 1000 votes list but it's not printing.. Can someone help
restive otter
noble lintel
restive otter
#

It's fixed in the master branch, you can install it instead until it rolls out to PyPI

noble lintel
restive otter
#

on_guild_post is dblpy thing

zinc gyro
#

How can I update the server counter on my bot?

rain heart
#

it is used to interact with the top.gg api of posting stats or getting stats from bots on top.gg

hidden brook
rain heart
#

you're posting