#development
1 messages · Page 1325 of 1
@vale garden you need to call embed.attachFiles() and pass in an array with your attachment
what
embed.attachFiles([attachment, another_attachment_if_you_want, another_if_you_need])
to make the image display, attach it first with attachFiles, and then you can set the image to the attached one in setImage
at Object.run (/home/runner/Thunder/commands/image/shit.js:14:36)
at Client.<anonymous> (/home/runner/Thunder/server.js:100:17)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/runner/Thunder/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/Thunder/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/Thunder/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/home/runner/Thunder/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/home/runner/Thunder/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)```
const canvacord = require("canvacord");
module.exports = {
name: "shit",
noalias: [''],
category: "image",
description: "Sends a shit image",
usage: "shit <user>",
accessableby: "everyone",
run: async (client, message, args) => {
let user = message.mentions.users.first() || message.author;
let avatar = user.displayAvatarURL({ format: "png", dynamic: "false" })
let image = await canvacord.Canvas.shit(avatar);
let attachment = new Discord.MessageAttachment(image, "shit.png");
return messsage.channel.send(attachment);
}
}```
why its not working
One message removed from a suspended account.
What?
One message removed from a suspended account.
One message removed from a suspended account.

One message removed from a suspended account.
Yes
One message removed from a suspended account.
One message removed from a suspended account.
so what should i do
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ok
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
but its a module that makes canvas cmds very easy
One message removed from a suspended account.
One message removed from a suspended account.
so what should i do
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
msg or message
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
according to the docs, shit is a static property of Canvacord
so you would use it as Canvacord.shit
Can any1 send picture of how to like the galaxy gate control panel for vps looks like!
i m kinda confused now
try canvacord.shit instead and see what happens
at Object.run (/home/runner/Thunder/commands/image/shit.js:17:1)
(node:513) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:513) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
there's three ss

