#topgg-api
1 messages · Page 24 of 1
the "readme"
is it an old version of the readme or Oliy's own bullshit
I can't just copypaste a markdown file lmao
what format do you need it in?
a .oily file
kk i'll update it tonight 😉
Does the api have an event for on vote? Like am i able to trigger code right when somebody votes?
webhook
the api does provide a webhook you can configure when someone votes/unvote
Oh ok thanks

why?
var dbapi = require("./discordbots.js/index.js");
var db = new dbapi("secret token")
db.getStats("388025818720501760").then((botData) => { console.log(botData) })
ow
that's not how you require it
0|disc | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
0|disc | Error: 400 Bad Request
0|disc | at _response.transport.finalizeRequest.call.then (/Users/whirl/Desktop/disc/node_modules/snekfetch/src/index.js:195:23)
0|disc | at <anonymous>
0|disc | at process._tickCallback (internal/process/next_tick.js:160:7)
Why?
@restive otter you need to use require("dblapi.js")
@restive otter you aren't sending the stats correctly, can you show your code?
Sure
i want to show the name of the bot
do not show your token
@junior goblet Did you see it?
const DBL = require("dblapi.js");
const dbl = new DBL("token");
setInterval(() => {
dbl.postStats(bot.guilds.size);
console.log("Posted on DBL " + bot.guilds.size + " guilds")
}, 1800000);
try this
see what
oh did you share your token
const DBL = require('dblapi.js');
const dbl = new DBL('token I will add later', client);
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 1800000);
});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity('>help');
client.user.setStatus('online');
});```
@brittle swallow
Here it is
@junior goblet
@restive otter
?
put in your ready event
Um, wdym?
Consts?
to run when your bot is ready
You mean the consts?
do I use my bot's client ID or ID from DBL
why does your new DBL() include your client @restive otter
const DBL = require("dblapi.js");
const dbl = new DBL("token");
setInterval(() => {
dbl.postStats(bot.guilds.size);
console.log("Posted on DBL " + bot.guilds.size + " guilds")
}, 1800000);
``` I use this and is working, put in ready event
you just need the token

I like how people are helpful here.
@vast junco use your client id
are you using the lib?
@restive otter 🕹
Thx
😄
@junior goblet It is not working
Not showing
the server count
are you getting any errors
k
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity('>help');
client.user.setStatus('online');
const DBL = require('dblapi.js');
const dbl = new DBL('');
setInterval(() => {
dbl.postStats(client.guilds.size);
console.log('Posted on DBL ' + client.guilds.size + ' guilds');
}, 1800000);
});
```]
@junior goblet
ok
I did npm also
where do I get my token from
Tried three times
the api page
I think it was at the bottom on the old documentation
@vast junco Edit your bot and scroll down
you'll see it
o
Hm
@junior goblet Solution to my prob?
😦
const { DiscordBotsList } = require("dblapi.js")
const DiscordBots = new DiscordBotsList('token');
const id = '415099419592228864'; // Replace '' with a id.
DiscordBots.getBot(id).then((res) => {
console.log(`Bot: ${res.body.name}`);
});
``` Why?
don't work
one sec
@restive otter if im not wrong the way setInterval works is it wont fire the first time you run it
so you just gotta wait
your code works
k
but you need to wait for the setInterval
Yes yes yes, at me is the same
i waited
and is work the serer count
Unexpected require(). (global-require)'
There is eslint error
@junior goblet
try it with a number
What?
oh
verify is the servercount is working
wait more
do not restart the bot
if you restart the bot
you need to wait again
Yup
k
@restive otter so whats the issue exactly? is res undefined or something?
you don't need to do res.body
TypeError: DiscordBotsList is not a constructor
const dbl = new DBL('dbltoken', client); blake should I use this
const { DiscordBotsList } = require("dblapi.js")
const DiscordBots = new DiscordBotsList(config.dbltoken);
const id = '415099419592228864'; // Replace '' with a id.
DiscordBots.getBot(id).then((res) => {
console.log(`Bot: ${res.body.name}`);
});
@restive otter without client
^
yeah
oh
Not full though
exports.run = (bot, message, args, Discord, config) => {
const { DiscordBotsList } = require("dblapi.js")
const DiscordBots = new DiscordBotsList(config.dbltoken);
const id = '415099419592228864'; // Replace '' with a id.
DiscordBots.getBot(id).then((res) => {
console.log(`Bot: ${res.body.name}`);
});
}
why are you requiring "DiscordBotList" from dblapi.js
k
make const { DiscordBotsList } = require("dblapi.js") into const DiscordBotsList = require("dblapi.js")
now is udnefined
should just be res.name
what does res return
im not sure
you'll need to check what the name is defined as
Bot: [object Object]
just console.log(res) on its own
oh
@junior goblet is works!
dblpy pls
alright good 
Wut 'bout m?
do I put the class that handles interactions with the dbl API in my on_ready event?
DBL-Python-Library - A simple API wrapper for discordbots.org written in Python
@junior goblet Didn't work
error?
did you remove the setInterval
k
what
There is a erro
@junior goblet
yeah ok you dont need to ping me all the time as well im right here
why are you formatting with css
this is js
k

