#development
1 messages · Page 1600 of 1
you can talk to eacthother
talk in dumb people words
ehhhhhhhhhhhhh you're getting massively un-reasonable for python
like 4 letter words max
using pipes like that is a really bad idea in python's async world
okay, you know what process is ?
yes
okay, good
process.send() is a function that you can use to talk with IPC
it works like an emitter
let me get my example from leviathan rq
alr
I literally have Discord open?? LOL @umbral zealot I don't get the issue.
can you give me your bot's ID, lemme check something
as long as it works, it wont be rejected
okk do they accept semi inapropriate bots
Erwin this is Python not JS
read the #rules-and-info
oh, if its python
dude
I told you like
xD
lmao
oopsie

im legally blind, i'll let you know sir
Alright I read the rule
or maybe caipiroska
but my bot is kinda on the limit
okay so why not @modest maple
causality
can I dm someone about what my bot does and you tell me if that's not allowed
or show in vc
2 options
Rules are extremely clear, there are no grey areas
and your bot will be reviewed when it reaches the top of the queue not before
i run a specific instance of the bot for dashboard, or i can add ipc to all the bot clusters
and then just find a way to ask the specfic cluster to do set thing
Because python web-servers work via a pre-forking moddle each worker is a new stateless process which is a new ipc client mess per server instance which makes your code even more spaghetti
how do you spawn your clusters anyway? doesnt py have a master process? like a shard manager
sharding in python is still 1 thread
so you can normally support upto 15-20k servers per instance on your average server
my pc can handle about 60k servers per instance
rip
my understanding is hes already running multiple instance
ik
at least thats what i understand as "clustering"
which he shouldnt be doing
Fixed
master, heheheh
so im asking, how are you spawning these instances
well the way im doing it is have each cluster be an instance then making the instance run specific shards
2 dif files
ah
okay
so
i REALLY gotta repeat that your shouldnt be clustering
like no offence
but this is way out of your skill level from what i can gather for now
guys pls give me some hints how to solve this problem. I am sure I am not the first who had this, I was on google and all I could find was topics with v11 js
djs
i mean
1 instance is fine to use for the ext-ipc module
you could try just switching libs 
Then you cant access cache from each process
you can
huh
jk, lets see whats up
exactly
prob would work
async stuff is annoying AF. returning data from a Promise that runs inside a promise, i hate it.
same thing with ipc
@midnight blaze how good is ur internet and are you sharding?
exactly
your dashboard will need to send a message to all processes
and have the right process respond
How many guilds do you have, and also, what's your sharding code?
ye
like discord.js does
not really
you can find what shard it is in
is that guild in your list of guilds?
if you have the total shards and the guild id
each cluster will only have a set amount of guilds
send to all then have only one respond
but you cant use the ipc module for this btw
not really needed tho
what tim said is right
theres a formula to calculate the guild
if you know which shard ids each process has, then you can send it only to that one
ye?
true
fuck i forgot the rest
programmer moment
og right
pwogwammer
uWU pWoGrammR WoWment
(GUILD_ID >> 22n) % SHARD_COUNT
thats the formula to see which shard your guild is in
so like tim said, yeah, you can directly fetch the shard the guild is suppose to be in
yes
you would need to have a master though
that bot cluster gets and acts on
Pwowogwammer
yea i wanted that
or somewhere so you can fetch how many shards your bot has
oof, hardcoded shards
well, i guess you could just read the file and send it via http
guildcount would still be hardcoded
wdym?
when someoena dds ur bot
just send a request to /gateway/bot
then your number is already wrong
true
6000, should I really share my code? It aint special
oh yeah
well then what can i do?
how wouoldu have dynamic shards doe?
or is it on the gateway?
gateway iirc
internet? It is a vultr vps?
dont u have to specify shardcount on bot start?
unless you've literally duplicated the exact shardingManager code, I'm pretty sure it would be helpful
send a request to /gateway/bot with your bot's token, and you will get the recommended shard count
use that to know how many shards
@quartz kindle ye but i still will need to CHANGE the shard count
like restart the bot
yes, but you dont need to hard code it
every time your bot starts, it should be getting the right number of shards automatically
reason why i ask is thats usually due to poor internet which makes discord send too much data and you miss ACK's and heartbeats before they become ready. Caching all users can cause that, if your bot is pretty big
ah ok got it
manual chunking™️
manual thonking
Dynamic Cluster Gang ||and ddosing twitch in the process of learning||
require("dotenv").config();
const AutoPoster = require('topgg-autoposter')
const Discord = require('discord.js');
const client = new Discord.Client();
const { ShardingManager } = require('discord.js')
const manager = new ShardingManager('./index.js', {
totalShards: 'auto',
token: process.env.TOKEN
});
const poster = AutoPoster('eyJhbGci----iWt_c', manager);
manager.on('shardCreate', shard => {
console.log(`Launched shard ${shard.id}`)
shard.on('ready', () => {
console.log('Shard ready')
})
shard.on('disconnect', (a, b) => {
console.log('Shard disconnected')
console.log(a)
console.log(b)
})
shard.on('reconnecting', (a, b) => {
console.log('Shard reconnecting')
console.log(a)
console.log(b)
})
shard.on('death', (a, b) => {
console.log('Shard died')
client.destroy()
client.login("token")
console.log(a)
console.log(b)
})
})
setTimeout(() => {
manager.spawn()
},15000)
lol
whats the /gateway/bot url?
like how would i do it?
i STILL dont understand http stuff lol
thats not what we asked lol
shard.murder
how many members/guilds is ur bot in and how fast is ur internet/processor
they did tho..
who?
aiohttp
in the headers put Authorization: Bot tokenhere
here 😛
@opal plank @quartz kindle @modest maple ty all so much
6000 servers
that might be why
running a client in the manager oof
I feel like maybe now all the information has been gathered, but I don't do sharding 
are you caching all members on startup?
@quartz kindle d.js caches everything by default no?
Do you just get the bot developer role when your bot goes on the site?
https://discord.com/api/gateway/bot is the /bot?
delet this
const Discord = require('discord.js');
const client = new Discord.Client();
bot token?
yes
cool
yes
but not members
isnt there a chance he might be missing heartbeats due to discord sending all member data?
i remember cake having a similar problem on his
because djs has a flawed fetchAllMembers
indeed
i had to fix it myself on djsl
So my bot died this morning because it sends GET requests to the Top.gg API checking if a user has voted (for certain commands). In order to solve this, I need to implement better error handling so if the top.gg API isn't working, it just bypasses and allows the user to use the command anyway.
However, with the issues, it takes around 10 seconds for it to receive the 504 error from the API. Because of this, I don't think it's feasible to just wait until the response comes back... what can I do instead? I've heard that webhooks might be a superior solution, however, how can I make my bot store the data that the user has voted within the last 12 hours (as I am not rewarding users, I am just force-voting on some special commands for the bot).
top.gg is having issues
always catch your errors
catch the error
yes but that's the issue, as the catch takes like 10 seconds to work
because it is still waiting for the response
like a champ, ts topgg.postStats().catch(() => {})


