#topgg-api

1 messages Β· Page 139 of 1

restive otter
#

That one only i kept

hearty lintel
#

all the ports are open properly and whatnot?

restive otter
#

Yes

#

i checked my balance also i didnt got 5000$

hearty lintel
#

does it console.log?

restive otter
#

nope

#

I saved it and clicked on Test button also

hearty lintel
#

if u go to the link in your browser what does it say

restive otter
#

which link?

hearty lintel
#

the webhook link

restive otter
#

I mean i created a channel named vote logs in that channel i created a webhook

hearty lintel
#

u cant use discord webooks in the url field

restive otter
#

then?

hearty lintel
#

i mean the url you put in the webhook field

#

your.ip:port/dblwebhook

restive otter
#

Idk my ip:port

#

how to know it?

hearty lintel
#

what're u hosting with?

restive otter
#

Editing with glitch and hosting with google script

hearty lintel
#

i've no clue how those networks work

#

you have to host a webserver

restive otter
#

ohok

#

ok np

barren kestrel
#

How can I make a command saying

n!leaderboard

(Display how many votes each user has)

Can the top.gg api do that?

#

Ping me if you know c:

#

Thanks!

tropic galleon
#

You could use webhooks for that and store vote counts in a database of yours

#

@barren kestrel

winter jasper
#

what's api usage iirc?

tropic galleon
#

?@winter jasper

winter jasper
tropic galleon
#

What's the context

#

I have no clue what you're asking

#

API usage is API usage

#

Iirc stands for if I remember correctly

restive otter
#

How would I setup the webhook?

green roost
#

Create a Webserver and set up the webhook endpoint

#

Your library docs will have instructions

hallow cargo
#

discord member intents are no longer working for me?

rain heart
#

-api

abstract mothBOT
#

TOP.GG API ONLY!!!
ANY OFF-TOPIC CONVERSATION WILL BE DELETED AND MUTED
This channel is only for SUGGESTIONS/HELP/BUGS to do with OFFICIAL API LIBRARIES and API DOCS found at: https://docs.top.gg

hallow cargo
#

Sorry!

hasty mica
#

object 'Client' has no attribute 'loop'

sullen nymph
#

Ok this is slowly getting out of hand

#

Show your code

hasty mica
#

upvotes = dbl.DBLClient(db.Client, token).get_bot_upvotes()

sullen nymph
#

Nmmnnnmknnnn

hasty mica
#

?

sullen nymph
#

Not the class ITSELF

hasty mica
#

ah, got it

#

Task was destroyed but it is pending! wha

#

@sullen nymph what is this

sullen nymph
#

Force-exit while some task was running

hasty mica
#

how am i supposed to get vote data then

sullen nymph
#

oh God what are you doing

#

Create one object, ONE ONLY

#

Save it in a VARIABLE

#

And then just use its methods

hasty mica
#

i thougt the function returned a list?

#

of recent users who voted

sullen nymph
#

Well yes that's not the issue here

#

The main issue is you're not awaiting it

hasty mica
#

but its being awaited

sullen nymph
#

Yeah where

hasty mica
#

votes = >>>await<<< dbl.DBLClient(db.Client(), token).get_bot_upvotes()

sullen nymph
#

Does it work

hasty mica
#

i just called it from my commands

#

i have print(votes) after it

#

nothing is happening

#

yeah nothing is happening

#

not even errors

sullen nymph
#

Show the full commands

#

Command

hasty mica
#
@Client.command(aliases = ['upvote'])
async def vote(ctx, mode = mode):
    
    token = "token"
    upvotes = await dbl.DBLClient(db.Client(), token).get_bot_upvotes()
    print(str(upvotes))

    embed = db.Embed(title = "Vote for Case Bot", color = db.Color.gold())
    embed.add_field(name = "Top.gg Bot List:", value = "[Vote Here!](https://top.gg/bot/767633990701678602/vote)", inline = False)
    embed.add_field(name = "Vote Rewards:", value = " - 100k Credits \n - Credit Multiplier (need to activate)\n - 20k Tokens")
    embed.set_thumbnail(url = thumbnail)
    embed.set_footer(text = "Thank You For Voting :)")
    await ctx.send("<@" + str(ctx.author.id) + "> - You wont recive items yet, that feature is being added.\nSill feel free to Vote CB tho :)\n", embed = embed)
sullen nymph
#

Disaster of random object creation

restive otter
#

naming convention 😩

hasty mica
#

yes ty

sullen nymph
#

Use your Client instead of db.Client

plush lintel
#

lol

sullen nymph
#

Create only one object and use it

#

Stop with this fucking mess before it bites you AGAIN

restive otter
#

hey anyone help me code bot?

#

or where to go

sullen nymph
#

Out of all channels you choose the channel about top.gg API

#

Ask in #development

restive otter
#

it says on top.gg I have to join this discord to add a bot

hasty mica
restive otter
#

found the bot area

sullen nymph
#

Call what

restive otter
#

shiv meant you're supposed to pass Client instead of instantiating a new object.

hasty mica
#

Client instead of discord client

restive otter
#

Client is a discord.Client instance lol

sullen nymph
#

Client is a ready instance

#

db.Client() isn't

restive otter
#

it's kinda confusing, so kindly rename it to client or something

hasty mica
#

ok so put in a variable

sullen nymph
#

Yes please

hasty mica
#

ok

sullen nymph
#

I was saying yes to norizon

restive otter
#

low sounds like he's a pro

hasty mica
#

im not

#

noob > low

sullen nymph
#

But yeah put your DBLClient in a variable that's shared between other functions

restive otter
#

wait I can code in vsc with py?

#

why not

sullen nymph
#

Yes because VSC is just a text editor

#

And code is text

#

You could even use notepad

restive otter
#

mmm

restive otter
#

low has been on vsc for 9h

plush lintel
#

Is there an easy way to get the number of upvotes

#

without dbl

#

like with just an api GET request

sullen nymph
restive otter
hasty mica
#

im trying to give users rewards for voting tho

sullen nymph
#

Thank you norizon for being cool

hasty mica
#

dang wifi went out ofc