k
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity('>help');
client.user.setStatus('online');
const DBL = require('dblapi.js');
const dbl = new DBL('');
dbl.postStats(client.guilds.size);
console.log('Posted on DBL ' + client.guilds.size + ' guilds');
}, 1800000);
});
all good 
in the readme
self.session isn't even defined
.. code:: py
import dbl
import discord
from discord.ext import commands
import aiohttp
import asyncio
import logging
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token, loop=bot.loop)
self.updating = bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
await self.bot.wait_until_ready()
while not bot.is_closed:
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
pretty sure that should be better
Can someone gimme more examples of the api js
?
I have done the server count
How i can get the avatar using dblapi?
from res.
const DiscordBotsList = require("dblapi.js")
const DiscordBots = new DiscordBotsList(config.dbltoken);
const id = message.mentions.users.first().id // Replace '' with a id.
DiscordBots.getBot(id).then((res) => {.................................................}
why are you using the dbl API for that
why not?
because avatars are a Discord thing
you don't want to do this through the dbl API
how?
try #development "how to get a users avatar"
@golden wind read my message up there
@calm torrent ye i updated it in my local copy

XilmamDnoi£!"!9£÷$9£!÷$$!÷£÷!9£÷9€÷/9€&÷/&€9÷/÷/&8÷^8/4&7!/3&€93/&9€÷/€÷9/!£93/
Nice
Is there any way to get a response code from dbl.hasVoted('id') on Node.js? The 502 errors are crashing my commands.
catch the promise
does anyone know what i'm doing wrong?
library: discord.py
py version: 3.6.3
lib version: 1.0.0a
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'token'
self.dblpy = dbl.Client(self.bot, self.token, loop=bot.loop)
self.updating = bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
await self.bot.wait_until_ready()
while not bot.is_closed:
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))
does it error
no
thinking
Not logging code errors
but there are some things that are underlined red in vscode

