#development

1 messages · Page 2032 of 1

near stratus
#

The only thing you said in past hour that actually makes sense

boreal iron
earnest phoenix
#

Study History

#

I have exams final exams

quartz kindle
#

node 18 or djs 18?

near stratus
#

node

quartz kindle
#

easy

lyric mountain
#

is timhack still needed or does replit officially supports node 18 now?

quartz kindle
#

yes

#

or other hacks

#

i think nix only goes to node 16

#

but the bash method works for any version

lyric mountain
#

weird

quartz kindle
#

ah they do have 17 now

lyric mountain
#

ayo jdk 18 will have a webserver added by default

#

and they finally made utf-8 default

gentle condor
#

So hey, I have a mongodb db where I have a list in the value of a key like "key":["dis","dat","den"] and I want to get like all the collections with a specific element in that list, like I want all users with "dat" in their list , so how do I do it?

carmine summit
#

is there any way to get the this on the constructer rather than on the function?

#

without a variable outside the class

cinder patio
#

Can you give an example of what you mean

lyric mountain
carmine summit
#

oh wait im dumb

#

i just need to make a param

lyric mountain
#

?

carmine summit
#

a parameter on the function ?

lyric mountain
#

no, I mean, what exactly are u trying to do?

carmine summit
#
this.player = new Player(c);
this.x = c.width / 2;
this.y = c.height / 2;
lyric mountain
#

that's valid

cinder patio
#

yes, aaaaand

carmine summit
#

yeah

#

that swhy i said im dumb

lyric mountain
#

lul

lyric mountain
#

the parser works as expected

wheat mesa
#

Nice

lyric mountain
#

this is how it was declared

#

it was a pain to create the linter but damn, having syntax-checking and intellisense was well worth it

earnest phoenix
#

@earnest phoenix

#

New error

#

3:35 pm for me

#

i am free now

#

@earnest phoenix

#

Ping me when you're back

#

@slender thistle

slender wagon
#

Dont massping stupid

#

Just wait

earnest phoenix
#

ok....

slender wagon
#

Hmm

earnest phoenix
slender wagon
#

Can u show a screenshot of the entire thingy

wheat mesa
#

Even better: stop following discord bot tutorials on YouTube

lyric mountain
#
A SyntaxError: Unexpected end of input error typically means either you are missing a closing parenthesis, brace, bracket, or similar character somewhere in your code or you are trying to JSON.parse() a string that is missing such characters.

Run your code/JSON string through a javascript linter (e.g. jshint) to find syntax errors.
slender wagon
#

What are u doing in #development if the video states code without coding

lyric mountain
#

next time try putting it in google before asking someone

wheat mesa
#

Looking up SyntaxError would’ve given you a ton of information too, just so you know

earnest phoenix
neat ingot
#

got my first ever actual programming job interview in 20 minutes. any pro tips? 😛

wheat mesa
#

Like @lyric mountain just did for you, he literally just googled it and got a ton of answers

slender wagon
#

Clearly

earnest phoenix
#

Yeah

slender wagon
#

without coding

earnest phoenix
#

But it DOES

neat ingot
slender wagon
#

Read docs instead

wheat mesa
#

Lmao

slender wagon
lyric mountain
# neat ingot

tbh even if that's a meme it's a very important thing to know lul

neat ingot
#

tbf, googling is a full skill. if you are aware of how to 'dork'

wheat mesa
#

“I can type 1000wpm into Google and skim through irrelevant search results faster than any of your other devs”

earnest phoenix
#

i forked it

slender wagon
#

Try go get a bot started

#

Then try a (all in one)

lyric mountain
#

what good it is to have

  • Master in Computer Engineering
  • 90 years of experience with NASA
  • Invented Assembly

if you miss

  • Knows how to Google
wheat mesa
#

Don’t fork projects you have no idea on how they work

earnest phoenix
wheat mesa
#

You’re setting yourself up for failure

dry imp
# neat ingot

i mean programming is about utilizing resources so googling might actually be a thing

wheat mesa
#

Make the first bot you ever do yourself

#

Without copying word for word

slender thistle
#

At this point just start with a fresh bot man, learn the basics of JS as well. You're struggling with very basic issues you could have avoided had you taken the time to learn JS itself.

wheat mesa
#

Yes

neat ingot
wheat mesa
#

If you’re struggling with SyntaxErrors then you need to learn js first

lyric mountain
#
intext:"index of /"
Nina Simone intitle:”index.of” “parent directory” “size” “last modified” “description” I Put A Spell On You (mp4|mp3|avi|flac|aac|ape|ogg) -inurl:(jsp|php|html|aspx|htm|cf|shtml|lyrics-realm|mp3-collection) -site:.info
Bill Gates intitle:”index.of” “parent directory” “size” “last modified” “description” Microsoft (pdf|txt|epub|doc|docx) -inurl:(jsp|php|html|aspx|htm|cf|shtml|ebooks|ebook) -site:.info
parent directory DVDRip -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
parent directory MP3 -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
parent directory Name of Singer or album -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
filetype:config inurl:web.config inurl:ftp
“Windows XP Professional” 94FBR
ext:(doc | pdf | xls | txt | ps | rtf | odt | sxw | psw | ppt | pps | xml) (intext:confidential salary | intext:"budget approved") inurl:confidential
ext:(doc | pdf | xls | txt | ps | rtf | odt | sxw | psw | ppt | pps | xml) (intext:confidential salary | intext:”budget approved”) inurl:confidential

what ungodly tarnation is this google search

slender thistle
#

It's fine to ask for help, but you're fucking everything up and wasting your (and our) time with every error you encounter (or create, rather)

neat ingot
#

i found that via google, guess i should add googling to my cv too 😛

earnest phoenix
#

const fs = require("fs");
const emojis = require("./config/emojis.json")
const config = require("./config/config.json")
const keepAlive = require("./server");
// require('canvas').registerFont("Genta.ttf", {
// family: "Genta"
// }); //loading a font

// client define
const client = new Client({
messageCacheLifetime: 60,
fetchAllMembers: false,
messageCacheMaxSize: 10,
restTimeOffset: 0,
restWsBridgetimeout: 100,
shards: "auto",
disableEveryone: true,
partials: ["MESSAGE", "CHANNEL", "REACTION"],
presence : {
status : "dnd",
}
});
module.exports = client;

const mongoose = require("mongoose");
mongoose
.connect(config.mongo, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true,
})
.then(console.log(
.............................................................................. ........................ Mongo DB Connected .................................. ..............................................................................
));

client.setMaxListeners(50);
require('events').defaultMaxListeners = 50;

// //Loading discord-buttons
const dbs = require('discord-buttons');
dbs(client);

// Global Variables
client.commands = new Collection();
client.aliases = new Collection();
client.events = new Collection();
client.cooldowns = new Collection();
client.category = fs.readdirSync("./commands/");
client.db = require('quick.db')