restive otter
#

low what version of py are you on

#

@hasty mica

hasty mica
#

the latest and greatest

restive otter
#

3.9.2

#

?

#

Low

#

@hasty mica

#

ur on 3.9.2

#

?

hasty mica
#

idk i think so yea

hasty mica
restive otter
#

What? I was telling the other guy, just use that get_bot_upvotes method

hasty mica
#

it wont display anything when i call it tho

#

nothing happens

restive otter
#

Send the code

hasty mica
#
client = db.Client()
    upvotes = await dbl.DBLClient(client, token).get_user_vote(ctx.author.id)
    print(str(upvotes))
restive otter
#

I think you've been told not to instantiate a new object. You already got it, just pass it...

hasty mica
#

why isnt it printing tho

restive otter
#

Because it's waiting for the client to be ready, which is never gonna happen

hasty mica
#

oh

#

so i can search the list?

restive otter
#

No, it's a list of dict

hasty mica
#

for loop?

#

searching it?

restive otter
#

You can do {int(data['id']) for data in upvotes} so that it'll be a set of user ids

#

Sure, you can do the generic for loop

hasty mica
#

is the string the same format as that webpage you sent?

#

dict*

restive otter
#

Yes

hasty mica
#

πŸ‘

#

its telling me upvotes is a boolean

#

nvm mb

#

still nothing is happening

#

@restive otter why wont anything happen bruh

restive otter
hasty mica
#

so how am i supposed to save the DBLClient

#

in a variable in on_ready?

#

@restive otter

restive otter
#

I'm making my first bot in py

#

ya I'm gonna failπŸ˜‚

hasty mica
#

i alr failed

#

cant get things done

restive otter
#

@restive otter bro thats not gonna happen i have seen a guy make his first bot and he has succeeded ....

#

now his bot is 250+ servers

restive otter
#

You will learn easily brother

#

dont be hard ya self

#

dude it's like learning spanish

#

na

#

yes

#

na

hasty mica
#

🀣

restive otter
#

is getting the bot from api in every 15 sec is ok?

rain heart
#

I would not recommend it, but it is possible

#

depends on what endpoint you make a request to

restive otter
#

/bot/:id

rain heart
#

read this

restive otter
rain heart
#

yes, read the docs

#

about ratelimiting

restive otter
#

i read it says 60/min

#

i think

rain heart
#

then it is most likely fine

#

even if i still wouldn't recommend it, it is possible

restive otter
#

mhhhm ohk thanks

#

i will request every 15 sec

#

is it recommendable?

rain heart
#

again i still wouldn't recommend it, but it is possible

restive otter
#

☹️

#

what would you recommend then?

#

🀣

rain heart
#

each minute instead

#

depends on what the purpose is

restive otter
#

ohk

restive otter
#

plz post the status of the bot tooo. like online , offline idle etc

rain heart
#

Will be added in the near future

#

just not trackable right now

restive otter
#

who help me

#

very long problem

#

2000+character

#

@rain heart

rain heart
#

use pastebin and wait for someone that can help you

restive otter
#

hatebin?

rain heart
#

whatever you prefer to post the error code in

restive otter
#

?

#

@rain heart

rain heart
#

use pastebin and wait for someone that can help you

sullen nymph
#

P.S. it's strongly advised to use the top-gg/sdk package instead of dblapi.js

#

And the 504 error is a server-side issue, aka you just need to try again later

restive otter
#

i already telled him in another server KEKW

sullen nymph
#

πŸ™‚πŸ”ͺ

untold cliff
#

nee bit of help here

#

const client = new Discord.Client() // Your discord.js or eris client (or djs
do i need change anything here as i am using discord,js

#

let me know if i need to change anything

rapid kettle
#

don’t make a new client

#

please

untold cliff
#

what do i put in to replace this

rapid kettle
#

just get rid of that

untold cliff
#

in the const ap = ('', client) do put my token inside

rapid kettle
#

no

#

get rid of the const client = new...

untold cliff
#

done that

untold cliff
rapid kettle
#

in the string?

#

ap('token', client)

untold cliff
#

i have to put my token

hushed reef
#

Correct

#

You do

untold cliff
rain heart
#

-pins

abstract mothBOT
#

Your question is likely answered by one of pinned messages. Please take time to read the pinned messages by clicking on this icon.

rain heart
#

also mentioned on the docs

hushed reef
#

And almost anywhere else

untold cliff
#

done what happen next done what tell me to do

#

i got error message

rain heart
#

post it here

untold cliff
#

opGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint)
at Api._request (C:\Users\jakem\Desktop\EvalZero-main\node_modules@top-gg\sdk\dist\structs\Api.js:76:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Api.postStats (C:\Users\jakem\Desktop\EvalZero-main\node_modules@top-gg\sdk\dist\structs\Api.js:96:9) {
response: { error: 'Unauthorized' }
}

rain heart
#

you need to add your token to the constructor

untold cliff
#

don't know where

untold cliff
hushed reef
#

This is the part where i recommend reading the docs

rain heart
#

this tbh

hushed reef
#

Where all of your basic questions get answered

#

It's almost a waste of time reciprocating something already said.

untold cliff
#

find it

#

done thanks for lot of help

fickle lantern
#
await self.bot.dblpy.get_user_vote(ctx.author.id)

All the times I voted, sometimes it returns False, sometimes True. What is going on here?

sullen nymph
#

The API can be delayed in that sense. It can take a while for the endpoint's value to update after a vote

#

And since it returns status of an individual vote, yeah

barren kestrel
#

I mean it doesnt take too long for me.. But does take atleast 10-15 seconds after voting and checking

sullen nymph
#

Yeah, there's no definite delay. I remember it being delayed for like up to 10-30 minutes after voting

restive otter
#

Hey How to get our webhook link?

sullen nymph
#

http://ip:port/path

restive otter
sullen nymph
#

"Search"?

#

ip is your machine's IPv4 address
port is the port your webhook runs on
path is the route used specifically for your vote handler

restive otter
#

Idk what are the values

#

How to know

sullen nymph
#

How are you hosting your webhook in the first place?

restive otter
#

wdym

sullen nymph
#

Are you running a webhook even?

#

Do you know what a webhook is?

restive otter
#

Ik discord webhooks lol

sullen nymph
#

Why do you need it in this case?

restive otter
#

For giving voting rewards to the users

sullen nymph
#

Discord webhooks for rewarding users

#

Connect the two and tell me how that's possible in the first place

restive otter
#
const Topgg = require("@top-gg/sdk")
const express = require("express")
const app = express()
const webhook = new Topgg.Webhook("my api key");

app.post("/dblwebhook", webhook.middleware(), (req, res) => {
  db.add(`balance.req.vote.user.money`, 5000)
  console.log(req.vote.user);
});```
#

This is my code ^^^

sullen nymph
#

Right

#

The webhook isn't even run

restive otter
#

Ohk

#

The voting rewards code is correct know?

#

db.add

sullen nymph
#

I don't know

#

Try it

restive otter
#

Ok

restive otter
sullen nymph
#

It's a middleware that checks request authorization and passes the vote data to your function, I guess

restive otter
#

I already gave the code like this

const Topgg = require("@top-gg/sdk")```
for servercount
restive otter
#

Ohk

sullen nymph
restive otter
#

Ohok

sullen nymph
#

So you just do Topgg.Webhook to access the webhook

restive otter
#

Ohok

restive otter
fresh cradle
#

am i the only one here who uses node.js here-?

restive otter
#

No

ruby kiln
#

is that possible to vote on top.gg from a discord command ? f.e : I type !vote, and the user vote is automatically count on top.gg website

and if he already voted in the last 12h, it says impossible to vote

plush lintel
night matrix
#

Saw #support pins I'll go cry in a corner now.... Lol

sullen nymph
#

The ads have nothing to do with this

green roost
sullen nymph
#

The most viable option to keep it running well is via captcha on a webpage

#

aka what it is

green roost
#

Except for the ad wall. But I suppose that's by design

sullen nymph
#

Shrug. The ads don't bother me personally

#

Though, yeah, that's a different story, kind of

signal warren
#

a

bronze axle
#

When. Will. Webhooks. Be. Fixed.

sullen nymph
#

They're working?

plush lintel
#

I absolutely love the webhooks. Just figured out how to use them and they work perfectly.

#

(The test feature is very nice)

wheat cipher
#

I just figured it out to with my vps so nice indeed

wheat cipher
#

Hmm

#

So it works with the test feature but when someone votes nothing happens

#

Question if you vote on same ip adress with different account does it only register one. I tried testing real time and only 1 of the 3 came trough

night ingot
#

I'm pretty sure you're not supposed to be able to vote twice on the same IP, but I might be wrong

jaunty plank
#

voting on multiple accounts is against our rules

wheat cipher
jaunty plank
#

oh dont worry about it, i understand you just where testing πŸ™‚

#

we do have a test button next to the webhook if you want to test it

wheat cipher
#

Yes I know

#

But I put custom user in it

#

So I can give rewards and save it

jaunty plank
#

ah, i understand. yeah postman is your best bet

wheat cipher
#

πŸ™‚

hollow steeple
#

I cannot see my bot's approval process as%, what should I do?

umbral garden
#

can anyone help me with this?

#

how can I show the amount of servers it in

#

please ping me if you know

night ingot
umbral garden
#

Thanks! But is there a youtube video on how to do this..? I'm sorry its very confusing.

restive otter
#

I finally added emojis to my bot so when I type +about it says some stuff and when I do +sheesh it does πŸ”₯ 😎 πŸ”₯

umbral garden
#

lol

#

i found this-

#

do I put this in my bot?

#

how do I use this?

restive otter
#

astral

#

@umbral garden

umbral garden
#

yes?

umbral garden
restive otter
#

do you code boys

umbral garden
#

?

#

wym

restive otter
#

discord bots

umbral garden
#

yep!

restive otter
#

what do you use

#

do u use py

umbral garden
#

yep

restive otter
#

do you understand error messages

rain heart
#

-api

abstract mothBOT
#

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

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

umbral garden
#

sorry

open surge
#

It would be good to include in the endpoint (to see the last 1000 votes), the date a user voted

rain heart
#

you can use webhooks for that

#

tracking it yourself

open surge
#

well ... I was referring to the endpoint. but thanks for informing me

restive otter
#

-api

stiff night
#

AttributeError: 'Client' object has no attribute 'add_cog'

#

im trying to post my server count

#

but im getting this err

#

Python

green roost
#

This is a dpy error not a python-sdk one

#

You need to use a commands.Bot instance

#

Actually I think this point should be made clear in the docs (although it should be obvious)

#

At least for the cog example it should be mentioned that you need a commands.Bot instead of discord.Client

#

Cause client can't use cogs

stiff night
#

its working.....

green roost
#

ya cause Client can't access the commands extension

sullen nymph
green roost
#

Should he fine actually. None of this relies on the commands extension

real fox
#

I voted to my server, after setting vote tracker then it shows 0 votes to my server but in website 6 votes

green roost
#

A note can be added on how one can also use Bot.listen() instead of Client.event to listen for the webhook events.

sullen nymph
#

Hm. Is .listen necessary here? I could just rely on the event deco k3llyhmm

green roost
#

I suppose not, but it allows for multiple handlers.

#

event decorator overrides because you can't change the function name.

restive otter
#

Is it necessary to have multiple handlers for that

sullen nymph
#

Yeah, I usually prefer to encourage the event deco just because there's usually no need for multiple handlers

#

... especially with the Python SDK πŸ˜›

restive otter
#

It's more like a d.py example then if it uses listen one

#

shiv, have you considered returning self on WebhookManager methods? lol

sullen nymph
#

Bro I literally already have that implemented, just not pushed to the repo yet

restive otter
#

Oh great

sullen nymph
#

Cool idea

restive otter
#

Now I can chain it sunglas

sullen nymph
dusk latch
#

Hello,
I'm using Top.GG .NET Api.
I have two clusters, one updating shards from 0 to 1 and the other updating shards from 2 to 3. However, it seems only the latter is working. I am getting no errors. The Top.GG page only has 2 shards and the guild count of the shards 2 and 3.

This is how I update the stats:
await me.UpdateStatsAsync(FirstShard, TotalShardsInBot, guildCounts.ToArray());

First cluster:
FirstShard = 0
TotalShardsInBot = 4
guildCounts -> a list containing two numbers

Second cluster:
FirstShard = 2
TotalShardsInBot = 4
guildCounts -> a list containing two numbers

Can anyone help me? What am I doing wrong?
Thanks

green roost
#

Also a database bulk insert that depends on it.

#

So it could be a valid use case.

restive otter
#

I see, but if it was cog-less, would you need multiple handlers in the main file?

green roost
#

How many bots made with dpy that are listed here do not make use of the commands extension?

#

Its really hard to not want cogs when you have a large bot

#

I see the point about making examples cog less though

#

I'm just asking for a note on how it would work with the command extension, since the SDK would work perfectly with just a discord.Client instance.

#

Since the example with cogs also specifies that the dbl.Client constructor takes a discord.Client, but discord.Client doesn't have access to commands.Cog

#

I hope I'm making sense here

restive otter
#

I was genuinely asking about listen use case with the SDK out of curiosity

pastel drift
#

How can I make this show the server count on top.gg website?

rain heart
wheat cipher
#

webhook testing broken?

#

I didnt change anything from my code from yesterday but now when I presh the test button nothing happens.

pastel drift
prime juniper
rain heart
#

though only on servers, not bots

wheat cipher
#

It works 2 out of 15 for me

wheat cipher
prime juniper
#

does it not work with your bot?

wheat cipher
#

Well I tried it 15 times in the past 5 minutes

#

and out of those 2 came in

prime juniper
#

I've tested on mine and it works

wheat cipher
#

Hmm

prime juniper
#

You should try using a webhook tester online to see if it would work with it

#

If it does then there's something wrong with your code

wheat cipher
#

My postman works

#

Which is a replicated of the webhook request

wheat cipher
pastel drift
#

webhook_path='/dblwebhook' what is supposed to be in this? the complete webhook url?

sullen nymph
#

The route that comes after the IP and port in URL

sullen nymph
#

This is top.gg API assistance channel

thorny agate
thorny agate
oblique temple
#

I'm trying to get the webhook post using php, I used another program and it works, but when I tested it using the test button, it didn't

#

I tried to get the value "user" in post

rain heart
#

have you saved the webhook before testing?

#

have you tested your webhook using postman?

oblique temple
oblique temple
#

1 sec

#

Using it didn't work for me

rain heart
oblique temple
rain heart
#

Good i was about to lose my mind lmao

oblique temple
rain heart
#

again what exactly are you trying to do?

oblique temple
#

I am wanting to get the user id that voted and send for some things on my php site.

#

(I'm using the translator to chat, sorry for any mistake)

rain heart
#

as you're trying to make a request to our api it looks like

oblique temple
#

ye

restive otter
#

its been awhile since i last touched it so

oblique temple
wheat cipher
restive otter
#

oof

#

probably then

restive otter
#

so since we use webhooks i only need to export the code then?

#

so put the code in another file then define to run the express file in the index.js?

wheat cipher
#

I just have it in the index.js

#

The req.vote return the following object: {
"bot": "",
"user": "",
"type": "upvote",
"query": {},
"isWeekend": false
}

restive otter
#

its fine if i just use the localhost right?

#

or do i need to use a server

wheat cipher
#

test requests from top.gg needs a url the they can acces

#

If you use localhost they cant

restive otter
#

well how would i go about this without spending any money?

#

since i cannot find a job with covid

wheat cipher
#

I would not know. I use a vps for 4 euro`s. But I think this is going off topic.

prime juniper
#

I would guess you can try opening one of your ports then use your IPv4

restive otter
#

Kinda sus

green roost
#

high sus. also off topic for here

restive otter
#

is there a way to get your bot on

#

like always active

dusk latch
#

Hello, I need some clarification about the stats.
What should I do if I have two servers, each of which containing more shards?

For example, if I have Server 0 with shards from 0 to 4, and Server 1 with shards from 5 to 9:

From Server 0 I post:
shards should be an array of 5 numbers with the count per guild.
shard_id = 0
shard_count = 10

From Server 1 I post:
shards should be an array of 5 numbers with the count per guild.
shard_id = 5
shard_count = 10

With this setup only the latest server posting works (so I only have 5 shards instead of 10).
Any help? Thanks

dusk latch
clever tulip
rapid kettle
#

NOO

sullen nymph
#

All of you people get out of this channel unless you're asking top.gg API-specific questions

clever tulip
sullen nymph
#

Stop using this channel and come back when you can read channel topics

sullen nymph
#

I remember having issues with that, so what I did instead was post an array of guild counts per each shard myself

umbral garden
vocal robin
#

@keen arch WHich language?

keen arch
#

javascript

vocal robin
keen arch
#

thanks <3

sullen nymph
umbral garden
#
from discord.ext import commands, tasks

import dbl


class TopGG(commands.Cog):
    """
    This example uses tasks provided by discord.ext to create a task that posts guild count to top.gg every 30 minutes.
    """

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token'  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token)
        self.update_stats.start()

    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=30)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        await self.bot.wait_until_ready()
        try:
            server_count = len(self.bot.guilds)
            await self.dblpy.post_guild_count(server_count)
            print('Posted server count ({})'.format(server_count))
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))


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

i used it like this

#

i imported this into my code

sullen nymph
#

You imported it where

umbral garden
sullen nymph
#

Do you use commands.Bot or discord.Client?

umbral garden
#

discord.Client

sullen nymph
#

Remove the setup function and get rid of the class

#

All you'll need is fhe DBLClient instance and the update_stats function

umbral garden
#

Thanks!

#

One more thing

#

where can i find my dbl token?

vocal robin
#

here

#

@umbral garden Agree

umbral garden
#

Thanks!

sullen nymph
#

You know what I'm thinking

#

Actually nvm doubt it'll make sense

jaunty plank
#

πŸ‘€

umbral garden
#

?

#
    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token'  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token)
        self.update_stats.start()

    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=30)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        await self.bot.wait_until_ready()
        try:
            server_count = len(self.bot.guilds)
            await self.dblpy.post_guild_count(server_count)
            print('Posted server count ({})'.format(server_count))
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

umbral garden
sullen nymph
#

You don't need the init function

umbral garden
#
    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=30)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        await self.bot.wait_until_ready()
        try:
            server_count = len(self.bot.guilds)
            await self.dblpy.post_guild_count(server_count)
            print('Posted server count ({})'.format(server_count))
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

#

?

#

like this?

cunning basin
#

who have a ban script?

umbral garden
#

I do

sullen nymph
#

Just the top.gg token variable, DBLClient instance, and the update_stats

umbral garden
sullen nymph
#

@cunning basin do you ever read channel topics by any chance?

cunning basin
#

how do I know if my bot has been approved?

sullen nymph
#

#support question

cunning basin
#

ok THX

umbral garden
sullen nymph
#

Show your code

umbral garden
#

def cog_unload(self):
self.update_stats.cancel()

@tasks.loop(minutes=30)
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count."""
await self.bot.wait_until_ready()
try:
server_count = len(self.bot.guilds)
await self.dblpy.post_guild_count(server_count)
print('Posted server count ({})'.format(server_count))
except Exception as e:
print('Failed to post server count\n{}: {}'.format(type(e).name, e))

#

oops

#

well i get no errors though

sullen nymph
#

cog_unload not needed

#

where the fuck is your DBLClient

#

self.bot replace with whatever your d.py client instance is

#

self.dblpy with a variable that points to your DBLClient instance

restive otter
clever tulip
clever tulip
restive otter
#

idk

#

I'm using uprobotime

#

I think

sullen nymph
#

You people need glasses that specifically enlarge channel topics

wary plover
#

Well I got an advanced bot working on repl.it

restive otter
#

I need someone's help

#

I messed up on my economic bot

#

idk how to fix

knotty garnet
#

How don't you know?

restive otter
#

how do i fix that

sullen nymph
#

Sounds like one of your strings isn't closed properly

restive otter
#

prob

sullen nymph
restive otter
#

bruh

sullen nymph
#

For like a third time within the past day

restive otter
#

i went there

sullen nymph
#

Good

#

Keep it there

restive otter
#

k

#

why is there a API channel then

jaunty plank
#

for the api

sullen nymph
#

I did say multiple times to read the fucking channel topic

rain heart
abstract mothBOT
#

@restive otter

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

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

rain heart
#

because this

frigid shore
#

how do i set up vote rewards?

rain heart
#

use webhooks

frigid shore
#

i read the docs

rain heart
#

fully read then, you will know then

frigid shore
#

like to give people special items or coins or something

rain heart
#

You create a webhook through your bots code, set that on your bot page settings, then handle the webhooks that come in to reward users

#

You cannot use discord webhooks, that's a almost different thing

sullen nymph
#

a webhook is usually ran in the same process as the bot

frigid shore
#

not sure how to create a webhook tho

sullen nymph
#

usually attached as a property to it

#

What's your library

frigid shore
sullen nymph
#

You can wrap one up with aiohttp.web and attach it to your client object or use dblpy

frigid shore
#

uhh ok

gleaming compass
#

i got muted

tulip barn
#

yea your 7

#

and get out this chat its for people that can code

gleaming compass
#

im not 7

tulip barn
#

mhm

gleaming compass
#

i foud

#

this oic

#

this picture

rain heart
#

-api

abstract mothBOT
#

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

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

rain heart
#

please change channel

gleaming compass
#

why

rain heart
#

change channels

#

this is api only

exotic hinge
#

What is @bot.event

#

in the api

#

I want to post a message in a channel whenever a user votes the bot

restive otter
#

event decorator is just a d.py decorator that binds a function to the client or its subclasses object as a method

pastel drift
#

TypeError: object Lock can't be used in 'await' expression
I am getting this error

@tasks.loop(minutes=30)
    async def update_stats(self):
        await self.dblpy.post_guild_count(len(self.client.guilds))
        print("Count updated!")

I am not able to understand what's wrong

restive otter
#

Ig it's an issue that's been fixed on v1, maybe try to build from the source since it's not out yet

pastel drift
#

I don't get it, what source?

restive otter
#

The repo on github, or just downgrade to py 3.8

pastel drift
#

Okay I'll check it

#

Thanks

fast quail
#

-api

dusk latch
sullen nymph
#

Which ones?

old dust
#

So I am about to create code to recognize a vote, what kind of webhook do I need? (I am new to webhooks)

leaden minnow
#

is there a tutorial to get the webhook for dbl?

rain heart
old dust
#

Yea I found the docs, is there any way I can check if someone votes without a webhook? I don't have a domain so I don't think I can create a webhook

sullen nymph
#

You only need a machine with an open port

old dust
#

Right, I do have one I'll check if I can make it work

restive otter
#

MMMMMWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

pulsar atlas
#

the page won't let me change the webhook url

#

it just says: "There was a problem saving the webhook Thonk"

rain heart
#

Your bot needs to be approved first

#

-api @restive otter

abstract mothBOT
#

@restive otter

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

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

pulsar atlas
#

o okay

brittle spoke
#

no

abstract mothBOT
#

🀐 Muted Śmietaaa#3040 (@warm vigil)

wraith skiff
#

is this my dbl token?

spice heron
#

using top.gg python api, it's not updating my server count, with no errors in logs. anyone else having the same experience ?

rain heart
wraith skiff
#

oke

#

why isnt this working?

#

I mean it is

#

but on_dbl_test doesnt

spice heron
#

don't post your token dude

wraith skiff
#

oh

rain heart
#

don't post your token

#

reset it

wraith skiff
#

i didnt notice

#

I

#

did

spice heron
#

for what it's worth, this is my code: ```py
import os
import dbl
from discord.ext import commands
import logging

logger = logging.getLogger('hangman')

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

def init(self, bot):
self.bot = bot
self.token = os.getenv('DBL_TOKEN', 'Token Not found')
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes

async def on_guild_post(self):
logger.debug("Server count posted successfully")

#

any idea why no posting is happening ? and no errors either

wraith skiff
#

is on_dbl_test a thing?

#

it wont work for me

spice heron
#

no idea man, sorry

wraith skiff
#
from discord.ext import commands

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

    def __init__(self, bot):
        self.bot = bot
        self.token = token  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/webhook', webhook_auth='jK2n06Df', webhook_port=5000)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        print(data)

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

this is the code

green roost
green roost
tawdry bay
#

he he im still waiting for my bot to be added to the site

rain heart
#

-api

abstract mothBOT
#

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

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

spice heron
#

literally nothing

#

these are my logs

green roost
#

It doesn't? Huh. Feature request time then.

spice heron
#

it's supposed to log but it doesn't

#

it never logged (even when it worked)

night matrix
#

Question regarding 'test webhook' for the server - I'm assuming it's sent with a user ID other than my own? πŸ˜…

sullen nymph
#

It is sent with your own user ID

night matrix
#

I mean, I can see that it isn't currently being sent with my discord ID - I'm wondering if it's just the 'test webhook' bit that is doing something different or if I'm getting user IDs from the wrong place πŸ˜…

sullen nymph
#

I doubt you can even test a webhook with a pending bot

night matrix
#

Test webhook for the server lol 😜

jaunty plank
#

Pretty sure test webhooks dont work for servers currently

night matrix
sullen nymph
#

... yup

night matrix
#

Oh... So do I have to convert it to a discord ID? 😭

sullen nymph
#

I... don't think you can?

#

You can just hardcode the user ID to yourself if the request type is test

#

Honestly, though, not sure why top.gg IDs are sent instead

night matrix
#

🀷 I don't need it to be correct for test so I'll just add some logic to check if the ID is a real 'player' for my bot to prevent errors lol - thanks for the help all :+1:

sullen nymph
sleek mica
#

it takes around 2 weeks for my bot to get approved/denied right ?

rain heart
#

-api

abstract mothBOT
#

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

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

spice heron
#

the python sdk is either really terribly made or just won't work for me

#

what the heck is supposed to happen now

#

it's been like this for 5 mins

#

it's probably because of python 3.9 right

#

yep, fixed it

sullen nymph
#

v1.0.0 supports Python 3.9 but isn't documented very well atm

spice heron
#

it doesn't

#

last I saw anyway

#

unless my pipenv didn't automatically update anyway

#

let me check

#

@sullen nymph is 1.0 not on pypi? I get this: Skipped Update of Package dblpy: 0.4.0 installed, 0.4.0 required (Unpinned in Pipfile), 0.4.0 available.

sullen nymph
#

Yeah not yet

spice heron
#

sigh

#

that's why

#

oh well

#

time to adopt and fix the ratelimit package

wraith skiff
#

how can I test the votes?

#

without having to vote

#

so I know that it works

rain heart
#

press test vote

wraith skiff
#

yea but

#

that doesnt do anything

#

and yea I did do everything right

rain heart
#

then your url is most likely wrong

#

test it using postman

wraith skiff
#
from discord.ext import commands

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

    def __init__(self, bot):
        self.bot = bot
        self.token = token  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/webhook', webhook_auth='', webhook_port=23919)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print(data)

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

url?

rain heart
#

You need to set your webhook url in your bot page settings

wraith skiff
#

oh I did

#

wait

rain heart
#

cannot be a discord webhook

wraith skiff
#

ik

#

but

#

wait

#

look

rain heart
#

according to your code it would be http://yourserverip:23918/webhook

wraith skiff
#

should I remove webhook?

rain heart
#

You need to use a port from heroku iirc

#

nah that's correct

#

no clue how heroku works. can't help with that

wraith skiff
#

I use a flask webhook

#

not heroku

green mantle
#

flask != heroku

#

framework != host

wraith skiff
#

I'll just try to make the webhook handle upvotes since this won't work

sullen nymph
#

how are you running your Flask script

#

sigh

wraith skiff
# sullen nymph how are you running your Flask script

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    if request.headers.get("Authorization") == auth:
        if request.method == 'POST':
            return 'success', 200
        else:
            abort(400)
    else:
        abort(400)

if __name__ == '__main__':
    app.run()
sullen nymph
#

does that even run it

wraith skiff
#

yes it works

#

it prints and all

sullen nymph
#

so it runs on port 5000 by default

#

Try using webhook_port=5000

wraith skiff
#

I did but it still didnt work so I used the port that app uses which is 23919

#

but still nope

#

@sullen nymph ?

#

thats yours?

sullen nymph
#

yeah

wraith skiff
#

cool

sullen nymph
wraith skiff
#

its not running on my pc

#

its running on heroku

spice heron
#

while I wait to become owner of ratelimiter, here: pip install --target=./ --no-cache-dir --upgrade git+https://github.com/gear4s/ratelimiter.git@master

#

fixes TypeError: object Lock can't be used in 'await' expression for python 3.9

sullen nymph
#

Did you contact PyPi to have the project transferred to you

spice heron
#

yep

sullen nymph
#

Eh.

#

dblpy already has one built-in starting v1.0.0 which will be released soon

spice heron
#

I know

#

but it's not been released yet has it

#

and I'm kinda sick of my bot spitting that error anyway

sullen nymph
#

Wouldn't go as far as taking over a package, but you do you Β―_(ツ)_/Β―

spice heron
#

Β―_(ツ)_/Β―

#

it needs to be updated and the maintainer is not updating it

#

so

#

w/e

#

I've had py3.9 since release and it's bugged me ever since

wraith skiff
#

I managed to have the port be 5000

restive otter
#

Can I have a notification system every time someone votes for my bot without using webhooks ?

rain heart
#

no

#

if you want realtime notifications, use webhooks

#

there's no other way except spamming the heck out of the api that could get you ratelimited multiple times

restive otter
#

alright, thanks. I'm asking the question because I'm self hosting on my raspberry Pi

#

so I can't get a server that has a fixed IP to send the webhooks to

exotic hinge
#

How do I send a message with the bot whenever someone votes a bot

#

btw my bot runs on repl

jaunty plank
exotic hinge
#

I tried but its not working

jaunty plank
exotic hinge
#

I put

#

@clear geyserient.event
async def on_dbl_vote:
print(data)

golden tinsel
jaunty plank
exotic hinge
#

yeah

jaunty plank
exotic hinge
#

https://REPL_NAME.repl.co

#

it was in this format

#

then for auth

#

i put

#

MESSAGE_TRACKER

#

(my bot name)

golden tinsel
jaunty plank
#

using webhooks would be the best method

exotic hinge
#

ok wait discord webhooks or top.gg api webhooks?

jaunty plank
#

no

#

top.gg webhooks are not compatible with discord webhooks

exotic hinge
#

oh

#

So, do I code the top.gg api in my bot code?

jaunty plank
exotic hinge
#

so yes?

jaunty plank
#

yes

exotic hinge
#

do i make a seperate file

#

or no

#

cuz it looks like a cog

sullen nymph
#

eaeaeaeaeaeaeaeaeaeaeeaeaeaeaeaeaeaeaeaeaeeeeeeeaaaaaaaeeeeeeeaaaaaaaaeeeeeeeaaaaaaaaaeeeeeeeaaaaa

#

The examples are cog-oriented, but you are not forced to use them for dblpy

jaunty plank
#

yay, shiv save me. my lack of py knowledge ia_sad_cry_shy

sullen nymph
#

All you really need is an instance of DBLClient saved in a variable and events attached to the same client you pass to DBLClient

golden tinsel
#

So I have this

#

what am mI suposed to put in the webhook URL?

exotic hinge
sullen nymph
#

In a way

golden tinsel
#

I have this code:
And it prints nothing when I test/vote

from discord.ext import commands, tasks

import dbl
import libs.database as db

import os

KEY = os.getenv('TOPGG_TOKEN')

class TopGG(commands.Cog):
    """
    This example uses tasks provided by discord.ext to create a task that posts guild count to top.gg every 30 minutes.
    """

    def __init__(self, bot):
        self.bot = bot
        self.token = KEY  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='never', webhook_port=5000)
        self.update_stats.start()

    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=30)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        await self.bot.wait_until_ready()
        try:
            server_count = len(self.bot.guilds)
            await self.dblpy.post_guild_count(server_count)
            print('Posted server count ({})'.format(server_count))
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))


    @commands.Cog.listener()
    async def on_dbl_vote(self,data):
        print(data)
        print(data.isWeekend)
        print(data.bot)
        print(data.user)
        await db.query(
            f'''
                UPDATE users
                SET votecount = votecount + 1
                WHERE id = {data.user}
            ''')
    @commands.Cog.listener()
    async def on_dbl_test(self,data):
        print(data)
        
        


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