what error?
How i can do these things?
this isn't really related to the API, you'd best ask in #development or something
lol
don't request from the api every time a command is executed
?
are you sending a request to the api everytime a command is executed
idk
@buoyant jasper.command(pass_context=True)
async def purge(ctx, args1: int):
then i write some code like
bot.say
@restive otter if you're talking about the Discord API, this channel is only for the DBL api
if you think the Discord API is being slow, you can see https://status.discordapp.com
well it was for 10 min
then it sped up again
no signs of it slowing on the satus tho
rip
req.post(`https://discordbots.org/api/bots/${client.user.id}/stats/`)
.set('Authorization', 'A TOKEN')
.send({
"server_count": client.guilds.size
})
.catch(console.error)```
why no work?
req is snekfetch
kk
now, when i type https://discordbots.org/api this happens
Do I need to use the official api lib? can't I send my own request?
@sleek agate thats normal and has always been there
@silver dove you dont have to, but it is recommended
nah i'd rather use raw snekfetch
@golden wind is that considered a dbl token
the thing is, in the docs, it only shows examples of dblapi.js, not raw requests >_<
tried that
i found some helpful stuff in https://github.com/MattIPv4/DiscordBots.org-API-Examples/blob/master/to-be-processed-js.txt
DiscordBots.org-API-Examples - Bot Stats API Examples for DiscordBots.org
ye
thanks 
I was gonna plan a server count
but the api with no docs just redirects you to something
I have one question
I tried the api
But it's doesn't detect my bot
Is this normal ?
you don't seem to have an approved bot
what do i put on Java API > API#getVoters(String)?
404 docs not found

nevermind.
why get the bot id as a string and not a long tho
its a long afterall
who the f wrote this
nik
use mine :^)
if its actually working, yea
what the firetruck is this thing
it actually is retarded
by name????
no
i was to say
that doesnt work but compiles
it wont run, and it wont interrupt either
yes and thats the thing
the library is retarded
it should take a long
it takes a string
what is this
and why
https://discordbots.org/api/bots/392065608398798851/votes?onlyids=true
the list is there
its the library being unable to get
@sick temple lmao
I can make it take a long too if you want shrug
I dunno why I went with during
String
long would be more fitting, since afaik discord is handling IDs as longs
also
im a bit of a stupid firetruck
because guess what
...wrong token
im sorry blaming you @inner venture lol
well, ive learned a lot about requests in the process xd
🤦
yup
Are the API docs down? I get an error when I try to access them.
oh
nevermind I wasn't logged in
that's weird
I'm guessing that's a bug then? 
what was the error
"Oops, I think a bad happened, I'm trying again just hang in there"
so... not very descriptive
:P
ah
Now that we can upvote once every 24 hours, if we use the webhooks.
Does the API send a post request for every upvote a user do? or only for the first time?
Does the API send an "unvote" post request when the 24 hours are over and that the user can vote again?
how do i know if its working
you get a response from the API? 
Where do i need to get response
from the code you used to call the API on

no
ok
ken pls
ken?
thanks tonk, i gotta brb now
yes
using what
dont post your token
il re gen him
you use discord.js?
just use the autoposting
yes
you check if you can see the server count on the site
lmao
how is it that i get this error when the time is up
C:\Users\Jake\Desktop\stats\node_modules\snekfetch\src\node\index.js:93
options.connection.close();
^
TypeError: options.connection.close is not a function
at ClientHttp2Stream.stream.once (C:\Users\Jake\Desktop
first of all, change your token, right now
and second of all, it's not really related to the API, try #development
Hey guys
I was wondering if you could check for daily votes with dbl.hasVoted("129908908096487424")
Does a POST in the API return anything?
So I got dblpy installed but "No module named 'dblpy'" 
@timid nexus no you cant
Another thing, if someone upvotes, then cancels the upvote and upvotes again
Does it post to the webhook again or does it cancel out
As in do I have to cancel it out on my end
posts again
@pseudo patrol Yea same issue.
it posts for the cancelling too
Do the webhook urls have to be https?
no they don't
Alright, thanks
but I advice against plain http
but I can understand if you can't get a domain and stuff
Yeah, I can't right now unfortunately :/
You could get a tk domain or something from freenom and setup a reverse proxy
Does DBL take self signed certs into account, not that I have any but out of curiosity
I'm pretty sure self signed certs don't work
node's https module rejects bad certs including self-signed
wew
why not make it skip the error
isnt there any way to do so?
I have a couple selfsigned certs installed as root level certificates on my computer
and hmm
I actually agree with Tonkku, self signed certs are bad
no
when you test SSL
and cant be bothered with LE
or pay for a cert
selfsigning works great
something about webhooks
@pseudo patrol @unkempt escarp use import dbl , the docs on the dbl site are incorrect
I did that but got an error 🤔
Traceback (most recent call last):
File "C:/Users/***/PycharmProjects/NekoBotRewrite/bot.py", line 9, in <module>
dbl = dbl.Client(bot=config.botid, token=config.dbots.key)
File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dbl\client.py", line 59, in __init__
self.loop = kwargs.get('loop') or bot.loop
AttributeError: 'int' object has no attribute 'loop'``` 

