#development
1 messages · Page 1806 of 1
yes whenever an error occurs, the bot send that error to a specific channel
and trackback
By trackback do you mean the stacktrace?
nah the trackback and error we get in the terminal, that
What exactly do you mean by "trackback"
but where in my code and how?
Error: Some error here
at test (...) // Do you mean these?
...
...
...
let me find some old error screenshot
@earnest phoenix uhh i m sorry its Traceback
Traceback (most recent call last):
File "e.py", line 7, in <module>
raise TypeError("Again !?!")
TypeError: Again !?!
Look at the stacktrace of your error, in index.js, line 124, column 204
discord.py has on_command_error event that passes context and the raised exception for commands extension
That's actually called stacktrace so yea, anyway; you could catch these errors by try-except and send the the error message to a specific channel by using its ID and calling the send() method, you could also use the on_command_error event
k
@earnest phoenix so is this correct??
@client.event
async def on_command_error(ctx, error):
try:
ch = .......
ch.send(error) # is this correct??
except:
# what to do here???
pass
client.on('message', async message => {
if (message.content.startsWith('!help')) {
message.channel.send('https://discord.gg/NqQ8mqW')}
if (!message.guild) return; // No DM Messages Allowed!
if(message.channel.id === "851716854471852042") return; // Avoid duplicate logs
if(message.channel.id === "668445747611435008") return; // Avoid secret channel logs
client.channels.cache.get('851716854471852042').send('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \nServer: ' + message.guild.name + ' \nChannel: ' + message.channel.name + ' \nUser: @' + message.member.user.tag + ' \nMessage: ' + message.content);
});
``` 118-125
Should work I guess
Remember to await the promises/coroutines
No
ohh yes
on_command_error is emitted when an error actually occurs
error is the exception, ctx is the context object for your command
Use <Message>.author.tag instead of <Message>.member.user.tag
Is message.author okay too?
soo what all to change in that code sir?
<Message>.author turns into the user's mention when casted to a string so, sure
msg.channel.send(error.stack)
Eh nothing apart from probably doing something helpful when an error occurs when sending a message in the event itself
They're not using discord.js
oh
yes its py
oh sry
ok hi lol, im once again stuck with the slash commands, this time it won't let me updateOverwrite the voice channel seriously it says no error but it just doesn't do any changes.
else if(command === 'update_role'){
const role = args.role;
const voice = bot.guilds.cache.get(interaction.guild_id).channels.cache.get(db.get(`voice_${interaction.channel_id}`))
const permission = args.new_permission;
const state = {
2: true,
1: null,
0: false
}
voice.updateOverwrite(role, {
permission: state[args.state]
})
bot.api.interactions(interaction.id, interaction.token).callback.post({
data: {
type: 4,
data: {
content: 'Done!'
}
}
})
}```
let me send the needed media
so this is me using the command and it's successful
this is the succesfull code take
actually for now all the errors got either fixedor got an reply msg, but when the bot actually goes in use and some new errors come becoz of diff situations, so i needed to know if any error comes, bot should send it in my test server, soo can u plz tell was that code correct/
aaaaah lol
it's the first time im using js
that's a js thing not djs
Just make sure the channel you send the errors to actually exists and your bot sees it
and you're good
okie sirr thankss
oof
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1000
Anyone has an idea of what causes this error? It happens once in a while
Please, explain this to me...
discord.js, voiceStateUpdate.js
what do you want to get explained
When i print this Object i cannot find a certain property in the list. When i access the property it is there.
show the console
That's because members is defined as a getter rather than a property @viral spade
"Bot has started, with 6 users, in 3301 channels of 124 guilds."
Can't be 6 users lmao
Why doesn't it work correctly?
CAN
not cant
it means u dont use the MEMBERS_INTENT
so it caches them as they send messages
and by no means all users will be cached at all times
you need the intent to load all members
uh?
unless u tell it to, in detritus u can set to cache all users
you need intents to load all members
that'd be a crime against programming
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
still uses less ram than djs lmao
How?
lul
in the intents u put on ur code
djs has an intents array u pass
when u initiate ur client
So when i do a console log, or a for-in loop, i will not see this method? how can i print these getters?
. . .
ugh, just google "discord.js intents"
@opal plank you need the presence intent to have all guild members sent on guild create. members intent does allow for fetching all members but not until the client reaches a post ready state
yes, im aware
tell that to them tho
not me
May have just misconstrued your words then. My mistake 
I was meaning to clarify this since guild members is still on message create
thats what i said tho
you dont need guild members for message create member caching
the member object is always on the message if sent in a guild
but i never said that
he was asking how to get all members cuz it seemed off having only 6
so apparently in PHP there's an ability to use indents for if statement calls
inherited Java/C++ logic
so i explained those 6 comes frmo passively caching them
And that's why I may have misconstrued your words
i see
kinda looks like scuffed java
don't disrespect java like that 😔
java make memory usage go brr
No, it's still pretty bad during runtime.
Run time is still pretty meh. LavaLink advertised itself as having a low memory footprint when it takes 1GB in prod with < 5 active players
not if you use it right
Ah yes, you're using it wrong
yeees
@client.event
async def on_command_error(ctx, error):
ch = client.get_channel(id=862010583783178273)
await ch.send(error)
``` This code only gives me the error msg, how to send the traceback
you use traceback module
are u asking me or suggesting me??
suggesting
how to use that??
you import it
oooo
yeah
tbf, I never really had issues with compilation times
unless raw java is slower ofc
but who uses raw java nowadays?
that's what i'm thinking right
Idk you might go back to raw java depending on how oracle continue to play their licensing game lol
oh noe
thats what i mean
What status code should i return when a user reached a limit of items? Like too much autoroles.
yes an api
400 maybe? theres not really anything specific to too many items or anything along those lines
400 means bad req so maybe thats most suitable 🤷
Or just 429
429 is ratelimit
thats not related tho
Yeah but maybe 413 is perfect for it
yea i think so
mk
@latent heron i wanted to send the whole thing from terminal to a channel but how to??
whole traceback and the error
you probably don't want to do that
i want to bro
char limit says you don't
its 2000 characters na??
ye
so it can come
complete tracebacks/stacktraces are reeeeeally long
unless you send it as a file, you won't be able to
Stream the file data in chunks instead of accepting it all in one go
okie but how to send it??
bot tag?
u cant
@lyric mountain ```py
@client.event
async def on_command_error(ctx, error):
ch = client.get_channel(id=862010583783178273)
await ch.send(error)
Just use the inspect() method from the native util module and set the getters option to true
Or if you want to see all the hidden getters/setters/non-enumerable properties or other stuff, set the showHidden option to true
Example:
// ---
// You can get the inspect method in both ways, just use the one declared in your module specifications
// CommonJS require util
const { inspect } = require('util');
// ES6 import util
import { inspect } from 'util';
// ---
// An object with a getter
const obj = {
get test() {
return this.valueOf();
}
};
// Inspect the object
const inspected = inspect(obj, {
showHidden: true
});
// Log the inspected object
console.log(inspected);
// Output: { test: [Getter] }
How can I get all permission listed for a role?
let perms = Checkrole?.permissions?.joinToString("\n")
does not work
<Role>.permissions.toArray().join('\n')

