#topgg-api

1 messages Β· Page 155 of 1

gritty belfry
#

Do I have to get my bot verified to run a webhook?

#

I just want to collect user votes on my server

#

I have a bot, but I don't really wanna make it public

#

Any idea why it shows this?

#

My bot isn't verified

#

But I need to run a webhook to get server vote details

#

Hmm, I always shows get this error when I try to setup one

#

Maybe, I'm mixing it up. Do you have a different webhook for servers?

gritty belfry
#

Wow, thanks man. Just needed to get that link

#

Damn, that was easy. It worked. I was seriously messing it up

#

Thanks again

eternal turret
#

oh thnx , cud u show me an example of how that works

eternal turret
#
    """
    This example uses dblpy's webhook system.
    In order to run the webhook, at least webhook_port must be specified (number between 1024 and 49151).
    """

    def __init__(self, bot):
        self.bot = bot
        self.token = '[insert token here]'  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='path', webhook_auth='yeet', webhook_port=5000)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        """An event that is called whenever someone votes for the bot on top.gg."""
        print("Received an upvote:", "\n", data, sep="")

    @commands.Cog.listener()
    async def on_dbl_test(self, data):
        """An event that is called whenever someone tests the webhook system for your bot on top.gg."""
        print("Received a test upvote:", "\n", data, sep="")


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

i copy pasted this code to test out the vote command

#

but there was no output on voting

#

am i doing something wrong here

restive otter
#

Have you loaded the cog? Is that path a placeholder? Cuz it should start with a slash.

lavish sentinel
#

Do we need to set anything in the bot settings page for webhooks for dblpy to work?

restive otter
#

Yes

lavish sentinel
#

what do we need to set?

restive otter
#

The URL at least

lavish sentinel
#

what url? /dblwebhook ?

restive otter
#

That's the path, the URL will be something like http://IP:PORT/PATH

lavish sentinel
#

the ip of where the bot is running on?

restive otter
#

The public one, yeah

lavish sentinel
#

I used it and tested it and it doesn't seem to work

#

I put http://IP:1234/dblwebhook
and the password

restive otter
#

Try accessing it through your browser, it should show 405 if it's running

lavish sentinel
#

It's not appearing in browser, saying it "took too long to respond"

restive otter
#

Make sure the port is open and it's the exact same port and path you put in the code

lavish sentinel
#

webhook_path='/dblwebhook', webhook_auth=password, webhook_port=1234

sullen nymph
#

@restive otter is it fine to enter example data like this?

#

I don't see any other "sensible" way of doing that so uh KEKW

restive otter
#

I guess so, there's nothing wrong with it

sullen nymph
#

Thanks

restive otter
#

Assuming that d's reference isn't used, since if something is popped, it might break the tests.

sullen nymph
#

πŸ˜›

restive otter
#

If it works, it works better_lollipop

sullen nymph
#

Now for the more painful part:
Documentation!

#

KEKW Tests pass so I don't care

restive otter
#

I wonder if the docs build from the objects' __doc__

sullen nymph
#

Sphinx does, yeah

restive otter
#

Ah, cuz syncing them by hand seems a pain

sullen nymph
#

lmfao no way I'm gonna copy-paste class docstrings xd

#

Changelog and additional notes I have to do by hand though, so that's the painful part

eternal turret
#

and what is the path supposed to be?

restive otter
# eternal turret how do u load a cog?

Is that your main file? If so, just put the bot.add_cog line on the top-level, meaning, put it outside of the function. Otherwise, just load it with bot.load_extension

plucky lance
eternal turret
#

thats it

#

rest all i can do

plucky lance
#

Well if it's supposed to happen "live" you will have to setup a webhook service

#

To receive incoming requests from topgg

eternal turret
#

also

#

what excatly is bot supposed to be

plucky lance
#

The docs already contain examples how to do so

eternal turret
plucky lance
#

Keep in mind you have to setup firewall rules for incoming connections

eternal turret
#

uhuh

plucky lance
#

And don't think about hosting the webhook service at home

eternal turret
#

im not doing that

#

gonna cloud hosted

plucky lance
#

Alright, this means you don't have to deal with a router firewall but still your own system firewall

eternal turret
#

ok

plucky lance
#

After installing the lib as the docs say you have to specify a webhook port your service will listen to, for example 5000

restive otter
plucky lance
#

That port (e.g. 5000) needs a rule in your firewall

#

INBOUND rule on port 5000 TCP

#

That's all

eternal turret
plucky lance
#

depends on the OS

eternal turret
#

of the host?

plucky lance
#

yeah, your webhook service will run on

eternal turret
#

hmmm

restive otter
#

The host you're using might have a GUI for it

eternal turret
#

wud that work?

plucky lance
#

actually can't tell you, dunno that service provider

restive otter
#

Heroku dynamically changes the PORT afaik, get it from os.environ or os.getenv

eternal turret
#

ayt thnx

sullen nymph
#

It's amazing how many mistakes there are in the docs and no one ever pointed them out

sullen nymph
#

Exactly

restive otter
#

Is there even a single soul reading it lulw

sullen nymph
#

I have no clue lol

#

Let me see the stats

restive otter
sullen nymph
#

Surprisingly

restive otter
#

Didn't expect that tbh LUL

sullen nymph
#

Me neither KEKW

eternal turret
#

pretty sure half of that was from me

restive otter
#

That's nice

loud token
#

I do not like the current docs

#

or at least that it says import dbl in some places

sullen nymph
#

Ya that'll be changed soon

loud token
#

this isn't really an api question, but have you used apscheduler before? and if so which job store do you rec

sullen nymph
#

Never. I only use asyncio tasks and while True loops in my projects to mimic cronjob behavior

loud token
#

hmm okay

#

it's just because I want job persistence so that's why I was considering using it, ofc I could just save a bunch of datetimes in a sql table and use that as a way to work around it

#

but that's a little scuffed

sullen nymph
cobalt dirge
#

Hi, I didn't get bot because of that code from top gg and now it's out of the code that I'm sending to top gg doesn't answer please what to do now πŸ₯Ί

restive otter
#

Best way to get votes for a specific bot via python?

jaunty plank
restive otter
#

generic

jaunty plank
#

oh the lib might have it actually

restive otter
#

hmm

#

yeah i think i see it

#

I appreciate it my guy πŸ™‚