function requirehandlers() {
client.basicshandlers = Array(
"command", "events", "distube"
);
client.basicshandlers.forEach(handler => {
try { require(./handlers/${handler})(client); } catch (e) { console.log(e) }
})
requirehandlers();
keepAlive();
client.login(config.token);
module.exports.requirehandlers = requirehandlers;

#

This is my index

#

Or

lyric mountain
#

```js
code
```

neat ingot
#

you should use a site like pastebin or some jkunk for sharing large code snippets

slender wagon
#

He be using mongodb connections already

#

Lmao

neat ingot
#

or the backtab thing

wheat mesa
slender wagon
#

I started with quickdb 😂 😂

earnest phoenix
#

And

#

i try to learn

#

But its complicated

wheat mesa
#

You’re not learning by copy pasting

#

We’ve told you that 100 times

neat ingot
#

wooops

earnest phoenix
#

okay

neat ingot
#

Watch this JavaScript tutorial for beginners to learn JavaScript basics in one hour.
🔥 Want to master JavaScript? Get my complete JavaScript course: http://bit.ly/2KZea52
👍 Subscribe for more tutorials like this: https://goo.gl/6PYaGF

⭐️ Want to learn more from me? Check out these links:

Courses: https://codewithmosh.com
Twitter: https://twi...

▶ Play video
earnest phoenix
#

okay

wheat mesa
#

Read documentation, maybe follow a w3schools tutorial on javascript or something

#

Do ANYTHING but copy paste

neat ingot
#

JavaScript is the the programming language that built the web. Learn how it evolved into a powerful tool for building websites, servers with Node.js, mobile apps, desktop software, and more https://fireship.io/courses/javascript/

#js #programming #100SecondsOfCode

🔗 Resources

History of JavaScript https://youtu.be/Sh6lK57Cuk4
How JavaScript W...

▶ Play video
earnest phoenix
#

okay

wheat mesa
#

That’s the worst mistake you can make when starting off with learning something

earnest phoenix
#

okay

#

I am watching the videos

slender thistle
#

Write one from scratch. Better yet, start off wit smaller projects.

lyric mountain
#

start with hello world

#

then make a ping command

slender thistle
#

A Discord bot is not that simple as you may think it is

neat ingot
#

tbh, discord bot is easily the most complex thing ive written, and ive been coding for a decade

crystal wigeon
#

has anyone worked with firecracker microvm?

neat ingot
#

it lures you in with a false sense of ease, but its really just not.

earnest phoenix
#

coding

slender thistle
#

Not Scratch

earnest phoenix
#

i just know blocks

slender thistle
#

I mean from literal 0

earnest phoenix
#

?

neat ingot
#

lol

lyric mountain
slender thistle
#

An empty program that you write YOURSELF

neat ingot
#

from square 1, from scratch, from the start, in your own words, without copy paste, etc

lyric mountain
#

square 0 u mean

neat ingot
#

😂

earnest phoenix
#

downloading Visual Studio

lyric mountain
#

Code

neat ingot
#

KEKW im out

lyric mountain
#

Visual Studio != Visual Studio Code

#

remember this so u don't become reason for jokes later on

slender wagon
lyric mountain
#

VS is for VSC what Java is for JavaScript

neat ingot
#

lol, i remember the day my lecturer was trying to explain the vs and vscode difference

slender wagon
#

💀

slender wagon
earnest phoenix
#

andd

#

i deleted it

neat ingot
#

vs code took too much space?

slender wagon
#

Vsc

neat ingot
#

vs is gonna take way more./

slender wagon
#

Space?

#

U mean VS

earnest phoenix
#

Oh

earnest phoenix
#

Visual Studio

slender wagon
#

That takes some space depending on what tools u use

earnest phoenix
#

IT TOOK 30 GB

slender wagon
#

Vsc is just an editor

earnest phoenix
#

Downloaded

neat ingot
slender wagon
#

Yep

neat ingot
#

I'm quite nervous for my interview 😰

earnest phoenix
#

can anyone tell me where to learn html?

neat ingot
#

that question is proof, that 'googling' is indeed a skill 😄

wheat mesa
slender wagon
wheat mesa
#

Even if you don’t make it, you’re learning for your next ones too

#

So it’s a win-win situation

neat ingot
#

Yea, tbh i dont expect to get it, but it will be good to know how a pro interview actually goes

#

i do have almost all requires skill tho, so there is a chance 😛

#

guess i better pause my rap music while iw ait for them to join the teams meeting lol. dont want them to join and hear folks talking about 'trapping' and junk 😄

quartz kindle
#

lmao this guy again

wheat mesa
#

I’m not gonna bother helping with it

#

He just forked it off of replit somewhere so he’s gonna have a lot more issues than that if he doesn’t know js

earnest phoenix
#

I made my first piece of shit

#

On My own without copying

wheat mesa
#

<h1>Hello world!</h1> 🙂

earnest phoenix
dry imp
#

yoo pog

#

html is my fav language

wheat mesa
#

Just remember, html and js have very different functions in terms of what they do

#

So if you learn html don’t expect to be an expert at js right away

#

It takes some time

earnest phoenix
wheat mesa
#

Just gotta persevere

earnest phoenix
wheat mesa
#

Damn one got through

#

@solemn latch

earnest phoenix
#

Its so aobvious

#

obvious*

wheat mesa
#

You’d be surprised

earnest phoenix
#

@wheat mesa

#

i TYPED IN THIS CODE

#

Like in the video

wheat mesa
#

Cool

earnest phoenix
#

and for him

#

It says Hello World in the console

#

But for me it does not?

wheat mesa
#

Then you didn’t write anything in index.js

earnest phoenix
#

I did

earnest phoenix
wheat mesa
#

Looks like you didn’t save it

earnest phoenix
wheat mesa
#

What console are you looking in

earnest phoenix
wheat mesa
#

Yes

earnest phoenix
#

oh ok

#

Got it

#

@wheat mesa how do i open my folder using command prompt?

#

Like this

wheat mesa
#

cd yourFolderDirectory

earnest phoenix
wheat mesa
#

Or go to the folder in your file explorer and at the top type cmd and it’ll open that directory in the console

#

If you’re in vscode you can do CTRL+~

earnest phoenix
#

ok

neat ingot
#

~ interview flopped 😄

wheat mesa
#

Unlucky, what happened?

#

“Sorry you don’t have 45 years of experience in assembly”

neat ingot
#

they were looking for a senior dev, i have no 'professional' experience. stupid job posting didnt mention any senior requirement lol

#

pretty much yea 😄

wheat mesa
#

Ah

#

I see

#

That’s unfortunate

neat ingot
#

ahh its all good. the actual interview wasnt too bad, guys were nice enough 🙂

wheat mesa
#

Good experience!

neat ingot
#

for sure!

wheat mesa
#

Now you have a better idea of what to expect in the future

neat ingot
#

yep, and can prepare more for the tricky questions 😄

wheat mesa
#

Exactly

neat ingot
#

shame tho, job was right up my street: writing backend api's using node js for a game dev company

wheat mesa
#

Damn

lament rock
#

wow

#

That's one hell of a listing

lyric mountain
neat ingot
#

wish i lived in la. the wages those fools get for programming is insane

#

senior js dev average
uk: £60k ($74k)
la: £94k ($117k)

#

like, how is there even that big a difference? 😄

cinder patio
#

cost of living

neat ingot
#

i checked already, la is around $200 more on average per month without housing, and housing costs are maybe 20% more expensive than here

#

20% increased cost (rough average) doesnt translate to 50%+ increased wages

#

i guess demand plays a big part. la has a lot of big startups etc

cinder patio
#

You're comparing a city to a country tho

sullen crater
#

whats your tax situation also lol

neat ingot
sullen crater
#

a lot of banks and facebook still have big offices out there o:

neat ingot
#

yea, i have a mentor guy from jp morgan, apparently they have a large office in my city

sullen crater
#

ayoo

neat ingot
#

those kinda places all want degrees and junk tho 💔

sullen crater
#

not necessarily true! especially for like frontend/fullstack type roles in banks, youd be surprised

#

its always worth applying

#

fwiw i got a bank job without a degree so im basing it on that

#

to be fair MOST people in those places are actually piped right into the company via internships at the colleges anyway

neat ingot
#

yea i guess that is quite fair

sullen crater
#

iirc that was like 80% or some other absurd high number of new hires. really strong intern systems

#

but they gotta hire people from the outside who actually know what theyre doing sometimes 😪

#

especially the banks that are trying to work like tech companies!! the big ones all pretty much split their tech divisions out from the pure banking side

#

so theyre much more like, accepting of non traditional backgrounds

neat ingot
#

i mean, it certainly cant hurt to apply, worst they could say is no 😛

sullen crater
#

you should give them all tries tbh even if the job postings require degrees, its just a line item they like to check off while doing the screening

#

yeah exactly!

#

banks are good money if you dont mind selling your soul for a while

#

but rent is rent

neat ingot
#

lol

#

i do like my soul, but yea, bills need billin'

#

what i find amazing, is these stories you hear of people who started to learn coding and 6 months later had a high paying dev job

#

and im just like~ how?!

#

lol

sullen crater
#

true true

#

tons of luck

woeful pike
#

it really is just about luck

neat ingot
#

yea probably, or just knew a guy, and in the right place etc

woeful pike
#

connections go a really long way

neat ingot
#

yea for sure

woeful pike
#

make friends with the right ppl, don't burn bridges

neat ingot
#

I try not to burn bridges, but I tend to just, lose touch with people over time 😦

woeful pike
#

happens

neat ingot
#

no doubt. I recently made a linked in which i now realize i should have done years ago lol

#

got like 5 connections 😂

woeful pike
#

I personally try to think I have full control of my success/career but acknowledge it's really more about being in the right place at the right time and less about pure skills

neat ingot
#

yea that seems fair

wraith gust
#

Happy

spark flint
#

sad

fathom sonnet
#

is there a way in js to make that only whitelisted user ID's can use certain commands? like ```js
if(user.id === "USER_ID") {
doSomething()
}

cinder patio
#

yes

quartz kindle
#

gg bronzil (jobs here pay like 15k/ usd yr)

lyric mountain
#

it'd be like R$ 589k

quartz kindle
#

which is a stupid amount of money

#

like not even the president's salary is that much

#

(hence why politicians steal instead)

woeful pike
#

well you get paid a lot in the US cuz inflated salaries but also you have so many more expenses. Gotta dish out hundreds for an insurance plan that will do nothing for you, housing is nightmare in LA etc etc

quartz kindle
#

yeah

#

so get a remote job and live in africa

woeful pike
#

lol literally the life I'm living rn

quartz kindle
#

lol nice

woeful pike
#

except I hate this country

#

super unhappy being here

quartz kindle
#

ip

#

rip

#

make topgg pay you an LA salary and move out

woeful pike
#

gotta get paid 6 figures so you can afford to use the ambulance one time 🙂

quartz kindle
#

mozambique and indonesia are awesome places to live in according to a few people i've met

#

also thailand

#

stupid cheap cost of life, great weather, beautiful places

lyric mountain
#

really, I have no idea how the country of suing and protests didn't get upset with health bills

quartz kindle
#

because they hate socialism and they hate the idea of having to pay taxes for someone else's health care

#

¯_(ツ)_/¯

neat ingot
#

oh hey i didnt even take into account health insurance and that kinda thing, that would really raise the average cost of living as we dont really have to pay for shit here

lyric mountain
#

basically you go to a restaurant, instead of splitting 500 so each pay 50, they prefer to each pay their own 500

quartz kindle
#

pretty much

#

#americanlogic

lyric mountain
#

like imagine, you lost everything, got so broke that your wallet shows negative money, you attempt suicide but fail and get rescued only to have a thousand dollars bill added to your situation

#

that's beyond fcked

quartz kindle
#

theres this whole controversy about people who forbid the hospital from attempting to save them in case anything happens

#

and the hospitals do it anyway

#

some guy divorced his wife so that his hospital debt wouldnt affect her after he dies

neat ingot
#

there was a site that people would post their insane american hospital bills on. one woman got charged like 2k usd for 'skin to skin contact' after she gave birth to her baby... they literally charged her 2k to hold her kid after it was born...

lyric mountain
#

heard that too

quartz kindle
#

and if you ask them to send you a detailed "itemized" bill, it gets 10x cheaper

#

basically they are skyrocketing the prices hoping you wont double check, but if you ask to check it, they suddenly lower the prices to hide it

#

such a scam

#

its basically a money laundering scheme between hospitals and insurance companies

hollow needle
#

huh

neat ingot
#

also, patients have the option to pay cash (assuming they have it) and not go through their insurance, which works out about 60% the price, but they tend not to mention that when your there

#

tbh the entire american economy is rekt, and most other countries too lol

#

america is pretty bad though

wheat mesa
wheat mesa
# quartz kindle and if you ask them to send you a detailed "itemized" bill, it gets 10x cheaper

Eh, not so sure about that. Went to the ER for two hours, got a $6k USD bill, asked for an itemized list, got the itemized list full of a shit ton of tests we never asked for but were deemed “medically necessary” (which I understand the doctors are just doing their job). Despite being medically necessary, our insurance has paid less than 20% of the total bill (probably around 1.5k ish? 6k was after insurance). I think that both hospitals and insurance companies are to blame for this sort of thing

#

The hospitals intentionally overcharge because they expect the insurance to fight the costs a little bit, so it evens out to what the hospital technically wants for it

#

It’s ridiculous

neat ingot
quartz kindle
#

there are reports from hospitals charging basic items like cotton tips for 500x more than pharmacies

neat ingot
#

yes, but medical grade cotton tips! 😛

quartz kindle
#

lmao

neat ingot
#

there are reports also of nasa contractors charing thousands per nut and bolt for crap that you can get for near pennies

quartz kindle
#

yup

#

just your everyday "superfaturamento" like we say in portuguese

neat ingot
#

tbf, if nasa calls you to write a discord bot, your gonna chuck a few extra 0's on the bill 😛

quartz kindle
#

companies supercharging each other so that the ceo's get a larger slice

neat ingot
#

gotta have big bills to launder big sums 😛

quartz kindle
neat ingot
#

thats when you counter for 40x and a 60/40 split to you 😛

quartz kindle
#

xD

#

and they gonna accept because 40% of 40x is more tha 50% of 20x

#

and they dont care, they just want to make more money

neat ingot
#

exactly!

quartz kindle
#

rich people business 101

neat ingot
#

rip gif not showing

#

i need to go paint the ceiling again, but i dont wanna 😭

slender thistle
# quartz kindle because they hate socialism and they hate the idea of having to pay taxes for so...

Holy shit. Louisiana Republicans have voted to advance a bill out of committee making abortion from the moment of fertilization a crime, in which the mother can be charged with homicide.

Likes

11453

Retweets

4972

@shivaco_ @MayapplePawl @g_rootResister @StrikeDebt @AOC Yeah,how many immigrants are you willing to sponsor,,really, invite them to your home, feed and pay medical costs, quit asking others to support your virtue signaling pipe dream,really,we have citizens who need help now,,how about stepping up?🌎👍🇺🇲✝️

#

I really don't understand Americans

boreal iron
#

Nobody does

quartz kindle
#

people on twitter rarely ever make sense

#

we live in an idiocracy where idiots were given too much voice and too much power

boreal iron
#

Poor Tim

#

You’re just not rich enough

quartz kindle
#

lmao

boreal iron
#

to have voice and power

quartz kindle
#

remember when stephen king said that covid is not even close to being as bad as some virus in one of his books

cinder patio
#

which book

quartz kindle
#

and some idiot on twitter said "how the fuck would you know? did you even read the book"?

quartz kindle
cinder patio
#

one of the books I don't have

boreal iron
#

imagine having the time to read books

quartz kindle
#

someone on twitter said that "elon musk could have used those 40 billion to end world hunger, 40 billion dollars to 8 billion people, thats 5 billion dollars for every person, imagine how your life could have changed"

boreal iron
#

Errr what

#

I see… math, very complicated

quartz kindle
#

basically a repeat of this one

slender thistle
#

Let's be honest though

#

It doesn't have to be billions

cinder patio
#

In this state of the world global hunger can't be fixed

#

There'll always be suffering

boreal iron
#

That’s how capitalism works

#

You better throw stuff away than giving it to somebody for free

#

And literally nobody cares about 3rd world countries

cinder patio
#

Seriously the amount of food that gets wasted every day...

quartz kindle
#

roughly 50% of all food produced world wide gets wasted

boreal iron
#

We only care in terms of where to produce goods as cheap as possible

boreal iron
cinder patio
#

While we lose 25K people to hunger every day

#

People need to stop breeding

lyric mountain
cinder patio
#

Man wants to give 7 billion people a dollar

boreal iron
#

That would be fun

split hazel
#

thats a lot of bytes is that even correct

#

thats 1.6gb thats definitely not right

quartz kindle
#

lmao

split hazel
#

i think its not stopping for some reason

#

might ask on the os forum about that

#

i ported the parser library from c to c++ so that mightve caused some issues

oblique flame
#

Can I transfer ownership of one of my bots to a different account?

rustic nova
#

By deleting and resubmitting it on the new account

quartz kindle
#

tfw i sit down and start coding with the intention of finishing the missing stuff on my api, and instead i end up reworking the existing features for the 6th time

#

btw turns out fetch in node 18 is shit

#

much better to install nodejs/undici and use undici directly

split hazel
quartz kindle
# split hazel prove it

its 1:1 the browser fetch, stripped out of all sorts of cusomizability that node-oriented libraries have, like tweaking timeouts, keepalives, agents, it has locked/unremovable headers and its also slower than all other fetch implementations

split hazel
#

rip

#

node-fetch time ?

quartz kindle
#

nah just use undici directly

#

npm i nodejs/undici

#

theres a proposal for exposing undici in node, hopefully it will be approved

#

then you can just do require("node:undici")

#

but right now its unaccessible, so you need to install it separately, which is dumb af

split hazel
#

these proposals 💀

#

i swear if you want to get something approved you have to go through blood sweat and tears

#

SPEEDY OS ANNOUNCEMENT - speedyos now supports compilation of C files which are all linked together at the end alongside the C++ files

quartz kindle
#

lmao nice

#

also

#

this is the kind of errors you get if a fetch fails, while using the node 18 fetch

#

10/10

earnest phoenix
#

The most helpful error ever

vivid fulcrum
#

it's giving

earnest phoenix
#

Something happened

craggy pine
#

I think something happened

quartz kindle
neat ingot
#

did something really happen though?

lyric mountain
#

when u put a global exception catch

split hazel
boreal iron
split hazel
vivid fulcrum
#

at least node 18 reports the error without silently failing 💀

split hazel
#

its because it would take ages to write out a specific error message for every little error

earnest phoenix
#

It's better for it to take more time to give out proper errors instead of letting the user spend hours trying to figure why the error occured

#

Who thought just telling the user where the error occurred right next to a character was a good idea rather than making proper errors

boreal iron
#

Saved a lot of time of the developer I guess

lament rock
#

idk what makes me think this, but I think something happened

earnest phoenix
neat ingot
#

the dude that created javascript did so in 10 days

#

they have spent since like 1995 trying to fix his bugs 😄

lament rock
#

JS by itself is pretty darn good

neat ingot
#

ngl, i'd be stoked if i was the dude that whipped up an entire programming language that runs the world in 10 days

boreal iron
earnest phoenix
neat ingot
#

oh i think its a huge acomplishment lol

#

bugs are always there

earnest phoenix
neat ingot
#

is there a link to the livestream of him getting in the car? 😛

boreal iron
#

There we go

#

Threatening the western world again

solemn latch
#

👀

earnest phoenix
#

Threatening the outlandish statements of FakE with his fake news troll

boreal iron
molten coral
#

just askin', what are the differents objects existing in js ? can't find any list

#

like arrays, dates, json objects...

earnest phoenix
molten coral
#

regexps...

neat ingot
#

I do realize i linked the guide for like, classes, but on the left panel there is a list with some default classes and examples

molten coral
#

classes are "object constructors" aren't they ?

#

oh

#

oh thanks didn't notice

neat ingot
#

a class is basically a namespace for data, they can be constructors for data objects

#

they can also be 'static' where no object is created and just methods are called

earnest phoenix
#

Btw if you didn't know, arrays are just actual objects with indexes as keys and elements as values in JavaScript

molten coral
#

okay thx !

earnest phoenix
#

And probably also the same concept in other programming languages

neat ingot
#

there are tons of js features and classes i forget about, or learn about every day

#

recent ones are: Intl class for handling times in zones etc, and # for private class functions/variables

earnest phoenix
#

There's also Reflect

solemn latch
boreal iron
neat ingot
#

devdocs is a nice site

solemn latch
#

oo i like that

boreal iron
#

It’s a bit easier to use than the Mozilla docs

neat ingot
#

their doc works offline too which is hella nice

boreal iron
#

Yeah

earnest phoenix
#

They also seem to show internal symbols, nice

boreal iron
#

Well made docs tbh

neat ingot
#

devdocs pulls docs from other sources and just formats them/stores them for offline use iirc

solemn latch
#

yeah, looks like it contains reference links

#

which is really nice

neat ingot
#

thats a good list of default classes too tbf

#

wth is atomics...

solemn latch
#

at tim

#

(dont actually)

neat ingot
boreal iron
#

Probably something Voltrex would use

earnest phoenix
#

I actually do use them, they're pretty useful especially at times when debugging or working with large array buffers

quartz kindle
#

atomics especially for SharedArrayBuffer

#

i've used them a bit when i was working on a shared memory prototype

#

currently in my abandonware shelf

#

exdee

#

the idea is if you have a buffer that is shared between two workers, lets say you do something simple like this

if(buffer[0] === 120) {
  buffer[0] = 125;
}
``` between the time you read the buffer, and you write the new value, the original value might have been changed by another worker. its a stupidly small fraction of time where it can happen, but it can happen
#

Atomics are a way to prevent that

#

they can execute a read and a write at the exact same time by only writing if the read matches the expected value, which ensures atomic safety

lament rock
#

waiting for the day worker threads share the same module require cache

#

memory usage go brrrrr

quartz kindle
#

likely never

earnest phoenix
quartz kindle
#

i can read c++ but i cant read v8 code

earnest phoenix
#

It's so complex that even Google's syntax highlighter is confused

split hazel
#

i swear people just love to overcomplicated code

#

just like the source code for C standard library the person that wrote it cant be human

lyric mountain
boreal iron
#

At least that’s what we hope

sharp geyser
#

Right now it goes
Client -> WebsocketShardManager -> WebsocketShard -> Gateway (On Identify)

quartz kindle
sly solar
wheat mesa
#

what on earth is crosspost()

#

wow okay that's a real thing

#

you need to await sending your message

#

.send() returns a Promise<Message>

wheat mesa
#

no

sly solar
#

ha

#

okay

#

1 min

wheat mesa
#

(await client.channels.cache.get("id").send("sss")).crosspost()

#

that outside await only applies to the final function call

sly solar
#

again

wheat mesa
#

it might be helpful for you to learn some js async/await syntax

lyric mountain
wheat mesa
lyric mountain
#

shouldn't that be called "publish" then?

wheat mesa
#

djs should be called "dumpster fire" but unfortunately names are weird sometimes

sly solar
#

👍

dry imp
quartz kindle
slender thistle
dry imp
#

like if you wanna have a bad indentation, do it on every line dont be an asshole and just do it on 1 line

sharp geyser
#

smh

#

one indent and I can fuck ur whole program up

dry imp
#

god bless u misty and your indentation

sharp geyser
#

:^)

#

I just use prettier

#

I don't gotta worry bout indentation then

dry imp
#

good

real rose
#

out of curiosity what is crosspost

sharp geyser
#

From my understanding it just lets you send across all channels that follow the news channel the message is sent in

#

Have you ever sent a message in a news channel and it asks if you wanna broadcast it to all the channels following it?

#

It essentially does that

real rose
#

Was just looking it up yeah, didn't know discord api had that

#

cool

sharp geyser
#

Yea, it is cool

sly solar
sly solar
#

Problem solved.

boreal iron
#

Flazepe would scream when seeing all that parenthesis

quartz kindle
# boreal iron Flazepe would scream when seeing all that parenthesis
Discord.on("message", function (message) {
  var boolean = true;
  if (!!!!Boolean(boolean) !== false && Boolean(boolean) === true) {
    {
      {
        {
          {
            {
              {
                {
                  {
                    {
                      {
                        if (!!!!Boolean(message.content.includes("discord.gg")) === true && Boolean(message.content.includes("discord.gg")) !== false) {
                          message.delete();
                          message.reply("No Invites!!1! You will get baned soon.")
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
});
wheat mesa
#

what the fuck

#

this is cursed on so many levels

#

@sharp geyser you should design your lib like this

#

invent a brand new syntax checker for js that forces you to write like that

earnest phoenix
quartz kindle
#

yes thats where i copied from :^)

#

mfw this has more stars than my projects

#

for some reason my github desktop's updater started using 100% cpu

carmine summit
#

did i do something dumb or the number from a for in loop is always a string

earnest phoenix
#

A for loop with the in keyword iterates through the keys of an object, so if you're iterating through an array with it, the iteration value will be the index of the current element as a number, for objects however, it iterates through the object's keys, which can be a string, number, or a symbol

carmine summit
#

i see

sharp geyser
#

why do more suffering

boreal iron
#

I somehow like that statement

#

Idk why

quartz kindle
#

"pretty"

sharp geyser
#

hi tim

livid lichen
#

By chance, does anybody know what I'm doing wrong here? It always returns the 401 status error.

const axios = require("axios");
  
  return await axios.post(`https://discord.com/api/v8/channels/805844980337475636/invites`, {
    headers: { 'Authorization': `Bearer ${process.env.TOKEN}`, 'content-type': 'application/json' },
    body: JSON.stringify({
      max_age: 0,
      target_type: 2,
      target_application_id: "880218394199220334",
    })
  })