it was originally messsage.channel.send(attachment);, but you fixed it now
If I get a galaxygate vps, how would I make a webserver?
how do i fix the error "Client is not a constructor'???
show your code
just send it here
oh ok like all of it or a bit?
put it in code blocks, or if it's really long, put it into a hastebin
ok thx i did thaty and the errors poped up so thx anyways
is there anything else wrong with it?
if there's anything else wrong i can't tell
there something wrong with the ytdl but i think i can fix it but thx anyways
well i do see this
you need to be careful with your spelling and capitalization in programming
yeah i mispelled connection lol
i was typing to fast again
thx its running now!!!!!!
@sonic lodge
@drifting wedge same what you would do it in ur pc??
whitelist = ["762848911446376480", "727696378305970217"]
def is_in_server_list(server_list):
def predicate(ctx):
return ctx.guild.id in server_list
return commands.check(predicate)
@client.command()
@is_in_server_list(whitelist)
async def server(ctx):
await ctx.send('Check!')```
Anyone know why this won't work?
aren't snowflakes int in python?
shouldn't it be [762848911446376480, 727696378305970217]?
help
2020-10-16T05:39:48.930315+00:00 heroku[worker.1]: State changed from up to down
2020-10-16T05:39:48.935833+00:00 heroku[worker.1]: Idling because quota is exhausted
2020-10-16T05:39:54.868101+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable
what can i do?
same here dude
you crossed your quota
@earnest phoenix wdym
heroku isn't 24/7
there's a quota for each month
and you crossed it
meaning you can't use it until the next month
i started using the up like 6 days ago
can someone check, https://juix.io and try click store, for me it just wont change from my coming soon page but i changed da code
i started using the up like 6 days ago
@earnest phoenix
So I basically coded a command and I just want to addd a function like if I type ,warn @user mention . It should send the message that please Provide a reason.
Anyone to help?
Ping me if you want to helo
Help*
So I basically coded a command and I just want to addd a function like if I type ,warn @user mention . It should send the message that please Provide a reason.
@sick fable i can help,
send the code
@tardy hornet k wait
@client.command()
async def warn(ctx, user: discord.Member, content):
embed=discord.Embed(title=f"Succesfuly Warned {user.name}!" , description = f"**User warned by** : ``{ctx.author.name}``\n**Reason** : ``{content}``" , colour=discord.Colour.green())
await ctx.send(embed=embed)
emb=discord.Embed(title = f"You have been warned From {ctx.guild.name}!" , description = f"**Reason** : ``{content}``" , colour = discord.Colour.teal())
await user.send(embed=emb)```
@tardy hornet
just do
let reason = 'no reason specified';
if (args[2]) reason = args.splice(2).join(" ");
@tardy hornet thanks (:
@sick fable yo, check out your dms
python is so weird i accidentally read f"** as fuck
how can i view all the servers my bot is in djs?
client.guilds
Please help me how to prevent the bot from registering everyone here in the command!!
well if he sees everyone or here in the message, he did not send
if(args2 === '@everyone'){
message.reply('давай без этого')
return
}```
what is wrong? https://prnt.sc/v0dlxr
@lyric stag you don't have a closing bracket for the else statement in the info case
message.channel.messages.fetch({around: "766566025440788481", limit: 1})
im trying to get this to work where i can execute it in any channel but it only searches a specific channel. I've tried multipe .cache.get('channelid') but cant seem to get it to work
How to i change this
how do i see if someone votes for my bot on topgg? djs
whats a good way to tell when a channel is "active"? would it be tracking like historical data on it and then seeing if it goes above the average?
that seems super resource intensive to do
yes and yeah it is
you can do your best to minimize the impact though by only keeping necessary data
hmmm
i see i see
@earnest phoenix if you'd like, i can provide the parameters i use to detect when a GUILD is active, while not the same case, you might wanna use some of it
sure
@silver lintel its unrelated to djs, though you can use https://discordbots.org/api/docs#jslib this
:O
How can i copy the vote link of any server
Ooh thanks
oh its just if a threshold is met in a timespan
basically, yeah
though there are other checks which arent implemented yet
this is just what i use to auto-leave bot hells
Is there anyone who can help me develop a simple music bot
map channel.id => 0
for every channel
then on message, add +1 onto that channel
the idle_timer is one week iirc, once that timer runs out, it checks if it had at least 20 messages
while this may not be the best example for your case, this might help
yea i was thinking a threshold that scales depending on members would probably be good
map.has(channel.id) => map.get(channel.id) ++
else map.set(channel.id, 1)
something simple like this
so like a 5 member server has a threshold of like 10 while a 100 member serve rhas a threshold of like 500
i do something similar for my spawn crates
get % of the maxmimum amount of members
like 10% per se
though i would recommend also capping it
for example, this server has 100k members, igve or take
making it a 500k message threshold is quite absurd
add a maximum and minimum for the server
logmarithic functions op
@opal plank why is there a semicolon in an object declaration
const constants = {
// ...
};
WHY
if(1000 < memberCount || memberCount < 10) => use minimum/max threshold
else % of memberCount
what? @earnest phoenix
why would there not be a semicolon ?
save a single byte of storage space by removing semicolons boi @opal plank
bruh
that byte of storage space is translated to ram when interpreting
save ram instead :^)
yeah
waiy
bruh my linter auto puts it
javascript is compiled when it's run?
though the linter dislikes not having spaces nor semicolons
by the same logic, remove all spaces in your code

for programming
in vs code install standardjs and set it to auto format on save
clean code > your sanity
@opal plank jokes on you i have a tsconfig.json
work with that
that isnt clean
its effecient but not clean
thats how its intepreted by the compiler
@earnest phoenix too lazy to go fix it
you got the gist
no i got the repo
i don't even use TypeScript i was just testing your laziness 
you got the gist
@opal plank
no i got the repo
@pale vessel lmafo
lmafo
i code and drink alchool all day, what else did u expect code
sjon
the only thing i dont cut edges is work
which speaking of which im still indecisive about how to do this for the company

i code and drink alchool all day, what else did u expect code
@opal plank i expected you fucking up twitch with your slave thingy
alchool
alcohol
anyways, i should get back to coding
got shit to do
oh, speaking of which
52k channels
and a TON of errors
welp, time to improve the fuck out of it
can you eval smth for me
client.messages.get("766574469870387201").react("⭐");

how is blue fox host
@opal plank any idea why i cant run my bot?
2020-10-16T09:07:42.898736+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable
@tardy hornet where you even getting that error at?
it should return 2

dude
Yes
Cant !
Why
@tardy hornet where you even getting that error at?
@opal plank heroku
@tardy hornet that error is likely being thrown cuz a heroku error, i dont think thats being thrown by node
ik
and if you next question is: How do i fix it?
i dont know, i dont use heroku
@client.listen('on_message')
@is_in_server_list(whitelist)
async def msgfilter(message, member: discord.Member = None):
for word in filter:
if message.content.count(word) > 0:
await message.channel.purge(limit=1)
embed = discord.Embed(
colour = discord.Colour.red())
embed.set_footer(text=f"Test")
embed.add_field(name='Filter', value=test', inline=False)
await message.channel.send(embed=embed, delete_after=10)
return
await client.process_commands(message)```
Why does this still repeat commands? It only filters servers within the whitelist and works but when you use commands it keeps on sending forever
@gentle lynx use amounts.set("prop", "value") for maps, not amounts["prop"] = "value"
it still doesnt work
what is the difference between an Array, an Object and a Map
object = {}
array = []
map = idfk
arrays don’t have keys
maps are indexes basically
a unique key(usually string) and then a value(of any kind)
as the name suggests, its a map, you get one key, it leads you to one value
its a 1-1 MAP per se, in the very sense of the word
https://discordapp.com/channels/264445053596991498/272764566411149314/766589675430346763
@gentle lynx because the loop is async

turn that function and callback into async await style, then remove the timeout, this way you can make sure its already done before sending the size
even you add timeout, you dont know if the task is already done after 1 second
alright ill try it, thanks
to add onto above js objects are just dynamic maps
@sinful lotus i did this and its still an empty message
did I do something wrong? I've never used an async function
a map is a complex object, you can't send it and expect it to resolve to whatever you want
you need to format it to a string accordingly
the sql statement is what you want to transform into something awaitable
should i console log it
based on your code here
https://discordapp.com/channels/264445053596991498/272764566411149314/766589675430346763
this thing is a callback
i removed the sql code, no longer need it
then your for in loop didnt loop
i noticed sometimes bot statuses just turn off randomly for some reason when i have it in the ready event, am i going crazy?
@earnest phoenix probably some ws disconnect
uh
does the ready event not fir when reconnect?
I added await though ?
you dont need to asycn await if you ddont have the sql statements anymore, I said that because you had an async operation earlier @gentle lynx
@earnest phoenix depends, on internal sharding I dont think it fires
well even when i removed the sql statement, it is still empty
interesting
@gentle lynx as I said for in loop is probably not looping
is internal sharding built in these days? IE automatically implamented or do you still have to declare it
d.js has internal sharding built in by making the client shards option into auto
@earnest phoenix ^
thats what I cant answer, probably the object you are trying to loop is empty
or just use Object.entries(yourObjectHere)
then loop from that
personally I dont use for in loop for looping
@gentle lynx ^
I'm trying to figure out how to make my music bot leave a voice channel if a specific account Rythm joins in the same voice channel
so can I now remove the loop?
@foggy cove just get rhythm id, listen to voice state update, do some code there when rhythm joins dc your bot
async loop*
WHY IS IT SO ORGANIZED?
you dont need it at the first place @gentle lynx
@carmine summit litterally no reason to be lazy programming bots especially ones you want to eventually scale etc
many files
program with quality
do you keep your bot and functionality etc in one process / sharded ?
im taking the whole rest api -> integration route
@sinful lotus oh yeah that makes sense, ok I have a clear goal on what to do now, thanks!
rest api
websockets
and
process
gotch gotchu
most of my game apis are on rest api
game data api* rather
so I can reduce the load on bot
i mean thats the proper way to do things anyways
- if you have like a microservice styled backend modular scaling
uwo
owu
docker and k8s op
yes tho I dont use those

still lazy to do some major porting to those
tho im pretty sure the code is pretty much ready
i mean practically speaking if you have the whole endpoint -> integration style it wouldnt be hard to convert
just a few configs here and there
and learning the techs
ye
besides I migrated stuffs to api so they would have their own dedicated system to update theirselves without relying on bot's resources
specially fuzzy searching
if not k8s at least look into docker
yeah Im thinking about docker
pushing to github -> travis pulling and testing then publishing to docker -> and server auto pulling the image from docker
is so based
cicd potential is big boy
tho I will still setup it that
I will manually pull it when I want to
since I push to master without testing stuff

have a dev branch and master branch
have 2 process pull from each respective one
have a dev bot and prod bot
so
i want to put inj the hashmap
evertyhing in items
so like
IRON_INGOT => 2
WOODEN_STICK => 1
smh dev bot pulls from dev branch and merge to master once stable is pog
smh just push to master and dont update prod bot until its stable gang
@gentle lynx what I can only thing is, the second .set() is messing something on your code
move that outside the loop probably
or just remove that
idk what that supposed to do
log your loop, log the amounts, and properly format amounts
dont just send the amounts without parsing it
just had a pog idea that a million other people have had
if api healthcheck goes down bot dms me
just fix that undefined thing
Seems like whatever crafts[craft].items[item] is, is undefined
ur undefined @twilit rapids
i think i know why
crafts[craft].items[item] gives me the value not the key
oh wait no
just do Object.entries() loop
item gives me the value
so it's doing
crafts["IRON_SWORD"].items[1]
i want to do
crafts["IRON_SWORD"].items["IRON_INGOT"]
its undefined because there is no key called 2 or 1
idk what you doing, but isnt it better to use an array for this case?
just a recommendation
that way you can also keep its shape
['','IRON','', '','IRON', '', '','STICK','']; all 9 slots from the crafting area
also another recommendation is the Object.entries loop so you get less confused on key and value or rather item and its number
but i havent tested its performance
mostly preference, for me I use Object.entries then loop from it because of readability
your mom
@gentle lynx you can take your jokes to #general or another server if you'd like to ask for support while being rude like that
I- 
@mossy cloak yeah, #312614469819826177
what?
I Say About The Error
Export it, require it in the other file
yeah how
At the bottom of the class add module.exports = User, in the file you want to use it: const User = require('path to user class file')
You can probably also use es6 import/export but idk how that works
just User?
Yes
module.exports = User
Unless you want to export more then just the class
That needs to be in the file where you define the user class
Then require it
also I doubt that would return anything
as I said you are using callbacks
that will return undefined
Yes, require in the file you want to use it in
Also as Atri said you should use promises becouse you are working with callbacks
Or use callbacks
it looks like this
const util = require('util');
util.promisify(this.message.client.con.query)(sql)
.then(console.log);
the file i want to use the class in is under the commands folder, the class file is outside the folder
how do I get the path?
require('../file') is the easiest
../folder/file
thanks
../ means go down one folder
didnt tonk maintain the dbalapi?
well its archived now
Its depracted now
axios machine go brrrrrrr
also I doubt that would return anything
@sinful lotus yeah it doesnt return anything
uh
rewrite the last part
to look like that
but instead of .then
just do return code here
you mean the get function?
ok
@sinful lotus every function i ever write is almost always a promise :^)
promise gang gang gang
you forgot to return the util.promisify
also
.then(result => // do something)
if you want to chain promise
presence.activities[0] is undefined
doesnt work
whats a good way to counteract ready not firing on ws reconnect
im sorry im really dumb
maybe i update presence on an interval?
@earnest phoenix just fire ready once
What should I do
@earnest phoenix just dont set an empty presence
and if the ws disconnects?
@gentle lynx what doesnt work
Are you using shards
internal sharding atm
@earnest phoenix depends on your implementation, even ws disconnects, doesnt matter
whenever I use the get function
ideally ide like to have full uptime of the status :p
Your issue is your status disappearing right
well tap on shardReady @earnest phoenix
i'm bored
oooh shardready is probs a good op
imma go make a huge ballpit in matter.js
@twilit rapids yea status just drops randomly
if that fires more than one thats an re-ident
basically
just do
when it fires once, thats a ready shard
when it fires again thats a reident
Just have an interval in the ready event to update it every 30 minutes or something 
setInterval(function () { client.user.setActivity(`poggers bro`, { type: 'LISTENING' }); }, 30 * 60 * 1000);
setInterval 
¯_(ツ)_/¯
smh
but yeah
Or do it every 4 seconds if you're fancy
setInterval(() => client.user.setActivity('poggers bro', { type: 'LISTENING' }), 30 * 60 * 1000)``` ftfy
shardReady first fire = shard ready
shardReady fired after first fire = shard reident
ill jsut throw it onto shardready
and when shard reident, do your thing
also that gives the id of the shard that fired ready
so use the options in setActivity
to just set it on the shard t hat reidentified
Hi, guys, anyone was worked with lavalink?
to save some ratelimits
whats a lavalink
i dont think anyone here knows what that is
especially not music bot owners
what's a lavalink
Well what's the issue you're having
sorry havent heard it
lavalink is basicaly ip routing iirc
only @twilit rapids have a music bot here
have you tried turning it on and off again?
so he might know it
what's a music
actually, wait, i might be wrong
lavalink is used for music mainly
though iirc it can be used for routing ipv6's
how do you download individual files from GitHub without cloning the whole repo
Lavalink is a standalone audio sending node @opal plank
@twilit rapids My friend has such a problem, his code is exactly the same, but when he tries to start music, his bot enters the voice channel and immediately exits (everything works for me even if I put his node)
He use lavacord/discord.js
Check your bot's and Lavalink's logs
@twilit rapids yes, that bit i know, but i think it can route ip blocks
1 moment
i remember someone using lavalink for that
If you see the number "429" anywhere then get an IPv6 subnet
just fetch the file
@sinful lotus lmao
aaah, found it
I'm signed-out on GitHub Web in incognito mode
I use it but maintain it some build that makes my head goes rm -r saya_brain
cuz my host has a 39 ip block iirc
Would be smart to just show the error rather than sending a file with your IP
just realized there is a Raw version for every single file you upload on GitHub so I can just press Ctrl + A on this file and paste it on my computer and save it 
my ip is 127.0.0.1 ddos me
@twilit rapids Where ip?
@real otter seems like you're getting Failed to match ytInitialData JSON object
my ip is 127.0.0.1
Didn't notice
Ask about it in the JDA server
ill show you mine if you show me urs 😊
ads
In the #lavalink channel
I just made a repl called plain-anarchy-to-fix-my-boredom
Ok, thx
actually I can show you my ip
@sinful lotus also you use ll in prod smh
I just work with lavalink for 2-3 days and don't know how to fix it
@twilit rapids mine is called lavaweeb
s m h
ur a funny business
ok
no
which lang?
js
what is the difference between Kyoyu and Kyoso
hmmm
ts is fine but I think its better to just use another language than ts for me
i might wanna yoink that lavalink from ya
you mean the wrapper I use?
i need to route my traffic within the twitch slaves, possibly assigning each websocket to a different ipv6
You mean you wanna use my node

yoinks
lmao
just lazy rn to see an example
i'll google it later
i still need to finish the dynamic spawner
but timo dont need flex
they have examples on their github
this crap isnt properly counting the channelLimit
The limit is 5k per shard(slave)
clearly properly distributed and respecting the limit

5k what?
smh why has no one made a central sharding system
as in master/slave
centtal
but master handling all conn
thats what i did though....
the slaves connect to the channel that they were commanded to, then they route all traffic to master
I mean I have 200k channels per process if thats what you mean
eh
master is what handles everything
is there a CLI GFM parser
thats not discord @sinful lotus
any guild the bot is in
why do that though?
so master balances the guilds
wait what channels is that
why not
enlighten me
usually the holdback is on the connection
channel as in twitch channel(aka a stream channel)
owh
oooooo
makes sense
the problem that requires sharding is the buffer becoming too large
so they ask you to split it
as far as everything else goes, there isnt need for the shards to talk between eachother
they only talk to the master
which handles everything and dispatches events
not the same system, but I also deploy kinda something like that
I dont broadcastEval instead I have my ipc
though my problem rn is that
A) its not respecting each shard limit of 5k channels
B) its not spawning more as needed
and they are not being equally routed
but yeah you need to respect the 5k thingy soon
oof
probably use some penalties system?
18k on one, 6k on another
like i said, thats not discord, and twitch doesnt do sharding
I mean
this is all choice from me
yeah I mean I know its not discord
thats why implement some penalties system
so you can add or loadbalance your channels
respecting the 5k limit
i already have the in place, though it just isnt being respected lmao
probably an if or something missing somewhere
like for example, the closer the slave to 5k limit, the higher the penalty on it
OOOH thats what you mean
yes
mine works more with spawning X amount on startup, then filling them as needed with the startup splitting the load
the problem is: they ARE being evenly split
the issue comes when the channels they were ordered to join fail
if they start getting too much stress they may get ratelimited
which halts the whole thing
if they join fail, probably implement some back buffer queue
and try again after some x time?
something like the same logic of discord.js queue system on rest
on('failure') => timeOut(1000); => continue
that when 500 happens, they put it on back of queue and try again after other things are done
i could do a queue system too
though ive seen some people put the websocket to 'sleep' too
also if its fine to move the failed join in another slave
on join retry
that would be more better
like if it will retry the request, check the slaves for penalty then do it on that slave
i need to dispatch it with a RETRY_COUNT too
to make sure it just doesnt forever loop onto every slave trying
what i SHOULD be doing is separating the dispatcher tbh
its QUITE the hassle to have it on the index
since i cant delete the cache for it
deploying updates on the go without having to restart and re-query everything
actually
hmmmm that might be more troublesome that i hoped for tbh
actually
thinking about how to deploy updates on the slaves
i could put their functions outside and re-require it

i see this is gonna get hard and advanced really fucking quick
put it on a map and replace the data on map as you see fit 
Command => index => Dispatcher => slave => command => run command file => Dispatcher => emitter => index again
thats becoming quite the chain tbh

if it works fine that way then its probably ok 
How to make the bot say a message everytime it joins a server js
u need intents for it fyi
but use GUILD_CREATE event emitted by discord
if you using discord.js
listen to 'guildCreate' event on your client
but like i said, you need to be verified to do that now
GUILD_MEMBER updates are priviledged now
welp, time for a TON of booze and another 5h of coding

Hi, is there a way to find a channel by name?
I want to send a message to a specific channel, but don't have access to message object
if possible i'd like to avoid hardcoding channel id
Yeah, you can loop over all the channels and use lambda to check the channel name
But if you're going to be hardcoding the channel name, might as well do it with the id
Unless it's a command ig
it actually did work, I got confused by not seeing name property here - https://discord.js.org/#/docs/main/stable/class/Channel
Array.prototype.fill only changes elements that are already there and I want to just fill everything from index A to index B with whatever I want
Is there a method to do this?
i'd use .map()```js
function fillArray(arr, fill, from, to) {
arr.map((x, y) => y >= from && y <= to ? arr[y] = fill : null);
return arr;
}
fillArray([0, 1, 2, 3], "yes", 1, 2);```
// [ 0, 'yes', 'yes', 3 ]
i mean i already figured out how to do that but they should add a way to replace elements of the array and create new ones without the extra lines of custom code we bois make (and girls)(i'm bisexual)
replace elements of the array and create new ones
You want to enlarge the array size?
nope
var orginarr = ["yeet","lol","reeeeee"];
// fill only replaces the existing elements within the range
var fillarr = originarr.fill("nope", 0, 100);
console.log(fillarr); // ["nope","nope","nope"];
var smtharr = originarr.smth("yes", 0, "100");
console.log(smtharr); // ["yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", ...];
wouldn't it be just a simple for loop
That's what I said
i don't think so
why don't you think so?
because i have no brain to think
just extend the array prototype

also this is what I'm doing:
https://plain-anarchy-to-fix-my-boredom.code913.repl.co/
I've got an SQL questions myself.
If you had a piece of logic in some C lang that called a SQL database, would it be more performant to rely on the DBMS to perform arithmetic or rather should the program retrieve the record from a general query and perform the arithmetic itself?
I suspect relying on the dbms is faster
quick.db error
uninstall and reinstall the whole package
(your stored data won't be deleted)
can switch statements return data or are they void functions?
@carmine summit F
are you using glitch on light mode or is that repl
@earnest phoenix former
because glitch loves to fuck sqlite
switch can either break or return a value
so this is possible?
switch (_i) {
case 1:
return "smth";
break;
case 2:
return "smthelse";
break;
}
there's no need for the break there
but yes
its repl
return would exit the function
its an experiment bot
so break is technically unreachable there
dunno if its gon work
i dunno how to fix it tbh
i just reinstalled like fuck and it smh fixed
let _i = Math.floor(Math.random() * 2);
let thingtodraw = switch (_i) {
case 1:
return Bodies.rectangle(Math.floor(Math.random() * 1000), Math.floor(Math.random() * 1000), 50, 50);
case 2:
return Bodies.circle(Math.floor(Math.random() * 1000), Math.floor(Math.random() * 1000), 50);
}
thingies.push(thingtodraw);
Uncaught SyntaxError: Unexpected token 'switch'
wat
= switch wat
I remember past me not using functions and loops...
let thing;
switch(something) {
case 'a': thing = 1;
break
}
return thing```
if return is usable inside a switch statement and you can't directly assign a value to a variable what's the point
let val;
switch (thing)
{
case 1:
val = whatever;
break;
}
I remember past me not using functions and loops...
@carmine summit past you should cease to exist
c'mon we all have been there atleast once
this
I'd shake my past self's hand for being interested in coding tbh
@faint prism Your PFP makes me uncomfortable
why is shivaco's pfp stuck
sweet days those were, where we simply played with variables and if statements. Now here we are, clustering shit and breaking/ddossing twitch. No regerts 
ddossing twitch wtf
@faint prism didn't you hear the news? c#8 allows inline switch

ddossing twitch 
wtf
yup
you can further extend this behaviour with when operators
now i also have circles
sometimes i regret logging shit on my bot tbh
what browser tf is that?
what browser tf is that?
@carmine summit the only browser in the world that is good
lemme introduce you to Brave
if you dont use AOL, we cant be friends
const Database = require("@replit/database")
const db = new Database()
```boom
ez fix
@faint prism c#9 introduces the not operator
so that's fun
you'll be able to do when not
you can see how they're favouring functional language design
my terminal just sent that
(node:15156) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 closing listeners added to [VoiceConnection]. Use emitter.setMaxListeners() to increase limit
and now its doing some weird crap
One message removed from a suspended account.
yup
One message removed from a suspended account.
wdym?
i've been using it in my code for discord opcodes
what did i do
just do this 
cs8
you guys mean es8?
you added way too many listeners to the same event
we're talking about csharp
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
rly? no one screeched seeing that pic?
did someone hacked my bot?
ok
One message removed from a suspended account.
so what is that?
One message removed from a suspended account.
rly? no one screeched seeing that pic?
@opal plank me did, but on the inside
One message removed from a suspended account.
wdym too many
okay good, i wanted a reaction @earnest phoenix
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
c#9 also has records which are perfect for json deserialization
talking to me?

One message removed from a suspended account.
im using cases
One message removed from a suspended account.
lib is capable of 20 joins every 10 seconds, and each promise holds for 10 seconds, so doing 40(double) is a safe way to allow each shard to work with that many

One message removed from a suspended account.
One message removed from a suspended account.
but i have like 70 commands
✨ read your errors ✨
the error is 312 lines
@opal plank what are you even trying to do
im not gonna read it
@sage bobcat so just delete some commands?
i need to create and destroy a listener everytime i push a promise on the IPC pipe
the error is 312 lines
im not gonna read it
@tardy hornet because 99.99% of the errors is just javascript telling you where the error happened and node.js takes like 100000000000000 lines to show one file path
i need to create and destroy a listener everytime i push a promise on the IPC pipe
pretty much the same with react components mounting and unmouting
except 300 iq libs. on('error', => console.log('oops')), you'd be surprised how many libs do that shit
erwin
thats me
you are a good coder
im not
any idea what can i do?
remove event listeners
One message removed from a suspended account.
im 99% sure you dont need more than 1 listener
One message removed from a suspended account.
post error again
im using cases
nothing related to cases
One message removed from a suspended account.
its event listeners
One message removed from a suspended account.
its 312 lines, im gonna send the first line
post error again
(node:15156) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 closing listeners added to [VoiceConnection]. Use emitter.setMaxListeners() to increase limit
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
^^
^^
imagine going to the doctors and complaining you cough too much... but you left out the whole part where you smoke a pack of cigs a day
One message removed from a suspended account.
you using VSC ? @tardy hornet
whats vsc
One message removed from a suspended account.
visual studio code
g00gl3
visual studio code
@opal plank yes
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
good, then do this
One message removed from a suspended account.
ctrl + f
now type on('
then show me the results
One message removed from a suspended account.
i just wanna see how many listeners they have
lmgtfy became sellouts (uses your data and redirects you to their own engine instead of google) use http://letmegooglethat.com/ just to serve a bit of salt 
yup
One message removed from a suspended account.
I saw that and all the ads
@tardy hornet ctrl + f
then search for .on('