#
Unhandled exception in internal background task 'update_stats'.
Traceback (most recent call last):
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\discord\ext\tasks\__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "D:\PycharmProjects\Tricorder\cogs\general\LoopedTasks.py", line 39, in update_stats
    print('count', await self.bot.dblpy.get_bot_info())
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\client.py", line 226, in get_bot_info
    return await self.http.get_bot_info(bot_id)
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\http.py", line 180, in get_bot_info
    resp: Union[dict, str] = await self.request('GET', '/bots/{}'.format(bot_id))
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\http.py", line 144, in request
    raise errors.Unauthorized(resp, data)
dbl.errors.Unauthorized: Unauthorized (status code: 401)```
#

oof

#
print('test', await self.bot.dblpy.get_bot_info())
jaunty plank
#

get bot info requires the id of the bot you are trying to look up

#

oh or not

#

you didnt use your token

restive otter
#

oh btw

#

when does the token expire

jaunty plank
#

Hit the Edit Button on your bot page
Press the Webhooks button on the sidebar
Hit Show Token
Copy

restive otter
#

because it constantly expires for me

jaunty plank
#

never afaik, unless it gets leaked, or you(or another one of your devs) reset it

restive otter
#

hmm

#

Unhandled exception in internal background task 'update_stats'.
Traceback (most recent call last):
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\discord\ext\tasks\__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "D:\PycharmProjects\Tricorder\cogs\general\LoopedTasks.py", line 39, in update_stats
    print('count', await self.bot.dblpy.get_bot_votes())
AttributeError: 'DBLClient' object has no attribute 'get_bot_votes'```
#

ok

#

aaaand forbidden

#
Unhandled exception in internal background task 'update_stats'.
Traceback (most recent call last):
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\discord\ext\tasks\__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "D:\PycharmProjects\Tricorder\cogs\general\LoopedTasks.py", line 39, in update_stats
    print('count', await self.bot.dblpy.get_bot_upvotes())
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\client.py", line 203, in get_bot_upvotes
    return await self.http.get_bot_upvotes(self.bot_id)
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\http.py", line 189, in get_bot_upvotes
    return await self.request('GET', '/bots/{}/votes'.format(bot_id))
  File "D:\PycharmProjects\Tricorder\venv\lib\site-packages\dbl\http.py", line 146, in request
    raise errors.Forbidden(resp, data)