#

I can confirm TOKEN exists.

sharp geyser
#

It means you are unauthorized

#

so your authorization is wrong

livid lichen
#

I'm aware. I'm just not sure why it won't work.

sharp geyser
#

Are you using a bot token?

livid lichen
proven lantern
#

dont post it

#

just say what it is

livid lichen
sharp geyser
#

If you are using a bot token it has to be BOT ${process.env.TOKEN}

sharp geyser
#

Bot tokens are not bearer tokens

livid lichen
#

Alright. Thanks guys.

sharp geyser
#

Also I think you can just do Bot instead of all caps

livid lichen
#

Still the same error.

sharp geyser
#

Hm

livid lichen
#

Axios is killing me lmao.

sharp geyser
#

I doubt it is axios

livid lichen
#

Yeah, I just meant Axios doesn't have a clear documentation on how to authorize.

sharp geyser
#

It is the same with just about any library you will use

#

no need to really specify how the header should look when it will be the same no matter what lib you use

#

try just setting the token without Bot or Bearer

quartz kindle
#

should be Bot token

wide rock
#

Any bot devs ? DM me

lyric mountain
#

Why don't u just ask here?

#

"DM me" is as annoying as "price inbox"

wide rock
#

It’s a long explanation

#

That’s why

quartz kindle
#

