#development

1 messages · Page 1966 of 1

boreal iron
#

Yeah saw that crying on a webhook token alread

split hazel
#

brings me back to the time i trolled a server by making a selfbot

#

was fun

#

the good old days

boreal iron
#

Huh oh I read selfbot

#

calling the FBI now

quartz kindle
#

ef bee ai

split hazel
#

oh it does actually work

#

(my real token lmao)

#

i'll try not to accidentally paste it

boreal iron
#

Hit enter just for fun freerealestate

split hazel
#

all i'll say is

#

it starts with mfa.

winter pasture
split hazel
#

i think theres a lot of discord users with 2fa enabled

#

bruh

winter pasture
#

I mean you can get most of the token anyways

split hazel
#

i dont like how these tokens are partially predictable

#

they should be completely cryptographically random

#

its as if a discord developer wanted to make a cool token just for fun

winter pasture
#

It is really good actually

boreal iron
winter pasture
#

That’s how they are able to detect token leaks in GitHub and automatically block the key etc

split hazel
#

meh i guess

#

but they should have a signature instead

boreal iron
#

Once a beautiful day discord showed the message something is strange here, please verify your account without any reason

split hazel
#

like a string encoded in b64

sudden geyser
split hazel
#

i know all about signatures

#

the BIOS makes the operating system scan the whole ram for structures containing specific string signatures

quartz kindle
#

no idea why they chose to base64 the string value of the id, instead of the numeric value of it

split hazel
#

bc the locations for these structures are not standardised

quartz kindle
#

then again, a lot of discord is very inefficient

split hazel
#

i noticed

quartz kindle
#

ie guild flags as an array of strings instead of bitfield

split hazel
#

as an os dev this hurts

quartz kindle
#

as a performance nerd this hurts

split hazel
#

but then they would be limited to only 32 flags

quartz kindle
#

nah

modest maple
#

51 flags

split hazel
#

without the need for a "bigint" implementation

boreal iron
split hazel
modest maple
#

JS supports upto 52 bit signed ints

quartz kindle
#

they already use string flags for roles

split hazel
#

not talking about js

#

say someone was using some bad language

quartz kindle
#

string flags >>>>> array of string names

modest maple
#

well no other language has just 32 bits

split hazel
#

why 52

#

there is no processor that has 52 bits

quartz kindle
#

because js uses double precision

modest maple
#

the max sized int you can contain in a f64 without floating point error

quartz kindle
#

53 for matissa 11 for exponent

modest maple
#

This is what Lua does as well

split hazel
#

why are we talking about floats

modest maple
#

make optimising JITS much easier

quartz kindle
#

all numbers in js are floats

hidden gorge
#

No I mean't The Vibe

modest maple
#

because some languages have everything as floats

#

often because its simpler

split hazel
modest maple
#

its more of an optmisation tbh

quartz kindle
#

its simpler to work with, having all numeric values as a single primitive type

split hazel
#

but i mean discord can also just make another bitfield like flags_part_2 if they need more flags

hidden gorge
#

also
How do I make it add a reaction to my embed?

const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const { Color } = require("../../config.js");

module.exports = {
  name: "server",
  aliases: ["sr"],
  description: "```Use this command to find out how to join the FiveM server```",
  usage: "server",
  run: async (client, message, args) => {
    //Start
    message.react(":blurpleverified:887569285537480744");

    const embed = new MessageEmbed()
      .setTitle('FiveM server')
      .setColor(Color)
      .setThumbnail('https://cdn.discordapp.com/attachments/919675664406315028/934924145655959592/FiveM-Logo.png')
      .setDescription(` The Server is not out yet sadly but it will be out soon!  `)
      .setFooter(`Command Requested By ${message.author.username}`)
      .setTimestamp();

    message.channel.send(embed);

    //End
  }
};
#

whoops

modest maple
#

that goes a lil beyond what would be considered reasonable

split hazel
#

floats are a lot slower than ints

sudden geyser
#

now you need to be aware of what flags part 1 and part 2 support

quartz kindle
modest maple
quartz kindle
#

its a bitfield as a string

split hazel
#

in fact the cpu also has a dedicated float processing unit just for floats

modest maple
#

In JS land the JIT is insanely optimised for Floating-point arithmetic

split hazel
#

dont know i wouldnt want to make my flags a float

#

sounds illegal

quartz kindle
#

also, v8 does convert floats do ints internally depending on the situation

split hazel
#

and yes it does depend on the language

quartz kindle
#

for example when doing bitwise

boreal iron
#

my gosh be open for new stuff speedicus

split hazel
#

but an api has to think on the behalf of all languages really

modest maple
#

yes

#

and generally its the case of "does this work with JS"

#

because 99.99999% of the time JS is the special one with the number limitations

quartz kindle
#

but does it blend? that is the question

sudden geyser
split hazel
#

but i'd like to think the new stuff works well

#

with no big caveats

#

(first time using that word)

modest maple
#

I mean, JS having everything being a float isnt a massive caveat / limitation as many think

#

99% of the time your integers are bellow the bounds of a u32

#

99.999% of the time your integers are bellow 52 bits

quartz kindle
#

i made a lib to do bitwise up to 52 bits

#

because bigints are slow

modest maple
#

and 100% of the time its easier to implement a fast runtime assuming one type for something than several types which could be interoperated

modest maple
quartz kindle
#

bigint bitwise is 50x slower than nomal bitwise

#

literally

split hazel
#

and ive never heard bitfields with floats

quartz kindle
#

50 times

split hazel
#

first time hearing about them

modest maple
#

I mean, if you've every used Excel then you have

#

everything numeric is a float in excel unless it explicitly goes beyond the bounds where it becomes a string.

#

but also you're thinking about it as if you're dealing with the floating-point rather than just some whole numbers which internally you can convert to a i64 but not expose that to the user.

boreal iron
split hazel
#

bigints have size restrictions? borrinnggg

#

infiniteint when

quartz kindle
#