what are you using to initiate the client?
dbl = dbl.Client(bot=config.botid, token=config.dbots.key)
dont pass the bot id, pass the actual bot object
ooo
DBL-Python-Library - A simple API wrapper for discordbots.org written in Python
see this example
@golden wind Awesome thanks, got it to work! 
😃
await self.dblpy.get_upvote_info(bot_id=config.botid) gives a NotFound: Not Found (status code: 404): {"error":"Not Found"}
dont provide the bot id and whats the resposne?
its the same
NotFound: Not Found (status code: 404): {"error":"Not Found"}
If I https://discordbots.org/bots/(botid)/votes + authorization header in postman I get a 404 too 
<h1>Sorry we tried very hard but something went wrong :(</h1>
<h1>Not Found</h1>
<h2>404</h2>```
or is it /api/bots/*** lol
xD
/api
When I use api.getVoterIds("String", int) what is the int for?
@pseudo patrol what version of the api are you on?
latest
await self.dblpy.post_server_count(shard_count=self.bot.shard_count, shard_no=self.bot.shard_id) is working but not get_upvote_info() so I just used aiohttp
🤔
i'm working on adding typescript on the dblapi.js module, its annoying to look up the website everytime...
if it's unsuccessful, there's {"error": "Describing the error"} and if it is successful it's just an empty object
ok, also the way to call the api needs to change to aply the typescript, now instead of ```js
const dbl = new DBL('Your discordbots.org token', client);
its js const dbl = new DBL.DBLAPI('Your discordbots.org token', client);
I don't like that
me neither, but else i cant typescript the module 
yes it does
ikr, im gonna try to find a way to don't change how to call api
what about: ```js
const dbl = require('dblapi.js').DBLAPI("Discord Bots Token", client);
ok
i founed the way of how to add ts without doing a breaking change, wait some mins, then i will PR
im pr rn
done
So I added the below code to my bot, and started getting To Many Request errors after a few minutes... did I do something wrong?
const DBL = require("dblapi.js");
const dbl = new DBL('MyToken', client);
did I do something wrong? I got the code from the api example page
How many requests are you sending...
From what I understood It said that it was automatically handled when I do it that way.
show code
or is that the only code?
ok u dont need to show ur token
but
how often are you restarting your bot, if you are?
not restarting
how often are you calling the module then
I shall wait lol
@azure pollen Do I need to let it send at an interval, or can I just update it 1 time at load and 1 time for each Guild_Create?
probably best to do a long interval
best ask tonk
he knows the api more than myself
kk for now I'm going to set a long interval, and I'll wait for his reply. Thanks 👍🏻
So is setting it at the intervals acting like a heart beat, and keeping the bot marked as "ONLINE" on the website?
The status on the site is just taken from discord @ivory wren
Well mine just shows a grey ??? next to it
Heyo
I was wondering if anyone knew when the "You have already voted for this bot today" message disappears
as in the timezone
@azure pollen @inner venture @arctic arch I'm good now I got it working well with the normal set interval, Thanks for the help earlier!
ok
@timid nexus its not based on timezone, it's 24 hours exactly from the time you vote
yeah
maybe you restarted your bot so many times you hit the ratelimit at some point
use a webhook
You can specify query params in the original vote link that you send to the user and then the webhook will post those same params back to you once they vote
Hi
In the list it shows my bot is in 1 server and actually it is on 30 server!
servers*
show code
@vast junco Thanks, I have resolved it
oh
so, i post to the api and for some reason it says that its in 3k servers when its only 1.7k, I think its a sharding issue, idont know.
@restive otter which one of your 300 bots are you having issues with
@inner venture cough cough, not 300, anyways its @paper monolith
you've set shards 0 and 1 both to
1748 servers
Im gonna guess that you have two shards and youre posting the full server count to each
I tried to setup Webhooks with Discordbots, but somehow it's not working.
Steps I have done:
- Created a Webhook in Server Settings.
- Copied the link I got there and pasted it into webhook field at the edit panel of my bot (screenshot).
- Saved it and voted.
Well, nothing has happend.
No message in the channel.
What am I doing wrong? Did I somehow missunderstand Webhooks and how they work or is it something else?
Webhooks are a generic concept
DBL's webhooks dont have anythign to do with Discord's
To receive the webhook, you need to setup a webserver and point the webhook to that webserver
and then your bot will receive that request
thank you!
no problem friend 😳
The 😳 emoji somehow scares me 
https://discordbots.org/bot/411860199473938433 has no "date" field in the API
cool
#memes-and-media pls
ok so
I've set up the webhook for my bot
but for some reason the post data is empty
what does that mean?
what's your setup
uh I'm running a php script on an apache server if that's what you mean
switching to nginx wouldn't be a problem for me
hi. i'm sans. sans the skeleton.
ok
How to send message to whoever votes!
You have to set up a webserver to accept webhooks which will give info on someone who voted when they vote
I want the bot to send dm voter a message
@cobalt ruin How to send message (DM) to the voter whoever vote for the bot?
I see there is understandable explanation in the API
@random oak
spotify @oblique fractal
That looks like a selfbot 👀
@vagrant kayak I was telling that I cannot use my bot commands in #topgg-api channel
bots dont respond in any channel outside the testing channels, unless its luca and tonkkubot.
well testing and bothell
ok makes sense, wording was weird
Wrong channel
okay ^^
uh
I still need help with my problem
I switched to nginx but that didn't help either I still don't get any data
so you get no data?
it posts your server count to your bot's profile
how to post server count DBL API? with python's reqeusts module
don't use requests, it could freeze up your bot if a request takes too much time
use aiohttp instead
sorry......^_^;;
also maybe consider using dblpy library for server count post
my bot prefix is "f."
my nick = __FUNC__tion
@oblique plaza you aren't doing it correctly, i don't think
are you even calling postStats?
is your api token correct?
is there errors whenever trying to post?
uhh
still should change your token btw
in #265156361791209475 there's probably bots that logged it
wait
are you using the user token for the dbl api
you're required to use your bot's api key
for posting
probably
🤔
@arctic arch yes my post is completely empty
how are you getting the body
I use php's global variable
I put the code here, if that helps: https://gist.github.com/Zeryther/803a2fb346d3ffc8a4037237f26bd0b1
does php decode json 
ok wow
I did that
but the data is still empty
both the array and the json string
Why is this example still wrong? ```Python
import dblpy
from dblpy import Client
import asyncio
import aiohttp
import json
dbl = dblpy.Client()
botid = 264811613708746752 # your bots user id (client id on newer bots)
token = 'abcxyz' # DBL Bot Token. Obtainable from https://discordbots.org/api
class Example:
def init(bot):
bot = bot
session = aiohttp.ClientSession(loop=bot.loop)
async def poststats():
await dblpy.post_server_count(botid, dbltoken, 65)
async def getstats():
resp = await dblpy.get_server_count(botid)
print(json.dumps(resp))``` https://discordbots.org/api/docs#pylib 😄
And this isn't working too ```Python
import dbl
import discord
from discord.ext import commands
import aiohttp
import asyncio
import logging
class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""
def __init__(self, bot):
self.bot = bot
self.token = 'dbl_token' # set this to your DBL token
self.dblpy = dbl.Client(self.bot, self.token)
self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while True:
logger.info('attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('posted server count ({})'.format(len(self.bot.guilds)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
def __unload(self):
self.bot.loop.create_task(self.session.close())
def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))``` https://github.com/DiscordBotList/DBL-Python-Library 
DBL-Python-Library - A simple API wrapper for discordbots.org written in Python
@golden wind
Im not sure if this is an api issue or what, but I was talking in a Discord.js discord channel and got directed here due to the output of some logs
Long story short
A whole lot of 400 Bad request issues since updating to d.js 11.3.1
@primal lark because i cant update it on the site
But on the github page its wrong too o.O
@dawn topaz show us your code
its different wrong but still wrong 😄
https://hastebin.com/lopanakisa.rb theres the output where i made it log the unhandledRejection. (Also don't tell me to change my secret key, cause i already did :P)
body:
0|bot | { error: 'Required parameter shard_count missing or invalid value' }
remove the unload func @primal lark
are you sending a shard_id?
nope
I did not run it yet but this is wrong: await self.dblpy.post_server_count() The parameters are missing
bot not in enuf servers to shard it 😛
@primal lark what version is your dblpy module cause it should be working
i triple checked that
Ok w8
show me the code you use to post stats
talking to meh tonk?
0.1.3
yes
okay updoot it should work 👍
dbl.postStats(bot.guilds.size); dbl is defined above this
and it worked flawlessly until today
hmm I dont see how d.js update would break that
i dont see either but im saying its a bit of a coincidence mayb? 🤔
@golden wind Nothing changed yet?! Or what did you update? o.O
it should auto pull the server count from the discord.py bot instance passed in the __init__
i should probably add an update function into the api to notify of you're out of date
Am I out of date? o.O
ok 👌
@dawn topaz what's your bot's ID
from .client import Client
File "/usr/local/lib/python3.5/dist-packages/dbl/client.py", line 31, in <module>
from .http import HTTPClient
File "/usr/local/lib/python3.5/dist-packages/dbl/http.py", line 234
await self.request('POST', f'{self.BASE}/bots/{bot_id}/stats', json=payload)
Im getting this error when I import the example @golden wind
Sorry 😄
File "run.py", line 6, in <module>
import statics, loops, utils, discordbotlist
File "/home/discord/xenon/discordbotlist.py", line 1, in <module>
import dbl
File "/usr/local/lib/python3.5/dist-packages/dbl/__init__.py", line 19, in <module>
from .client import Client
File "/usr/local/lib/python3.5/dist-packages/dbl/client.py", line 31, in <module>
from .http import HTTPClient
File "/usr/local/lib/python3.5/dist-packages/dbl/http.py", line 234
await self.request('POST', f'{self.BASE}/bots/{bot_id}/stats', json=payload)
^
SyntaxError: invalid syntax
thonk
oof sorry Tonk
@dawn topaz ok I see that you're sending 0 for shard id and count
im not trying to send shard count or id in the first place
are you sure that's what you're calling
@primal lark hmm idk I'll look when i get home
it doesn't make them send 0 with the code you sent
Ok thanks 🙃
okay well i still dont see why it would work for a while then just stop working today
@arctic arch would specifying shard id and count fix this issue? 🤔
yes very weird
have you passed client to the constructor?
I'm having a brain fart in what that is again. been a long day
is it new DBL('token') or new DBL('token', bot)
the second one
yea
do you call postStats() manually
Well i do this for actually posting it
dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total);
for atleast thats what i changed it to
do you start your bot using the sharding manager?
my bot isnt sharded
do you spawn it with child process?
ok that would explain why it picks up the sharding
client.shards.Id should be client.shard.id 
🤔
docs errar?
@arctic arch this is definitely something to look into cause the error did not go away after putting in the post shard id and count
well i have it posted in some of my events
which may be a weird choice
to me it wasnt particularly
guildCreate and guildDelete, and ready all contain the dbl code to post stats when those events are called
this should fix it
npm install DiscordBotList/dblapi.js
tell me if it still continues to error
now im getting a totally different error
which is in regard to posting that shard count
ok what is it
nah
shards is undefined so im just gonna remove that since im not using the sharding manager atm
the long hastebin that i posted
yea i was
okay
I dont 100% know as of yet
but it appears to have been resolved
interesting very emergency hotfix there 🤔
@arctic arch perfect, except the __unload function isn't actually needed 😂
I copied it from your github
imo
while True: should be changed to while not self.bot.is_closed():
Webhook
Don't rustle your feathers for no reason, if you're lost you can read more about our webhooks here
Logan's Webhook Options
URL
For that part of API what do i do?
do you want to set up a webhook?
y e s
@calm torrent while not self.bot.is_closed(): doesnt work on my end
@primal lark everything is working fine on my side?
can you double check it?
(i didnt change anything lol)
@golden wind Weird. Its working on windows but not on linux
weird
its working on my debian machine
whats the output of python -V and python3 -V ?
no
@golden wind But thats the only difference between my windows and my linux machine o.O
idk lol
i need help with webhooks....
Did you setup a webserver to listne for the post request?
umm
lemme guess
im new to Webhooks.
you put in a discord webhook url?
yes
well theres your problem
oh
Webhooks are a generic concept
DBLs webhooks have nothing to do with discords
Basically, whenever someone votes on the bot, DBL will send a post request to the url of your choice with relevant info
So you need to setup a webserver to receive that request
so if i wanted it to send it a discord channel i have to?
You cant just send it to a discord channel
oh
o k
One sec.
def __init__(self, bot):
self.bot = bot
self.apitoken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjM0MTgzNTE3MTYwNTExODk3NiIsImJvdCI6dHJ1ZSwiaWF0IjoxNTIwMTQ5MTQ0fQ.V0rdI4NGPnB91u3VJTXB16adJaAMwHmCKxv2nJ7oLv8'
self.dblpy = dbl.Client(self.bot, self.apitoken)
self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
while True:
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(len(self.bot.servers)))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
Will regenerate a token.
regen your token
Yep.
did that code work?
How to send a message by bot to who ever has voted
@calm torrent aki bot uses and sends using bot only
what?
@calm torrent can you give an example
I have no idea how to use webhooks for this api
read the docs, create a webserver
no.....
So
have you read the api documentation?
you need to create a webserver to handle the request
@calm torrent how to?
uh what lang are you using?
Discord.js
@calm torrent Alright, the code for updating stats on the website works, as turns out. 😂
That's what I needed the most, sorry for wasting your time. 😄
haha no problem, don't provide parameters unless you are using shards 
👌
@calm torrent discord.js
@restive otter i don't know js personally but maybe you could try the express lib?
heard people using it
but stop pinging me since idk about javascript
Well, you can google how to make a simple webserver to catch responses
Example of WEBHOOK
Discord.js
I am stuck I have seen hundreds of articles and Docs too
Webhooks are as simple as a POST request from a user to your site containing info
Never found anything
Except this case a bot
You create it
How?
Dear lord
Lel
Do you know how to create a webserver with urls
Host?
Huh
Okay at this point Rule 7b applies, if you dont know how to make a webserver for receiving simple Post requests then use google there are plenty examples out there.

I put no arguments in get_upvote_info(), right?
🤔
Sure.
hi?
@sullen nymph on v0.1.4 and above, get_user() has been replaced by get_user_info()
why are you doing a request every 3 seconds
can someone do the math im havinga headache
is that over the ratelimit
20/minute
@steady sundial are you sure you don't do any other requests in other places?
just to make sure before I update the bot on the VPS, is this the correct way to use the API? https://puu.sh/zBhIE/e69173f5f8.png
discord sometimes fucks up and spams guild joins
posting on an interval is safer
and can spam less the api
yeah I just want to know if the API has an exception on if it goes over the limit
yes
it will block you for a duration (i think it was a hours, not sure) from using the api
1 hour
no
@pulsar lance wrong channel
@golden wind I will try out later, thanks! 😄
does it have to spam my console like that? https://cdn.discordapp.com/attachments/418460910609367052/420377486250213386/unknown.png
no
how would i actually set up the webhook...
@shut ibex wdym
like the url and stuff
gonna need you to be clearer
Your url for a webserver?
so like set up nginx to work with the url?
Does this have any support for ruby?
I dont believe there is a ruby API lib for DBL atm
so youll have to implement the API yourself
it does
Then how am I supposed to check if it gets triggered