dbl.errors.Forbidden: Forbidden (status code: 403)```
jaunty plank
#

did you give it the right token for the bot you are looking up?

restive otter
#

yea

#

or

#

well

#

let me check something

foggy slate
#

how I do setup a webhook url to send webhook data to?

restive otter
#

Figured it out

#

Ty

#

(Woo)

jaunty plank
#

port and path you choose in your code, ip is the public ip your webhook can be received at.

foggy slate
#

how do I make a reciever?

jaunty plank
foggy slate
#

I'm using dblpy

jaunty plank
foggy slate
#

I'm already using it but I don't understand

#

does client.dblpy = dbl.DBLClient(client, topgg_token, webhook_path='/dblwebhook', webhook_auth='hehexd', webhook_port=5000) create a webhook at localhost:5000?

jaunty plank
#

the webhook would be at
http://PUBLICIP:5000/dblwebhook

#

it can listen on localhost too, but localhost isnt something top.gg can access

foggy slate
#

so the http://PUBLICIP:5000/dblwebhook i'd put in webhook url settings right?

jaunty plank
#

yep, will need to replace the actual ip, but yep thats it

foggy slate
#

I tried accessing http://localhost:5000/dblwebhook but I get 405: Method Not Allowed

jaunty plank
#

yep thats normal, its a webhook, not a website.

#

you cannot "get" a webhook like your trying to do, only post to it.

foggy slate
#

how i access the data?

jaunty plank
#

you dont? its a webhook.

#

you run the reciver in your code, then put the url in the url section on top.gg
then top.gg will post to your webhook, and you handle it in code.

foggy slate
#

Why am I getting TypeError: on_dbl_test() takes 1 positional argument but 2 were given

#

this is my code

class TopGG(commands.Cog):
    def __init__(self, client):
        self.client = client
        client.dblpy = dbl.DBLClient(client, topgg_token, webhook_path='/dblwebhook', webhook_auth='hehexd', webhook_port=8015)
    
    @commands.Cog.listener()
    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 upvote:\n{data}")
sullen nymph
#

Forgot a self parameter in the method

foggy slate
#

client.dblpy = dbl.DBLClient(self.client, topgg_token, webhook_path='/dblwebhook', webhook_auth='hehexd', webhook_port=8015)

foggy slate
sullen nymph
#

In the on_dbl_test event

foggy slate
#

I dont understand what u mean

sullen nymph
#

Do you understand how a method should refer to the instance of the class it's used in

foggy slate
#

ohhh

#

i get it now

devout anchor
#

hi so i was wondering how i could use the api so when they try using the command after using it it tells them how much time they have left to vote again

restive otter
#

Server count blank - what to do?

plucky lance
#

Ask in support.
You can’t remove your server count or post null using the API

smoky marten
smoky marten
silk canopy
#
app.post("/dblwebhook", webhook.listener(), async (req, res) => {
    const hook = new Discord.WebhookClient("id", "token")

    const user = await bot.users.fetch(req.vote.user)

    const embed = new MessageEmbed()
    .setDescription(`${user.tag}(${user.id}) just Voted Me On Top.gg`)

    hook.send(embed)
});

Is This Correct?

restive otter
#

hi

#

i need help

#

how do server count like this

rain heart
restive otter
rain heart
#

read the docs

restive otter
#

soory

restive otter
#

How to get the server count on bot home page

upper lark
restive otter
#

Idk how to use their api

upper lark
bleak jacinth
austere seal
#

For which code

restive otter
#

You should pass an instance of Client or its subclasses, not a module. Also, why would you attach the DBLClient to a module?

bleak jacinth
#

owh lol. i was being stupid

sullen nymph
restive otter
#

Sure, ez 2 lines

sullen nymph
#

evil giggles assert isinstance(client, __import__("discord").ext.commands.Bot)

restive otter
#

lmao

#

you should check it against discord.Client doe

#
class WhatEverErrorItsCalled(TopGGException): ...

if not isinstance(bot, discord.Client): raise WhatEverErrorItsCalled("some message")
#

Oh no, no docstring blobweary

sullen nymph
#

ClientException gang KEKW

#

I'll probs add it after I'm done with vote data

restive otter
#

You haven't updated topggpy's readme btw mmulu

sullen nymph
#

Hold on I'm busy having a pointless argument on Twitter

restive otter
#

lmao

scarlet cobalt
#

One message removed from a suspended account.

sullen nymph
#

I hope your keyboard disconnects from your PC while you're playing Overwatch

scarlet cobalt
#

One message removed from a suspended account.

scarlet cobalt
sullen nymph
#

I hope your drivers will always be outdated

scarlet cobalt
#

One message removed from a suspended account.

sullen nymph
#

❀️

supple karma
#

how do i take the bot field in spring boot , idk how to take Snowflake type variable πŸ€”

#

pong me and tell pls o:

sullen nymph
#

spring boot..?

#

snowflake is ID in string form

supple karma
#

well that answers my question

supple karma
sullen nymph
#

express in JavaScript

#

So a webserver

#

Yeah KEKW

tacit moat
#

Perhaps I placed this in the wrong channel previously... But I don't see a "bug reports". Indirectly API related? (don't hurt me lol)

#support message

#

Website bug.

#
Yo. I'm unable to reply to reviews or thumbs-up reviews, it seems.
I get a nice little load bar at the top along with the loading circle for a long time (20 seconds or so, for completion), then when it finishes, nothing changes. No page POST, no reload, and on refresh nothing has updated.
restive otter
#
  1. Explain the state of matter
sullen nymph
#

Indirectly not specifically the API itself, but yeah - website bug

tacit moat
#

Pretty easy to repro

#

Will do.

vague zinc
#

on python im trying to print the bot.dblpy.guild_count, but all it returns is that its a method of an object at a certain address

#

more specifically

<bound method DBLCient.guild_count of <dbl.client.DBLClient object at (address)>>
#

thats with the ()

uneven valley
#

Is it possible to get a bots monthly votes via the API without an Authorization token?

jaunty plank
#

I dont think any endpoint is available without a token.

uneven valley
#

hmm. Than is it possible to get it if you dont have a submitted bot?

jaunty plank
#

nope. the api is for bots only.

sullen nymph
uneven valley
#

I wanted to make something that you could enter the bot ID and it would display the monthly votes for that bot.

uneven valley
#

I know.

vague zinc
#

python 2.7

uneven valley
#

I was going to try to make a badge on shields.io for it

sullen nymph
#

2.7 what

sullen nymph
#

This channel is appropriate for help with the API

#

Anyhoo wdym by blank

restive otter
#

I mean

#

I dont know how to display server count

sullen nymph
#

Ah okay

#

What language do you use

restive otter
#

Even in -botinfo it says my bot is in 0 servers

restive otter
sullen nymph
#

discord.js?

restive otter
#

Yes

sullen nymph
restive otter
#

Thx

uneven valley
vernal trench
#

Whats the webhook auth?

jaunty plank
#

its a password for your webhook to know if the request is coming from top.gg
you choose what it should be.

vernal trench
#

ok

#

dbl_token = '***'  # set this to your bot's top.gg token
bot.dblpy = dbl.DBLClient(bot, dbl_token, webhook_path='/dblwebhook', webhook_auth='****', webhook_port=5000)

@bot.event
async def on_dbl_vote(data):
    """An event that is called whenever someone votes for the bot on top.gg."""
    print(f"Received an upvote:\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 upvote:\n{data}")

I use this code. why it doesnt work?

jaunty plank
#

did you fill in the url and auth on the website?

vernal trench
#

yes

jaunty plank
#

where are you hosting? home/vps/replit/heroku

sullen nymph
#

@restive otter

class DataDict(dict):
    """Generic class used in topggpy to represent received data from the API."""

Would this technically be correct or should I use another word instead of Generic?

#

Cuz to me it sounds reasonable but wrong at the same time

restive otter
#

Hmm, I don't think it's a generic class, because the value type varies

sullen nymph
#

idk which word I can use in this case

#

"General"?

#

Data class? KEKW

restive otter
#

"The base class for TopGG models" or something? xD, I'm bad at wording mmulu

#

It's indeed a base class, isn't it

sullen nymph
#

Base class!

#

ty man

restive otter
#

np

sullen nymph
#

Oh God autodoc is such a pain

#

Like it refuses to refer to the local types folder when I use types.X with current module set to topgg

#

But when I change current module to topgg.types, I can't refer to DBLClient.generate_widget without having to specify the module name!

#

Oh God

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

const app = express()

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

app.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\
  
  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(80)

What does the /dblwebhook respresent?

#

Webhook URL?

#

@sullen nymph Sorry for ping but can you help?

vernal trench
jaunty plank
vernal trench
#

yup

jaunty plank
jaunty plank
vernal trench
#

ill just host it on replit lol

restive otter
jaunty plank
restive otter
#

hm

#

ok

vernal trench
#

Still doesnt work

jaunty plank
vernal trench
#

oh no not that

#

i have lke this

jaunty plank
#

top.gg webhooks are not compatible with discord webhooks.

#

you need to use the url to your webhook receiver(the code you used above) not discord.

vernal trench
#

ok

#

i think i know what you mean

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

const app = express()

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

app.get("/", (req, res) => {
    res.send("The Bot is preparing to get uploaded...")
})

app.post("/dblwebhook", webhook.listener(vote => {
    const hook = new Discord.WebhookClient('webhook-id', 'webhook-token');

    hook.send(`${vote.user} just voted!`);
}))

app.listen(3000, () => {
    console.log("express server started")
})

@jaunty plank Its saying
webhook.listener is not a function

jaunty plank
#

are you on the most recent version of the sdk

restive otter
jaunty plank
#

sorry for the basic question, but did you save the file before running it

restive otter
#

so yes

#

and I reran the process too

jaunty plank
#

in your package.json is the version 3.1.1 or 3.1.0
any time before 3.1.0 webhook.listener worked differently.

restive otter
#

mine is showing "@top-gg/sdk": "^3.0.9",

#

idk why it installed the old version, I just installed it 30 mins ago

#

How do I update the version

jaunty plank
#

npm update @top-gg/sdk

mystic arch
#

So I know for a fact that my bot is in more than 1 server but for some reason, it's posting to top.gg like this

#

I just implemented this system the same with with one of my other bots and it worked fine. But for some reason, it's not working correctly with this one.

brittle spoke
#

whats your code

#

the sdk?

spice helm
#

Don't post your token

#

You'll have to regen that

brittle spoke
#

hmm it should be fine that code

mystic arch
#

I already did regen it the second I realized OMEGALUL

spice helm
#

Ah cool

mystic arch
#

I big dum

#

So, idk why it isn't working though

spice helm
#

We all make mistakes, i uploaded mine to a github repo once lmao

mystic arch
#

Still appearing as 1 server though oldstare

#
// Require discord.js package
const { Client, Collection } = require("discord.js");

// Create a new discord client using the new keyword
const client = new Client();

// npm install @top-gg/sdk
// Posts stats to top.gg
const AutoPoster = require('topgg-autoposter')

const ap = AutoPoster('token', client)

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

I think it may be a top.gg side bug.

#

Or maybe it has to do with my webbrowser

#

Cause I just reloaded the other bot that had it working a few seconds ago and now it has the same issue.

brittle spoke
#

no idea

mystic arch
#

What's the difference between them?

#

Like will I need to change anything code wise?

brittle spoke
#

if you read the code you will see the difference

mystic arch
#

Well other than the require area. Is there anything different?

#

I found it, nvm

#

Still didn't fix my issue btw, still says I only have 1 server.

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

const api = new Topgg.Api('')

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
    shardId: client.shard.ids[0], // if you're sharding
    shardCount: client.options.shardCount
  })
}, 1800000) // post every 30 minutes
#

Actually, it's possible I am stupid.

#

Hold up OMEGALUL

#

Okay, it was partially my fault and partially not.

#

Fixed it now though like

#

It's still pretty dang glitchy actually. Idk

mystic arch
#

Yeah, it's still broken.

#

So, idk what to do.

#

Hopefully it resolves itself 🀞

jaunty plank
#

are you running this on a test bot?

mystic arch
#

I checked that. It's on my main server for the bot and still posting wrong.

#

@jaunty plank

jaunty plank
#

so the code you are running is running on the actual main bot?

mystic arch
#

Correct.

#

100% certain of that because I accidentally made it go offline with messed up code lol

jaunty plank
#

what version of djs?

mystic arch
#

Latest stable version I believe.

#

7.7.6

jaunty plank
#

djs is on v12

#

v7 is like years ago

mystic arch
#

Yeah, that doesn't make sense Confused_Dog

#

I ran npm discord.js --v

#

Is that the wrong command?

jaunty plank
#

i typically check in the package.json

mystic arch
#

It's v12

#

I was running the wrong command I believe.

jaunty plank
#

hmm should be right then

#

might want to try the auto poster.

mystic arch
jaunty plank
#

yeah it does

mystic arch
jaunty plank
#

oh are you changing your code quite a lot? the example you gave wasnt the auto poster

mystic arch
#

Yeah

#

Cause I tried the other one and it didn't make a difference.

#

So I changed it back to the auto poster.

jaunty plank
#

it takes some time for the site to update to new values. if your swapping code quite a lot it might not show up.

mystic arch
#

I think it may be being ratelimited because initially I accidentally had it on my testing bot.

jaunty plank
#

ah then thats it

mystic arch
#

My Barnyard bot seems to be posting correctly.

#

Now that I fixed it

#

Does it say 100 for you?

jaunty plank
#

shows as 1 for me.

mystic arch
#

Tf

#

It was just showing 100 for me and then I reloaded and now it says 1 oldstare

#

What is this quack

jaunty plank
#

like i said, it takes time for the values to update.

mystic arch
#

Accept the Barnyard one was only on the main

#

I didn't use any alt bot for that.

#

So idk why it says 1

#

I guess I'll just wait for it to update and hope it fixes itself 🀞

jaunty plank
#

I think you just posted your test bots server counts, and haven't given it enough time to update.
if its not fixed in 30 minutes, try changing your code, and giving it another 30 minutes.

mystic arch
#

Alright shrug

#

Thanks for the help.

#

Now it's correct and then I will reload and it won't be correct quack

#

Yep.

#

Strange weird caching.

jaunty plank
#

i mean thats normal for pretty much anything with counting online

#

twitter, youtube both do it.

random zenith
#

@jaunty plank hey I got a question, I'm using the Java API but my bot got 4k votes rn, does that mean I got to switch to the webhooks?

jaunty plank
#

many of the endpoints are not safe past 1000 votes

random zenith
#

I've actually been busy creating a webserver in Java, but I just remembered the rule about ratelimits, its been 4 days since I use the java API

#

would I need to take the API out of the bot immediately?

restive otter
#

can i use autoposter if i dont have shards

jaunty plank
jaunty plank
random zenith
#

I use the DiscordBotListAPI in java and all I do is check if someone voted or not

#

api.hasVoted().whenComplete

random zenith
jaunty plank
random zenith
#

alright, then there shouldn't be a problem trespassing the 1k votes on top.gg MCSweat

restive otter
#
const api = new Topgg.Api(process.env.TOPGG)
setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
  })
}, 1800000) // 30 mins```
#

