#development
1 messages · Page 30 of 1
interaction is null at the time
and null obviously has 0 props
has is null
permissionsFor is returning null
this is the error
ill check
if it's null or not
you can do an optional chaining
if you are using typescript
which you don't
@white hornet you should use typescript
i dont like type script
its work for message
hear me out.
interaction.channel.permissionFor(...) returns either a permission list, or null
alright?
you get me?
The error declares that the channel has no permissions assigned for the client, you should always check for that before checking the permissions on it
right, in this case it's not a permission list, but rather null
and in this case
you tried to read the property has from it
i gwt it
the channel have permissions assigned for the client
null has no such property called has to be called upon
so
you must check the permission list
i get it
Clearly not, because then it wouldn't return null
ill do it now
it work for message in the same time that not work for interaction
const permissionList = interaction.channel.permissionsFor(interaction.guild.me);
if (!permissionList) { // it's null
// do somthing
}
if (!permissionList.has("EMBED_LINKS")) return
Messages and interactions don't work the same way, and the channel you're looking up the client's permissions for can technically be different
step 1: use typescript
alternative: please read the docs
i get null
interaction.channel.permissionsFor(interaction.guild.me) is null
in this case null means there are no permission flags assigned to said user
then?
return
how?
i get it
and now you ask me how to write your program 💀
also
i assume you use vscode, right?
hover your mouse over the function
its not like this im sorry😅
it will show you the definition
yep
u get me everything i want ty
thank u
ok
if the return type has ? that means it's nullable
if you read carefully you won't miss it