If you use @bot.event, pass bot to DBLClient

#

see where I'm getting at?

exotic hinge
#

ok

sullen nymph
#

Ah missed the message above

#

http://ip:5000/dblwebhook

#

where ip is your machine's IP addrss

golden tinsel
#

I host it on heroku...

exotic hinge
#

i host on repl

golden tinsel
#

so what ip would I use?

exotic hinge
#

i actually have the same question as creare

#

what url would I put if I have it on repl

sullen nymph
#

For repl you host on port 8080 and use the repl.co URL

#

For Heroku, as it seems, you need to get the PORT environment variable passed by Heroku itself

#

that means you can't just do run(port=xxx)

exotic hinge
#

oh

#

ok thanks

sullen nymph
#

You can usually easily get it when running your repl

exotic hinge
#

what should I put for auth

restive otter
#

dont forget to add /dblwebhook btw

sullen nymph
#

Anything you wanna use as a password

#

Auth is just that, a password you create and enter in your code and on top.gg

exotic hinge
#

should I add /dblwebhook after repl

sullen nymph
#

yes

golden tinsel
exotic hinge
#

172.18.0.1 - - [11/Mar/2021 19:01:56] "POST /dblwebhook HTTP/1.1" 404 -
172.18.0.1 - - [11/Mar/2021 19:02:56] "GET /dblwebhook HTTP/1.1" 404 -