so i have added this into my main.js

#

and the server count is not working

#

any ideas why

brittle spoke
#

read above

#

or try the autoposter

restive otter
#

.nw a elysia

#

.nw acelyia

sullen lichen
#

what is the requirement for dbl python

#

i tried topgg==1.0.0

#

dblpy==1.0.0

#

neither work

sullen nymph
#

topggpy

sullen lichen
#

thx i will try it

#

what's the import?

#

I tired Import dbl but i got this error

2021-05-17T22:30:16.842315+00:00 app[worker.1]: Traceback (most recent call last):
2021-05-17T22:30:16.842424+00:00 app[worker.1]: File "/app/RoasterRooster2.0.py", line 8, in <module>
2021-05-17T22:30:16.842854+00:00 app[worker.1]: import dbl
2021-05-17T22:30:16.843014+00:00 app[worker.1]: ModuleNotFoundError: No module named 'dbl'

brittle spoke
#

there are docs about python...

sullen lichen
#

i probably wouldn't be asking here if I hadn't already looked

willow sphinx
zealous finch
#

.networth IBadAtEverything raspberry

#

rip

grim pewter
#

I'm confused what I'm supposed to put here, if someone could clarify that, that would be awesome

loud token
#

so if you're hosting on your computer, it'd be http://PUBLICIP:PORT/

#

where PUBLICIP = your public IP and PORT = the port you select

grim pewter
#

ah alr

grim pewter
loud token
#

go with port 5000

grim pewter
#

just did it, is there something I'm supposed to look for?

loud token
#

well are you sending anything to the webhook?

#

if you're not sending anything to it it's not gonna do anything

grim pewter
#

is it this?

loud token
#

that would do something when someone votes for your bot

grim pewter
#

wrong ss

#

this one

loud token
#

have you read the documentation on top.gg

grim pewter
#

its these that are triggered correct?

loud token
#

the events are triggered

#

so on_dbl_vote and on_dsl_vote

#

look at the documentation

grim pewter
#

I'm in the process lol

loud token
#

you gotta read it through

grim pewter
#

I have one last question

#

@loud token what exactly is this parameter ?