ok tySayuri🥲
i miss it i now🥲
Someone?
Can you show us what it draws currently?
Like the result?
Yes
I want this Avatars to be circular
Now can you show us more of the code?
const canvas = Canvas.createCanvas(1000, 500);
const context = canvas.getContext('2d');
const background = await Canvas.loadImage('https://cdn.discordapp.com/attachments/785156938627153992/910541044792311899/slap.png');
context.beginPath();
context.arc(125, 125, 100, 0, Math.PI * 2, true);
context.closePath();
context.clip();
context.drawImage(background, 0, 0, canvas.width, canvas.height);
const { body } = await request(message.author.displayAvatarURL({ extension: 'jpg' }));
const avatar = await Canvas.loadImage(await body.arrayBuffer());
context.drawImage(avatar, 350, 70, 200, 200);
const avatar1 = await Canvas.loadImage(message.mentions.users.first().displayAvatarURL({ extension: 'jpg' }));
context.drawImage(avatar1, 580, 260, 220, 220);
const attachment = new AttachmentBuilder(await canvas.encode('png'), { name: 'slap.png' });
message.reply({ files: [attachment] });
doesnt clip depend on specific locations.
ie you're putting your image not on the clipped position(125,125)
AHAHAHAHAHAA
i had that typed, just busy and couldnt finish the thought
minds think alike
got chu
You're supposed to draw the arc after drawing the background, after that clip into it and draw the avatar where you drew the arc
this is confusing
I just make an utility function for clipping
input image + shape, output clipped image
still have problem in installing Canvas someone help plz 0.0
What problems do you face?
I have drew the arc after background and now i need to position image in that arc's cords? Like is the arc drawn correct in provided code?
Can you give an example;-;
make a blank canvas, set clip, draw image, dispose of canvas (if this is a thing in js), return image
Since you're using Windows, you must follow these installation instructions to install Canvas
https://github.com/Automattic/node-canvas/wiki/Installation:-Windows
What i have did what i want
Yes you need to position the image at the arc's coordinates (it may not perfectly fit so you might have to play around with the coordinates a little)
Ah then i did it and now it's criping whole image into that circle but not avatars i don't want to crop whole image in circle only avatars
an utility function would still be a better idea
so u don't need to repeat the same code everywhere u need to crop an image
You're drawing the arc at coordinates X 125, and Y 125, but you're drawing the avatars far away from the arc
Because you're drawing the other avatar in the clipped context as well, you're supposed to save the state of the context, clip, draw the avatar, restore the context, draw the next arc, and repeat the process
Oh thanks
I did.. I install GTK libjpeg turbo and python also all important stuff in node.js and use npm install -g node-gyp but still I cant install the canvas
and this is my new err https://pastecord.com/amesacyzir
For example
// Create canvas and get it's 2D rendering context.
const ctx = canvas.createCanvas(1_000, 500).getContext('2d');
...
// Draw the background.
ctx.drawImage(background, 0, 0, ctx.canvas.width, ctx.canvas.height);
...
// Draw the arc.
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
// Save the context.
ctx.save();
// Clip into the said arc.
ctx.clip();
// Draw the avatar in the coordinates relative and close to the arc.
ctx.drawImage(avatar1, 100, 125, 150, 150);
// Restore the saved context to unclip.
ctx.restore();
// And repeat the same process to draw other avatars with arcs.
So i need to draw 3 canvas and then merge all them so my question is how can I merge 3 canvas @lyric mountain did you meant the same?
what
There's no need to create and draw into separate canvases and merge them, but it can be useful to not waste time coordinating the placements
So can I set arc only for the avatar if yes how?
Are you using a 32-bit installation of Windows or 64-bit?
Or make balnk canvas add background with load and draw and same for avatars and then only set arc for avatar context?
seems to have been answered a few times.
Also note, https://github.com/Automattic/node-canvas/wiki/Installation:-Windows#2-installing-gtk-2
Download GTK 2, not GTK 3, which is missing the required libpng. If you get linker errors you've most likely picked the wrong bundle.
The stacktrace node-gyp outputs for you seems to contain linker errors
am I the only one who didnt know about windows powertoys? 🤔
Sorry but i still not understand stuff. Do you have example code?
example code @fervent moss
Thanks i dint saw that code
I doubt that, the node-gyp error stacktrace shows not only npm ERR! gyp info using node@16.17.0 | win32 | ia32 (notice the ia32) but also C:\\Program Files (x86)... which indicates a 32-bit installation
Would probably be beneficial to get a test VM instead of using dev env
although might require some jank
I would recommend installing the 32-bit binaries of the outlined packages and libraries such as GTK 2 instead of the 64-bit ones
alternatively, upgrade
^ Better solution, unless you aren't able to upgrade due to hardware limitations
So, I'm new to SQL, and I want to figure out what the address, database name, and the username is.
Is it localhost:3306, BungeeCord, and root?
anyone using shoukaku?
?
Ah, so I got this error:
Access denied for user 'Mysql'@'localhost' (using password: YES)
I have a question, whenever I downloaded MySQL...
I have this, what is this, exactly?
that's a saved instance in mysql workbench
Ah, so if I want to make a new database, where do I do so?
CREATE DATABASE name;
to have a visual interface
it's like asking what's the purpose of a browser if you have telnet
Fair enough, so if I would want to create a user within a database, what's the username supposed to be.
root@ or?
you cant create a user within a database
users are above databases
you assign databases to users, not the opposite
Ohh.
do note tho, mysql is a shitty database that has a lot o crap errors for seemingly no reason
and 1246189 types of collations
I'd use MongoDB but work needs MySQL. 💀
I think both are even worse than each other. I'd rather use PostgreSQL.
A minecraft server, unfortunately yes. 💀
like, there's maria which is a fork of mysql
I'm working with a bungeecord server so I gotta understand what I'm doing.. (great not a big one, however)
do you have IJ ultimate?
No.
meh
By the way, I just downloaded MySQL, are there supposed to be any users?
Example, root or something.
root is just the default user so you can access the database to make other users
like postgres user
Ah, so when I create a database, how am I supposed to grant myself.
Do I grant root, or HamoodiHajjiri or create a new user?
root is the superuser, forget about it
mysql> SELECT user FROM user;
ERROR 1046 (3D000): No database selected
Cause right now, no users.
that's not how it works
USE database;
when u install mysql, it'll have only 1 user: root which is the superuser
Alright, fair.
to make another u just create an user and assign it to a database
If I make databaseTwo, do I need to make another user?
USERS ARE ABOVE DATABASEEEEEEEES
ALRIGHT.
users have databases, not databases have users
DROP DATABASE db; oh damn I dropped myself mb
Ah, so I should really make a user for myself, then.
yes
Like hamood@localhost.
give google a try, there are literal tons of resources regarding mysql usage
users have shit... all they can have is access to a database
either that or just add the database to the query
Keep in mind that localhost will not allow external access to the user
Nesting of sub-commands is unsupported at this time
anyone now whats this error?
I think it means you tried to put a subcommand under a subcommand.
Damn, you're a father now
yeb but why its not work?
Because that's not an accepted form.
You can create subcommand groups, however.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
ill check
This don't look right.
God, that much nesting will get confusing
Does discord even allow a sub command to go that deep?
i now
😅 yep wrong spell
then how i can make the goal that i want?
I don't even know what you are trying to do
i have a security bot
and the warn will be like this
!antiban [lmite/value/warn] and for warn also have [owner/staff/user/log] for all of them the command have [lmite/value/warn]
and i now sounds like crazy😅
it mean i have 12-15 options
lmite?
we already talked about this the last time
This seems like poor planning tbh
this structure you wnat is NOT possible (atm)
yep
is this good enough? I tried to make it look professional while still being kinda chill, not sure how good it is in practice tho
there are no dynamic command parameters based on the option or choice you choosed
idk
tried to make it look professional
Yo
Uses Sebastian from Black Butler
"Yo", "Cya"
professional.jpg