lmao

split hazel
#

my terminal just froze

modest maple
#

probably gone beyond the range that a array can hold within memory

split hazel
#

yeah uh bigints are a little slow

quartz kindle
split hazel
#

dont ask me

#

im still considering adding bigints to my os

#

they sound interesting

modest maple
#

dont

#

you have no need to

split hazel
#

do*

#

i want to

boreal iron
#

lol

split hazel
#

32 bit max number is only like 2 million or something

modest maple
#

you also want to implement parts of your OS in assembly for what ever reason

#

doesnt mean you should

split hazel
#

the only reason im making it is to have fun and make things

#

even if theres no use in them

quartz kindle
#

2.3 billion signed

split hazel
#

otherwise i wouldnt be making one

#

not a commercial product just a hackbox

quartz kindle
#

bigints are basically just a multi-part number in a big buffer

split hazel
#

yeah what i thought

quartz kindle
#

they are always good to have

split hazel
#

how does general math work with them

#

surely you need to take every bit into account

quartz kindle
#

its usually broken down in parts

modest maple
#

you dont do it natively on the CPU

split hazel
#

well yeah i know split into parts

modest maple
#

you maintain an array of unsigned 32 bit integers (or signed sometimes)

#

and then apply a cascading arithmetic to the array

split hazel
#

ah its easier to think of them in terms of integers

quartz kindle
#

how large is a "word" in c++?

#

32 or 64bits?

split hazel
#

i think a word (in assembly anyways) is 2 bytes

#

16 bits

#

a dword would be 32 bits

quartz kindle
#

ah

#

v8 uses words for bigints

modest maple
#

thats

#

interesting way of doing that

quartz kindle
#

actually

#

they seem to use uint64

#

but they name it words?

split hazel
# quartz kindle ah

you also accidentally and ironically said the name of a 16 bit cpu register

modest maple
#

lemon_raised_eyebrow thats pretty weird

split hazel
#

or well part of one

split hazel
#

yes

#

actually no thats a byte

quartz kindle
#

i have no idea what those assembly instructions mean

split hazel
boreal iron
#

You never know what the drunk monkeys in the background decide to do

#

Damn that fits on many cases

split hazel
#

also guys when do you think 32 bit machines will be forgotten

#

just like 16 bit machines

modest maple
#

I mean technically they already are starting to

quartz kindle
#

when 64bit becomes faster than 32bit

#

there are still a few situations where 32bit native instructions are faster, afaik

#

its not completely obsolete yet

boreal iron
#

Wait until the timestamp exceeds the limit in a few years and all machines explode KEKW

modest maple
#

technically 32 bit apps also use less memory

quartz kindle
#

that as well

modest maple
#

if it's perticularly pointer heavy

quartz kindle
#

embedded devices should be faster and more efficient as 32bit

split hazel
#

apparently referencing numbers in the biggest chunks (e.g. 64 bit numbers for 64 bit processors) it is faster than if you were to store and process 2-4 byte numbers in memory and in registers

sudden geyser
#

I mean they already

quartz kindle
#

my binary serializer also processes bigints in chunks of 64

split hazel
#

what if the device is 32 bit 😠

#

or dare i say 16 bit

#

running msdos

modest maple
#

well that depends more on memory alignment

quartz kindle
#

then rip the device

split hazel
#

i still dont understand how wrong memory alignment can completely fuck up cpu performance

#

what if you push a 1 byte entry to the stack

#

thats surely gonna fuck up the alignment

quartz kindle
#

because every single operation in the chain would need to realign it?

split hazel
#

but i dont get the need for alignment

#

whats so low level technical about them that makes them so crucial

#

assuming we both have the same understanding of alignment being aligned to a 16x memory address or something

quartz kindle
#

the fastest cpu instructions work in chunks of X bytes right? like SSE AVX etc

split hazel
#

yes in chunks

#

i learnt that the hard way

quartz kindle
#

so you need those chunks to fit the registers perfectly

split hazel
#

with the graphics

quartz kindle
#

so if you have arbitrary data like strings

#

its faster for the string to be padded/aligned so it better fits the size of those registers

split hazel
#

yeah but i heard that if for example a memory address of a location is not divisible by 16 it will screw up performance

#

thats probably waffle now that i think about it

modest maple
#

if you want to be additionally confused this is why alot of the time compilers allocate 1 Bytes for booleans instead of 1 bit

quartz kindle
#

v8 for example aligns everything to 64 bits (or 32 bits for node x86)

split hazel
#

well thats pretty much expected because i dont think you can make memory transfers less than a byte?

quartz kindle
#

if you have a string of 18 characters, like a discord id

#

technically that takes 18 bytes

#

in v8 it takes 24 bytes

#

because its aligned to the next multiple of 8 bytes

#

everything in v8 works like that

#

because if you have fixed block sizes like that, you can easily calculate exact memory sizes and memory bounds

split hazel
#

interesting

#

so you dont waste performance by fetching smaller bytes

quartz kindle
#

yeah its the classic "use more memory to get more performance"

split hazel
#

but then going by that shouldnt c++ store booleans as ints rather than bytes

quartz kindle
#

they do sorto of

#

booleans are uint8

split hazel
#

god cpus are so fucking confusing

#

years of backwards compatibility

modest maple
#

Tim have you observed anything like Rkyv in Rust which are true zero-copy serialization and deserialization framework?

modest maple
#

missing out PepeHands

quartz kindle
#

js cant do that

modest maple
#

true

#

JS weak

quartz kindle
#

instead im focused on how to utilize js in the most efficient ways possible

#

i managed to outperform msgpackr, the self-proclaimed fastest messagepack serializer for js

#

im also experimenting with storing strings as a pseudo utf6 i came up with

#

its slow af for large strings because there is no native api to help, but makes strings about 25% smaller most times

woeful pike
#

couldn't you take the brotli approach to compressing json where you store a local lookup table of the most common occurances like "} or ":"

#