loud token
#

that's the route to the endpoint

#

it's for webhooks

#

to function

grim pewter
#

ohh

#

so i use the link from earlier?

loud token
#

no, that's done for you with this lib

#

you can add more things to the end to specify where to send things

#

to organize stuff

grim pewter
#

oh like a channel then

#

alr

loud token
#

like you could send bot votes to http://publicip:port/bot/

sullen nymph
#

You don't know what a route is?

#

Oh, hour ago

ember swan
#

Hi i try to see when someone vote for the bot but it dont work :/ i have done as the documentation say but it dont want to work. here's my work

#

on the first screen the url look like : http://myip:myport/dblwebhook and the auth is the same things as the red rectangle on the second screen

restive otter
#

Hi I need someone to help me make server count for my bot using api

restive otter
restive otter
#

only like 20 servers

#

Only server count is required

#

everything else is optional

#

Oh

#

@restive otter I don't know how to use top.gg api

#

It's like any normal API

#

You make a post request with JSON data

shy vortex
#

may I ask why I get 401 errors with the top.gg sdk even though I just updated my code and made a new token

magic star
#

seeing a lot of 504 Gateway Time-out when posting stats currently. ongoing issue?

bleak jacinth
#

any help on setting up the webhook in replit?? i know replit is not resommended for bot hosting but i don't have any other options. I am using discord.py btw

sullen nymph
#

In short words, run an async webserver along with your bot

restive otter
#

WebhookManager in a nutshell

sullen nymph
#

LMAO don't expose my tactics of working code

restive otter
fresh fjord
#

SUCESSFULLY DONE VERIFING MY MUSIC BOT

glad merlin
#

gz but it is not related to this topic

ember swan
#

can anyone help me for the webhook that check when someone vote ? i try since a day without anything working

vagrant venture
ember swan
#

really ? that's sad mathox1Awm

fresh fjord
ember swan
#

sad

balmy hamlet
#

I was lucky enough to get my bot verified on the first week the verification process came our

wise dew
#

Fuckkk you

jaunty plank
covert crescent
#

please give me api for make this

junior lintel
bleak cypress
#

Why does someone post a lot of posts when they vote?

jaunty plank
#

Like getting multiple webhooks?

vague tangle
#

top.gg api docs say to come here with questions why my code isn't working, but every time me or someone else don't have success with the api either someone links back to the docs or just ignores the question

vague tangle
#

ive tried multiple codes

spice helm
#

Thats very vague, are you not recieving anything?

vague tangle
#

Yeah

spice helm
#

I see, youre trying this on your own home network

#

Or on a VPS?

vague tangle
#

I host my bot myself, so on my home network

spice helm
#

Ok, have you done port forwarding through your router?

vague tangle
#

I've tried but I'm not really sure what I'm supposed to forward

spice helm
#

What port are you using for the webhook?

vague tangle
#

I haven't really decided yet, but I've been using 373 for my tests

#

and 80

#

and 8080

spice helm
#

Then you need to open that port on your router and you might need to forward it to your local ip

vague tangle
spice helm
#

Tcp? I think, it depends what your options are

vague tangle
spice helm
#

Probably http

vague tangle
#

Should I have it doing TCP, UDP or both?

spice helm
#

Tcp

vague tangle
#

idk if this is related but now my bot won't load when i try to start it using node

spice helm
#

Thats odd

#

I cant see why that would cause that

#

Is it waiting on a request?

vague tangle
#

idk

#

i took the the code out and its still not

#

weird

spice helm
#

Ok, im not experienced in node so i cant help you here sorry

vague tangle
#

ima restart real quick

spice helm
#

Ok

vague tangle
#

hm weird

#

I'll restore from a backup maybe

spice helm
#

Yeah

vague tangle
#

the backup works fine

spice helm
#

Oh ok

vague tangle
#

would this code be good?

spice helm
#

Yeah, thats been used by a few, it does the job just fine

vague tangle
#

alr let me test

#

nope

#

nothing

#

maybe should i set a custom port instead

#

like TCP?

spice helm
#

Yeah, try that

steady steeple
#

How does one get started with logging whenever someone votes for our bot? (plan on making a voting top leaderboard)

spice helm
#

I should add a nice embed thing for that lol

steady steeple
#

Mint! thanks

vague tangle
#

i did the integromat thing on your guide

#

how do i make it output the id of the person?

#

if i can get it to output the id of the person who voted into a channel i can do the rest from there

spice helm
#

Like send the user id in a message? For top.gg i think that's the user variable

vague tangle
#

yeah

#

but when i put user as the content

#

nothing happens

spice helm
#

Do you have the little window with the red buttons?

vague tangle
#

oh

#

hold on

#

let me drag in user

#

it worked!

#

thanks

spice helm
#

Np

vague tangle
#

but wait

#

it only does it when i click on the run once button

spice helm
#

You need to click that little switch to keep it running at all times

#

In the bottom left

vague tangle
#

i have it on yet its doing nothing

#

i accidentally made two webhooks could it have something to do with that?

spice helm
#

Yeah, just delete the disconnected one on the left

#

That should mean you only have one entry point

#

try it again after that and let me know if it works

vague tangle
#

hm

#

still nothing

#

they have these little bubbles

#

idk what it means

spice helm
#

Click on the 1 above the http, it might show an error

vague tangle
#

it says its fine

spice helm
#

Is the webhook one or http one?

vague tangle
#

webhook

spice helm
#

Ok, what's http say

vague tangle
#

the http one is also fine

#

i would send but it has webhook url

#

and im too lazy to block out

spice helm
#

You sure? open all fields on the http, it should show an error if there is one

vague tangle
#

no errors

#

when i do run once its fine

#

but it just doesnt activate automatically when someone votes

spice helm
#

That makes no sense, hmm

#

Make sure the switch is toggled on, and click back, it should ask you to save, maybe try that?

vague tangle
#

saved it

#

and the switch is toggled on

#

still nothing

#

wait\nevermind

#

it did it

#

i just had to save

spice helm
#

Ok cool

vague tangle
#

tysm!

#

ur the first one whos helped me with the votes

#

its confusing

spice helm
#

It is a bit lol

#

I'm trying to build a bot specifically for this stuff, but i'm not entirely sure if it would collide with discord ToS so idk rn