I haven't gotten around to getting a custom profile picture yet, AND wanted to seem chill, kinda like dank memer used to be back in 2020
If you wanna be professional, be professional. If you wanna be chill, be chill. Don't try and be both, it will just end up looking bad
I just wanted the bot to seem fun while being able to properly explain it's functionality
Its a moderation bot no?
kinda like dank memer
when will u stop saying "like XXX"
Dank Memer and professional are two words I never want to see in the same sentence
Why is a mod bot supposed to be fun
yeah, a moderation, automod, antiraid type of bot
So /banana can be a thing
its meant to help protect server not crack jokes
/knockknock
it used to be multipurpose, has plenty of game commands, image manipulation and random utilities
for amazing knock knock jokes
Then its not a moderation bot
its multi purpose
it is, I'm focusing on moderation now
like you've told me, to pick one thing I should focus on doing
I mean, thats cool and all. But people will still see iit as multi purpose
it's multipurpose if it has more than one purpose
moderation bot has nothing but moderation
games bot has nothing but games
After messing for while i was able to do this but the avatar is cut into 1/4 tho it's exact coordinate of arc like both coords are same
my bot is multipurpose, there's no shame in that
even tho most of it is related to my tcg
I'm focusing on the bots moderation while everything else is like a side thing I add occasionally
just a couple weeks ago while I was openly advertising it as a multipurpose u guys kept telling me to pick a thing to focus on -_-
not me, I said you should stop trying to copy other bots and be original
we're keep telling you different things to confuse you as much as you us
There is nothing wrong with multi purpose, as long as you don't try and copy other people's ideas
:P
I am original, most of the ideas I came up with myself, others are mostly inspired
The reason I said for you to focus on one thing is cause you were essentially just making a multipurpose bot that was the same as everything else already out there
and now with moderation you're doing the exact same thing
😔
@earnest phoenix could you help me if you aren't offline
and by inspired I literally mean commands like whois, serverinfo etc. I don't copy commands
Me personally, I don't think there's anything wrong with copying others ideas.
I'm combining everything I would want in a bit into one
Copying is fine as long as you are improving on them
strong antiraid, automoderation, chat filters etc.
A lot of people fail to do that though
antinuke *
and wonder why their bots aren't as successful
I still don't think that's a problem.
A lot of people make bots to see others use them but ultimately for education
So even if it sucks it's not a problem since they'll do better next time
And thats fine, but with growth in mind you have to think on how to actually achieve that. and I have seen many clones never succeed
It's not supposed to be the exact coordinates of the arc, as I said you'll have to play around with the coordinates to the make it fit inside the said arc
And the width and height of the image you're drawing inside the arc also matters
recently my bot had been getting quite some invites, I think it's because of my website's description
quite happy with it
I jumped from 78 to 87 in 2 days
Oh thanks ic i used exact dimensions and coordinates now i would just mess around thanks!
What is x,y = 0,0 in canvas is it supposed to be left hand side bottom corner?
left upper corner most likely
always the left upper corner
I need help
I am trying to set permissions using a if statement on my bot to make sure only people with manage.messages can use the purge command. I cannot seem to find the correct statement that works.
whats your current code?
Sending
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('purge')
.setDescription('Prune up to 999 messages.')
.addIntegerOption(option => option.setName('amount').setDescription('Number of messages to prune').setRequired(true)),
async execute(interaction) {
const amount = interaction.options.getInteger('amount');
if (amount < 1 || amount > 999) {
return interaction.reply({ content: 'You need to input a number between 1 and 999.', ephemeral: false });
}
await interaction.channel.bulkDelete(amount, true).catch(error => {
console.error(error);
interaction.reply({ content: 'There was an error trying to purge messages in this channel!', ephemeral: false });
});
return interaction.reply({ content: `Successfully purged \`${amount}\` messages.`, ephemeral: false });
},
};```
1 and 99? that says 999
Just realised lmao, Fixed
I am changing it to ephemeral 😄
Just busy focusing on the permissions
if (member.permission.has("MANAGE_MESSAGES")), {
// command
}
else {
await interaction.reply('You failed the requirements. You need MANAGE_MESSAGES!')
}``` but it doesn't check for the permission
which djs version?
V14 the guide says
MANAGE_MESSAGES isn't a known constant
if so pass a string
Oh
"MANAGE_MESSAGES"
Like that ^^
try it and see
Ok ty
v14 changed everything to pascal case
Didn't they say they were on v13?
yeah but Tim is too lazy to read
Wait a second, double checking
yea
lmao
tf