that's specifically crafted for json? but I guess most content isn't repetitive enough for that to make a big difference unlike html or css

quartz kindle
#

actually json as a format is highly compressible already

#

zlib often achieves reductions of 60-70% on typical json strings

#

a streamed zlib with shared context, like what discord uses, manages to reduce up to 90%

woeful pike
#

but zlib isn't aware of context right? Like the reason why brotli beats gzip for web stuff is its specifically for web assets

quartz kindle
#

both are aware, they just work differently

woeful pike
#

I don't know a whole lot about compression so I'm just throwing stuff out there

quartz kindle
#

brotli manages to achieve better results by using more memory and having a bigger context to work with, but its slightly slower than deflate at similar levels

#

for static assets, its recommended to pre-compress them

woeful pike
#

My understanding of brotli was that it comes with its own local lookup table for web specific things to compress without having to attach it to the message itself

#

could be wrong tho

quartz kindle
#

it does have a few premade profiles yes, i believe

#

not sure what these profiles actually contain

woeful pike
#

I tried to implement LZW decompression a while back while making a gif reader but it didn't go too well. I should give it another go sometime

quartz kindle
#

sure, data efficiency is an interesting subject

#

im not much into compression per-se, i think deflate does a pretty good job for my needs

#

im more into json replacement, ie how data is represented before compression comes in

woeful pike
#

yeah I don't think I'm going to invent a revolutionary algorithm people 800x smarter than me haven't already thought of

quartz kindle
#

im working on a binary serializer that is basically a competitor to messagepack

#

which is also a json replacement

#

messagepack is already very efficient, idk why not more people use it as a standard

#

if the entire web got rid of json and started using messagepack instead, everything would be much more efficient

sharp saddle
#

someone knows how works passportjs, express-session, cookieParser?

quartz kindle
#

discord should add messagepack as a format alongside json and etf

modest maple
#

\o/ Synonym support hath been added

sharp saddle
#

I want to program a "redirect to previous page", but I have no idea how it works

#

All lib/authRoutes.js

var express = require('express')
  , session = require('express-session')
  , app = express()
  , router = express.Router()
  , passport = require('passport')
  , Strategy = require('passport-discord').Strategy
  , refresh = require('passport-oauth2-refresh');

  
router.get("/login",passport.authenticate('discord'), function(req, res) {

});
router.get('/callback',
  passport.authenticate('discord', {}), function(req, res) {
    console.log(req.session.redirectTo)
    // req.login();
    res.redirect("/");
  } // auth success
);
router.get('/logout', function(req, res) {
  req.logout();
  res.redirect('/');
});


module.exports = router;```
quartz kindle
#

like when you click the login button, add a header containing the url of the current page

#

then redirect to that url

#

you could even do that in the url itself, plenty of websites do that

sharp saddle
#

can you give an example?

sharp saddle
split hazel
#

i implement that in every login system i make

boreal iron
#

You should not forgot to add and validate an unique token to prevent submit spam

warm swan
#

how to set the guild icon to "None" ?

#

like to edit it

lyric mountain
#

errr...none?

#

wdym?

round cove
#

Probably means remove it.

pulsar bone
#

how to permanently install a pip in replit

dry imp
#

there is no "permanently" in replit cuz replit uses containers and it may resets every some time but you could use poetry add [package] to add it to poetry

pulsar bone
dry imp
#

yea

#

even though i dont get why you need third-party discord components

pulsar bone
#

also help me with this please

pulsar bone
dry imp
#

using third-party components like that is not recommended

#

cuz it will get outdated

pulsar bone
#

ok

#

I will try if it works without discord_components

pulsar bone
dry imp
#

every interaction must provide a response

boreal iron
#

Watching his code again it looks like he placed it in the messageCreate event, regarding the defined trigger

#

Doesn’t make any sense at all

warped venture
#

how do i make it so my bot dms the server owner

boreal iron
#

By fetching the guild owner, then sending a message to him

pulsar bone
boreal iron
#

Let me guess, yes you did?

dry imp
#

^^ on_message in py

boreal iron
#

Ok I see

#

message_create gateway event

spark flint
boreal iron
#

Ew

spark flint
#

i recommend not using @client.event as that stops @client.command()

#
@client.listen("on_message")
async def idk_anything_here(message):```
boreal iron
#

better not use py at all freerealestate

spark flint
#

true

#

i'm ditching py

marble juniper
#

true

spark flint
#

discord.js dance

dry imp
#

or just get good

marble juniper
#

just use js

spark flint
#

i have been converted

marble juniper
#

discord.js v13 ChiakiGasm

spark flint
#

i can't really add slash commands tho because no one using my bot has application.commands setup

marble juniper
#

Tell them to reinvite the bot in the help command

#

Like a little section with a link in it

spark flint
#

or just anytime they use a command say "we are moving to slash commands!"

dry imp
#

but the users will ask why?

spark flint
#

i have message intents

ancient stream
#

If u want to verify a discord bot u need to give a terms of service for the bot, does anyone know what to put in there?

marble juniper
#

Same

boreal iron
spark flint
#

i should make a discord bot tos generator

ancient stream
#

heh?

marble juniper
spark flint
#

and privacy policy

dry imp
#

yes please

#

yes please

marble juniper
#

every existing one assumes that you want to make a tos for some website or mobile app

spark flint
#

yeah

boreal iron
spark flint
#

LMAO

marble juniper
#

and they have pay walls

ancient stream
#

what should i put in the terms of service then

#

for a discord bot

sudden geyser
marble juniper
#

Find some template and edit that with ur own info

dry imp
#

search in google

marble juniper
#

Just writing rules is not enough

dry imp
#

and modify

boreal iron
#

I mean it’s not required to put your own tos in place

ancient stream
dry imp
#

lmao

sudden geyser
#

None of us are lawyers and most templates include a lot of irrelevant info

marble juniper
#

bruh

dry imp
spark flint
#

i'm working on a templat enow

boreal iron
dry imp
#