vague tangle
# spice helm It is a bit lol
 if (message.channel.id == "the channel id"){

        if(message.content){
          voterID = message.content
          const voter = client.users.cache.find(user => user.id == voterID)

          console.log("New vote: "+voter.tag+" ("+voter.id+")!")
          voter.send("Thanks for voting for Jimmybot! 20 Treats have been added to your balance! Vote again in 24 hours for more!")
          .catch(() => console("The voter has dms off!"));



          if(money[voterID] == null || !money[voterID]){
            money[message.author.id] = 0
            fs.writeFileSync(__parentDir+'/storage/money.json', JSON.stringify(money));
        }

           voterbal1 = money[voterID]
           voternewbal = Number(voterbal1) + 20
           money[voterID] = voternewbal
           fs.writeFileSync(__parentDir+'/storage/money.json', JSON.stringify(money));



        }

     }```
#

thanks to you i finally have a working system

spice helm
#

Nice :D

jaunty plank
# spice helm I'm trying to build a bot specifically for this stuff, but i'm not entirely sure...

I'm considering making a site that pretty much does what the above site does, just automatically.
something simple like,
http://topggwebhooks/webhooks/844312677757222739/QRxNoCRQnU2zOc3fBKROC7e6W5XnXz-e3Ox1lMLODXB8li6LxgObR9uASh7MHGYppNmC/
and just reformats the request to discords webhook format and sends it.
could be an easier solution than making a bot, and should have no issue with discord tos.

spice helm
#

Ah, that's simpler

#

My concern is would the site get rate limited by discord for sending to many webhooks?

jaunty plank
#

the ratelimit for webhooks is quite high isnt it? lemme take a look

spice helm
#

I was under the impression that bots were allowed to send more messages than webhooks per minute

#

I think they get like 100 a second, not sure for webhooks but in a script i had to space them apart a bit

jaunty plank
#

for one webhook right?

spice helm
#

Is it not rate limited by IP?

jaunty plank
#

hmm, I was under the impression its per webhook.
otherwise how would large companies(like github) send all those webhooks without using hacky methods.

spice helm
#

I had an idea of letting someone choose a path, say comhad for example and then having a bunch of options for stuff at the end of the url like
api.localhost/comhad/top_gg_bot and api.localhost/comhad/wordpress_comment

#

We could combine those like
/webhooks/844312677757222739/QRxNoCRQnU2zOc3fBKROC7e6W5XnXz-e3Ox1lMLODXB8li6LxgObR9uASh7MHGYppNmC/top_gg_bot?

jaunty plank
#

yeah realistically would work fine

spice helm
#

Nice

high topaz
#

why is bot an undefined name?

#

I need help with this stat!

#

Am I missing something?

spice helm
#

hmm, when do you declare your bot variable?

high topaz
#

uh

spice helm
#

Like the bot = commands.Bot line, you'll have to place the bot.dblpy line after that

high topaz
#

oh

#

so just basically type above that bot = commands.bot

spice helm
#

Put the bot.dblpy code after that line

high topaz
#

ok

#

so like this? bot = commands.bot bot.dblpy = dbl.DBLClient(bot, dbl_token, autopost=True)

spice helm
#

Yeah

high topaz
#

ok

#

it says

Traceback (most recent call last): File "main.py", line 14, in <module> bot = commands.bot NameError: name 'commands' is not defined

#

that's the error message sent to the console

spice helm
#

Oh, i assumed you use commands framework, do you use the discord.Client thingy instead?

high topaz
#

yeah

spice helm
#

Oh yeah, i can see you do

high topaz
spice helm
#

Same

high topaz
#

ok

spice helm
#

Put client.dblpy = dbl.DBLClient(bot, dbl_token, autopost=True)
after the line
client = discord.Client()

high topaz
#

ok

#

do I need to remove
bot.dblpy = dbl.DBLClient(bot, dbl_token, autopost=True)

spice helm
#

Yes

high topaz
#

ok

#

Yes!

#

thanks

spice helm
#

Np

simple jetty
#

Top.gg says:
There was a problem saving the webhook Thonk

digital nexus
#

my bot is saying it is on 3,000,000 servers but it is not even verified

#

l tried to reset my token

rain heart
#

being able to do https://hook.discord.re/webhooks?url=webhookurl

rain heart
#

you, someone from your team or anyone who had your token set it to that

wintry glade
#
@tasks.loop(minutes=30)
async def update_stats():
    try:
        await client.dblpy.post_guild_count()
        print(f'Posted server count ({client.dblpy.guild_count})')
    except Exception as e:
        print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

update_stats.start()    
#
2021-05-19T00:05:39.968795+00:00 app[worker.1]: Failed to post server count
2021-05-19T00:05:39.968812+00:00 app[worker.1]: TypeError: object Lock can't be used in 'await' expression
#

any idea what caused that?

#
dbl_token  = os.environ["TOPTOKEN"]
client.dblpy = dbl.DBLClient(client, dbl_token)
wintry glade
#

@rain heart?

rain heart
#

you have to wait for a response from someone who can help you

wintry glade
#

Ok

#

Sorry for the ping

loud token
#

dbl is deprecated

#

and broken

wintry glade
wintry glade
wintry glade
#

ok

wintry glade
loud token
#

yeah

#

I think so at least

#

it's in the docs

wintry glade
#

ok, thanks

#

@loud token same problem

#

git repo^

loud token
#

don't import dbl

#

use topgg

wintry glade
#

i do, just did not get rid of the import

loud token
#

you did not

wintry glade
#

ik

#

just did not get rid of the import

#

folowing their docs

loud token
#

should be client.topgg = topgg.DBLClient

#

so on

wintry glade
#

oh

#

should i add autopost=True?

loud token
#

if you want it to do that

wintry glade
#

k, cause i got a error

#

autopost must be activated

#

@loud token thanks! it worked

loud token
#

np

plucky lance
#

The authorization is a value you can specify to make sure the request is coming from topgg checking it in your script (like a general password check).
It’s not necessary needed to use it.

restive otter
#

nvm, i got

#

it

#

but thanks

#

how do I find my port

pastel drift
#

I’m being returned
<coroutine object DBLClient.get_user_vote at 0x7f55d00f9640>
instead of Boolean when I use
self.dblpy.get_user_vote(ctx.author.id)

#

How do I get it to send a bool? Please help

loud token
loud token
pastel drift
pastel drift
#

Thanks

loud token
#

but use topgg

#

dblpy is deprecated

pastel drift
#

I'll check

#

Thanks

vast plinth
#

I belive rate limit is like 100 per second

#

but Im gonna go with its safe to try every 5 seconds

#

yes?

craggy flame
#

?

#

Siviper

ember swan
loud token
#

what's the scenario also votes don't use discord webhooks

ember swan
ruby kiln
#

what happen if my bot recieve more than 1000 votes in 12h ? Does a user who voted between the 12h and now will be able to vote again ?

restive otter
#

How we can know who have voted for my bot and give him auto rewards

ruby kiln
loud token
ruby kiln
loud token
ruby kiln
loud token
#

it sends it to your computer's port

spice helm
ruby kiln
loud token
#

oh

#

just http://publicip:port/route

#

just follow the quick start and it should be fairly self explanatory

ruby kiln
loud token
spice helm
#

It works with domain names

ruby kiln
spice helm
#

Are you sure? I know if you set up a scenario for discordbotlist you need a different one for top.gg, they don't provide the same data

#

@ruby kiln

ruby kiln
spice helm
#

What do you mean by tried? You need to setup up an entirely new webhook URL in a new scenario, you can't use the same one

ruby kiln
spice helm
#

Did you click save?

ruby kiln
spice helm
#

Ok, but did you click save on top.gg before you clicked test?

ruby kiln
#

yes

spice helm
#

Hmm, click copy address to clipboard and try with that address, its possible you missed a character at the end

ruby kiln
#

I copied with the "Copy address to clipboard" button

spice helm
#

That's weird, i'm not sure what's happening then

#

Make a request to the URL through curl or something, see if it responds to that

ruby kiln
#

it worked, so the problem is from top.gg I think

spice helm
#

Yeah, it looks like it

rain heart
#

Have you pressed save before testing

vast plinth
#

the rate limit is 100/s so using it every 5 seconds would be fine

#

right?

vast plinth
#

then is checking if a user has voted every 5 seconds fine?

#

ok

#

i-

#

fine

#

I hate webhooks

vast plinth
#

good for you

green fog
#

Can someone tell me exactly how to upload the bot server count please?

spice helm
green fog
#

Discord.js

spice helm
#

I dont use node so i cant help you there sorry, but i think there is modules with sample code on the top.gg github

green fog
#

Can someone tell me exactly how to upload the bot server count with node.js?

plucky lance
#

Using a library or just send a POST request to the topgg API, for example with "node-fetch"

restive otter
#

Its saying 403 when trying to post bot stats using top.gg js library

green fog
#

Umm

plucky lance
#

Used the correct token?

green fog
#

Wut

plucky lance
#

Hmm without a little knowledge I can't really help you.

green fog
#

Sadly couldn’t find much on youtube

plucky lance
#

As I said you can use node-fetch or http or axios etc. to send a simple HTTP POST request, too

green fog
#

Like 3 videos but they have bad quality and they don’t make sense

plucky lance
#

understanding through pictures or videos
That's not really understanding. That's seeing code and copying it but okay.

green fog
#

Can I do it with heroku

#

I might have to copy since the computer I’m using has top.gg blocked

plucky lance
#

I'm not familiar with that service but if you can install libraries to use in nodejs, yes you can

green fog
#

I do learn from examples

plucky lance
#
Fetch("https://top.gg/api/bots/" + <bot_id> + "/stats", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": <dbl_token> }, body: JSON.stringify({ "server_count": <guild.size> }) }).then((response) => { if(!response.ok) return console.log("Posting DBL statistics failed"); });
#

I do learn from examples
That's still copying not more... but that's not my issue, yikes

green fog
#

?

#

So that’s supposed to go into a Json file?

plucky lance
#

The example will require the package const Fetch = require("node-fetch");

green fog
#

If I have to download anything I can’t

#

Npm doesn’t even work

#

I’ve tried

plucky lance
#

Well then you're limited to basic JS

green fog
#

I don’t know how to do that

#

Man I can code a bot but I can’t do this

plucky lance
#

Alright... there's nothing more I can do for you.
You can only use the basic JS methods which are existing or being able to download packages via. NPM.

green fog
#

I can use the js method but I don’t know how

plucky lance
#

Man I can code a bot but I can’t do this
Don't get me wrong but using djs or dpy doesn't mean being able to code a bot, just using existing libs/frameworks etc.
But that doesn't matter at this point.
I told you what you can do.

#

I can use the js method but I don’t know how
That's the reason I sent you the link.

#

It explains (with examples) how it works.

green fog
#

Alright

#

I’ll try to figure it out from there

#

Thanks

plucky lance
#

Just a random Google match.

green fog
#

Alright thanks

median wyvern
#

anyone know can i specify type of data that i want in reddit json api. for example: https://www.reddit.com/r/aww/?t=image or something like that?

quiet iron
#

do I need to wait for my bot to be approved to start working on my Vote cog or can I get api keys and start now

alpine jay
restive otter
#

hş

#

i

loud token
oak orbit
#

why am I getting this error
webhook.listener is not a function

#
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express();

const webhook = new Topgg.Webhook('123456789')

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

app.listen(8000)
plucky lance
#

Because webhook isn't the expected data type

#

Looks like something has gone wrong while initialization new Topgg.Webhook('123456789')

#

Log the webhook var

jaunty plank
#

what version of the sdk are you on?

oak orbit
jaunty plank
#

thats v3.1.0+ code

oak orbit
#

im gonna update it

plucky lance
#

πŸ€¦β€β™‚οΈ

spice helm
fickle pewter
#

How does the main top.gg site searching the bot/server list without authorziation token?

sullen nymph
#

Main site endpoints allow it

#

To use the API you need auth

restive otter
#
const { webhookPW } = require(path.resolve(path.normalize("./config.json")));

const express = require('express')
const app = express()
const Topgg = require('@top-gg/sdk')
const webhook = new Topgg.Webhook("authorization code")

app.post("/6f7XNQM9ds0Sad4jyTUoRaRN3K1zgBRvSI26JnQytpvsVefn8uKA4yrgJRTtvXrNKJLx", webhook.listener(vote => {
    console.log(vote.user)
}))``` why does this not work? no console logging when I test it
sullen nymph
#