in d.js - v12.5.3
var type = [ "audio/mpeg", "audio/vorbis", "audio/aac" ]
let Stream = args[0];
let RStream = await fetch(Stream);
let StreamCT = RStream.headers._headers['content-type'];
I am trying check if StreamCT [content-type] doesnt have a type one of these types
Any way to do this without causing errors
so Rstream is sometimes malformed or without content?
no
without a contect in the type
var type = [ "audio/mpeg", "audio/vorbis", "audio/aac" ]```
basically I am checking if its not a audio
any which error do you get?
I dont get errors it doesnt work
It might be wrong
if(!type.some(verify => StreamCT.includes(verify)))
Hey, why is giving me this error?
if you're using the latest dev versions, thats no longer supported
the correct way is ```js
message.channel.send({
embeds:[e]
});
I think it's just embed: e
not in the dev version
Ah, it is like that
[HTML] Is there any difference between using and omitting a p tag?
<body>Yeah</body>
<!-- vs. -->
<body>
<p>Yeah</p>
</body>
what is it
if(args[0] === 'become') {
if(!args) {
message.channel.send(becomeE)
}
if(args[0] === 'server') {
message.channel.send(serverE)
}
if(args[0] === 'bots') {
message.channel.send(botsE)
}
if(args[0] === 'website') {
message.channel.send(websiteE)
}
}
because that code is never going to execute
why
if args[0] is already become and it passed that statement
then args[0] cannot be something else
cmon
brain exercises