omg swearing

marble juniper
#

do you even know what terms of service areee

#

lol

ancient stream
dry imp
marble juniper
#

for legal stuff just get a lawyer

#

lol

boreal iron
#

Don’t choose Klay for it

dry imp
#

pretty sure discord wont care anyway

boreal iron
#

Only if you wanna be listed to their app list

#

iirc

marble juniper
#

yeah but you can't just write a tos and say "don't do shit and then I wont to do shit"

sudden geyser
#

since when did everyone in this chat become a lawyer

marble juniper
#

you know what I mean?

sudden geyser
#

what have I done with my 17 years

spark flint
#
XXX ("us" or "we" or "our") owns and operates the XXX Discord Bot ("Bot"). The following Terms of Use (“TOU”) govern your use of the Bot.

Using XXX is at-will and can be terminated at any time by either us or you for any reason. By using XXX, you agree to be bound by the bot's TOS. If you do not agree to be so bound, you are not authorized to use the Bot. This TOS is a legal contract between you and XXX and govern your access to and use of the bot together with any services offered through the bot.

XXX is not affiliated with Discord in any way.

# Usage
The purpose of XXX is to XXXXXXXXXXXXXXXX.

The information supplied by XXX is provided for entertainment and informational purposes only. You agree that you will only use XXX, or data/information provided by it, for its intended purposes, and not for other commercial ventures without first seeking approval from XXX.```
#

there

marble juniper
#

there is also specific wording you need to use

#

etc etc

dry imp
#

ben you are so nice omg

#

i love you

spark flint
#

gonna make a simple site for it

sudden geyser
#

Using XXX is at-will and can be terminated at any time by either us or you for any reason.
Yeah that won't stand any legal procedure

dry imp
#

or copy paste the site aswell

spark flint
sudden geyser
#

That clause will just get you laughed at in court

ancient stream
boreal iron
#

You may should read discords tos

marble juniper
#

look at my bot's tos

#

if you want

ancient stream
dry imp
marble juniper
#

its a bit longer but it works

#

wait a sec

ancient stream
#

sure

boreal iron
#

No ads, no!

spark flint
dry imp
marble juniper
ancient stream
#

ty

marble juniper
#

Lol

#

I got nice markdown formatting as well for it

dry imp
#

thats long

#

lmao

marble juniper
#

ik

dry imp
#

looks cool tho

marble juniper
#

ever seen a short tos on a legit product before

boreal iron
#

Imagine looking at your wall asking yourself where your led panels are gone, looking at the floor and yay there they are

dry imp
#

@marble juniper you wrote the privacy policy by yourself?

boreal iron
#

Not like that’s a big deal

sudden geyser
#

Privacy policies are much easier to write

#

Doesn't need any of that terse grammar

boreal iron
#

There you go

sudden geyser
#

This is mine.

# Privacy Policy

Assistant does not collect data or personal information.
marble juniper
boreal iron
#

That’s just an example

#

To describe witch data you collect and you deal with it

marble juniper
#

I wrote both the tos and privacy policy by myself

#

lol

dry imp
boreal iron
#

And how an user can request a deletion of his data

#

That’s all it needs to contain

sudden geyser
#

Nope. Just Assistant.

boreal iron
#

Klay is plural?

#

Damn fat boy

marble juniper
#

you will need to state any data you collect

#

that includes if you store user settings for your bot in your database for example

boreal iron
#

Actually you don’t need to as long as nobody gets access to it

marble juniper
#

bruh

boreal iron
#

Well that’s the true reality

#

What you should do and what you’re actually doing are two different things

boreal iron
earnest phoenix
#

hey, on node.js it exist pm2, what for python?? to host a bot 24/7 on ubuntu 20.04
anyone knows?

boreal iron
#

Instead of relying on packages, setting the app up as service is the easiest solution

earnest phoenix
#

?

#

what does that mean?

boreal iron
#

pm is a package you can install

earnest phoenix
#

nothing that exist for python?

boreal iron
#

Why shouldn't it work for py?

earnest phoenix
#

idk

#

it says

#

js

#

works it for python?

#

@boreal iron

boreal iron
#

Define pipenv as interpreter in your config

earnest phoenix
#

?

boreal iron
#

Instead of stopping to read after reading the title, go on reading the documentation

earnest phoenix
#

should i install on the vps node.js and python right?

boreal iron
#

It also allows you to pass the interpreter as start parameter as I can see right now

#

--interpreter python

novel jetty
#

Any idea why this fails mid way?

earnest phoenix
#

@boreal iron

#

no python

spark flint
spark flint
#

Just gotta add other option fields and make an export feature

#

Gonna make a click to copy feature and export to url feature

feral aspen
#

I did this horribly, how can I summarize this?

if (sServer.id === interaction.guild.id) {
    embed.addField(`${roles} Roles`, sRoles.map((x, i) => {
        if (i > 10) return;
        i++
        return x
    }).join(" "));
};
earnest phoenix
#

hi

earnest phoenix
pale vessel
#

array.slice()?

earnest phoenix
#

it changes on every loop

pale vessel
#

why are you using that

earnest phoenix
#

yeah you can use array slice too

feral aspen
#

.slice(0, 9)?

neat ingot
#

So i've noticed some bots display a 'loading...' like status when they are first booting. What is the best way to calculate that? Like, what events are fired in between the client logging in, and the client 'ready' event being emitted? (discord.js)

pale vessel
feral aspen
#

Well, that's the method of the day.

#

I appreciate it!

#

Did I do something wrong here?

.addField(`${emoji_guardian} Emojis`, emojis.slice(0, 9).join(" "))

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.

const emojis = sServer.emojis.cache.sort((a, b) => b.position - a.position).map(role => role.toString());
earnest phoenix
#

you can always just

[
  array[0],
  array[1],
  array[2],
  ...
]
feral aspen
#

What do you mean?

earnest phoenix
#

idk

neat ingot
#

😂

feral aspen
#
let user = message.mentions.members.first() || await bot.users.fetch(args[0]);

if (!user) {
    embedError.setDescription("❌ Please specify a user you are wishing to pay!");
    return await message.channel.send({ embeds: [embedError] });
};

I have a quick question, when it comes to like these, how can I handle them? The !user is for the .mentions part, although what about the .fetch(), do I add a .catch()?

cinder patio
#

.catch(() => {});

feral aspen
# cinder patio .catch(() => {});

What about something like this?

let user = message.mentions.members.first() || await bot.users.fetch(args[0]).catch(() => return message.channel.send("Invalid User"));

if (!user) {
    embedError.setDescription("❌ Please specify a user you are wishing to pay!");
    return await message.channel.send({ embeds: [embedError] });
};
boreal iron
cinder patio
#

no point

feral aspen
#

That would silent the error?

cinder patio
#

.catch(() => {}); will make user undefined

#

so then the code inside the if statement will be executed

feral aspen
#

OH, seriously?

#

That was what I wanted in the first first place.

#

I appreciate it!

raw nest
#

I have dockerized my React App and I'm serving the static files from the build with NGINX. But the problem is it gives me a 502 (Bad Gateway) error... I don't know why. I have my docker containers behind a NGINX too but I think it's because of the one in the container

split hazel
#

@boreal iron I gave myself motivation for a job interview

#

no job = cant touch os for a week

boreal iron
split hazel
#

I paid taxes but my job was only temp

boreal iron
#

Yes give that OS a break

split hazel
#

this time it's a permanent

boreal iron
#

Lots of artists doing a break

#

Permanent company troll?

split hazel
#

bruh

quartz kindle
#

a vacation from the dev hell

split hazel
#

lmao

#

thing is im addicted

#

it's like a heroin addiction

#

Once you pop it you can't stop it

boreal iron
split hazel
#

Well in this case run out of things to add

boreal iron
#

I always knew you’re on crack

split hazel
#

nice

boreal iron
#

now we know for sure

split hazel
#

I understand job hunting signals now

#

email = declined phone call = accepted

raw nest
#

I have dockerized my React App and I'm serving the static files from the build with NGINX. But the problem is it gives me a 502 (Bad Gateway) error... I don't know why. I have my docker containers behind a NGINX too but I think it's because of the one in the container

split hazel
#

just to confirm you've exposed the listening port in your docker?

#

don't use docker really

quartz kindle
#

what port is docker running on?

split hazel
#

real men use pm2

quartz kindle
#

^

raw nest
quartz kindle
#

so the main nginx is doing a reverse proxy to port 100?

raw nest
#

yes

quartz kindle
#

and the inner nginx is running on port 3000 and doing a reverse proxy to your react app's port?

raw nest
#

I run "npm run build" in the react app so the nginx just serves the static files from the react build

#

oh my god

#

I'm stupid

quartz kindle
#

lmao

raw nest
#

I had nginx configs in the container pointing to Port 80... xD KEKW

spark flint
edgy hearth
#

is there a way that users can use /vote and then it votes on the website?

solemn latch
#

nope

edgy hearth
#

ok thx

novel jetty
#

How can i generate the tsconfig.json file?

lucid trench
#

i tried interaction.channel.send but it runs the premium cmd too

#

and replies you cant use that

#

defer / followUp dont work either

compact pier
#

how would I solve this :((

quartz kindle
#

fail

sudden geyser
compact pier
wheat mesa
#

It’s not though

compact pier
#

it was my interview question

quartz kindle
#

i would fail that interview as well

wheat mesa
#

Same

compact pier
#

failed

wheat mesa
#

Not sure why that’s even a relevant interview question tbh

#

“proBlEm sOlVing”

compact pier
#

yeah lol

quartz kindle
#

well its those types of questions to see if you can think outside the box and come up with weird solutions to impossible problems

#

but its not like you're being hired to develop complex algorithms lol

compact pier
#

some company just ask those question, but after all my work is just pasting code from stackoverflow KEKW

quartz kindle
#

companies ask these questions from you then put you doing basic html css

#

or excel

sudden geyser
#

algorithms and data structures

compact pier
#

yes

#

right

sudden geyser
#

goes back to writing if else

compact pier
earnest phoenix
compact pier
earnest phoenix
wheat mesa
#

“We judge your abilities by an obscure problem that will never have a real world use and if you cannot solve it, you’re unqualified and useless”

#

Ngl if they declined you for just that then you probably dodged a bullet

quartz kindle
#

im never getting a job at a company anyway

wheat mesa
#

Just work for Tim 😉

compact pier
#

tim startup :D

earnest phoenix
sudden geyser
#

just be a sindre sorhus

quartz kindle
#

and work on a few long term projects

#

that will hopefully make money one day

#

lmao

#

ask fake, he knows about my api

#

that is forever delayed and procrastinated

compact pier
#

@quartz kindle

#

some legend just found it

quartz kindle
#

i googled it

compact pier
earnest phoenix
#

but during the process,its hard to concentrate ,since you are stressed

quartz kindle
#

i can find anything in seconds

compact pier
earnest phoenix
#

tim has its own search engine

wheat mesa
#

Pretty stupid interview question if you ask me

compact pier
#

and there were 4

#

I managed to solve only 1

#

1/4

sudden geyser
#

all interview questions are dumb but that one was especially dumb

#

they applied an actual brain teaser to a job interview

wheat mesa
#

This is the shit my 8th grade algebra teacher would put on the board every Friday I stg

compact pier
#

and the problem is

quartz kindle
#

they work for the joker, who hired the riddler to make the questions

compact pier
#

all 4 for 30min

#

I just got fucked in their office

quartz kindle
#

what were the other 3 questions?

wheat mesa
#

Was it something you had to code a solution to, or was it just “solve the problem”?

sudden geyser
#

No doubt the only people who pass that question already know the answer

compact pier
sudden geyser
#

Since it's very common

compact pier
#

no code

wheat mesa
#

Lmfao

quartz kindle
#

and the job was for programming/dev?

compact pier
wheat mesa
#

“You spent 4 years studying data structures in college? Here’s 4 brain teasers we got from Google in 30 seconds. Have fun!”

sudden geyser
#

You spent 4 years studying data structures in college?
That's just torture.

compact pier
#

I never felt more dumb than today

wheat mesa
#

Personally I’d love to study data structures in college

compact pier
#

me 2

wheat mesa
#

I think algorithms/data structures are really interesting

compact pier
#

yeah

#

specially if you like math

sudden geyser
#

I personally wouldn't want to do it as my driving force

#

In most apps you only use a few basic data types

wheat mesa
#

Do the dirty work other people don’t wanna do 😈

sudden geyser
#

and those special linked list deque etc is just once or twice or because some sleep deprived library dev thought it would be fun to return an immutable set

wheat mesa
#

Lmao

compact pier
#

I guess, I will go back with web backend dev

#

I don't belong to a big brain position

wheat mesa
#

Don’t let an interview bring you down, those are stupid questions anyways

#

You’ll find something else somewhere

compact pier
#

yeah

sudden geyser
#

x to doubt

compact pier
#

I hope so

sudden geyser
#

you find those dumb algorithm and data structure questions everywhere

wheat mesa
#

Yeah but I don’t think I’ve seen something quite as dumb as that though lol

sudden geyser
#

yeah this one was super dumb

#

since it wasn't even a programming question

quartz kindle
#

i dont know exactly what they mean when they say "data structures", but figuring out how to store dynamic data in a buffer is quite interesting, been doing a lot of that lately

#

robin hood hash tables are really smart

wheat mesa
#

I can’t wait until I’m done with high school KEKW

compact pier
#

but I don't think in dev process, there will be a problem like that

#

or stupid like that

wheat mesa
#

Apparently my high school offers a data structures course, which I will gladly be taking

sudden geyser
#

pray it's not in java

wheat mesa
#

It’s in Java

compact pier
wheat mesa
#

All the classes here are in Java

sudden geyser
#

your poor soul

compact pier
#

Java is kinda good, but old

wheat mesa
#

I think it’s a decent choice for a data structures course

#

C# would be better though

compact pier
#

High level programming languages are trendy

sudden geyser
#

I'm taking CSA this year and hate using it

#

especially since it's java 8

wheat mesa
#

Oh yeah they always use outdated Java

sudden geyser
#

and a lot of the recommendations are terrible like using Math.random instead of the Random class

wheat mesa
#

I hate writing out the full types

#

And not just using var

#

Since it doesn’t exist in this version

quartz kindle
wheat mesa
#

Lmao

sudden geyser
#

lol

wheat mesa
#

Java itself isn’t really that bad tbh

#

I just much prefer C#

quartz kindle
#

js best lang

wheat mesa
#

Memory management is something I’m also interested in but neither of those languages really goes too into depth with that

quartz kindle
#

:^)

wheat mesa
#

I’m just excited for the future

#

Seems like it takes ages

lyric mountain
wheat mesa
#

Yes but I meant managing memory manually without a garbage collector

lyric mountain
#

ah

modest maple
#

just use Rust verycool

wheat mesa
#

Rust is cool but it’s still fairly young

sudden geyser
#

Pain.

modest maple
#

I mean it's only really going to get bigger

wheat mesa
#

I think it’ll grow in popularity more and more

lyric mountain
#

then it'll become stainless

modest maple
#

It's stapled itself pretty well into the ecosystem despite stable being only being 6 years old

split hazel
#

pov you use rust

#

can't find a suitable image

#

pov you say typescript is the best and you're not a good developer if you don't use typescript

#

happened btw

split hazel
sudden geyser
#

REST APIs are just operating systems in disguise

#

this is the only safe channel

cinder patio
#

Rust is amazing hashflushed

quartz kindle
#

rust is rusty

spark flint
#

how would i replace all new lines (from a textarea) with <br> with js?

#
- Set channel ID's when the "set-channel" command is run
- Logs server IDs on join and leave```  turns into ```- User ID's when blacklisted - Set channel ID's when the "set-channel" command is run - Logs server IDs on join and leave
#

so i need to replace with <br> because html go brrrrr

vivid fulcrum
#

i'm pretty sure you can do this with just css

#

can't find it

#

right now

#

but i remember there being a way

spark flint
#

it stores in a db like that

#

so if i store with <br>

vivid fulcrum
#

but with js it's just using replace()

lyric mountain
#

Or just replace - with <br>-

vivid fulcrum
#

found the css way, white-space: pre-line;

spark flint
#

ah yeah that worked

#

ty

spark flint
#

?

wheat mesa
#

lmfao my CS teacher wrote some code to mess around with us

#
   public boolean equals(Object other)
   {
     if(other instanceof BankAccount) {
       return ((BankAccount) other).getAccountNumber() == this.accountNumber;
     }
     throw new WhatAreYouDoingException("What are you even doing???");
   }

}

class WhatAreYouDoingException extends RuntimeException {
  public WhatAreYouDoingException(String message) {
    super(message);
  }
}
sudden geyser
#

I wish my CS teacher did that

wheat mesa
#

we have to use replit

#

it's terrible

#

not the worst experience at least though

earnest phoenix
#

I see no issues here

lyric mountain
#

Replit for java?

lyric mountain
sudden geyser
#

usually java 11

lyric mountain
#

Can't imagine how shitty it is to run a java program there

sudden geyser
#

it's better than code studio

#

those replit guys have it much better than we do

cosmic forum
#

Hello, so I am trying to set the font for my site's header to Consolas, and it works on desktop, but when I visit the site on mobile it shows Times New Roman, does anyone know how to fix this?

(Site for reference: https://runs-on.tech/)

lyric mountain
#

Is consolas a default font tho?

#

Try font-family: monospace

lyric mountain
#

Or add consolas as a site asset

cosmic forum
cosmic forum
lyric mountain
#

Setting font family to monospace will pick the first available monospaced font

#

If u want it to use specifically consolas u need to add it as an asset

cosmic forum
#

Okay, thanks!

lyric mountain
#

Yw

earnest phoenix
lyric mountain
#

Doing fine too

#

Recovered from that maven issue?

earnest phoenix
#

What maven issue?

earnest phoenix
#

@lyric mountain Instead of a discord bot i decided ima just make an api mmLol

neat ingot
#

so, if your bot is sharded. do you call client.user.setPresence from each shard, or does your shard manager handle that?

#

tbh, i really should just shard a bot and tinker lol

round cove
#

You call it for each shard afaik

neat ingot
#

yea seems to be that way from my basic tinkering 🙂

split hazel
#

they don't check them manually

#

if you can't do it via stripe then you can't verify

neat ingot
#

if i use client.channels.fetch(some_id), would this return a channel object from a channel handled by another shard? it seems like it does, but i figured i'd ask incase anyone knows for sure 🙂

#

like, it'd make sense that it does, and i feel dumb for asking... but yea...

lyric mountain
#

why are u ternary'ing a boolean?

#

also couldn't u pass the message id as a function argument?

quartz kindle
#

the api doesnt care about shards

#

any shard can fetch anything

drifting coral
#

my account's verified and still im not able to fill the application

spark flint
#

Add tags

#

On the application page

drifting coral
#

how do I do that

#

there's no option for adding tags

drifting coral
#

i got it

#

finally

#

thank you

earnest phoenix
#

hi how much is the message delete limit?

pale vessel
#

If you mean bulk delete it's 100

slender thistle
#

$2/message

hybrid cargo
#

:cringe:

earnest phoenix
#

or just so many stipulations that I can’t delete more than 100 at a time

wheat mesa
cinder patio
#

Why is next.js middleware so weird? Why are they ran in a different runtime? questions that will never be answered

neat ingot
crystal wigeon
#

hi um. is absolute import not supported anymore in typescript?

#

like short imports. something like
import x from "../abc" -> import x from "abc"
I even set the baseUrl in my tsconfig file and this seems to be working on windows but not on mac

hybrid roost
#

How to check if bot on the server by ID? I using D.JS

boreal iron
#

Probably by fetching the guild member object using the user ID

#

Your bot needs to be in the guild, too

hybrid roost
#

no, I have a guild ID and I need to find out if the bot is present on this server

#

I solved it by fetching all guilds

(await bot.guilds.fetch()).has(req.query.id)
boreal iron
#

Guilds are usually cached even if they’re unavailable

quartz kindle
boreal iron
#

Fetching with a no access error will tell you your bot isn’t in the guild

crystal wigeon
#

i see

quartz kindle
#

its better to always use relative paths if you're looking for local files and not modules installed by some packager

crystal wigeon
#

it gets messy tho when you have deep imports tho right?

cinder patio
#

Are you using react>

crystal wigeon
#

like src/abc/xyz/foo/bar

#

nop typescript

cinder patio
#

I mean typescript

crystal wigeon
#

nodejs ts app

cinder patio
#

use the paths option

crystal wigeon
#

yeah tried that, doesnt work on mac/ubuntu

#

it works on windows for some odd reason

boreal iron
cinder patio
#

uuuh I highly doubt such a feature wouldn't work on macos

#

there's nothing platform dependent about it

#

try restarting VSCode

crystal wigeon
#

ye thats the weird part

#

welp

compact pier
#

I think web3 is kinda usefull for user auth

bright thorn
#
    let channel = client.misc.get(message.guild.id, "t2channel");
      channel.send({
        embeds: [
          new MessageEmbed()
            .setColor(client.settings.embed_color)
            .setDescription(`Team \`${args[1]}\` has been accepted For : ${Reason}`),
        ],
      });