Yh correction v13
i did read chat
Sorry it said v14 for a second
lmao
Thank you and testing now
v13
v13 defiently

Ty for correcting me Tim
since you're just starting, better go for v14
ok you're fine then
👍 I will do when it not night
It says member not define so I need to define it
interaction.member
Btw, is it easy to convert to v14?
How can I get an infinite repeating sliding image animation without it flickering if I want to make the background-size smaller
as a begining you can try to follow the guide to v14
have the first frame be the exact next frame of the last one
then checking the docs until you're familiar
if you're just starting, its better to start with v14 so you dont need to change everything later on.
the less code you already have, the easier it is to change
does the image have seamless borders?
like if you put two copies of it next to each other, does it blend nicely or is there a hard edge?
It blends just fine. The issue is if you shrink it's size and keep the same animation, when it goes to repeat it snaps in place as if it was it's normal size.
can you show an example?
sped up to show it snapping back when repeating
Created a parallax affect combined with falling petals. Noticed the background snapping back when waiting long enough since we have the bg petals fall much slower
well you only have two options there, either fade out or increase the height
right lol
the way i did a similar thing was to have it repeat
it is repeating 😭
it just reaches the end of the set animation bg-position-y
I have a round 10 commands, ill start the change tommorrow, ty for the tip
Those uneven cards make me feel icky
masonry?
looks nice
Idk how to explain it, masonry is the name of the style of layout
It's when cards of different heights fill up void space
Lol
ok you are banned from chat
:///
FakE secretly trying to flirt in a weird way
I'm not allowed to flirt with the guys in here
so the way i did it was to have multiple copies of the image and cycle them, like when the bottom-most image goes completely offscreen, it swaps to the top and starts entering
too young, you know
that sounds so hacky lol
yup
don't wanna have the fbi knocking at my door voltrux
FakE, everyone currently in this channel is of age I'm sure
false
nah dylan is 13
lol
misty is 12
I am not of age yet
true
Wtf ban
Damn tim

gotta expose me like that
Okay that actually urks me
don't ever say that again
@.@
Gotta love development conversations
At least there are intelligent conversations here than the other channels 
sometimes
When Bae is not around
:^)
AtItsOkayBae


its percentage based

the more you have, the harder you're hit
Misty you have a cursed code skill istg
I only make my code cursed for you to refactor
I made a different keyframe and tweaked the bg-y numbers until it looked smooth, here's it going with a duration of 2 seconds, tell me if you can even notice a stutter
All my if statements are now going to be ternary operators
How dare you! I'll put you into the LLVM decompiler!!!
and I will throw you out a window
voltrex putting everyone in his compiler he doesn't like
Oh no, I wonder when that language will actually be finished 
i could never lol
What the hell, then how else would we make humans and computers interop and give each other instructions?!
true see how broke speedy is or parm
Unless we just scream at computers and hit them until they do what we want
its barely noticeable
at this speed at least
it's going to be on a duration of 2mintues, I doubt anyone will notice it then
I certainly can't notice it
It works all the time, have you never seen one of those people fixing their broken tv by punching it?
Nah, you need a semi truck to hit it
And also fixing their monitors somehow by hitting it with a hammer
You need to become a superuser first, Android doesn't give you superuser access by default, and it's not easy to get superuser access in the newer versions of Android