nobody will dm you

#

just post here

sharp geyser
#

Mmm, I am wondering how i should do the rest api stuff, should i just make a 'RestClient' that gets attached to the client itself and in that rest client I just have methods to fetch from the api or should I do it differently?

#

Cause if I do it that way I think I will be limited on how well I can fetch different things like channels, users, members, guilds, etc

sharp geyser
#

that I should do it differently or?

#

I was thinking of somehow attaching a rest client to all the classes like Guild, User, Member, etc

round cove
#

Yeah I think you should probably have a base rest client

sharp geyser
#

Mmmm

#

Wdym by "base rest client"

#

in your mind what would that do? I am unsure if we are thinking of the same thing here

pale vessel
#

you could attach it to the client, but you don't have to make it rely on the client

#

just think of it as a separate class

round cove
#

You'll have a client, a RestManager and then all your actual managers (channel, message, etc) that all extend off the rest client in some way and implement their respective methods and then the client has all of those managers on it.

sharp geyser
# pale vessel just think of it as a separate class

Yea that is how I was going to do it but then I thought like, how would I efficiently do requests for different things unless I just did smth like

export class RestClient {
  constructor(){
     
  }

  get(url: string){
    request(url)
    return theDataGotten
  }
}

and just provide the rest api url for the current thing I need