What

restive otter
jaunty plank
#

did you fill in the url and auth on your bots page?

#

http://PUBIPHERE:PORT/6f7XNQM9ds0Sad4jyTUoRaRN3K1zgBRvSI26JnQytpvsVefn8uKA4yrgJRTtvXrNKJLx

#

filling in the public ip and port

restive otter
jaunty plank
#

nope, top.gg webhooks are not compatible with discord webhooks.

jaunty plank
restive otter
#

sorry bout these questions

jaunty plank
#

where are you hosting?

restive otter
#

my own hardware

jaunty plank
#

the url in the case you port forward will look something like http://yourpublicip:port/path

spice helm
jaunty plank
#

yeah i just now opened it. looks pog

spice helm
#

It's very rough design, but it works

#

Ah ty :D

jaunty plank
#

how long till you actually deploy it.

spice helm
#

It's active now,

jaunty plank
#

oh pog, ill have to take a looksie

spice helm
#

My concern is it gives me a warning that its a dev server im using, but all the tutorials tell me to use that

#

I didn't disable logging, i'm split between security and privacy about all the discord webhooks tokens and IPs being recorded to the logs

jaunty plank
#

as in heroku logging it?

spice helm
#

Yeah, but i can have access to the logs

#

I can put a little snippet in the code so it will only record errors though