#

this popped up

golden tinsel
#

same,



golden tinsel
#

oah gosh thx

sullen nymph
restive otter
#

also you need to turn on web dyno

#

dang it shiv

exotic hinge
sullen nymph
#

Let's take a step back, then. Are you using commands.Bot or discord.Client?

exotic hinge
#

commands.,bot

sullen nymph
#

How do you load your cogs/extensions?

exotic hinge
#

client.load_extension("file_name")

sullen nymph
#

Do you think I could view your repl manually?

golden tinsel
#

quick question I have my error, I my issue that I just don't have the right port? I am using webhook_port=5000 is that wrong? for heroku

#

gtg, If you have a response dm me

exotic hinge
#

ok

sullen nymph
#

read this

#

get the PORT env var

exotic hinge
#

dms

sullen nymph
#

the returned value will be what you will use as a port

jaunty plank
exotic hinge
#

i dmed you @sullen nymph

sullen nymph
#

apart from enabling the dyno, there's a special case with ports for Heroku @jaunty plank

#

There's no specific port Heroku sticks to, but instead it's a dynamic system

#

according to a few SO posts, one must rely on env vars for the port

#

oh good lord

#

@exotic hinge you have a keep_alive running that occupies your port 8080

exotic hinge
#

yeah

sullen nymph
#