like args[2]
it's your code
ok
i don't know what you want to do with it
Be smart lol
Array.prototype.uniqueCombinations = function () {
let r = [],
l = this.length;
for (let i = 0; i < l; i++) {
let t = this[i];
for (let j = 0; j < l; j++)
if (j != i) r = [...r, (t += this[j]), [...t].reverse().join("")];
}
return r;
};
let all = "abc".split("").uniqueCombinations();
console.log(all);
/*
[
'ab', 'ba', 'abc',
'cba', 'ba', 'ab',
'bac', 'cab', 'ca',
'ac', 'cab', 'bac'
]
not good!
*/
im trying to make a prototype method to let me list all unique combinations of every array element up to its length, but this isnt doing the trick, any idea how to improve it while maintaining the simplicity and compatibility with 10+ elements?
Thanks 🙂
I think the word you're looking for is permutation
might wanna look up example algorithms using that word first
uhh.ye it only replys the bot emebed if you do like the whole command plus previus, for example, ++partner become server bots
and replys all if you do all commands
ping in reply if going to reply 😅
Does anyone known a good + affordable host for music bots?
Does someone know how to fix this?
message.buttons is not a funtion
Yea but how do i fix this?
d.js right?
Yes
Version?
Messages doesnt have buttons
Thanks
not really a help - No worries but
how can you deduce all the reasons at once? only the most recent reason is displayed now
console: https://hastebin.com/cokototihe.less
code: https://hastebin.com/icotarogiq.js
about all user reasons from the database
yeah but, you want to list all reasons at once in that embed?
in embed i can't list all the reasons am i right?)
yes, I want to list all the user's reasons in embed, but if this is possible
pebblehost
iterate over each reason and append to description
or use fields
just note fields are limited by 25/embed
okey
How can i fetch a single member in discord.js?
await msg.guild.members.fetch(targetUserId);
this gives me the list with all members
thanks
client.channels.cache.get('id')
wat do you mean probably lol
suddenly i cant log into the bot anymore "SHARDING_READY_TIMEOUT". Have i been rate limited? if so, how long until i can log in again? discord.js
normally it says right next to the error the timeout
doesn't look like a ratelimit error, more like a failed attempt to login
like wrong credentials?
i just saw, my token has changed too. but even with the new token, i cannot login... please help
hi someone know about js please i have a problem
setTimeout(() => {
wb.Props = {
Title: "Test",
Subject: "Test2",
Author: "Test3",
CreatedDate: Date.now()
};
wb.SheetNames.push("Names");
wb.SheetNames.push("Emails");
wb.SheetNames.push("Linkedins");
const ws_data1 = [[`${naming}\n`]];
const ws1 = xlsx.utils.aoa_to_sheet(ws_data1);
const ws_data2 = [[`${email}\n`]];
const ws2 = xlsx.utils.aoa_to_sheet(ws_data2);
const ws_data3 = [[`${urlsys}\n`]];
const ws3 = xlsx.utils.aoa_to_sheet(ws_data3);
wb.Sheets["Names"] = ws1
wb.Sheets["Emails"] = ws2
wb.Sheets["Linkedins"] = ws3
xlsx.writeFileSync(wb, 'results.xlsx');
console.log("Check the output folder, the migration and scraping is successful.")
}, 5000)``` hey, why is my excel data only writing to rows instead of columns? I am using xlsx package for this.
i am already stuck on this little hiccup for days

Lmfao
how i can filter the user author only?
no?
I just want to export some data
why are you making assumptions so fast lmao
take ya chill
and then this #development message
you tried using a .txt db, then moved to a json db, and now, if we follow the trend, you'd b going at a sheet's db
and thats why i made those assumptions

Are you on the master branch?
How to stop your bot on restarting
you could...like...not send a msg everytime it restarts
discord has micro restarts
Do a funcion on process exit event
@quiet pawn
Listen to the process event emitter
Id use webhooks for that
so instead of making the bot send it make it send through a webhook?
is that whatcha mean
correct
the bot is going down anyway
no need to hang the lib
just use any http service to send it
so when its about to go offline send a thing to webhook to tell it that correct? then get the webhoook to send a message
just making sure i fully understand
well yeah, how are you going to send a message if the bot is closing?
which can also work for when ur bot have disconnected from discord
o oki yea makese sense thank you
hello
hi
👻
@clever agate freenom is broken
dont use it
they will take your domain for no reason
like free domain?
yep
Dot TK is the only top level domain name registry that provides free domain names. Get your free domain name today, before it's gone.
you can get free domain on there
idk about vredit card tho
i personal have paid domains i never used free ones
it redirects me to freenom
weird
idk what to say then, even if you do get a free domain you can technically lose it anyday
thats why its free
namecheap give u domains like .pw for like 88 cents
well yea
ye ik
weird doe
or a like acess to certain places maybe
even tho that would make no sense
ok you can get a .xyz on namecheap for 88 cents
.pw used to be on the 88cent offer
technically it's never been YOUR domain
yea
i use that for domains
and cloud flare for dns ofcourse
i have 3 domains for my image hoster
What is the advantages of using schemas for mongodb. Do I have to use it?
You have to use it if you're using mongoDB as a database. It defines the content of documents in a collection.
Should I separate module or it is ok under 1 hood, I mean the module anime seem going growing larger now.
Talking about this
Could you provide more detials?
I don't see anything wrong with keeping it in the same file/class.
It is just 1 part of the discord bot though, so kinda make it seperate package
or just leave it be
better to leave it be
It's fine if your modules are large.
What matters is the functionality and its purpose.
any good reasoning behind it? 🤔
The majority of the file is your Anime class, and trying to split up a class is weird. Though, there are other ways to solve this. For example, you could think simpler and not use a class in general.
Also, why are you using jikan? Why not use MyAnimeList's official API?
Yea, it is all related to anime referring to jikan api
I dont really understand the url redirect part
basically, i dont even have domain to begin with
You should be able to set your application type as web
as of Class it mainly for me practice using/learning Class/Constructor
I think I can use module.exports as well, but that beat the purpose for me learning
Ah, okay
I think I can separate constant into another file, as I'm going to make Manga class soonish
Excuse me? MAL official api?
Yeah
When and where?
Meh
Tbf, I see a lot of potential improvements there
First being setting fields by name for those objects since you're using the exact same naming as the returned payload
Can comment on my repo if you willing to
Nah, already buzy with my lib
quick question
ping me with answer
what's the limit on the ID of a button
ie how many characters can it have
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
100 chars
Ah, alright
In other words, you cannot read the property length of undefined.
and how i can fix this ?
By not reading length of undefined
Cjs?
what?
Es6 for command handler?
ill have to await the imports if i use dynamic es6 imports
commonjs is synchronous tho
Js is mono-thread
no?
if u using import(), then yeah
that async
but why would that matter?
you can just require() it
just gotta use require().default if u using default exports
thats the only real difference
this is synchronous:
import anime from "erwin";
this is not:
for (let cmd of fs.readdirSync("./commands")) {
const data = import(`./commands/${cmd}`);
}
what if someone runs the command before it's registered cuz async
Why don't u just cache the commands?
cuz they are different things
like i said
if someone wants to run a command you make it async[
and let them handle it
or require() like i said
that is exactly the reason why im not using commonjs
reload commands fail cuz cache
and also because es6 looks awesome
or run that only once the bot has emitted a ready state
OR, better yet, only run your bot ONCE that has been fullfilled
Yeah
make sure the bot is ready before running it
I'll emit a custom event when the commands are done
ok
a command isnt loaded, so what?
its not gonna error
its just not gonna output anything
and regardless, this is a one time thing in the startup
at best you looking at one or two poorly timed users doing that
ight
we gave u plenty of options, just pick one
Or just make a "Loading command..." message
And execute it once ready
That way you don't even need to hang the bot while loading commands
or
ignore the poorly timed users

@opal plank this lookin good?
import { CommandoClient } from "discordjs/commando";
Comando...
you dare speak to me of commando and djs?

alright
i mean, if u need your daily dose of "discordjs and commando are shit", im more than happy to advertise detritus
I agree
commando is as good as my ccode(shit)
one import only, take it or leave it
see?
still waiting for that deno port
you know you can just run a script to change all internal node api imports to https://deno.land/std/theapi/index.ts
then it will work in deno
how do i make a slash command with dpy?
Hello! I can't figure out how to install node and nodejs latest version on Ubuntu 20.04. I tried a list of things, such as installing them with apt (this didn't install the latest version) and installing nvm to install it this way (which only installed node, not nodejs).
Any help is welcomed!
"It installed node, not nodejs"? What do you mean by that?
When I ran node -v, it shows the correct version, as expected. However when running nodejs -v, it does not show up a version, as it isn't installed. Even after "layering" the version through nvm on top of apt's installation, it only showed the earlier version compared to node.
It's always been node
Well, it says that I only have the earlier version or don't have it at all
I've never been more confused in my life tbh lol
like i said, node -v will give u ur nodejs version
the node command refers to nodejs
the fact that u can use node means u have nodejs installed
Why is the versions differing then?
Error: The module '/home/ubuntu/beycord/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing```
likely cuz u installed it twice
also it doesnt say it twice
it says it once
use a newer node version
uninstall and get a newer one
I've been trying
it won't let me for some reason
what the
whats deno
@earnest phoenix I don't think anyone here actually cares enough, but if you have password auth set up, I'd probably consider changing your ssh port and setting up sha-256 public key login for your server or else people would be able to brute force your ssh password and gain access to your vm
after you verify pub key based login works, disable password auth
ssh keys really aren't about security, if you have a good enough password it's as good as an ssh key
only difference is password auth might get your machine flagged by port scanners and people might try to brute force (unsuccessfully) and that might be annoying
only difference for me is ssh keys are convenient
how long ya'll think a 1vcore cpu and 2gb ram should last me
i say 400 servers
another js runtime made by the guy who made node
it's built on rust and can run typescript and needs no npm
400-600, something in that range
im at 400 and only using 500mb
so i'm probably getting all this wrong
i haven't used my rpi for hosting yet lol
i use a galaxygate vps
solely because of laziness
lol
me
that eats your money away like nothing
im getting an rpi for my birthday
what should i host on it
no clue
i'm personally using ubuntu server
bland
whats a rpi
no desktop
raspberry pi
raspberry pineapple
lmao
since my linux installation broke imma do my linux stuff on it
kinda like a persistent trial ubuntu
bro
i can use my rpi for using linux images
with my 32 sd cards
but no
i choose to use a vm