voteParse = await got(`https://top.gg/api/bots/695011795110461520/check?userId=${message.author.id}`, { headers: { "Authorization": process.env.TOPTOKEN } });
like i've just been sending requests
this is probably a bad idea right
thats not a good idea for many reasons yes
yea better use webhooks
implement a cooldown system, this will not only prevent your users from spamming the commands but it will also prevent reexecution of the same command while the first one is still executing
SUPER
webhooks are usually more opt for this @rugged girder
FUCKING thats ur name
i forgot yesterday
i dont remember why but someone was asking about something from you
do you all have a guide for the webhooks, as I don't think it's feasible to store the data and delete after 12 hours...?
lol im getting famous here?
you need a database
and then delete after 12h?
most databases can delete after 12 hours fine
if you want to store temporary i can suggest use Redis
it also fires an event if the TTL is reached
so you can send a reminder with it
technically, you dont even need it
if you already have a database which stores user info
would say its better than having every x minutes a db call
but to prevent a ton of database queries, then won't you have to cache like 1000 votes?
you can just add a field that says lastVoted: timestamp
i had to mention you yesterday for something, but i forgot your nick
and i now forgot the reason too
do i need to lurk around here more?
that thing was there only because I tested something and forgot to delete it..well, but anyways, now it works for some reasons
caching 1000 votes wouldnt be a ton of data
yes
a few kilobytes if done properly
prob not lmao, too much braincell leaks
yes because your client was trying to login without sharding, so it was erroring
does anyone can help me ?
I am programming on discord.py, and the file I have to send guild count make my bot doesn't launch.
But the one important thing, is the file worked perfectly 2h ago, but not now.
It'n not working on both OS, Ubuntu LTS and Windows
error?
if you mean the top.gg api guild count, it's because there are errors right now on the system. See #site-status and #support 's last message.
hmm..ok, I see, I guess you are right, I just dont get why it wasnt deleted completly and I missed it, thanks for your help
anyways i think i did something cool.
a Expess Tensorflow integration with automatic scaling Worker threads and load balancer.
someone have a code for deleting messages? (not bulk delete)
no because don't delete messages individually. It's bad, it's API spam.
and somebody knows why for some reason when Im bulk deleting 14+ days old messages, the bot just stop working
because you cant
bcs you cant
thx
the limit is 2 weeks max
I know
If you want to delete all messages in a channel, clone() the channel and delete the original one.
and bulk deleting anything beyond that is API abuse
it's 2 lines, can't be simpler.
but why its just stopping my bot
Because you didn't code it right
catch the error
thx
if you use node unhandled errors will exit the process
likely cuz u use node 15
But, again, the way to do this is clone + delete. Super simple.
yeah thx for the advice
pog
imagine not handling your errors
imagine not handling and counting them
and logging
why did it not crash the process before 
cuz pre node 14 it just dont
thanks !! the problem isn't from me. oof 😂
they advertised it for a long ass time
exactly 😄
that it would crash the process
ultimate logging™️
im docker so i not got those colours 
imagine not having console variables
i gotta work out where df that EOF error is coming from though 
welp my bot got seizures. https://i.s8s.app/Wdw1bmdd most informative error ive ever got
5 different systems that can raise that message 
How do I know my bot has been reviewed
I have another question, how can I make my bot to delete the specific amount of messages that I declare to him
you get DMd by luca
i feel like anyone can make a custom console error logger
apply a limit to the bulk delete
my console pogs
indeed, but not many do
ok and...
and what
thats it?
just give the bulk delete a limit parameter 
I Checked IN MORNING, MY BOT HAD 50%
Now, it is getting reviewed
I had to do final try for myself
Wtf should I do now
nothing
if your bot is 50% in queue its not getting reviewed now
just wait
I said I checked in morning, it was 50%
Now, is getting reviewed
its not
@slim heart //@ts-nocheck > //@ts-ignore
again, trust us its not read what @cinder patio sent you
i dont use ts-ignore even
just 300IQ and go full on
discord-api-types poopoo
lmao
frick u tim