You can't have two scripts running on the same port

exotic hinge
#

wdym how else woujld I do it

sullen nymph
#

One way is to have your keep_alive script use a separate route for top.gg requests

#

and then to INTERNALLY redirect it to your dblpy webhook

#

aka keep_alive in port 8080, dblpy webhook port 5000. on request to keep_alive, route /dblwebhook, send a request to port 5000 localhost

exotic hinge
#

so do i make another file?

sullen nymph
#

Not exactly

#

The thing here is you need to modify your keep_alive in order to make it work with a webhook running locally

exotic hinge
#

I don't really understand

#

am i supposed to change the port

sullen nymph
#

I wish I wasn't dead tired to explain this in detail but my brain is barely putting together two sentences

#

keep_alive is a Flask webhook, right?

exotic hinge
#

yeah

sullen nymph
#

So that means that it's a webhook, but a publicly accessible one

exotic hinge
#

well yeah cuz its on repl

sullen nymph
#

Your dblpy webhook, on the other hand, will not be publicly accessible through a repl.co URL

#

Instead, it will run locally under some port like 5000, which is not publicly accessible

#

In your Flask webhook, you might want to create a specific route for top.gg requests, like /dblwebhook

#

what it will do is send POST request to the local webhook, port 5000, with the vote data and headers, etc.