channel.send is not a function

compact pier
#

it is isn't a thing

bright thorn
#

enamp data map

compact pier
#

how u store it?

bright thorn
#
let channel =
      message.guild.channels.cache.find((c) => c.id === args[0])
client.misc.set(message.guild.id, channel.id,"t2channel");```
civic scroll
#

misc ig here is a custom predefined property

compact pier
#

that isn't the map syntax

civic scroll
#

using a custom object

compact pier
#

and you can use client.channels.find(a => a.name === "t2channel")

bright thorn
#

if i will do console. log to channel then i can see id too

compact pier
civic scroll
#

that api is deprecated iirc

compact pier
civic scroll
#

what id

compact pier
civic scroll
#

<misc.set(string guild, string channel, string name)>

civic scroll
#

you can't access the collection directly

compact pier
#

oh really?

civic scroll
#

that's v12 way

compact pier
civic scroll
#

i already mentioned them lol

compact pier
#

nvm

civic scroll
#

moment

compact pier
civic scroll
#

it will work.

#

i already said that it's a custom-defined object

#

what if

compact pier
civic scroll
# compact pier
<Misc> ....
 set(guildId: string, channelId: string, channelName: string) {
    // ... some custom 
    <map>.set(`${guildId}-${channelId}`, channelName);
}
compact pier
#

dude it dones't save the "b"

civic scroll
#

man you don't know what a preprocessor is do you

civic scroll
compact pier
#

.-.

#

bro

#

but the .set(a, b, c) doesn't come from js

civic scroll
#

it comes from js

compact pier
#

you can't pass 3 var in .set() function

civic scroll
#

in fact i can make it take 12 parameters and it still takes the thing

civic scroll
compact pier
#

look bro

civic scroll
#

wait

#

let me type an example in console

#

gimme a moment

compact pier
civic scroll
#

chả xàm

#

bạn non

compact pier
#

nó đâu có sẵn trong js đâu

#

phải tự code

civic scroll
#

i just said that it was "custom code"

compact pier
civic scroll
#

dude did you even read

compact pier
#

but is kinda anoying

#

everytime you want to set something

civic scroll
#

you do once

compact pier
#

you need to write more code

#

just do with objects

#
{
a: "a"
b: "b"
}
#

simple

civic scroll
#

not every time that works

#

remember, when you pass an object like that, it has to create new instances of Object in heap

#

so it's not very efficient

compact pier
#

hmm

civic scroll
#

there are many turnarounds

#

but in case of inheritance you can just extend it with new methods

compact pier
#

and what is with 1002020?

civic scroll
#

or override

#

random sequence of number idk

compact pier
#

lol

#

I don't even know why u need it

civic scroll
#

to test data duh

compact pier
#

yeah

civic scroll
#

unless you wanna store undefined

#

💀

compact pier
#

wait u can't store undefined?

civic scroll
#

the question is, why do you even bother to do that

#

undefined is not a valid key

#

so is null

boreal iron
#

Damn I really wanted to see a mud fight

compact pier
warm sphinx
#

how can i verify the bot?

boreal iron
#

Heading to the discord developer portal, select your app and there you go.

#

It has to be in at least 75 guilds before a verification is possible

tribal crow
#

idk if this counts as development, but i need ideas for my economy bot

sudden geyser
#

You haven't given us much info about your bot as well

lament rock
#

is there a way to refresh an interaction? I want to edit something past 15min and I still want to use the webhook part of interactions, otherwise I'd have to check permissions

boreal iron
#

I don’t think so

#

How about a button interaction after 15 min to have a new interaction?
Or isn’t that a thing for u?

lament rock
#

That's not a thing

#

the user has to trigger an interaction

#

even buttons expire after 15min

eternal osprey
#

How do i find the general/main chat of a server in sjd v12?

#

djs*

lament rock
#

the old way used to be looking for the channel with the system messages flag

sudden geyser
#

There's no clear way to get the default channel in a server

#

Of course, you can try and match names, but it's unreliable.

#

It would involve looking in a guild's channels.cache and .findind channels that equal the name (e.g. chan => ["chit-chat", "main", "core", ...].some((c) => c.includes(chan.name)))

lament rock
#

on new guilds, the default channel has the system messages flag

#

but names are probably better because permissions

eternal osprey
#

Hmm yeah sounds awesome. Thanks boys!

#

Or girls ofc

boreal iron
#

I mean I don’t actually know what’s your purpose

#

So I can just assume wildly

wheat mesa
boreal iron
#

Nostalgia

lament rock
#

as in, I reply to a command interaction

boreal iron
#

Oh you wanna reply with a webhook after 15 min

lament rock
#

editReply after 15min

#

but yeah same logic

boreal iron
#

Nope without a button interaction on your already existing response you can’t edit it

#

Only an user can trigger it after 15 min once again

lament rock
#

son of a bitch

boreal iron
#

But you can edit the webhook like a normal message?!

#

That’s what I do.

lament rock
#

the webhook path takes interaction token

#

the token expires after 15min

boreal iron
#

Yes you need to send a message to the channel or update your already sent webhook

#

(that should at least work iirc)

lament rock
#

I'm a little bit lost trying to put your words into logic

boreal iron
#

I see

lament rock
#

so, say 14min after the user interacts, I send a followUp message and then just edit that?

boreal iron
#

Yee

#

If deferred no issue here

lament rock
#

the followup message routes in that instance would still take the interaction token which would be expired

boreal iron
#

Yeah it needs to be a normal message to the channel after 15 min, it can’t be a followup message anymore

#

Yes the webhook token is expired

lament rock
#

Then that would mean I'd have to check perms if I want to send embeds indiscriminately

boreal iron
#

Im not aware of a way to keep it active for longer

boreal iron
lament rock
#

Yeah. Webhooks are totally exempt from message related permissions

boreal iron
#

Oh how stupid am I…

#

I thought at least things like embeds would still require the associated permission

lament rock
#

Nope. The point of application commands is to be as stateless as possible

modest maple
#

nah, webhooks are basically the, "Look at me... I am the captin now." of the message world

boreal iron
#

Yeah

#

You grant that permission then when authorizing slash commands for your app

lament rock
#

My database has so many reads and writes related to roles and permissions, I'm surprised it hasn't exploded

boreal iron
#

lol

#

It would be nice if you could send pings to the API to expand that 15 min expiration then

lament rock
#

ikr

#

What I can do is just stop editing and then just say that a new interaction needs to be sent and then assign that to the queue

boreal iron
#

The better question is why do you even need to edit the followup msg after 15 min

#

Why do you need to be different!!?

lament rock
#

I edit it every 5 seconds to show a progess bar

boreal iron
#

you and your special use cases

#

Guess you gotta switch to common message handling then

earnest phoenix
boreal iron
#

Without webhooks

solemn latch
#

is this something any user can do?
wont that contribute to global ratelimits rather quickly?

lament rock
#

Well. I have to do something to stand out otherwise

embed

NOW PLAYING: WHO ASKED FT (NOBODY)
NaN min NaN sec

is just generic. It's easy, but generic

earnest phoenix
#

whats the max time of a gif?
60 secs?

boreal iron
#

Aha I see API abuse, you devil

lament rock
solemn latch
#

I dont think gifs have a max length do they? 👀

boreal iron
#

No but probably a max size the uploaded has to accept

lament rock
#

patch message requests are per channel anyways

solemn latch
earnest phoenix
#

since you could just use a gif to animate a progressbar

lament rock
#

500 active at once

#

No cluster will hit that

earnest phoenix
lyric mountain
#

Or cut the progbar into 10 sections

#

Maybe 5

#

And update every 20% or so

lament rock
#

I tried to do gif encoding, but that would be WAY too slow

lyric mountain
#

?

#

I do gif encoding a lot on my bot, didn't see any slowness on response

#

I mean, as long as u optimize the gif

earnest phoenix
boreal iron
#

Well you’re basically fucked and cant use webhooks here if you it takes longer than 15 min

#

That’s how it is

lament rock