You should also jailbreak your iPhone and delete it's important system directories, should also work as well!
not alllowed, sorry
So bad...
Does everyone know why does this happen?
2022-08-20 18:19:12.815 INFO 18893 --- [ XNIO-1 task-10] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:test"
2022-08-20 18:19:13.221 INFO 18893 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : No matches found```
It couldn't find a match for your search query "ytsearch:test"
you are likely sending lavalink your query in the wrong way and it is taking the entire thing instead of just test
without code its rather hard to figure out though at least I myself can't tell what is going on without it
The moving animation combined with the colors and lettertype just gave me a stroke and epileptic seizure
discord video compression is pretty messed up
looks fine on mobile and desktop when in front
exports.run = async (client, msg, args) => {
const player = client.manager.players.get(msg.guild.id);
const search = args.join(" ");
const res = await client.manager.search(search, msg.author);
console.log(res)
what exactly is search
it's args.join(" ");
It's basically search <takeargumentfromhere>.
it's a string
how
erela.js
So you aren't doing anything wrong by the looks of it
have you tried searching for an actual song instead of just test btw?
yes, the same happens
I think you're using an older version of ErelaJS, some people seem to have the exact same issue with the older versions
i think i have the most updated one, but let me check
i'm running the most updated version
the same issues occurs, no matter what song I tried to search with.
It might be an issue with lavalink itself
i mean idk i'm running on lavalink 3.4
Not even talking about version wise
lavalink could just be broken, its a probability
Since ErelaJS requires Java, what version of Java do you have installed?
would version matter here?
If it wasn't the right version wouldn't it just not run the lavalink server to begin with?
It requires Java 11, Java 13 is recommended; if you're using something higher it can cause problems like this
ah i see
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.4+8-Debian-1deb11u1, mixed mode, sharing)
Yeah you're using a way higher Java version than it can run with
I see. Which version do I have to downgrade to?
@ashen saffron also it's a good idea to read this part
https://github.com/MenuDocs/erela.js#prerequisites
I forgot about this piece of code, this kept breaking what did you guys say that I should change to make this better again?
It wasn't worth downgrading, the error still stays.
ok so i have a JSON object
in the format ```json
{
"MODERATORID":[<array of bans>]
}```
never heard of a js library requiring java 
how can I format it into the user with the most bans decreasing
Well, it only requires java for the lavalink server iirc
it interfaces with the server running to make the music requests and respond back with the audio
probably get the size of each moderators actions first (array of bans), then loop through and sort using .sort()?
i tried js const sorted = all.sort(function(a, b) { return parseFloat(all[a]) - parseFloat(all[b]); });
probably very wrong

Pretty weird then, looking at the source of the search() method of ErelaJS doesn't spark anything, I think there is an issue with ErelaJS using Petitio as the HTTP client, their latest commit seems to switch to Undici
I suppose you'll have to wait for them to fix the issue
whats "all"
all is the object in the json format i sent before
The sort() method is for arrays, not JSON
with that said, I have to downgrade ErelaJS?
try loading the sizes into an array ye
key value? sort the value, use key to identify which moderator it was
loop through the values, sort
The older versions of ErelaJS still use Petitio, so that wouldn't fix anything, I mean that they're switching to Undici so that might fix it
to then apply this on the value of each key
Is my fair guess
thanks for the help
ok so found a solution
const sorted = Object.entries(all)
.sort(([,a],[,b]) => a.length-b.length)
.reduce((r, [k, v]) => ({ ...r, [k]: v }), {});```
that works, just need to reverse the array now
yep
You can just reverse the order of the sort instead
b.length - a.length
for whats the .reduce
If you're using the reduce() method to turn the array back to an object, you can just use the Object.fromEntries() method

