#topgg-api
1 messages ยท Page 76 of 1
the token is ok
Tonkku will help ...
now it says cant read postStats
some people have issues seeing the whole token on the api docs page
or try making new
posted event isnt the one posting stats... it's an event that happens after stats have been posted
oh... \๐
there are 2 postSTATS which one should i remove?
well now it says servercount is not defined
i did still says servercount is not defined
define ....
line 1105
${client.guilds.size}
like this?
it says that
so where should i make it log i dont know anything about this api thing never done it before
no..
Well
this is getting on my nerves
Why no
ive been on this 5 hours trying to figure this out alot of problems
you want to log once its done posting stats right?
it only logs the post count not (Server count posted)
change post count to "Server count posted"
says 0
don't log count lol
^
console.log(Server count posted ${client.guilds.size}.)
thats what u told me earlier
^
And that's it
that part wont work with my bot
wdym
it doesnt show console.log('Server count posted!')
well i use the code on the site
yup i have my token in the code
and client at the end?
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(Oops! ${e});
})
client.on('ready', () => {
setInterval(() => {
dbl(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
dbl.getStats("651003099636301834").then(stats => {
(stats) //{"server_count":2,"shards":[]}
});
console.log(Server count posted ${client.guilds.size}.)
const dbl = new DBL('Your top.gg token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
}) ```
thats my code had to remove my token so no one see it
or main file
Just copy paste this in index.js
its already in there
i didnt
i remove those earlier
Delete this part
thats from my index.js
still n/a for my bot
yup token is valid
i'm sure u don't have this code
i have it
....
look at the top
@true talon like an 1 hour?
alright if it works ill let u know
what the heck is going on
does nobody helping know how to use the damn module
stop helping if you have 0 idea of whats going on
you're all going back and forth with where you're taking this guy
REMOVE THE MANUAL POSTSTATS FUNCTION AND THE INTERVAL IF YOU PASS YOUR CLIENT TO THE CONSTRUCTOR OR YOU'LL CONFUSE THE FUCK OUT OF YOURSELF AND EVERYONE ELSE WHILE ALSO POSTING YOUR STATS TWICE FOR NO REASON
if everything was done correctly the module will automatically post stats when the bot is ready
no need to wait
@restive otter are you sure you've passed in the client of your bot that's actually running instead of creating a new client
yh
send your whole index.js
ill generate a new one
your bot client is named
bot
and you're creating a new client which doesnt even connect
that was just a huge lie
literally two lines above you're creating a new client
remove red line
change client => bot
You just posted your dbl token
read the top
Still it's bad practice to post secret tokens, some day you will do it accidentally
ask lincoln
XD
This is fun reading
Someone knows how to get a log when someone votes your bot with dbl api?
I can't get it to work.
create a webserver and hook it in the webhook field in bot config
whenever someone votes it'll send a request to that webhook mentioned
port is forwarded
Is that heroku?
Are you using nginx?
ask to @narrow geyser
no
Ik, just kidding
Go to your vps
Write cd /etc
See if there's a nginx folder there
there is one
Ok
You'll have to create a proxy to allow your vps to be found in the internet
Brb, I'll get you the file model
@knotty garnet Please do not spread bullshit. nginx is not needed.
yeah it doesnt
I dont care enough about vote locking commands to set it up, but I doubt webservers require that.
Besides, discord essentially is just one big webserver.
nginx is already installed there, it'll block incoming request attempts to webhooks
also, you don't need to be a d**k just because I offered help
I'm currently using webhooks actively on my bot, that's why I pointed to that
So if I do this would it be ok?
dblsetup(bot)
print('Started top.gg webhook')
bot.run("************************")```
@sullen nymph it still doesnt work, rewards are now being given twice..
My bot is an AutoShardedClient, could that be why?
In how many guilds is your bot rn?
450
hm
any ideas as to what's causing the issue?
wait don't worry
ive fixed it
thanks for the help :)
@restive otter What was the issue?
I kinda forgot to turn on the Atom FTP before saving so it didn't upload to the GCloud VM ๐
Completely my fault :P
Ah lol
it's fine :^)
you dont need that if you're using dblapi.js
unless you wanna manually process the webhook
but..
you didnt define the webhook options
i copied it from api page
hmm weird, did you save the code before running?
yes
do you need express for anything?
no
then try without it
use the webhook example with port instead
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
but i need port 3000
just change the port number
but its only port 3000 available on glitch
yes, but my bot is in port 3000
and i want to add roles to voted people with bot
but port 3000 is unavailable :(
why is port 3000 unavailable?
5000 will not work on glitch
you will never receive anything
and you told me you dont need express, then how are you using port 3000?
did you receive a vote in it?
that makes no sense lol
are you sure you dont have another dblapi code somewhere in one of your files?
well if it works it works lol, but if you want i can take a look at your project code
const DBL = require('dblapi.js');
const dbl = new DBL('token', { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
I will later when I'm off my phone
// Main File ie index.js
// npm install dblapi.js
const Discord = require("discord.js");
const client = new Discord.Client();
const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);
const port = 5000; // Glitch 3000
const DBL = require("dblapi.js");
const dbl = new DBL("top.gg_token", {
statsInterval: 1800000, // milliseconds - Default 30 minutes | May not be smaller than 15 minutes
webhookPort: port,
webhookAuth: 'password',
webhookPath: '/dblwebhook',
webhookServer: server
}, client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
// Optional
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
app.get('/', (req, res) => {
// ...
});
server.listen(port, () => {
console.log(`Listening to ${port}`);
});
just example keep if good or delete \๐
My DBL webhook works just fine, but server count isn't posted
const DBL = require("dblapi.js");
const dbl = new DBL(client.dbl_token, { webhookPort: process.env.PORT, webhookAuth: 'my password' })
dbl.webhook.on('posted', () => {
console.log('Server count posted!');
})
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('error', e => {
console.log(`Oops! ${e}`);
})
dbl.webhook.on('vote', vote => {
user = client.users.cache.get(vote.user)
client.channels.cache.get('685971547315240969').send(new Discord.MessageEmbed().setColor('RANDOM').setThumbnail(user.avatarURL({ format: 'png', dynamic: true, size: 2048 })).setDescription(`Thanks you for voting <@${userid}>! `))
});
any error |
not updating count on bot page
too many requests
Bruh
d.js master?
V12.0.2
yes, it's a bug by d.js
d.js goes to #development
https://prnt.sc/repuab it tried to post server count
404 not found
https://prnt.sc/repuzn this works fine lmao
they are two separate things
still separate things
yea
show code?
k
I guess I have to put client at the yellow arrow? https://prnt.sc/repyok
or im wrong
or after wehbhook settings
according to dblapi.js, after
lets try
if you didnt add the client at all, there should never be any attempt at sending, let alone 404s lol
now lets wait for dblapi to post server count
*with heroku I've never added client but posting worked as normal
theres no waiting
if you used postStats, yeah
but if you dont use either postStats, nor add the client to it, then it should never attempt to post anything
now sure how you got that 404 lol
the autoposter posts every 30 minutes by default, including minute 0
the module has other functions
like getting bot stuff
you could get a 404 with an invalid id
Just saw that sorry
Ask it in #development @toxic niche
Constantly getting Unhandled rejection at: Promise [object Promise] reason: Error: postStats requires 1 argument
js library
dbl.postStats(stats.guilds != null ? stats.guilds : 200000, null, totalShards);```
ternary operator
3 parameter types are numbers
It worked fine before when I had this:
dbl.postStats(stats.guilds, null, totalShards);
I thought maybe adding the if/else would fix it so /s
let stats = (await pool.query("SELECT * FROM stats WHERE index=1")).rows[0].botstats;
why are you getting your stats from a database
Because that's where the stats are posted to by each cluster.
Trying something new.
Are there rules for the API ?
yes
dont spam it
dont post a fake guild count
use webhooks if your bot gets >1000 votes a month
sure you can
webhooks can be used whenever you want, getting votes using other methods is what stops working if you have more than 1000
if you implement webhooks from the start you dont have to worry about it later on
Ok nice
@gaunt umbra https://top.gg/api/docs#ratelimits
Here are the rate limits for the api
No more than 60 requests per minute
And also what CF8 and Tim said ^
The rate isn't a problem, I'm not requesting the api
Excepet for stat update every 2 hours
Could somebody help me with dblapi webhooks?
js
The problem is, I want to use port 3000 for my webhook , which I use for https data with express
U use glitch?
Port will be process.env.PORT
Ik, that port is usually 3000, but I cannot have express and dblapi use it at the same time
Ok
@nova summit
I tried that
Recommended
app.get is an example for the rest of your webserver
Okay lol, I think it works
hell
How do you get a top.gg bot token?
api token*
oh
more specifically, https://top.gg/api/docs#mybots
How do you vote restrict a command?
@restive otter Maybe log the vote in a database with a data and when the user uses the command running by the database?
Not sure
What should be in URL bar?
In Webhook Title?
In API options
.
Dotpost
module.exports.startUp = async (client) => {
const dbl = new DBL(post["topGG"]["token"], { webhookPort: 5000, webhookAuth: post["topGG"]["password"] });
dbl.webhook.on("ready", async (hook) => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on("vote", async (voter) => {
console.log("voted");
});
};```
The ready event works
But the vote event doesn't
Not sure why
webhookAuth
Nvm got it to work
I keep getting this error:
Error: listen EADDRINUSE: address already in use :::3848
I've tried 10 different ports now
@steel hawk are you sure you're not trying to use the same port twice?
ie: every new port you try, you're always using it twice, thats why it always says its already in use
so the ports have to be different?
I am trying to check if someone has voted or not
but if you have an existing webserver, and you want to use dbl webhooks, you can attach it to the existing server
my webhook.on event and hasvoted event use the same port
const dbl = new DBL(dblToken, { webhookPort: 65335, webhookAuth: dblPassword }, this.client);
dbl.hasVoted(message.author.id).then(voted => {
if(!voted){
const embed = new Discord.MessageEmbed()
.setDescription(`Enjoying the bot? Vote for it here (it only takes a few seconds!): https://top.gg/bot/685159987638435861`)
.setFooter(`Voting will remove this message.`)
.setColor(colors.main)
message.channel.send(embed);
}
});```
This is in my ready event:
const dbl = new DBL(dblToken, { webhookPort: 65334, webhookAuth: dblPassword }, client);
dbl.webhook.on("ready", async (hook) => {
console.log(`Top.gg webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});```
why are you creating dbl twice?
two different files
still no need to create it twice
yes
also, hasVoted doesnt need a webhook, its a rest method
just create dbl once and then attach it somewhere you can access from all files
such as client
client.dbl = new DBL(...)
Still displays the error...
are you still running something else it the same port?
is port 5000 the one recommended to use? how do i know if thats open on my vps?
ping it
ping (myip):5000 in commandline?
should work afaik
could not find host should mean that the ip is invalid
i can check it if you want if you wanted to dm me your ip
ill try to figure it out
oki
im using OVH as my vps host and it has this in the control panel
im assuming that means i need to enable those thigns to be able to use them
ye
okay gotta figure out how to do that
you might be able to do it from within linux
i ssh into it from my computer to upload the files so idk why it has a red x next to ssh
hm
if i dont put the port i can ping the vps but if i put the port then i can't ping it
OH
cuz
pretty sure
ping does
ping ip -p port
or
wait no
hold on
ping doesnt support ports
ah okay, so gotta find a different way to find if the port is open
i was trying to ping the linux vps from a windows machine
do you have telnet
or
actually
open powershell
and do
Test-NetConnection <ip_address> -p <port_number>
tcp connect failed
try it with port 22
or 21
to see if the command works
(those are the ssh ports)
so i cant use 5000 so i gotta find a different port to run the webhook on?
just open it
oh how do i do that
send output of sudo ufw status verbose
error: bad port
now ping it
it still says tcp connect failed
hmm
from powershell
still says failed
and should show up on sudo ufw status verbose
should i restart the vps?
i'd just restart networking
To Action From
5000/tcp ALLOW IN Anywhere
5000 ALLOW IN Anywhere
5000/tcp (v6) ALLOW IN Anywhere (v6)
5000 (v6) ALLOW IN Anywhere (v6)
thats what the status says lol
it says that service isnt found
what distro is that
ubuntu
cat /etc/issue
ubuntu 18.04.3
hm
this is a lot more complicated than i thought it would be
try rebooting
cuz that should have opened the firewall
(it also could be the fact that nothing is actually listening on the port)
well when your bot starts, do netstat -tulpn | grep LISTEN
its not wanting to let me ssh back into it, and the control panel says its restarted
i hope i didnt break it lol
thanks
alrighty it says its configured to allow all tcp traffic to port 22 but still wont let me shh in
does ovh have a cloud console?
not as far as i can see
i wish they did at this point lol
i can ping it so i know its online lol
seems odd that there isnt a web console
lemme look
@quartz quest no
hi, i maded a basic command checks if user is voted, if user is voted gives user to a point. But i want to let user use command just one time. Until other day. How can i do it?
You could add their user id to a database when they use the command and remove it when they vote
Then just check that their id isn't in the database when they try to use the command
Obviously you could have their id be added when they vote and removed when they use the command
Works either way
ty i will try.
I had accidentally posted this in the wrong channel before, but
I assume that the Java DBL wrapper does not support webhooks, unlike the js one?
@bleak ledge in java you can setup springboot to make a webhook listener
Also make apis, but thats another history
Springboot is quite straightforward, you just need to set a few annotations here and there and call it a day
Why's voter.discriminator returning null by using .GetVotersAsync() in C# authorised API?
GetVotersAsync returns an array, are you treating it correctly?
Yes, using foreach. You can see from the debug info that all other properties are defined.
I just used discord websocket client .GetUser(id) anyways to get their discrim
If i am using a webhook, to post my stats, would i need to do dbl.postStats or dbl.webhook.postStats
wrong channel
how do i use dbl.webhook
js btw
because like uh
its undefined
const DBL = require("dblapi.js");
const dbl = new DBL(config.dbltoken);
dbl.webhook.on('vote', vote => { });```
the code errors there
sec
cannot read property 'on' of undefined
yes thats how mine ssetup
i left the webhook object out when i sent code
yup
I get my ready event to post the webhook running at (path) but i can't get anything to happen when i test the vote feature, it doesn't console.log the (user has voted) part
idk what i've messed up
const DBL = require(`dblapi.js`);
const dbl = new DBL(config.topggtoken, { webhookPort: 5000, webhookAuth: config.topggpass});
dbl.webhook.on(`ready`, hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
}); //THIS WORKS
dbl.webhook.on(`vote`, vote => {
console.log(`${vote} received`);
}); //THIS DOESNT```
got it to launch! what do i put in the url section of the Webhook?
where is your bot hosted?
locally
then the URL should be YOUR.PUBLIC.IP.ADDRESS:PORT/dblwebhook
you might need to open ports in your router
ahhhhhhhh
@vapid cape I put the http://(ip of my vps):5000
I allowed traffic on port 5000 from the vps firewall settings
did you put /dblwebhook after port?
No, I thought that was the default
I'll try that
i get this: Webhook running at http://0.0.0.0:5000/dblwebhook but when i try to test a vote it doesn't send anything
and the url is YOUR.VPS.IP.ADDRESS:5000/dblwebhook right?
the url on the bot page is that, yes
and the Authentication in the bot page, is it exactly the same as the value in config.topggpass?
should it have the http:// in front of it? cause i have that
yeah the passwords the same
yeah it shows "saved" under the test button
oh hold on im getting an error in console
its working now, i must not have saved it ๐คฆโโ๏ธ sorry
๐
What do you mean with vote count?
number of votes in my bot
because i have 31 votes
but code:
dbl.getVotes().then(votes => console.log(votes.length)
print 22
it takes time to update in api
:(
monthly 31 votes
Hm
https://i.imgur.com/YG58WyS.png
dbl.getBot("264811613708746752").then(bot => {
console.log(bot.username) // "Luca"
});```
I use this method and it works
I suggest you use the getBot() method
and bot.votes?
tks
You can see everything it returns here https://top.gg/api/docs#bots
You need to use your DBL token when making requests
i use..
Try again and make sure your token is correct?
without code
let b = await dbl.getBot('659831331169239060')
all works
but with it..
pls help
why
with this code
prints that unauthorised
do you have the token in the constructor
Hey guys, I am using your npm module for posting my bot's srver count, recenly moved to v12 and couldn't post the bot's server count and I get an eror now.
Oops! Error: 400 Bad Request
I wanted to get a acces token but it showed that I havent have any bots
@fluid river did you install the latest dblapi.js? if not, update it
@manic basin your bot needs to be approved first
Ok. Thx
@vapid capei think new discord.js is weird
Why we should check our embeds
Or messages
Where do I get the Acces token?
a
how can i make if user vote for my bot send message with webhook
u cant
?
oke thanks
he says "without webhooks" first
oh
well technically you still can, but its terribly inefficient and will have a lot of delay lmao
What is this problem
discord is down
Oooo
@restive otter don't use #topgg-api for this
can anyone help me out with this 400 error? thanks
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 1800000);
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
whats your discord.js version?
12.0.2
update your dblapi.js
okay
and no need to use postStats
?
can anyone guide me through with the webhook process to retrieve user from dbl api
Can someone help? My webhook is not working. But last time i tried to vote it worked
where do I get an api key
you need to have a approved bot to get it
how come my the dbl token seems to change every time I refresh the page 0.o
it shouldnt
think its buggy, when I click refresh on the token, it regenerates a new one, but if u refresh the page I guess it somehow just keeps regenerating a new one till u exit the page and come back
works fine if I exit the page and come back instead of refreshing
show full code
ugh wrong channel sry
the url I put is this: ip_address:5000/dblwebhook
in top.gg
website
@stiff orbit is your counter inside an "onReady" event?
Bot got errors since there are no 'Authorization' header in webhooks. Was API changed or there are some problems atm?
there will be no authorization header if you haven't set one
@stiff orbit in your case, have you put the guild count uploader inside an onReady event?
like, it'll not send any stats if your bot isn't ready yet
where is the counter located?
ok, but it has to be somewhere
like, just putting it in a file will not make it run
could you show the code?
but where?
The used API for this Command returned an Error, please try again later.
like, it depends on WHERE the method call is located
anyone can help me ?
you can't just "place" it in the code
The used API for this Command returned an Error, please try again later.
@lament sigil for what command?
X!rule34 bot's Senpai
X!rule34 bot's Senpai
@lament sigil are you sure you're in the right server?
in general all of commands nsfw
-wrongserver @lament sigil
you know something information that can help me ?
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says
Join Support Server, then we can't help you. Sorry ๐ฆ
ok thanks
i was thinking its easy just put the code and the token and it will works
@stiff orbit the code you use to upload the server count is called a method (or function), it HAS to be called somewhere within the code execution
depending on where you've put it it might not work at all
could you show us your code?
@knotty garnet yes. it worked fine for a long time
@knotty garnet yes. it worked fine for a long time
@willow ruin what message are you answering?
If you could at least specify your library or programming language
Did you at least visit the dblpy docs
What's your dblpy version
There's no Client class in module dbl
And I am literally linking the class that you need
Can someone help me how to set up the webhook properly?
Bot got errors since there are no 'Authorization' header in webhooks. Was API changed or there are some problems atm?
hmmm, have you setup the authorization header in the bot's page?
yes. it worked fine for a long time
@knotty garnet Got a few similar errors again...
could you show us your error?
File "C:\Python36\lib\site-packages\aiohttp\web_protocol.py", line 418, in start
resp = await task
File "C:\Python36\lib\site-packages\aiohttp\web_app.py", line 458, in _handle
resp = await handler(request)
File "C:\Python36\_Scripts\Bot\bot.py", line 1729, in post_handler
if request.headers['Authorization'] != DBL_VOTE_AUTH:
File "multidict\_multidict.pyx", line 62, in multidict._multidict._Base.__getitem__
File "multidict\_multidict.pyx", line 57, in multidict._multidict._Base._getone
File "multidict\_multidict.pyx", line 52, in multidict._multidict._Base._getone
KeyError: 'Authorization'```
use .get or handle KeyError
Sometimes it's all ok, sometimes got errors
!play Sevimli dostlar
yes
!!yardฤฑm
yo
Am I able to get help with one of the dbl wrappers here?
Yup
s
What issue are you having
I thought I linked the proper docs?
I couldn't understood the docs yesterday
how i can invite my bot here?
Wrong channel to ask
;-;
@cosmic hornet
where i should ask?
ok
I don't see dbl.Client anywhere
Wait I will show sir
Why did you name your file dbl
yes
Name dbl
yes
you are litterally just overriding the module name with your own file
Stanford University, Class of 2019
Do you have any folders named dbl
Ya sir
shivaco hi need a little help when you're done
I remember I had this exact problem a while back where my console would show the request but my on_vote_test event wouldn't fire and we solved it by setting my webhook_auth to None, it's been the same ever since but I'm getting the problem again [18/Mar/2020:10:01:53 +0000] "POST /a21votes HTTP/1.1" 401 178 "-" "DBL"
Only thing that's changed is I recently moved bot hosts
And I checked the ports they're fine
Oh
401 is denied no?
I don't think empty header values are even valid for HTTP
I tried setting an authorization on both sides, still the same behavior
Yeah that might be the issue then
so I think it should be empty
Sir thanks problem solved @sullen nymph
So what ig is happening is req_auth (https://github.com/DiscordBotList/DBL-Python-Library/blob/master/dbl/client.py#L419) is returning None and I'm essentially comparing None and a string
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
Congratulations me
Well that's the conclusion we came to last time though?
And it still worked after I set the auth to None
I'm not sure how I didn't get to fix it then ๐คฃ
Not exactly sure what's happening rn
cant you just do is not None or is None
Or maybe you did fix it but since I recently re-installed dblpy my old fix got yeeted?
I highly doubt I remember telling you to change the internal code
I meant the solution you gave me of setting the webhook_auth to None
Could be that just doesn't work anymore
Yeah, that'd make sense
But it doesn't make sense because it's returning 401 when you're comparing None == None 
ig I'll make both empty strings and push that later today and see if it does the job
but I ofc can't test anything I do currently
if (self.webhook_auth == req_auth) if self.webhook_auth is not None else True: :P
tho that belongs in #development and idek if python would accept that
condition = (self.webhook_auth == req_auth) if self_webhook_auth else True
Still not sure if that's the actual problem though cause even when I do set an authorization I still get a 401
did you save it
Try not giving any webhook_auth to the client
No changes
ok just worked
webhook_auth="DBL" then bot restart seems to have done it
So both None and '' don't work?
Yeah those didn't give me any responses
if you have the auth field on the website empty
Yes
and thank you for giving the masses of kids wanting vote rewards some peace of mind lol

๐
That seems to be an error in your code
im having difficulty understanding the webhook on my bot's page, i get a warning that it's designed for my bot that it doesn't post messages to channels, its for my bot only. i put in a webhook link that goes to a channel in my server, is that not correct?
import dbl import discord from discord.ext import commands, tasks import asyncio import logging class TopGG(commands.Cog): """Handles interactions with the top.gg API""" 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) # The decorator below will work only on discord.py 1.1.0+ # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats()) @tasks.loop(minutes=30.0) async def update_stats(self): """This function runs every 30 minutes to automatically update your server count""" logger.info('Attempting to post server count') try: await self.dblpy.post_guild_count() logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) except Exception as e: logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e)) # if you are not using the tasks extension, put the line below await asyncio.sleep(1800) def setup(bot): global logger logger = logging.getLogger('bot') bot.add_cog(TopGG(bot))
@sullen nymph
Bro I am using this
Code
Uhhghuugv
- Have you heard of indentation
I'm not sure how to read this
- the error wasnt about that code
That's probably just the way it was copied
Your error was from the on_member_remove() event not dbl
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
Learn to read stacktrace
Is it okay to return recommended shards * 1000 for the server count? The way my bot is setup makes it a little tricky to find the exact count.
?
?
I'm using a semi custom C++ lib
I guess I'll just hack in a way
Can each shard post it's count separately or do I have to tally them myself?
they can post separately
its not hard to keep a server count, even if you're using a custom library
you get a server count for X shard when it connects, then just listen to guild_create / guild_delete packets to add/remove from it
I'm just using the ready event & updating delete/create events yeah
^
TypeError: Cannot read property 'on' of undefined
at Object.<anonymous> (/app/server.js:80:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)```
help
-
throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/dblapi.js/2.4.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/luffy.js:80:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)```
dbl.webhook only exists if you set a webhookPort or a webhookServer
check the webhook example
and ports can only be used once. you're already using port 3000 somewhere else
like an express server
@dense compass russian dota2 ads up there lmao
What should I do to retrieve votes without using a webhook?
-botinfo @restive otter
652156490819436544
LuffyBot. V2
2836
LuffyBot. have a lot of images commands like random animals images and fun commands and anime commands.
Other
luffy
106
41
2 Servers
@topaz verge
oh sry
iam so sry
for i am using commnads here
iam sry
iam thinking i am in testing1 room
Calmdown
lol
If somebody voted and then ran this twice within 12 hours
Would hasVoted be true both times, or would it be true the first time and false the second time?
should be true both times
Ok
That's gonna be a problem
Let's say I vote
wait 11 hours
Run a vote reward command
Wait another 2 hours
Run the command again
Unless I use webhooks, I won't know that those were two different votes.
afaik there's no way to know when a person voted, besides webhooks
so without knowing the time, you cant know which vote is which
Ok
I'll have to find a better webhook tunnel than pagekite then
And use webhooks
Hopefully I can find a good webhook tunnel
cant you simply use http.server?
I need a tunnel
Otherwise the outside world communicate can't with me
Because direct IP does not work without port forwarding
Actually, it looks like pagekite is temporarily giving an unlimited quota for free.
So I can stick with pagekite for webhook forwarding for now.
Hi guys
Hi
how do i fix this https://platinbae.is-inside.me/MnjVfiRN.png
ok i see
im getting a Error: 403 Forbidden when trying to check individual users in the api
gg
It's probably just the system getting updated, most likely they didnt deploy it on a seperate system so they're just live editing the code in the main site
idk
I don't think so
gg
call to get upvotes from dbl using the python library prints cloudflare error page:
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="what_happened">What happened?</h2>
<p>This website is using a security service to protect itself from online attacks.</p>
</div>
</div>
</div><!-- /.section -->
<div class="cf-error-footer cf-wrapper">
<p>
<span class="cf-footer-item">Cloudflare Ray ID: <strong>576532c2c9ccccfe</strong></span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Your IP</span>: ||IP ADRESS||</span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Performance & security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
<script type="text/javascript">
window._cf_translation = {};
</script>
</body>
</html>
ะงัะพ ัะปััะธะปะพัั? HELP
Hi guys, do you know what's the method in discord.js to make the bot reply not parse _ as italic marker
?
Wrong channel, but try putting a \ in front of it
dbl.on('vote', vote => {
let guild = client.guilds.get("563708914265358336")
let embed = new Discord.RichEmbed()
if (guild.members.get(vote.user)) {
let member = guild.members.get(vote.user)
let user = client.users.get(vote.user)
.setDescription(`T
hanks so much for <@${vote.user}> for upvote for me
If you want to vote for me go to [https://top.gg/bot/652156490819436544/vote](https://top.gg/bot/652156490819436544/vote)`)
.setColor("#33333")
.setTimestamp()
guild.channels.get("689908901235130634").send(embed)
}
});```
dons't work why
there is no dbl.on("vote")
webhook ?
yes
dbl.webhook.on("vote")
yes
what you put there
ohhhh thaanks
by both he doesn't mean "same as url field"
Im wondering how to get if bot is online
for your bot just run the code, if it's not running then it's offline
for other bots just get the bot's member object, it has a "status" property
@vapid cape
const embed1 = new Discord.RichEmbed().setColor(config.emcolor)
.setDescription(`
Thanks so much for <@${vote.user}> for upvote for me
If you want to vote for me go to [https://top.gg/bot/652156490819436544/vote](https://top.gg/bot/652156490819436544/vote)
`);
client.guilds
.get("563708914265358336")
.client.channels.get("689908901235130634")
.send(embed1);
console.log(`User with ID ${vote.user} just voted!`);
});```
not work
offffffffffffffffffffff
what did you put in the URL field?
webhook token
? why lol
where is your bot hosted?
glitch
then the URL should be YOURPROJECTNAME.glitch.me/dblwebhook
why are you telling the person to vote inside a "onVote" event?