#

essentially becoming middleware

exotic hinge
#

ok..

#

btw i use uptime robot to actually host the bot

sullen nymph
#

Yeah I could already tell

exotic hinge
#

should I make another function with port 5000

sullen nymph
#

You don't set a port to a function

exotic hinge
#
from flask import Flask
from threading import Thread


app = Flask('')

@app.route('/')
def main():
    return "Your bot is alive!"

def run():
    app.run(host="0.0.0.0", port=8080)
  

def keep_alive():
    server = Thread(target=run)
    server.start()

I have this

#

how would I modify

sullen nymph
#

use the @app.route thingy in keep_alive that will send a POST request to http://127.0.0.1:5000/dblwebhook

sullen nymph
#

the app.route and 127.0.0.1 things are for redirecting the request

exotic hinge
#
from flask import Flask
from threading import Thread


app = Flask('')

@app.route('/')
def main():
    return "Your bot is alive!"

def run():
    app.run(host="0.0.0.0", port=8080)
  
@app.route('/')
def keep_alive():
    server = Thread(target=run)
    server.start()

?

sullen nymph
#

google how to set up a route in Flask

exotic hinge
#

ok

scenic mirage
#

Hello

#

Hablan espaΓ±ol

#

??

#

:(

jaunty plank
scenic mirage
#

Si

scenic mirage
oak orbit
#

how do I write this in the new version of dplapi.js?

dbl.hasVoted(message.author.id)

the "new version" is @top-gg/sdk

scenic mirage
#

._.

restive otter
#

someone help me so that users have to vote for the bot to be able to use the command

#

please help

oak orbit
#

Just read the docs

restive otter
#

I don't understand xd

oak orbit
#

API Error: 429 Too Many Requests is topgg down?

oak orbit
restive otter
#

I do not understand anything xD

oak orbit
#

So there's nothing I can do to help you

#

Maybe learn some js

restive otter
#

okey

oak orbit
#

API Error: 429 Too Many Requests how can I prevent this error?

#

Ping me with the awnswer

willow spindle
#

are you spamming the api

oak orbit
#

No

willow spindle
#

429 means you are being ratelimited

oak orbit
#

Like one of my commands need to vote to be used

willow spindle
#

i think someone spamming that command

oak orbit
#

The command have 3s cooldown

rapid kettle
#

you should really store shit like that and use a webhook

oak orbit
#

Wym?

#

How should I use a webhook

#

I changed today from dblapi.js to the new one

#

So yea I'm a little confused

jaunty plank
oak orbit
jaunty plank
#

well, you dont send any requests at all, so you cannot get ratelimited

oak orbit
#

Hm ok

restive otter
#

Can on_dbl_vote be used as a normal client.event ?

restive otter
#

Please Tell

restive otter
#

yes

#

client.dispatch dispatches to both internal and external listeners

#

actually Bot since Client doesn't have external listeners other than wait_for

flat jetty
hushed reef
restive otter
#

I Have written using that only in my codes

#

but it never gets called

green roost
#

This is one of those if you did it right it would work properly situations.
Did you try testing your webhook?

restive otter
#
dbl_client = dbl.DBLClient(bot = client,token=dbl_token,webhook_path=dbl_webhook)
#

No I DIdnt try

#

testing my webhook

green roost
#

Well test it

restive otter
#

Is this right way to construct?

green roost
#

Lgtm

#

But test the webhook

restive otter
#

I Tested

#

But Nothing Happened

green roost
#

Then your webhook isn't working. Check the logs.

restive otter
#

Where Can I check them

#

I Have created a webhook Linked to a channel

green roost
#

Unsure if you need to specify a port as well Hmmm
Try specifying a webhook port in the constructor

green roost
restive otter
#

yes

green roost
restive otter
#

Oh

green roost
#

You need to specify a port in the DBLClient constructor

restive otter
#

Have i constructed The rest right?

#

correctly

green roost
#

And the webhook URL should be http://your_server_ip:your_webhook_port/your_webhook_path

restive otter
#

I Dont know anything about webhooks so i created one from a channel

#

F

#

Where Can i Create one

green roost
#

The python sdk creates a webserver for you that handles the webhook

#

Just pass an unused port to webhook_port and a webhook_path

loud jewel
#

I keep on getting this error on my VPS does anyone know a possible fix?

green roost
#

Did you install it?

loud jewel
#

nope, i've re-installed it a couple of times but that issue keeps on occuring

#

That emoji is perfect

restive otter
#

Kaka

green roost
#

Are you installing to the right project?

loud jewel
#

@azure pollen do you know any fixes?

azure pollen
#

i believe @hearty lintel is the maintainer for that?

#

i would just make sure you are installing it in the right place, node_modules can be super tricky

loud jewel
azure pollen
#

i pinged him here, he's offline atm

loud jewel
#

ok, Thanks

azure pollen
#

continue to see if you can get it working, it looks like an install problem rather than a lib problem

loud jewel
#

s

#

But this seeems like an isolated issue on my vps

sullen nymph
#

Berry maintains the js sdk

woeful timber
#

Hi

restive otter
#

So how do I make it when someone votes 5x they get voted 5x role 10x Ythey get votes 10x role and so on

rain heart
#

track the vote count using the webhooks, then give them roles on the 5th vote

#

It requires coding knowledge though

vocal robin
restive otter
#

e

short leaf
#

I am getting such an error on my discord bot what should I do please help me

faint knot
#

Fix it!