pale vessel
#

oh, dylan, what do you think of discord possibly killing reaction role bots?

round cove
#

MY BOT D:

sharp geyser
round cove
#

Kill in what way, how customizable would their implementation be

pale vessel
round cove
#

Send it, I haven't

round cove
#

literally my bot and it's category system, gg

pale vessel
#

it looks quite customizable ngl, yeah

round cove
#

welp was nice having a 3k bot

sharp geyser
#

its ok dylan

#

just come work for strife shameless ad :^)

round cove
#

I'm already working for guilded.js :p

sharp geyser
#

Ok

#

kindly fuck off

round cove
#

damn

sharp geyser
#

😔

round cove
#

been like this for awhile now 😔

sharp geyser
#

guilded suck

#

but ye nah

#

I gotta figure out this rest stuff

#

I like your idea of everything being a manager

round cove
#

Gotta be modular

sharp geyser
#

Yeee

sharp geyser
#

it is the only feasible way I see to be able to get the token they set to be able to do the rest api requests

round cove
#

manager->client->rest->routes->method

sharp geyser
#

wait what

round cove
#
// (channelManager)
this.client.rest.routes.getChannel(id);```
sharp geyser
#

Oh wait whattt

#

That do be smart

round cove
#

routes being a large collection of all api endpoints or something

sharp geyser
#

Yea

#

I am thinking of how i should actually code that tho

round cove
#

That's why you have a design phase

earnest phoenix
#

Help i am getting an error

#

nvm

#

fixed it

#

Cannot be a reserved keyword
Should be meaningful
Cannot start with a number (1name)
Cannot contain a space or hypen (-)

dry imp
#

"should be meaningful" troll

earnest phoenix
earnest phoenix
earnest phoenix
#

error

#

uh a lil help?

dry imp
#

bruh did your really just pinged me out of nowhere 💀

earnest phoenix
dry imp
#

im stuck in traffic jam MumeiSui

earnest phoenix
earnest phoenix
#

// Performing a task
function greet(name, lastName) {
console.log('Hello'+ name + ' ' + lastName);
}

// Calculating a value
function square(number) {
return number* number;
}

let number square(2);
console.log(number);

dry imp
#

no im not in the mood

earnest phoenix
#

okay..

#

My brain is dying?

#

idk

#

hmm

#

In line 12 i think theres a problem

#

is that right?

#

In the square text

#

I don't have an bracket

#

idh a bracket

#

is that rightt?

#

I finished Java script tutorial

#

basiscs

#

now i'm learning html

#

most ez language

#

?

#

HTML Tutorial for Beginners - Learn HTML for a career in web development. This HTML tutorial teaches you everything you need to get started.
🔥 Get the complete HTML/CSS course (zero to hero): https://bit.ly/3rUpjG4
👍 Subscribe for more HTML tutorials like this: https://goo.gl/6PYaGF

⭐️ Want to learn more from me? Check out these links:

Course...

▶ Play video
#

?

#

yes

#

alright

#

gimmie a min

#

typing

#

Like

#

I saw like that in the video

#

oops

#

No

#

...

#

..

carmine summit
#

why does it change the first item aswell?

      this.activeItems.push(this.availableItems[5]);

      this.activeItems[this.activeItems.length - 1].x = 1280;
      this.activeItems[this.activeItems.length - 1].y = this.height / 1.4;
earnest phoenix
#

..

carmine summit
#

this.availableItems is an array full of Items

earnest phoenix
#

virus.exe 💀

boreal iron
#

let number = value

earnest phoenix
#

I am bored

#

i learnt java script for 4 hourss skul

#

Nope

#

:c

#

I frogot

#

The video is complicated

#

can you just tell me?

#

and teach?

#

i'll pay you nitro nitro

#

@earnest phoenix

#

You already have but you're not using?

carmine summit
earnest phoenix
#

Okay

earnest phoenix
#

most of the time

#

yk

#

I'll pay nitro to the person who teaches me coding and how to make a bot 🙂

#

I am reaalyyyyyyyyyyyy bored

#

so ima play some minecraft tnt_boom

austere surge
#

minceraft poggythumbsup

earnest phoenix
#

yeah :c like i don't understand that man

#

They talk so fast fastlick

austere surge
#

slow down then

earnest phoenix
#

Then it becomes too slow

austere surge
#

;-;

earnest phoenix
#

and low qaulity

boreal iron
#

Try a book then and read it as fast as you want to

earnest phoenix
austere surge
#

ive got a javascript book lol

boreal iron
#

Not that the internet is full of documentations…

earnest phoenix
split hazel
#

I found coding books to ramble way too much about the wrong things

austere surge
#

12am

carmine summit
#
    //Summon Items on chance
    if (this.timeElapsed !== 0) {
      let chance = 1000 / this.conveyor.velocity;
      let rng = Math.floor(Math.random() * chance);
      //0
      if (rng === 0) {
        console.log("SPAWN"); //spawn

        let rng = Math.floor(Math.random() * this.availableItems.length);

        this.activeItems.push(this.availableItems[rng]);

        this.activeItems[this.activeItems.length - 1].x = 1280;
        this.activeItems[this.activeItems.length - 1].y = this.height / 1.2;

        console.log(JSON.stringify(this.activeItems));
      }
    }
earnest phoenix
#

8:05 am just had my bath and stuff

austere surge
#

nic

earnest phoenix
#

nice

carmine summit
#
    //LOOP EVERY ACTIVE ITEM get invaid spaces then move every item until invalid space
    if (this.availableItems.length !== 0) {
      for (let i = 0; i < this.activeItems.length; i++) {
        //dont move if on edge or next to an object
        if (this.activeItems[i].x < 50) continue;
        if (i !== 0 && this.activeItems[i].x < this.activeItems[i - 1].x + this.activeItems[i - 1].img.width + 50) continue;

        //move
        this.activeItems[i].x = this.activeItems[i].x - 1 * this.conveyor.velocity;
      }
    }
earnest phoenix
#

i'll pvp steve_baker

carmine summit
#

go laugh at my poor quality code

earnest phoenix
boreal iron
#

That answered my question

carmine summit
boreal iron
carmine summit
#

yeaah

#

yeah its fine

#

its main goal is to get a random item from the pool to put it in the active array

bright thorn
#

how can we spawn a particular shard

carmine summit
#

this.availableItems is an array full of Items

boreal iron
#

Yeah I know zoomeyes

dry imp
#

thats a bad suggestion fake im dissapointed in u

boreal iron
#

I’m just here to harass people and annoy them, you know?!

#

_but don’t tell anybody about it _

hexed garnet
#

Can someone help me with 2.0.0a0?

slender thistle
hexed garnet
pulsar bone
#
from quart import Quart, render_template, request, session, redirect, url_for
from quart_discord import DiscordOAuth2Session

app = Quart(__name__)
app.config["SECRET_KEY"] = "test123"
app.config["DISCORD_CLIENT_ID"] = ######
app.config["DISCORD_CLIENT_SECRET"] = "#########"  
app.config["DISCORD_REDIRECT_URI"] = "###########"   

discord = DiscordOAuth2Session(app)

@app.route("/")
async def home():
    return await render_template("index.html")

@app.route("/login")
async def login():
    return await discord.create_session()
  
@app.route("/callback")
async def callback():
    try:
        await discord.callback() <===error here
    except:
        return redirect(url_for("login"))

    user = await discord.fetch_user()
    return f"{user.name}#{user.discriminator}" 
if __name__ == "__main__":
  app.run(host='0.0.0.0',port=8080)
#

can anyone help ?

#
Traceback (most recent call last):
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart/app.py", line 1489, in handle_request
    return await self.full_dispatch_request(request_context)
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart/app.py", line 1514, in full_dispatch_request
    result = await self.handle_user_exception(error)
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart/app.py", line 964, in handle_user_exception
    raise error
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart/app.py", line 1512, in full_dispatch_request
    result = await self.dispatch_request(request_context)
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart/app.py", line 1557, in dispatch_request
    return await self.ensure_async(handler)(**request_.view_args)
  File "main.py", line 23, in callback
    await discord.callback()
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart_discord/client.py", line 160, in callback
    token = await self._fetch_token(state)
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/quart_discord/_http.py", line 68, in _fetch_token
    return await discord.fetch_token(
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/async_oauthlib/oauth2_session.py", line 242, in fetch_token
    self._client.parse_request_uri_response(
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 220, in parse_request_uri_response
    response = parse_authorization_code_response(uri, state=state)
  File "/home/runner/Dashboard-1/venv/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 272, in parse_authorization_code_response
    raise InsecureTransportError()
oauthlib.oauth2.rfc6749.errors.InsecureTransportError: (insecure_transport) OAuth 2 MUST utilize https.
tired panther
#

Github Copilot can't do math 😐

pulsar bone
fathom sonnet
#

hii people, so how can i make my bot to automaticly change this "server counter" when it is added or removed from server:

proper belfry
#
  throw err;
  ^

Error: Cannot find module 'colornames'
Require stack:
- C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\Commands\Utility\createrole.js
- C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\handler\loadCommands.js
- C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\Commands\Utility\createrole.js:2:15)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadCommands (C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\handler\loadCommands.js:13:23)
    at Object.<anonymous> (C:\Users\maxim\OneDrive\Bureau\REAPER-2.0-master\index.js:52:1)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\maxim\\OneDrive\\Bureau\\REAPER-2.0-master\\Commands\\Utility\\createrole.js',
    'C:\\Users\\maxim\\OneDrive\\Bureau\\REAPER-2.0-master\\handler\\loadCommands.js',
    'C:\\Users\\maxim\\OneDrive\\Bureau\\REAPER-2.0-master\\index.js'
  ]
}```
fathom sonnet
proper belfry
#