scratch is clearly the superior
ts doesnt offer any performance improvement over js iirc
again, read the message in #site-status
i'll stop working on djsl when they do
then tim will come to detritus
couldnt possibly become anyworse tbh
or just go raw
i mean
thats what she said
So, we can't see percentage?
Bruh
djs is adding customizable caching soontm
soon™️
read the message 
Ye
they've already added methods to stores that can do api requests without cache
or just use an alraedy good library that doesnt need to wait until v13 to have BASIC FUCKING FEATURES like caching customization.
cough cough detritus cough cough
@modest maple can u suggest me a good bot except dank memer, mee6, dyno, carl
That has games in it
🤨
?
my bot
shameless ads
jk

this channel really isnt the palce to ask tbh
This is development
yeah, BOT DEVELOPMENT, not ask-a-bot
if you wanna develop a bot, feel free to ask about it
How do I do YouTube notifs
webhooks™️
you can also doing it on websites
surely youtube api cant be that bad
I use bot designer
with fetch()
yikes
have fun with the Google API, this thing is not really user friendly
okay well gl with that
yeah bot makers and stuff wont take you far at all
Google api's are ass
for such a massive company ive never known docs to such so much
in master or next?
But, bot designer has 50m downloads
master
oh cool
or maybe already in current version
do you have the SMALLEST HINT of idea how much pain i went through to get my mail webhooks going? its SO FUCKING SHIT, you need to add pages and get verified and shit its HORRIBLE
And that makes a difference because?
bot designer is making discord bots on training wheels while driving on Instapac
Because?
wait... where?
im looking at master commits and dont see anything
oh nvrm
they are shit, had the same issue
i woulda sworn i'd already seen it
gasm
how many guilds/members cached?
im caching everything currently, but it'll change soon
gonna make it dynamically cache it
not sure
should suggest
you'd have to ask them
ive done that for rose
like here's an example for a shiro bot i made for rose https://github.com/jpbberry/shiro/blob/master/src/master.js#L12
it only caches channels and guilds, no props but id for guilds and channels just store nsfw props
its minute but it just add that little bit back
minute?
i think it has BaseStructureData
That's a little overkill imo
can never be too overkill when it comes to scaling
its overkill for tiny bots but when they get bigger it adds up
i did something similar with my custom lib for cb, and it dropped like 100MB off of ram
still
incredibly cheap for most things
yeah i guess
I gotta work with webRTC soon
gonna not be too fun
im determined to learn it though
yeah i use that
those choose what is to be cached
im talkin bout what props to be cached
within those individual caches
you can select what you WANT and doesnt to be cached
ah i guess not even detritus does that
i had that in mind for quite a while
this is the options per
yeah that's not indiv props
im gonna do that in my future testing stuff
https://github.com/jpbberry/censorbot/blob/master/src/discord/events/CHANNEL_CREATE.js#L1 was inspired by my own implementation here
Error: 504 Gateway Time-out i got this on one of my bots, did i hit a rate limit?
types for props sounds like a massive pain in the ass tbh
everything would have to be optional
for the user it still seems like a bitch to use
cuz everything would be optional
so it would highly increase complexity
not really
having to check if the data has the props you need
you just pick out the props you actually use
well yeah, but your compiler doesnt know that
you rarely use more than 10% of props of any cache lmao
random.js
index.js
how can i send (t) on index
im trying to get data from another js file
dont use var, var is deprecated and still there to not break the internet. Use Const or let instead
^^
Why not just allow users handle all the caching themselves 
did you guys talking about me?
see but then why try to implement built-in caching. If I were to make a discord lib I would make it so users can easily build their own caching system that feels integrated into the lib, but in reality it's not
its up to the user
you can customize built in caching and if u wanna do it urself just do it urself
what this mean
(node:25) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 Hey @PokéHunt#0608, sunucuda link paylaşamazsın! listeners added to [CommandoClient]. Use emitter.setMaxListeners() to increase limit
(node:25) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 The bot is offline / restarting, please join our support server for updates: https://discord/cpYkJzd listeners added to [CommandoClient]. Use emitter.setMaxListeners() to increase limit
(node:25) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 **No i delete your message you can not share links here , @PokéHunt#0608** listeners added to [CommandoClient]. Use emitter.setMaxListeners() to increase limit
you have too many listeners
thats a bad solution
how many event listener did you have? like client.on(message)?
not if its intended
You rarely need more than 1 event listener
i have 6
How can I pull the value(const/let) from another javascript file?
especially with djs' message collector that's just not the case
wtf?
You don't know?
how many client.on(message) etc did you got?
yea 13
but why?
you dont need a listener for each command
1 event or 2 would do it
i dont
did you have duplicated event listeners like for ready, etc
only 2
you have to got more, otherwise you wont get this error
i will check brb
client.on("guildCreate", guild => {
client.on('messageDelete', async message => {
client.on('guildMemberRemove', async member => {
client.on('guildBanAdd', async (guild, user) => {
client.on('message', ({channel, content, member}) => {
client.on('message', message => {
client.on(message, (message) => {
client.on('message', message => {
client.on('message', message => {
client.on('message', message => {
client.on('ready', () => {
client.on('message', (message) => {
client.on('ready', () => {
client.on("message", async message => {
why 8 message event listeners?

why 2 ready events 
if you want to have the files cleaner, split the stuff into sub files and call them inside the event
client.on('ready', () => {
console.log('Online');
client.user.setActivity('akhelp and watching 15 servers', { type: "Watching" })
.then(presence => console.log(Activity set to ${presence.activities[0].name}))
.catch(console.error);
client.user.setStatus('dnd')
.then(console.log)
client.user.setPresence({ activity: { name: akhelp || Watching ${client.guilds.cache.size} Servers and helping ${client.users.cache.size} Senpais || Watching Commands 81 || }, status: 'dnd' })
.then(console.log)
.catch(console.error);
})
client.on('ready', () => {
const antispam = require('better-discord-antispam');
antispam(client, {
limitUntilWarn: 3,
limitUntilMuted: 5,
interval: 2000,
warningMessage: "if you don't stop from spamming, I'm going to punish you!",
muteMessage: "was muted since we don't like too much advertisement type people!",
maxDuplicatesWarning: 7,
maxDuplicatesMute: 10,
ignoredRoles: [],
ignoredMembers: [],
mutedRole: "Muted",
timeMuted: 1000 * 600,
logChannel: "antispam-logs"
});
});
out them into one ready event
ok
do the same with the message event, then your error will also go away
it will probably break, but this is the price for bad code
you have 8 message event listeners, this is bad code
it for differener stuff
yes but wont change the fact that its bad
Is anyone else having an issue with the webhook voting thingy?
@placid iron can u help me setup a aiohttp webserver?
I'm getting a 500 error
I heard aiohttp
I heard requests
no flazepe shush
I heard http
I need help
@slender thistle no more mod? wot
my bot is in a terrible server that I dont want it to be in due to what the server is about and they wont kick the bot, how would I make a command that would leave the server?
👀
and 2. a way to find what proccess/shard a guildID is in
welcome to the blu chad squad shiv
guild.leave() should work on lamost every lib
in which library?
Discord.py 3.8.7
i still bet its guild.leave()
get_guild, .leave()
yes
dummy
i was righhtttt
😦
but i like pinging @slender thistle for no reason whatsoever
I am so confused, can someone please dm me if you know how to do it ❤️
both of them already told you how to use it
Use a cog for your routes ig
But where do I put that? in the console? or like how do I put that into a command
@slender thistle well yea
I'm sure you could figure that part out on your own
i need a way to send it to the speicific cluster
As for the shard...
gotta code it yourself
well yea
WS or just REST requests 
yeah chill you can take over cuz I don't know shit there
I am reaching out for help for a reason, because I couldnt figure it out
plz no
LMFAO
@modest maple i could set up a local server doe?
just localhost?
since will be on same server
dashboard and bot
This is what I tried to do but it didnt work
@commands.command()
async def leaffs(self, ctx, guild_id: in ):
guild_id = message
guild = await self.client.get_guild(int(guild_id))
channel = guild.system_channel
await channel.send("Leaving this server due to misuse!")
await guild.leave()```
👀 You know local host is local right, so if its local what's the point of your dashboard
We literally just told you
the local thing is for dashboard to talk to bot
like dashboard backend
just do self, ctx, guild_id: int in your command arguments
no get_x isnt a coroutine
can you do guild: discord.Guild?
done
@slender thistle yes
and it didnt break
Even better
only in master
or might still be a pr
😩
Well, my previous option then
for this you'd then simply do self.client.get_guild(guild_id).leave()

all that would be thrown in the garbage in my code lmao
client, payload, guildId
cuz fuck the rest
@modest maple instead of setting up an aiohttp server, could i just set up the ipc on the clusters?
Test shit out
mhm
this links back to the whole dont cluster stuff when you dont need to because it makes your shit 10000% more complicated
@modest maple alr
can you explain why i cant just set up a instance just for this?
like ik i shouldnt
but im not sure WHY
i mean you can
but then you login every time you make a worker
you eat up a large amount of ram per worker
you connect to the websocket every time
extra bandwidth used from events etc...
your webserver should run 2 * your_servers_core_count
e.g. 8 cores = 16 workers
so thats 16 bot instances
no the webserver spawns child processes
typically gunicorn etc... spawn 2 * the core count
hence why i said... its a bad idea
you guys wanna see how much js objects are bloated?
I JUST F****N IMPLEMENTED HOTSWAP HELL YEAH
ig so
js is kinda bloated in a lot of areas tho 
yes
then frick u
where n when
imagine not converting to human redable
so c++ best
shame on u tim
who cares about human readable
frick u
we are machines
beep boop
ha, pass this captcha then
I cannot.
btw you see that FTSet there? thats my lib that works on strings only. which means, if you convert the entire data to string, it uses 3x less ram
tim can convert bytes to human readable
link please
Okay, I think it's the first time I need help in #development
nohello smh
npm ftset
dont ask to ask 
🤣
welcome eri
it’s more a nohello tbf
My bot is going crazy rn, it has 20 shards and it's currently restarting again and again and I can't figure out why https://i.imgur.com/EUbRMyF.png
it returns this weird websocket error
but nothing else
I'm using d.py
21k
weebsocket is closin
on one instance?
yeah, I mean 20k guilds in a single instance should be fine tho as long as you use shard it correctly?
twinty shards
I'm using an autosharded client rn
do you have members / presence
only have members
whats your server specs?
do you have the logging Info at hand?
anyone happen to have a suggestion for an ORM for java?
in-all likelyhood your at the max you can support on a single instance
@flat pelican can you eval stuff?
Where am I supposed to get the logging info, except my console?
check os cpu and threads if they are getting clogged
logging.basiconfig(level=logging.INFO) put that at the top of your main file
eval seems to be working for 1/5 of times
does the vps have a montiro for that?
can you get your cpu usage btw
im under the suspicion it might be clogging some threads and disconnecting
20k is pretty high for a single instance to support
however, it is not showing the image when i submit it? Only works in preview
excuse me?
ah okay.
<style>
body {
background-image: url(https://wallpaperaccess.com/full/1204217.jpg);
background-color:#FF0000;
}
</style>
```this is what i've done. Doesn't seem to work.
But it worked before.
So i've got no clue what's up.
body should work
though i could be VERY mistaken
but you probably need to force override it with !important
According to netdata when I attempt to start the bot and htop: https://i.imgur.com/fsYSfaW.png https://i.imgur.com/1XvRPMP.png
body should work fine. I did it before.
dunno then
It just stopped working after a few months.
so i assume its not cpus
looks pretty reasonable that you're just maxing out at the most your server can support per instance guilds wise
just looking at those spikes
those spikes look like less than 60%
yeah you'd expect that
is it maybe because i am forcing dark page?
you shouldnt see a python process using 100% ever because it cant realistically
60-66% for the spikes
oh its python 👀
yeah

thats why i havent touched anything further, i can only assist with stuff outside of coding language here
can you enable logging output quickly to double check
so shards are connecting
so all those WS error happen before any shards identify?
or is it docker just repeating logs
ah thats what im looking for
Wait
i mean this is concerning but shouldnt be blocking that much
is it really blocking because requests fails to post stats?
it shouldnt be for that long
it'll have a affect but it shouldnt be causing those timeouts
Lemme try to remove it, just in case
mhmm
why are you using requests
termius ftw
@flat pelican do you have termius premium?
u get it with github edu
why not
ye, got it with ghub edu
i mean how often is that called?
nice
@flat pelican u should be using aiohttp
requests is sync
@modest maple every 10 minutes
ehhh i wouldnt really care that much then
litterally doesnt matter that much
i mean theyres no reason not to
i doubt that request is take several seconds to send a request
@modest maple true
@flat pelican happens to me a lot
also
"websockets are closing"
with aiohttp you can use a session which is poggers
thats concerning considering your bot is small
its literally just a waiting thing
requests have that aswell
erm, it really isnt
shards are waking up, let's see
then what is it?
Then your code is causing some really serious issues
if u know what it is u can help me lol
- your internet is so bad it doesnt let the bot chunk in time blocking heartbeats
- your server is so week that your single instance cant cope with the influx of events
- your code is blocking in some way causing hearbeats to be skipped
which reminds me
I got my on_ready event
@flat pelican do you chunk manually or default?
manually, yeeted the default because it was literally taking 100 MINUTES to chunk everything
yeah do be like that
case 'lb':
var money = db.fetch(`money_${message.guild.id}`)
let content8 = "";
for (let i = 0; i < money.length; i++) {
let user8 = bot.users.get(money[i].ID.split('_')[2]).username
content8 += `${i+1}. ${user8} ~ ${money[i].data}$\n`
}
const leaderboardembed = new Discord.MessageEmbed()
.setAuthor(`${message.guild.name} - Leaderboard!`, message.guild.iconURL)
.setDescription(content8)
.setColor(bsc)
message.channel.send(leaderboardembed)
break;
it should work as a server leaderboard, but it send an error that its 2000+ in length
Overall looking at this i would highly advise you start clustering
how you managed to get to 20k without this before amazes me tbh
@modest maple my on_message event is really fucking up my bot
like its causing it to never get "ready"
I don't think clustering is needed on 20k tbh
That doesnt make any sense unless you block the event loop for periods of time
20k is pretty high for most servers
bearing in mind your only a single instance and most servers have a rather low clock speed
presence accounts for alot of load but still pretty high
standard message ratelimit
you got multiple webhooks on that channel?
only one
it just posts an embed with a small traceback
i'Ll check that later I guess
how often is it doing it though
when a command errors out... so it's not supposed to happen every seconds lol
i'd say 1 time every minute, I get some errors for unchunked guilds
I'll check that later
you sure you're not hitting global then with all the shards etc... if this is on startup?
but btw, the root cause of this whole shitstorm was requests
for the requests issue? or webhooks?
how do I make my bot page have server count?
no
webhooks
probably yeah
logins are normally really quite heavy on your ip ratelimit
I think it was hitting the ratelimits today because of this issue, it probably attempted to post too much stuff in there
Btw, thanks @modest maple and @opal plank for the help ❤️
👍
can someone who understand quick.db help me please?
just wait
okie
eyyyy it worked ty :3
case 'lb':
var money = db.fetch(`money_${message.guild.id}`)
let content8 = "";
for (let i = 0; i < money.length; i++) {
let user8 = bot.users.get(money[i].ID.split('_')[2]).username
content8 += `${i+1}. ${user8} ~ ${money[i].data}$\n`
}
const leaderboardembed = new Discord.MessageEmbed()
.setAuthor(`${message.guild.name} - Leaderboard!`, message.guild.iconURL)
.setDescription(content8)
.setColor(bsc)
message.channel.send(leaderboardembed)
break;
it should work as a server leaderboard, but it send an error that its 2000+ in length, i want it to show the top 10 in the server that the command was sent.
how?? teach me to do that because I have a mistake
yes
"npm i top-gg/sdk"
"npm i topgg-autoposter"
i need to install 2?
const ap = AutoPoster('insert token here', client)
ap.on('posted', () => {
console.log('SYSTEM> Posted stats to top.gg')
})```
thanks
the 2nd one is preferred
ok
yes
yes i understand
Can I put the code anywhere?
i put it at the beginning but you can put it anywhere except inside events
oh thanks
ohh epic
shouldn't you be using new though?
ya
wat
new AutoPoster('thing')
add a new before that AutoPoster
this
would this work using internal sharding?
or would i get rid of the "servercount" since shard id and shardcount are already there
i think you have to use broadcastEval to get the guild count
oh the topgg api doesn't add up the shard servers?
not sure
i thought each shard reported servers seperately to the api based on id
hmm
i'm probably wrong
no idea, haven't used shards yet
you could use topgg-autoposter
i guess it'll handle shards correctly
i use that
o
yeah i'll just go with that, thanks
aight, np
so my code is wrong?
what is shards?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
cry, you understand a bit of quick.db and arrays? @earnest phoenix
k nvm then, ty tho
the server count is fine in the principal page ,but why dont show ??
the server count only shows on the bot's page, search/list and widget
not on the user profile
oh thanks
for the information
why the command for the server count in 5 minutes say's : time out
only solution?
am i supposed to be excited for this?
TopGGAPIError [Top.GG API Error]: 504 Gateway Time-out
at Api._request (D:\DATA.C\Documents\bot_sandwich\node_modules\topgg-autoposter\node_modules@top-gg\sdk\dist\structs\Api.js:74:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Api.postStats (D:\DATA.C\Documents\bot_sandwich\node_modules\topgg-autoposter\node_modules@top-gg\sdk\dist\structs\Api.js:94:9) {
response:
what is it?
is a error from autoposter
xd
or maybe it's your internet connection
uhmmm probabbly
https://i.callumdev.pw/2ga2x.png
why is this not working? trying to send an image through form-data
the error is coming from data.append
embed.attachFiles([{ attachment: canvas.toBuffer(), name: 'sample.png'}])
Not sure what's happening, but i'm not being able to set the image onto the Embed and i tried .setImage not sure whether i did it right or wrong.
you use attachments://name.extension on embeds
then u send files with the message
no preblomo
NameError: name 'client' is not defined```
when im starting ipc
and also, if i have 2 clusters, how will the ipc like choose which one to connect to?
@modest maple sorry for the ping
but any ideas?
it doesnt
like if i have 2 clusters how will i connect to both of them?
you cant use it for multiple clusters like that
so just running another instance without caching anything would be a good option?
like it wouldnt use resources
and it wouldnt respond to commands?
no, it is never a good option