1k servers are possible lol, just requires some cache optimisation
pihole
not my fault my old 1gb rpi 3 was 1gb memory
i had to allocate 512mb to node
i know people here run 2k guilds on 1GB ram
rip
what lib did you use?
i managed to somehow allocate 512mb instead of 1024mb
jsut normal djs
well
yea, use d.js-light and you can half the Ram usage, if you disable Presence caching
or switch to detritus.
im good
it killed my bot las ttime
hardcore
well then
made everything higher usuage
then you did something wrong
i was using 600mb at 200 servers
i didny
lol
ive had like 95mb with 270 Guilds
as soon as i changed back to djs
i was at 90mb
i think its because of the apis
idk
i use alot
of stuff
plus code is a mess
why tf did you want to use xml?
?
xml2js should format xml to a json object iirc
i havent updated that inawhile
its old
the package list
hald those i dont use anymore
i might remove it
only thing upto date on there is code
With d.js light I had a 500 server bot use 70mb of RAM
And thar bot also had an express server running as well in the samw process
just an FYI, its the other way around
yea ik
i just stick to djs
i run 2 bots on same vps
so that could be why it says 1gb ram usuage
but check this
interesting 
in the benchmark test, detritus managed to cache MORE users than djs and still come out as a lot less ram
if u want the full article https://github.com/Skillz4Killz/dapi-bench
300 more users and 80 mb less than djs
```Best Cache Gathering`
Detritus is the best library in terms of which library can cache the most amount of data coming in from the same events. During the entire benchmark, it was consistently obvious that Detritus was increasing much more rapidly in cached users which goes to show that their handling of events and caching is better than everyone. At certain minutes you could easily see Detritus having gained several hundreds more users as opposed to the other libraries.```
damn
its absurdly worth moving to detritus
i have never heaed of Detritus
as much as i meme about it
is it js?
its made purely in ts, but will work absolutely fine in js, you just wont get the benefit from the intellisense we ts users get if u chose to use it in js
i have a demo repo if u want to just spin it up
but why not
everything is commented, along with a debugger attached to help in development
well i stared it for now
ill probably try it out tomorow
when i wake up or something

its good as a basic framework. just dump your commands in src/commands and event handlers onto /srv/events/...
thats about it
swag
client.on('messageReactionAdd', async (reaction, user)=>{
const { message, emoji } = reaction,
{channel, guild} = message ;
if (message.partial) {
try {
await message.fetch();
} catch (err) {
console.error('Error fetching message', err);
return;
}
}
if (channel.id === "862010594601336903") {
if (message.id === "862211028464042035") {
let role = guild.roles.cache.find(role => role.name === emoji.name)
try {
user.roles.add(role);
} catch (err){
console.error(err)
}
} else {
console.warn("no message id")
}
} else {
console.warn("no channe id")
}
});```
Why when i run the bot this is work just for a new message don't work for old message
bc the event only works for cached messages
u can add a "REACTION" and "MESSAGE" partial to work
but u wont get any useful information with partials 
ud have to fetch them urself
@solemn jolt ^
My question is i send a message yesterday
wait i think u just use message partial instead
you shouldn't have to store user or count data on reactions unless you're doing a giveaway fn
And this code don't work on the old message
raw gateway reaction_* events are enough
Then you can add reaction partials safely or listen for REACTION_* events on client raw event
Bro i add this
For old reaction this event don't work
But dor new reaction work
How i can fix this
In Discord.js messages have to be cached (aka, they have to be sent after your bot comes online) in order for message reaction events to be emitted. Partials for reactions enables the event to be emitted on all messages regardless of if it's cached or not, but not all data will be there including all users who have reacted to it and the count of specific reactions per emoji
Can i do message.fetch()?
No
wait wut 
Why
Well. You can fetch the message if you know the ID, but if you want to be generic, then you can't unless you store the IDs of messages you intend to keep
client.on("ready", ready=>{
let guild = client.guilds.cache.get(id guild)
let channel = guild.channels.cache.get(id channel)
channel.messages.fetch()
})
You need an instance of the message to fetch which isn't available unless it's cached which old message pre boot are not cached. You can fetch messages by ID in ChannelMessageManager
oh i meant a partial message
channel messages fetch only fetches the last 100 messages in a channel
Ok 👌
didnt knew it had to be in the last 100 msgs of a channel
Like fetch(id message)?
Yes
Ok than you all
if you don't supply a message ID, it fetches the last 100
🤟
cant u limit the fetch?
wait lemme check
If i put message id and the message is last 200 ?
yes
if you pass a message ID, it doesn't matter how old it is or where it sits in relation to message count
it will fetch (granted you have permissions to fetch)
Ok 👌
oh yeah u can
TextChannel.messages.fetch({limit:100})
In djs v13, all the ID become Id. Kinda nonsense changes
idk why they change that 