jaunty plank
#

I really dont know heroku at all, so cant be much help there

spice helm
#

It's more flask, heroku is going to record whatever python prints, its just what i stop python printing for the sake of privacy

#

I mean top.gg keeps all the webhook info, and that seems fine, so as long as i put it on the readme that it logs it, it should be fine?

#

Best to be on the safe side, added it in there anyway

spice helm
#

I looked, that server i'm using is fine, it was just the debugging one i was using when i was trying to figure out how to use heroku lol

spark raven
#

Ignoring exception in on_message
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 45, in on_message
vote = json.loads(r.text)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

#

....

#

....

sullen nymph
#

And what value did you try to load from a string

oak orbit
sullen nymph
#

Use another port

oak orbit
#

And what is supose to write in /dblwebhook

#

Just keep it like that?

sullen nymph
#

Yeah

oak orbit
#

I just use a random number?

sullen nymph
#

Try to guess what's available

oak orbit
sullen nymph
#

If Google doesn't say anything then yeah

#

Unless your host occupied all ports except one

oak orbit
#

Ok thanks

restive otter
#

Is there a npmjs page of this api?

#

Nvm

coarse rune
#

How to make a message which is sent when someone votes? Discord.js

plucky lance
#

Create a webhook listener, listening to the topgg webhooks and react on the response you get - it includes the userid etc.

#

The actual timestamp is the moment you receive the webhook.

hushed reef
halcyon dragon
#

hi

scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

vast plinth
#

also ;) why is it an option if they don't expect someone to do it.

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.

vast plinth
#

yes

vast plinth
scarlet cobalt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sullen nymph
#

You might as well just have a webhook listening to vote requests BepShrug

willow sphinx
#

it's also possible to change role colors every 5 seconds on discord but it doesn't mean you're not gonna get banned for it

sullen nymph
#

This

#

Ratelimits are not absolute

vocal bluff
#

I want a chatbot api please

green violet
#

not mine credits to its owner

polar birch
smoky marten
vocal robin
#

hmm Somone pinged me Thonk

smoky marten
brave trellis
#

Δ°f i cant save the edits about my bot what should I do

vocal robin
frozen storm
#

how do i make it so the bot will show how much votes it has in the current month

smoky marten
frozen storm
#

what

smoky marten
# frozen storm what
const YOUR_BOT_ID = '748160981766635540';
//My bot for example


api.getBot(YOUR_BOT_ID).then( bot => {
    console.log(bot.monthlyPoints);
    //monthlyPoints is actually monthly votes
})
frozen storm
#

thanks

smoky marten
#

^Β°^

frozen storm
marsh marlin
#

You would save bot.monthlyPoints into a variable and then put that variable into an embed

#
const YOUR_BOT_ID = '748160981766635540';
//My bot for example

let votes = '';
api.getBot(YOUR_BOT_ID).then( bot => {
    votes = bot.monthlyPoints
    //monthlyPoints is actually monthly votes
})

let embed = new Discord.MessageEmbed()
  .setDescription(votes);

msg.channel.send(embed);
frozen storm
#

alright

restive otter
#

Does my bot have to be approved for me to use topgg api?

sullen nymph
#

Yes

restive otter
#

So can I use the api directly after my bot is approved?

sullen nymph
#

Correct

glossy spear
#

this should help you

#

for vote actions

leaden flower
#
    at Api._request (c:\Users\Utilisateur\Desktop\Bot\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
    at processTicksAndRejections (<node_internals>/internal/process/task_queues.js:97:5)
    at async Api.postStats (c:\Users\Utilisateur\Desktop\Bot\node_modules\@top-gg\sdk\dist\structs\Api.js:96:9) {name: 'Top.GG API Error', response: {…}, stack: 'Top.GG API Error: 404 Not Found
    at Api._r…modules\@top-gg\sdk\dist\structs\Api.js:96:9)', message: '404 Not Found'}
arg0:Top.GG API Error: 404 Not Found
    at Api._request (c:\Users\Utilisateur\Desktop\Bot\node_modules\@top-gg\sdk\dist\structs\Api.js:76:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Api.postStats (c:\Users\Utilisateur\Desktop\Bot\node_modules\@top-gg\sdk\dist\structs\Api.js:96:9) {name: 'Top.GG API Error', response: {…}, stack: 'Top.GG API Error: 404 Not Found
    at Api._r…modules\@top-gg\sdk\dist\structs\Api.js:96:9)', message: '404 Not Found'}
message:'404 Not Found'```
#

When I start my bot

rain heart
#

doesn't help much

#

code please

#

especially on your first use of the api

restive otter
#

Can I make use of the api to post a message everytime someone votes for a specific server

#

?

rain heart
#

with a coded webhook yes

restive otter
#

how can i make the bot send a DM to users when they voted

rain heart
#

using webhooks and getting the id from the webhook then fetching the user

#

you can only dm them when they're on a mutual server

brittle spoke
#

@jolly hornet

jolly hornet
#

man

brittle spoke
#

do ur job

jolly hornet
#

@restive otter no ads

restive otter
#

fuck off cunt @jolly hornet

jolly hornet
#

really dude

restive otter
#

Smh

jolly hornet
#

any last words?

#

sike

#

-b 404495532787236876

abstract mothBOT
#

dblMod Banned ! aaScepticel#9797 (@fallen apex)

jolly hornet
#

😎

restive otter
#

Epic

#

I was hoping you'd do that

vocal bluff
#

[https://api.affiliateplus.xyz/api/chatbot?message=$replaceText[$message; ;%20;-1]&botname=Add Your Bot Name&ownername=Add Your Name&user=1]
A working Chatbot API

bleak gale
#

no

crystal cloak
#

Why does my bot not auto post the guild count?

restive otter
#

The deprecated dblpy doesn't raise errors even if the posting fails, e.g., if you put a wrong token there, it won't tell you that the token was wrong. I'd suggest you migrate to topggpy.

#

can any one help me with the server count

#

?

crystal cloak
restive otter