10,030 👀
yup 
49k total bans, then a further 1.5k on the new bot where we actually track it
spent a good hour scraping 49k embeds
Zamn
async function scrape (client, channel, options = { reverseArray: false, userOnly: false, botOnly: false, pinnedOnly: false }) {
const { reverseArray, userOnly, botOnly, pinnedOnly } = options;
let messages = [];
let lastID;
while (messages.length < 49000) { // eslint-disable-line no-constant-condition
const fetchedMessages = await channel.messages.fetch({
limit: 100,
...(lastID && { before: lastID }),
});
if (fetchedMessages.size === 0) {
return messages;
}
messages = messages.concat(Array.from(fetchedMessages.values()));
await Promise.all(fetchedMessages.map(async (msg) => {
if (!msg.embeds[0]) return
const moderatorID = msg.embeds[0].author.name.match(/\(.*?\)/gmi)[0].replace(/\(|\)/gmi, "")
const userID = msg.embeds[0].fields[0].value.match(/\(.*?\)/gmi)[0].replace(/\(|\)/gmi, "")
const banTimestamp = msg.embeds[0].createdTimestamp
const msgid = msg.id
const duration = msg.embeds[0].fields[1].value
const evidence = msg.embeds[0].fields[2].value
const reason = msg.embeds[0].fields[3].value
const moderator = rblxToID[String(moderatorID)] || "NoLongerModerator"
console.log(`Inserted ${userID}'s ban by ${moderatorID} (${moderator}) to the database`)
await client.db.collection("bans").insertOne({ moderator, moderatorID, userID, banTimestamp, msgid, duration, evidence, reason })
}))
console.log(`Fetched ${messages.length} (${messages.length/50000*100}%)`);
lastID = fetchedMessages.lastKey();
}
};``` my glorious method
easy way of getting past the 100 max thing, works really well
i didn't even know that lastID was a possible thing before today
Although that can get you ratelimited pretty easily
was hosted on a dev instance of our bot and fetched 49k in ~8 mins
Oh alright
how can i add link
wdym embed?
nvm

it does seem to work properly
for now at least
Why do you keep doing .map(x => x) after we already told you that does nothing lol
solution: 100% viewport dimension / 100% overflow:hidden parent container of the axis the images are scrolling in
did you fix it
yeah I tweaked some numbers for a keyframe since I already had everything you suggested.
nice flowers btw



bro why
you wasted n operations
for nothing

remove the map function call
the silly map makes the neurons fire
I could've sworn .filter didn't work unless I mapped the collection first
collection
but I may just be wrong
.values()

[...collection.values()].filter()...
you apply the spread syntax to the iterator inside square brackets
can't you filter in a collection already without the values? I'll check the docs rq
gonna turn them into array
wait isn't collection a combination of array and map
so yes you could just use filter
collection is a map with some utility
bae moment

the class heading is quite literally class Collection<K, V> extends Map<K, V>
my b my b 
noob css question incoming
how would i center all of this for a galaxy fold?
(ignore the blub, will fix)
margin: auto
or margin-inline: auto
on the parent or the element itself?
you better use typescript
element
if the parent is a vertical flexbox
u want me to rewrite my entire JS bot into TS 
yes because it's not that hard
ts has an option called allowJs
actually nvm if you turn on strict mode with YOUR code you'd probably have like 600 million errors
well it is quite different, syntax wise
not really
hu
it's a superset of js
but this
somethings are done differently, is what i mean
nah
Good TS is literally just JS lol
but
nothing is done differently, it's a superset
you just have the option of doing things differently
you can paste javascript code into a ts file and it still work, given you disabled typechecking
and strict mode
if you're using ts without strict mode then there's not much of a point tho
right lol
you need help of types
and intellisense
if you don't know the data you are working with, what's the point of programming
the worst one to exist 💀
bro relax 💀
I do not speak german 
huh
there's a reason not many of us write our entire projects in C anymore
because humans are bad at not making mistakes
waffle said something in german but deleted it insantly
💀
when humans become to lazy to debug code
use js for fast prototyping
yoy don't even know how to debug
I do, check console for errors, console log the cause and change code until works
"would you rather have silly errors during development or sanity-inducing bugs on production"
not the official way but it is a way
ok, yeah I kinda feel that
i freeze the code in time, change its value, then resume
console log is pointless
here: ```js
function add(thing1, thing2) {
return thing1 + thing2;
}
add(1, 5) // This is what you intended
add("Hello, ", "world!") // This is not what you intended, however it still works
whereas in tsts
function add(num1: number, num2: number) {
return num1 + num2;
}
add(1, 5) // This is what you intended
add("Hello, ", "world!") // This is not what you intended, but because you made that clear to the compiler, it will error during compile time instead of having an issue during runtime
breakpoint exists
the debugger is cool
breakpoints and logpoints can essentially completely replace needs for console.log
(TS...) Type 'string' is not assignable to 'number'.
Though I still use console.log so I can look through long objects without needing to stop my code
"Hello, " as any
Since in the debugger you can expand objects like that
ok ok I get your point, I'll rewrite to ts in the near future
when I'm not too lazy
you said the same thing about changing your database to use booleans instead of strings lmfao
also make use of debug breakpoints
I usually code my bot without a ide just use the code editor of my vps
brug
bruh
that's why you're in here all the time then
or vim
vsc server yeah
or... just use vscode on your PC and a VCS to deploy to your VPS...
vim yeah
^
sounds good
this is what I do for all of my projects pretty much
minecraft realm
IDE -> Github -> Clone on VPS -> set up whatever the project needs
I guess it's time to get professional soon 
my bot should hit 100 severs in a couple days
if you wanna implement a big feature, just split into new branch
@civic scroll rate my pixel art of my gf's cockatiel
"soon"
yeah, I have a testing bot for stuff like this
i rate this a birb out of 10
great job
making her bird a video game that she can play with godot C:

I did

that's ehat i'm talking about
ok good
we do a little bit of dogshit logic that I will refactor tomorrow
svg is just infinitely resizable with no loss because that's what it's meant for
you know what would be easier tbh
there is no return
convert that isOnFloor func into a variable
huh
that's not my function and why would I do that
that's a built in godot function for a KinematicBody2D, which I'm extending
privatw bool isOnFloor ... => logic will return true or false when used
no
way easier
you didn't even see the function definition
💀
IsOnFloor() is defined in the superclass that I'm inheriting from
I don't need to be changing that
... I don't have to
what if it's something 100-line-ish of code check for position
and you declare that as a variable?
It's a complex check, it's not just "Oh it's on the floor"
you can use curly brackets still
It does vector normalizations and such

here you go
this is what you wanted right, let me change that into a variable for no reason
💀
not my function, no need to change it into a variable since I would just be making the same call either way
^
I did not see that
@wheat mesa btw conditions can be simplified

I have a little bit too many constants
just return when one of the blocks checks out
I kinda just threw this together earlier today so I haven't refactored it yet
wdym no headers
💀
I need to have some kinda sorting when doing variables
nah
I don't need to sort them cus I know what they do via their names C:
unity has a header flag that's builtin, it shows up in the inpesctor as well
too bad godot doesn't have that
Godot is so much better than unity in my experience so far
It's so much more responsive
Projects take like 3 seconds to start instead of unity's 3 minutes
sorting is always nice
And the node system is much easier
anyway gn
constants should be static, no?
depends
for example, if your constant holds considerable resources you might want to keep it at instance-level so it gets collected together with the instance
Do you guys have preferences for ID formats/tools to use (UUID, NanoID, etc.)?
I just use sequential ids
unless I need to make an unique column, in which case I use uuid
Just an incrementing number (1, 2, 3, etc.) or any sequential ID? (e.g. squuids)
Is that godot C# ?
Yes
In this case it doesn’t really matter. It’s pretty much all singleton anyways
I’m just not using static because const feels more appropriate
but static doesn't get created every time you construct an object with it
The script is only instantiated once
Plus it’s const so it probably gets inlined either way
I’m sure the C# compiler is smart enough to do constexpr folding
What packages are you trying to install
"discord.js": "^13.2.0",
"discord.js-akinator": "^3.3.0",
"discord-yt-poster": "^3.1.2",
"quickmongo": "^3.0.2",
"moment": "^2.29.1",
"humanize-duration": "^3.27.0",
"canvas": "^2.8.0",
"node-superfetch": "^0.2.3",
"br": "git+https://github.com/Sintya4/discord-image-generation-v",
"canvacord": "^5.2.3",
"one-liner-joke": "^1.2.2",
"something-random-on-discord": "^3.4.4",
"https": "^1.0.0",
"fs": "^0.0.2",
"axios": "^0.24.0",
"discord-xp": "^1.1.16",
"util": "^0.12.4",
"ms": "^2.1.3",
"common-tags": "^1.8.0",
"lodash": "^4.17.21",
"quick.db": "^7.1.3",
"merge-options": "^3.0.4",
"events": "^3.3.0",
"glob": "^7.1.7",
"path": "^0.12.7",
"express": "^4.17.1",
"discord-giveaways": "^5.0.0",
"node-fetch": "^2.6.1",
"body-parser": "^1.19.0",
"express-session": "^1.17.2",
"http": "^0.0.0",
"sourcebin_js": "^0.0.2",
"discord-backup": "^3.0.1",
"youtube-sr": "^4.1.6",
"ytsr": "^3.5.3",
"yt-search": "^2.10.0",
"dblist.api": "^1.1.1",
"@koenie06/discord.js-music": "^1.2.9",
Yea, gl
?
Its a node-gyp error...
And btw he asked which package you were trying to install
Not your package.json file
They showed the correct thing
npm install
they were running npm install which installs everything from the package.json
the hole package
Ohhh
The issue is, I am not going to sit through and figure out which package is having troubles at 3am
Damn it's 4 pm here lol
Yeah it's prob that
I will take a wild guess and say that is a big one that is having issues
yeah
all you need is to install microsoft visual studio 2017 or newer with Desktop development with C++ to fix the error based on the error's message
i love node-gyp
anyone know why this behaviour happens?
the same happens with spread syntax
so i can't override properties
apparently it appears as if the object is sealed / frozen
i'm crying