pls

#

can you help me

dry imp
#

its obvious

earnest phoenix
#

Hiring a person who can make me a bot or anything you will get nitro in return.

#

Dm. Me

fathom sonnet
#

Sooo something like

client.on("guildCreate", guild => {
  const status = ` Watching ${client.guilds.cache.size} Servers`
client.user.setActivity(status)
}) 
#

Alright tnx a lot man <3

#

But i also have "arrayofstatus"
So my bot have interval and xhange status every x Seconds.
Owner
Bot tag
Number of servers
Number of memebrs
Number of channels
Website
Supoort
...

So now i should create variables for every of these, xreate listeners for server number, channel number, memeber number

Then xreate interval and inside that call theese every x sexonds.

I think this is Right.

#

Well it change status

#

And it loop

#

But server status dosent update

#

It stays same

quartz kindle
#

you have to define the array inside the loop, not outside

#

so that its redefined on every loop

earnest phoenix
#

Paying nitro for making me a bot dm me

#

I am bad at coding

#

Don't judge

rustic nova
#

-needdev

gilded plankBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

lyric mountain
#

it's not that ur bad, it's that u started at the worst possible way

spark flint
#

why is this happening wahhh

#

no client.destroy()

tulip cradle
#
< eval.js >```
```js
const { SlashCommandBuilder } = require("@discordjs/builders");
const clean = require("../../../clean").default;
const { MessageEmbed: Embed } = require("discord.js");
module.exports = {
  data: new SlashCommandBuilder()
    .setName("eval")
    .setDescription("Evaluate a javascript expression")
    .addStringOption((option) =>
      option
        .setName("expression")
        .setDescription("The code to evaluate")
        .setRequired(true)
    ),
  execute: async (interaction, client) => {
    const string = interaction.options.getString("expression");
    if (interaction.member.id !== interaction.client.config.ownerId) {
      return interaction.editReply({
        content: "This command can only be used by the developer of the bot!",
        ephemeral: true,
      });
    }
    try {
      const evaled = eval(string);

      const cleaned = await clean(interaction.client, evaled);
      const emb = new Embed()
        .setTitle("Evaluation | Success")
        .setDescription(`\`\`\`js\n${cleaned}\`\`\``)
        .setColor(`AQUA`)
        .setFooter({
          text: `Evaluated by ${interaction.member.displayName}`,
          iconURL: interaction.member.user.avatarURL({ dynamic: true }),
        });

      return interaction.editReply({
        embeds: [emb],
      });
    } catch (err) {
      const emb = new Embed();
      emb.setColor(`RED`);
      emb.setDescription(`\`\`\`js\n${/*clean*/ err}\`\`\``);
      emb.setTitle("Evaluation | Error");
      emb.setFooter({
        text: `Evaluated by ${interaction.member.displayName}`,
        iconURL: interaction.member.user.avatarURL({ dynamic: true }),
      });
      return interaction.editReply({
        embeds: [emb],
      });
    }
  },
};```
tulip cradle
# tulip cradle ```xml < eval.js >``` ```js const { SlashCommandBuilder } = require("@discordjs/...
< clean.js >```
```js
/**
 
 * @param  {Object} client
 * @param  {String} text
 * @return {String} text with all the cleanups applied

 */
const clean = async (client, text) => {
  // If our input is a promise, await it before continuing
  if (text && text.constructor.name == "Promise") text = await text;

  if (typeof text !== "string")
    text = require("util").inspect(text, { depth: 1 });

  text = text
    .replace(/`/g, "`" + String.fromCharCode(8203))
    .replace(/@/g, "@" + String.fromCharCode(8203))
    .replaceAll(client.config.botToken, "T0$&N^");

  // Send off the cleaned up result
  return text;
};
module.exports = clean;```
rustic nova
#

Please do the following:

State your issue
State what you're trying to do
Just posting code and an error does not help

spark flint
#

i'd recommend using something like https://hst.sh (hastebin) when sharing code like this

#

so it doesn't floooood chat

tulip cradle
#
TypeError: Cannot read properties of undefined (reading 'guilds')

#

/eval expression: client.guilds.cache.size;

rustic nova
spark flint
#

not as bad as djs server

#

"how to fix regex error, heres no code, go figure"

tulip cradle
spark flint
wheat mesa
spark flint
#

lmao

wheat mesa
#

Shit even CollegeBoard offers more for taking surveys about the SAT

celest gate
earnest phoenix
#

I did not give up

#

i just want a bot

neat ingot
lyric mountain
#

really, IT IS NOT hard, you just need to start from the base

#

complex yes, but not hard

pallid zinc
lyric mountain
#

how would I go about implementing a map where 2 keys point to the same value?

map.put("123", "456", objA);

map.get("123"); // -> objA
map.get("456"); // -> objA

map.remove("123"); // removes both mappings
#

I thought abt making a custom key class, but then hashcode wouldn't match

#

additional details:

  • both keys are always the same type
  • there shouldn't be desync (as in, either both keys exist or neither do)
  • a key cannot be repeated, even within another pair (key count will always be twice the value count)
  • the value MUST be acessible by supplying either key, not both
quartz kindle
#

one option would be to store a copy of the keys in the object itself, so when you remove one key, you read the other keys from the object and delete them as well

lyric mountain
#

the object can be anything btw

quartz kindle
#

some kind of mapping then

#
put(a,b,val) {
  const obj = {
    keys: [a,b],
    val: val
  }
  this.store.set(a, obj)
  this.store.set(b, obj);
}

get(k) {
  return this.store.get(k)?.val
}

remove(k) {
  const obj = this.store.get(k);
  if(obj) {
    for(const key of obj.keys) {
      this.store.delete(key);
    }
  }
}
lyric mountain
#

to make visualization easier

#

a for would be an option, but then it'd not be O(1) anymore

quartz kindle
#

if its always 2 keys then you dont need the for

lyric mountain
#

yes, always 2 keys guaranteed to be the same type

quartz kindle
#

just ```js
this.store.delete(obj.keys[0]);
this.store.delete(obj.keys[1]);

#

of instead of storing them inside an array, you can have 2 props: key1 and key2

lyric mountain
#

oh wait, no it's not in that sense

quartz kindle
#

btw is this js or another lang?

lyric mountain
#

the map can have any amount on entries, and each entry will be mapped by 2 keys

lyric mountain
#

like, for some context:

quartz kindle
#

because js has a weakmap thingy where you can invalidate the value and make all keys to it disappear

lyric mountain
#

"Let's say we have a trade between user A and user B. The trade information will be stored among N other trades, and need to be accessed supplying either user ID (not both)"

quartz kindle
#

yeah my example should work

lyric mountain
#

but then there's the hashcode issue

#

a hashmap stores based on the hashcode instead of checking for equality

#

so ```java
map.put("123", "456", objA);

map.get("123"); // null
map.get("456"); // null
map.get(key("123", "456")); // objA

quartz kindle
#

can the same 2 user ids be used to store more objects?

lyric mountain
#

no, all keys can only exist once

quartz kindle
#

alright then shouldnt be an issue

round cove
quartz kindle
#

basically you have two copies of the same data stored in 2 different keys

#

can you store references in java?

round cove
#

Yes

lyric mountain
#

ye

quartz kindle
#

so you store the same reference using 2 different keys

#

and this reference points to an object that contains both keys along with the data

lyric mountain
#

but how would I remove the other sibling key without looping and comparing each?

quartz kindle
#

you access the object

#

a remove operation will first get the object, then read the keys from the object, then remove each key

round cove
#

If this was rust it'd just make two pointers to the heap mem ref.

#

Xd

quartz kindle
#
<store>
"a" -> obj1 { key1: "a", key2: "b", value: {...} }
"b" -> obj1 { key1: "a", key2: "b", value: {...} }
"c" -> obj2 { key1: "c", key2: "d", value: {...} }
"d" -> obj2 { key1: "c", key2: "d", value: {...} }

remove(k) {
  const obj = this.store.get(k);
  if(obj) {
    this.store.delete(obj.key1);
    this.store.delete(obj.key2);
  }
}
lyric mountain
#

so basically have a wrapper on the value instead of the key

#

HashMap<K, Pair<K[], V>>

#

this?

#

K being key and V being value

quartz kindle
#

yeah you could use a pair

#

a get operation will use any of the keys to obtain the pair itself, from which you then need to get V

lyric mountain
#

ic

quartz kindle
#

a put operation will put both keys and reference the same pair

lyric mountain
#

I'll give it a try, thx tim

quartz kindle
#

a remove operation will get the pair with any of the keys, read the K[] array and remove both keys

lyric mountain
#

is bool = bool || other equal to bool |= other?

#

like, ik |= is bitwise OR assignment, but does it work for booleans?

quartz kindle
#

should work

#

bools are coerced to 1/0 in most langs

lyric mountain
#

instead of 0b1/0b0 (whyyyyy)

quartz kindle
#

isnt that the same thing? lmao

lyric mountain
#

0b1 is 1 bit

#

at least in java

quartz kindle
#

no lang uses bit-sized storage

#

bools are always stored in a char

#

0-255

lyric mountain
#

like, 0xF would be 0b1111 in java

quartz kindle
brave nova
#

i wonder, from those bots i found on top.gg, do they scan redirects or only use public Phising.database on github

delicate zephyr
#

iirc most use anti-fish which is made by bytealex

brave nova
#

the anti-fish.bitlow.dev rite

delicate zephyr
#

which uses Phish.Surf and Phishing.Database

#

ye

brave nova
#

i see

#

cuz one time theres a raid on my server and multiple people sent a redirect, to be exact Meta refresh redirect

delicate zephyr
#

Phish.Surf is more trusted and has less false-pos and Phishing.Database has a ton of false-pos but anti-fish has its own whitelist/blacklist which overrides both

round cove
#

I use anti-fish for my mod bot

#

Seems p good

delicate zephyr
brave nova
#

i also use it, but these new link is considered "safe".

delicate zephyr
#

you can report them in the support server

brave nova
#

so i make a new bot for tracing the redirect, and i wonder, if its gonna be useful or not

#

if i made it as a public bot

delicate zephyr
#

Anti-fish follows domains

#

it follows link-shortners

#

hence why I said you should report it lol

brave nova
#

yea, i did, it was a meta refresh to ip logger website and then redirect to image attachment

delicate zephyr
brave nova
delicate zephyr
#

The domain where the scam/ip logger starts

brave nova
#

its already gone, the hoster close it

#

it short lived

delicate zephyr
#

We should move

brave nova
#

yeah

delicate zephyr
#

Oh you left the support server

brave nova
#

yea, i just report and leave lul

delicate zephyr
#

you never sent anything

#

rofl

brave nova
#

yep

#

dm staff and gone

feral aspen
#

Anyone knows what could cause my code font color to go from this to this?

quartz kindle
#

looks the same?

feral aspen
#

The color of the () isn't.

quartz kindle
#

did you install the brackets extension?

feral aspen
#

.. and the {} are rainbows every stage.

quartz kindle
#

oh i believe the brackets extension was integrated into vsc

feral aspen
#

The what extension, now?

#

Let me check.

quartz kindle
feral aspen
#

Ohh.. that.

#

Many thanks, it's turned off.

#

By the way, is the guildScheduledEventCreate working for you by any chance?

quartz kindle
#

idk i dont use that event

feral aspen
#

Not going to lie, it doesn't even run the file of the event.

#

The first console.log(1) doesn't even output.

quartz kindle
#

djs v13?

feral aspen
feral aspen
quartz kindle
#

idk then

#

try adding a raw event

feral aspen
#

A raw event?

#

I decided to try bot.on('guildScheduledEventCreate', console.log) for now, going to check if it will work or not.

quartz kindle
#
client.on("raw", raw => {
  if(raw.t === "GUILD_SCHEDULED_EVENT_CREATE") console.log(raw)
})
feral aspen
#

"raw"? I've never seen an event called raw.

#

And client as in bot right?

quartz kindle
#

yes

feral aspen
#

I did exactly that and nothing in the logs.

quartz kindle
#

then yeah you're not receiving anything

feral aspen
#

Oh, wat. What is the cause of this?

quartz kindle
#

ask discord

lyric mountain
# quartz kindle

ye ik, that's why idk why they use a whole 0xFF instead of 0b1

#

never made sense to me tbh, granularity? it's either true or false goddamit