cant wait for the wave of Pull Stack devs complaining that the 1 year old Repo they borrowed from Github doesnt work anymore
To piss ppl off, maybe. Lmao.
Your lavalink project can test out already?
Uh. Yes. One moment to open source the repo. One thing to note is that op filters and op seek doesn't work
Need to add that at some point, but I'd have to fuck around with ffmpeg
https://github.com/AmandaDiscord/Volcano I haven't 100% tested everything in LavaLink's protocols since I use it in a very specific way, so mine might break protocol somewhere. If you experience bugs, lemme know
People with OCD...
Ohhh...
Bro.. channelID not channelId.
Keep it.
A lot of changes are literally so unnecessary.
Don't ask me, not my lib
btw, bookmarked the github link, will try out over the weekend
You guys rewriting your bots for this?
I have less related code related to guild related or something related to id specific
so not a big issue
I never used serverID before except for MongoDB models. 🤷♂️ 😂
serverID
guildID
high level libs be like
Might make a public instance of my LavaLink rewrite to stress test
unironically host it on heroku
only the person who sent the cmd will be able to see theessage
what if I'm next to the person and I can see their screen
Some updates are really stupid/not necessary.
good point
Smort
😉 😂
a?
a.
ª
watt
kilowatt
megawatt
Gigachan
console.log(tyepof data.questions)
why is it logging an object? when its an array
Arrays are object
wait wut
use Array.isArray(data.questions)
Think of arrays like this { 0: "value", 1: "value" }
Its dict?
?
Nvm me i am used to use python words
Why hellroku though
If anyone wants to test my public lavalink rewrite instance, feel free to add
host volcano-test.herokuapp.com
port 80
pass "youshallnotpass"
I would like to stress test it.
no op filter or op seek support. HTTP file getting is not enabled.
just for the memes. Idle memory usage is 13MB
I doubt it'll hit 500MB
Less go
yeeeees #development message
400mb is how long song can go on
full doc
tho why not make it in C++
, more efficient
Bc idk c++ and I'm good at memory management in node as is
more speed = more code
and c++ is cringe for discord usage
Big pog, time to contribute 
:)
please save me the trouble of dealing with ffmpeg
filters is gonna fucking kill me
i mean older languages = more speed = more to code
it depends on compiler
though, it's not really old, there's just a lotta backwards compability
1 line == atleast 1 instruction, so not really
for ex. you can use compiler for python to get nodejs speed
compiled python is illegal
wtf
no not compiled
compiler
it's totally different
compiler compiles
But with different ways
compiled python is .pyc and it has no effect on speed
but using compiler to run code, has effect on speed
if you use compiler to run code, it's called intepreting
faster compilers are those one who, first translate code to like cpp or ... and then run it
interpreters are compiled
translating code is bad
via automated way
but slower ones are those who just translate and immediately run
even nodejs compiler translate your code to pure js
I believe you misunderstand.
it's intepreting it via v8
yes
and v8 is compiled
chrome's engine
but it doesn't compile your code, it inteprets it
search compiling vs intepreting
ok
The JIT "compiler" does create bytecode, but that's different than compiling it to another language
yeah, it'll go rougly like this: lexer runs to parse the code -> generate bytecode -> run the bytecode
or so
and thar happens everytime you restart your app
vs compiling into native application: ONCE: compiler parses the code -> does optimization -> generates machine code
WHEN you run your program: CPU executes instructions in the machine code
You kinda can't compile JS to machine code since it's loosely typed
which kinda sucks
but eh
Depends on what you're after. There is a bit of overhead with V8 or it's derivatives, but it can still be very good at speed. If you really want to profile it vs a clang, the difference could be negligible depending on how well the dev optimizes on both ends
that's why it's intepret
yeah ik
the performance between native and intepret is pretty huge if we really benchmark them in a performance-needing application (though we're talking only like 500-2000 us only, but it might matter in some cases)
key word might
millisecond delays are barely noticable in end user applications depending on scale
if you run single-threaded game server for roughly 10 000 daily users
good thing js can multithread
because no one is sane if they try to scale a single threaded application
writing my lavalink rewrite kinda helped me realize how multithreading can be difficult. There are plenty more areas where things can go wrong if you don't properly structure your thread messages, although the same can be said for IPC.
was painful ;w;
Can someone help me with this please?
There is no message
Member has the guild property so use that
guildMemberRemove has nothing to do with message
idk why they thought the event has msg params 


If you use those mimu emojis unironically I don't know what to tell ya

mimu emoji gang
anyways not development related
This is my event handler, can you check if its right? I tried but didn't work
https://starb.in/uOYyed.js
I love how react DEV tools is warning me about using the dev build of react
There is only param member and the guild id would be member.guild.id
If you use a event handler the provided code is incorrect
How can i fix it?
There already is a file named event.js
named by the event so guildMemberRemove.js
Well message isn't a valid prop on guildMemberRemove event to begin with and why not just use member to get the guild object

<Member>.guild.id
How can you get a text channel by mentioning it?
I only know how to get a channel by name:
msg.guild.channels.cache.find(channel => channel.id === newChannel)
But how can I get a channel by mentioning it. So instead of "djs-help" -> "#djs-help"
u mean like #development then it gets the channel?
anyways what do u guys do for fun when ur coding 
i code
wow i wish i could do that/j 
I mean, I find quite entertaining to code
I think its:
message.mentions.channels
yes
ye and that returns a collection of channels that got mentioned
for me its kinda fun debugging errors 
even when i rage if i dont fix the error 
Mostly errors can get fixed by debugging. Instead of searching years for the bug. with console.log or converting types ...
ye logging is my best friend for debugging 
then you debugging wrong
use breakpoints and ACTUAL debugging
you'll never use console.log for debugging
conditional breakpoints and normal breakpoints is what you actually use for debugging
and if u want to reduce the amount of bugs even further, use typescript
discord aint loading wtf
basically it stops the code execution whenever it hits that line
so you can see real time variables and values
say, for example, client.on('message', (message) =>
@solemn latch
anyway
rip bot dev 😦
yeah
then you try intellij debugger just once
never tried it, but holy shit vsc has some powerful shit
the conditional breakpoints alone makes it worth imo
never again have to change code to "debug" something
most of my errors is me mispelling 
use typescript, you'll love it
too lazy ill have to transfer all of my files 
or whatev to use ts
ts is js with flavor
i might consider it tho
imagine until they realise ts is js
ye i do know that 
just too laxy
lazy*
dynamic typed -> less verbose/hell to debug
static typed -> more verbose/feels good man
well, good luck restarting 40 times until ur bot works

ts screeches at u real time while you type it down
bet
its 10pm
also static typed langs have the advantage of not letting you even compile without fixing syntax/major logical errors
which is great cuz that saves u from bugs later down the line
rather than just encountering that bug weeks later whenever a user accidently steps on it, ts tells you right away when you try to run it
tbf that's what made me love java instead of javascript
i like the flexibility of js
apart from rendering and apps, its greatyl malleable for everything
browser AND rest
apis, servers, bots, websites, controllers
typescript is just what it needed, which is more type safety
anyone know how to do more then 1 row with buttons?
you can just add a new actionrow
did u switch to detritus or still on djs?
[5] implies 6th element
split it
thats why im saying i need mroe rows
i just sent u an example
but idk how
pass in another
o yours looks different asf
you sure?
if a lib doesnt follow the api's format it'll error
mine looks nothing like yours
notices how the first components[] has 2 objects
thats what u should do
console.log(row)
so i wanna console log each row?
also, like i said, this is detritus not djs
no, im trying to tell your stubborn self that they are the same thing
your constructor returns that array
but you have 6 buttons in one row
im listening
so make 2 rows
message.components = [actionRow1, actionRow2]
o