WHAT
huh
makes sense yes
huh
why so
it's supposed to show the en key
resolved: didn't define the key as enumerable
Hey does descriptions support media queries?
I wanna remove something in mobile but only display in desktop
why were you using Object.defineProperty
tried to create a temporary object in one line of code
also the object has a variable key
a key defined by a variable
so i can't do the normal object syntax
For bot pages descriptions does it support media queries?
WHAT
tim
you are kidding me
@quartz kindle you better be staying up 24/7
i need you as javascript dictionary
what's the point of (() => {})()
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Users\creative infotech\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\creative infotech\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! npm ERR! Unsupported URL Type "workspace:": workspace:^
npm ERR!
lmao
that exists in every language with curly-brackets
the difference is that in Rust you can do let a = { return 69 };
yes
lel
scopes in Rust can also act like (() => {})() would do in JavaScript
pretty convenient if you ask me
Can someone please help me
With?
with how to shower in hell?
For bot pages descriptions does it support media queries?
I would guess so.
Its not working for me how would I make it work
dev tools
dev tools?
element inspector / F12
use the mobile preview and check the css
did you test it with mobile preview in dev tools?
I have yes
media queries seem to work for me
fixed it
How can I uninstall chocolatey
What is that
tbh I dont know correctly
but it dont let node js install necessary applications like Python
delete the chocolatey folder directly (C:\ProgramData\chocolatey or value in $env:ChocolateyInstall)
tnx
You don’t need to uninstall that
It literally says that it was successful
It’s just warning you
It just says that it won't install Chocolatey again (basically overwriting the current installation) for security reasons, you can just use Chocolately itself to update Chocolately
As Waffle said, it's just a warning, nothing else
they kno da wae
tried it and no work 😢
I like to use ms
https://www.npmjs.com/package/ms
wow
awesome, ty 
ms is very popular yeah
i finally got it to stop pinging users too, took a bit of experimenting
You could also use discord's timestamps like @someone muted @someoneelse until <corresponding discord timestamp>
I usually prefer that approach since it localizes for all users
discord timestamp is nice because it's not only localized, but also reflects the viewer's timezone
its probably not a good idea here though
its important to keep a length of mute on hand
You could do both
@someone muted @someoneelse until <corresponding discord timestamp> (1 hour)
can't really in this format
i'm restricted by the format
as the bot i'm making is replacing an existing bot and I'm making it log identical to the previous bot
we have other log channels, this is just for our audit logs channel
with ms if you pass in values lower than 1000 it will just do 350ms instead of 0.35 seconds for example
what am I reading here again
you can tell ms to format it differently bae




