#development

1 messages · Page 2054 of 1

lyric mountain
#

easiest way would be something like```cpp
int[] bytes = ...;
char[] b64 = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'
};

str::string output = "";
for (int i = 0; i < bytes.length; i++) {
output += b64[bytes[i]];
}

return output;

or something like that idk
#

probably not the best solution, or a valid cpp code but whatever

split hazel
#

converting it to base64 shouldnt be too big of an issue

#

the issue is actually generating the key and importing a key from a base64 string

#

as well as exporting it to one

lyric mountain
#

generate a sequence of bytes and just encode into b64

split hazel
#

yeah but even if i could do that i still need to import it to openssl to be able to do anything with it

#

and i dont think you can just do that the keys need to add up to something mathematically

lyric mountain
#

just reverse the encoding at the other side

quartz kindle
#

c++ doesnt have a built in base64 converter?

lyric mountain
#

idk, cpp is usually very barebones

quartz kindle
#

cpp has a shit ton of standard libs tho

slow terrace
#

anyone can help?

split hazel
#

it has a ton of bloat no one realistically uses but it doesnt have any actual useful functions

lyric mountain
#

cpp is bing of programming world

safe harness
#

what are all the run commands? like i know node . and npm start for nodejs

lyric mountain
#

depends on what ur using

quartz kindle
#

all the run commands from where? like all the node commands? all the npm commands?

safe harness
#

cuz im trying to get my music bot to work cuz whenever u executed help or any commands it just crashes

split hazel
#

openssl really only has examples for loading and exporting to a file but thats useless in my case

lyric mountain
split hazel
#

my backup going insane solution is exporting it to a file then loading it in openssl using a function

quartz kindle
lyric mountain
#

no, I mean, export the file contents as a string instead of saving to a file

quartz kindle
#

slow internet, etc

safe harness
# quartz kindle then fix the errors

i get none from when they execute but now when im trying to start my bot i get
`node .
internal/modules/cjs/loader.js:818
throw err;
^

Error: Cannot find module 'node:events'
Require stack:

  • /home/runner/SeMusicMe11/node_modules/discord.js/src/client/BaseClient.js
  • /home/runner/SeMusicMe11/node_modules/discord.js/src/index.js
  • /home/runner/SeMusicMe11/node_modules/discord-player/dist/Player.js
  • /home/runner/SeMusicMe11/node_modules/discord-player/dist/index.js
  • /home/runner/SeMusicMe11/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/SeMusicMe11/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/runner/SeMusicMe11/node_modules/discord.js/src/client/BaseClient.js',
    '/home/runner/SeMusicMe11/node_modules/discord.js/src/index.js',
    '/home/runner/SeMusicMe11/node_modules/discord-player/dist/Player.js',
    '/home/runner/SeMusicMe11/node_modules/discord-player/dist/index.js',
    '/home/runner/SeMusicMe11/main.js'
    ]
    }`
#

thats what i get when i rtun my bot

quartz kindle
#

does heroku show you how much cpu/ram your bot is using? check if you're not using too much

slow terrace
lyric mountain
lyric mountain
#

or that

slow terrace
#

The bot i mean

safe harness
lyric mountain
safe harness
quartz kindle
lyric mountain
safe harness
#

well i had node 17

quartz kindle
#

had or have?

safe harness
#

had

quartz kindle
#

and what do you have now?

slow terrace
lyric mountain
#

internet is the least of ur worries

quartz kindle
#

btw the code you showed does not show you using the registerPlayerEvents function

#

did you use it somewhere?

safe harness
#

i have the run script in my package .json

quartz kindle
safe harness
slow terrace
#

I forgot to send it

quartz kindle
#

the damn thing wont run because your node version is outdated

#

thats why im asking what version do you have

#

you have something, but its outdated

safe harness
#

none i delted it and its still at node 17 i just said that

quartz kindle
#

sigh...

#

where are you hosting?

safe harness
#

so i cant get any nodes f my bot wont start

#

replit

quartz kindle
#

thats your problem

#

replit's node version is outdated

safe harness
#

i do the coding in there and then i put it onto a server

quartz kindle
#

go to the replit shell and type node -v

lyric mountain
slow terrace
lyric mountain
#

or connect remotely using vscode/intelij/whatever

slow terrace
#

So i should use vps or another host?

lyric mountain
#

but usually people underestimate how expensive is making a music bot

#

I based my assumption on that

quartz kindle
slow terrace
lyric mountain
#

tim wtf

green kestrel
lyric mountain
#

same source images, default settings, apparently same quality, 80% size reduction

#

wtf did google put into webp?

quartz kindle
#

png is lossless, webp is lossy

#

its not that the webp is super small, its the png thats stupid big

#

if you convert it to jpg you will see similar size reduction

lyric mountain
#

ik, but jpeg yeets alpha

#

I didn't know webp was THAT smaller than png

#

I'll start using it from now on

quartz kindle
#

webp is similar to jpg

#

just slightly more efficient

lyric mountain
#

how did they manage to keep alpha?

#

does it use a mask?

quartz kindle
#

idk

#

WebP's lossy compression algorithm is based on the intra-frame coding of the VP8 video format[21] and the Resource Interchange File Format (RIFF) as a container format.[2] As such, it is a block-based transformation scheme with eight bits of color depth and a luminance–chrominance model with chroma subsampling by a ratio of 1:2 (YCbCr 4:2:0).[22] Without further content, the mandatory RIFF container has an overhead of only twenty bytes, though it can also hold additional metadata.[2] The side length of WebP images is limited to 16,383 pixels.

lyric mountain
#

I didn't understand a thing but it sounds techy

safe harness
#

well got my bot to turn on but running help crashes it

quartz kindle
#

fix it then

safe harness
#

how the hell can i fix it when im not getting a specific error

lyric mountain
#

are u muting exceptions?

safe harness
#

`/home/runner/SeMusic231231/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Invalid Form Body
components[1].components[0].emoji.id: Invalid emoji
at RequestHandler.execute (/home/runner/SeMusic231231/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/runner/SeMusic231231/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async TextChannel.send (/home/runner/SeMusic231231/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.j`

#

thats all im getting

lyric mountain
#

components[1].components[0].emoji.id: Invalid emoji

unreal olive
#

Can any one give me mongo uri

lyric mountain
#

no?

unreal olive
#

;(

#

😫 sadboyhours

lyric mountain
#

oh tf

rose warren
#

Are you just expecting someone to give you their database? 👀

unreal olive
#

Thanks

lyric mountain
#

fk google adsense lmao

unreal olive
#

I just need to mongo uri site link tha ks

winter pasture
#

mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]

rose warren
#

||Oh I forgot we're Google mb freerealestate||

winter pasture
#

From the docs above lol

unreal olive
earnest phoenix
spark flint
#

happened again 😔

acoustic reef
#

csgocock

spark flint
#

yea

#

flagged because csgo

earnest phoenix
#

i found it in someone project :)

lyric mountain
earnest phoenix
#
{
  "name": "fs",
  "version": "0.0.1-security",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/npm/security-holder.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/npm/security-holder/issues"
  },
  "homepage": "https://github.com/npm/security-holder#readme"
}
#

is this really a fs source code ?

#
# Security holding package

This package name is not currently in use, but was formerly occupied
by another package. To avoid malicious use, npm is hanging on to the
package name, but loosely, and we'll probably give it to you if you
want it.

You may adopt this package by contacting support@npmjs.com and
requesting the name.
vivid fulcrum
#

no

#

the fs source code (and the source code of any other built-in module) is located in the nodejs repository

spark flint
#

Unavailable guild count: 1

#

for my test bot in one guild

round cove
#

shadow banned

earnest phoenix
#

hi, how do i use this bot.channels.cache.get("id").send("Message") sending an embed and not a normal message?

quartz kindle
#

does this look stupid?

#

.date.date.date

#

lol

spark flint
#

lmo

#

lmao

quartz kindle
#

idk what other names to use

#

the first date is to separate it from other non date things like location

#

the second date is for a date object made from year month day etc, and not a fixed time like timestamp

#

the third date is the actual values in an array of [year, month, day, hours, etc]

sick agate
quartz kindle
#

jdut = julian day in universal time
jdet = julian day in ephemeris time

sick agate
#

Oh

sick agate
#

But uh yeah no idea to replace it

quartz kindle
#

well i want suggestions

#

lmao

#

maybe the first one could be time

sick agate
#

Idk

quartz kindle
#

but idk, { date, location, options } looks better than { time, location, options }

sick agate
#

I think you can delete the second date

#

And do it time

quartz kindle
sick agate
#

Welp

quartz kindle
split hazel
#

updated my most ever difficult project attempts list

  1. ||openssl||
  2. trying to implement ACPI shutdown in my os
sick agate
split hazel
#

is impossible

#

its like the c source code all over again

#

except it makes your code look like it

#

which is even worse

#

the command line openssl might look very nice and intuitive but dont be fooled

sick agate
#

I don't think openssl cli looks nice

split hazel
#

COMPARED TO C YEA

#

i need to change my avatar

#

i dont feel serious with it

sick agate
#

...

quartz kindle
#

how about this

#

@earnest phoenix

sick agate
earnest phoenix
#

sure

#

if i use client
using new discord client
it says discord is not defined

wheat mesa
#

Show your code

earnest phoenix
quartz kindle
#

please learn js lol

#

that code is completely broken

#

you tried doing two different things in the same command and both are broken

#

what do you want that command to do? this or this?

#

chose one and delete the other

lyric mountain
#

given the run: I imagine he copied a python code

quartz kindle
#

nah that run should have been inside the module.exports brackets

#

but they just dont have any knowledge of js

earnest phoenix
#

without the function

#

100% good

quartz kindle
#

what function

earnest phoenix
#

the thing

#

for the send message in the channel

#

it's not broken it works

quartz kindle
#

you fixed it then because the code you showed is completely broken

earnest phoenix
#

that's old photo

quartz kindle
#

then why you show old photo?

#

cant help if you show old code

earnest phoenix
#

my bad

#

i fixed

rigid maple
split hazel
#

ALL IT FUCKING TOOK IN OPENSSL

#

it doesnt look like much but the documentation is scarce

#

it even kindly converted it to base64 for me

lyric mountain
#

Tf are those 4-word variables?

nocturne dagger
#
client.on('messageReactionAdd', async (reaction, user) => {

This is only firing on recent messages, older ones are not triggering this?

#

v 12

#

Does anyone know how to fix this?

lyric mountain
#

yes, update d.js

quartz kindle
#

thats for discord.js v13, but its the same concept for v12

sharp geyser
#

So this seems a bit off, as I know it is missing some of that stuff but a lot of it is still there

#
        const lowercaseCount = pass.match(/[a-z]{2,}/g).length ?? 0;
        const uppercaseCount = pass.match(/[a-z]{2,}/g).length ?? 0;
        const numericCount = pass.match(/[0-9]{2,}/g).length ?? 0;
        const specialCount = pass.match(/[\d\w\s]{2,}/g).length ?? 0;

        if (!(lowercaseCount >= 2))
            errors.push(
                'Password should contain at least 2 lower cased characters',
            );
        if (!(uppercaseCount >= 2))
            errors.push(
                'Password should  contain at least 2 upper cased characters',
            );
        if (!(numericCount >= 2))
            errors.push(
                'Password should contain at least 2 numeric characters',
            );
        if (!(specialCount >= 2))
            errors.push(
                'Password should contain at least 2 special characters e.g !, &, @',
            );
earnest phoenix
sharp geyser
#

Don't even ask me bro someone gave me that and I just went with it

#

😔

#

It makes no sense but 🤷‍♀️

earnest phoenix
#

The length property will always be present if it matches, the match will be null if it doesn't match so you probably meant to put ?.length ?? 0

sharp geyser
#

Ah

#

I didn't know match returned null

earnest phoenix
#

Also about the conditions, why not just count < 2

sharp geyser
#

👀

#

I feel stupid now

#

Actually no

#

checking if it is less makes no sense

earnest phoenix
#

You're negating the returned boolean from the comparison, so checking if it's less would be the exact equal value

sharp geyser
#

Mmm true true

#

Also this matching is turning out to be wrong

#

I am logging the counts from the matching's length and it is returning 1 in places where it should be more unless I am wrong about how match works

earnest phoenix
#

Yeah, because you have count capture clauses ({...,...}), you just remove them

sharp geyser
#

5jA12ajj input

#

1 1 1 1 output

#

this is the length of those lowercaseCount, uppercaseCount, numericCount and symbolCount in order

earnest phoenix
#

You're checking if the same type of characters match back-to-back in a row, not at any position

winter pasture
#

The double spaces is killing me WHYYYYYYYYY

sharp geyser
#

How would I do it so it is in any position tehn

#

regex is not my strong point

sharp geyser
earnest phoenix
#

You just remove the character count capture clauses (that's a mouthful)

sharp geyser
#

Wdym

earnest phoenix
#

{...,...}

sharp geyser
#

Isn't that needed tho?

earnest phoenix
#

Having that there is interpreted as matching them back-to-back, not at any position

#

For example, [a-z]{2} would match ab1 but not a1b

sharp geyser
#

Also just realized I have 2 lowercase regexes

earnest phoenix
#

Misty who wrote this hellscape of a validation procedure

sharp geyser
#

I wrote some of it, but I got a good bit of it from a repo I found that did what I wanted

#

Volty if you have a better idea I am all ears

earnest phoenix
#

I was expecting you to say StackOverflow

sharp geyser
#

nah

earnest phoenix
sharp geyser
#

Oh

#

I see

#

Well I got it working but I noticed that my symbol regex doesn't cover things like [ and ]

earnest phoenix
sharp geyser
#

I can remove symbols then

#

What do you recommend to use when hashing passwords?

#

I usually just use argon2

#

but idk if there is something that is better to use

lyric mountain
sharp geyser
#

Fuck passwords just have a recovery phrase

lyric mountain
#

add a recovery phrase recovery phrase

#

just to be safe

sharp geyser
#

and to get the recovery phrase of the recovery phrase you need to verify your phone number

split hazel
#

then you need to solve the quadratic formula

sharp geyser
#

and to verify your phone number you need to verify your email

earnest phoenix
#

And also solve world hunger

split hazel
#

after that you need to become an rsa algorithm and decrypt the password on paper

sharp geyser
#

Still mad about that speedy?

earnest phoenix
split hazel
sharp geyser
#

Honestly do we even need passwords anymore?

split hazel
#

voltrex is greedy and won't send me the nodejs crypto source code

sharp geyser
#

👀

quartz kindle
#

just go to the node repo

split hazel
#

permission denied

quartz kindle
#

node's crypto is a mess anyway

sharp geyser
#

just make your own speedy

quartz kindle
#

doesnt even support raw keys

split hazel
#

I can imagine since it uses openssl

earnest phoenix
split hazel
#

bruh

#

that's basically null

sharp geyser
#

Speedy already has that on lock

#

gotta make it harder for speedy voltrex

earnest phoenix
split hazel
#

anyways I found a better library called libtomcrypt which is much easier and isn't as high level as crypto++ which uses weird data structures to input and output data

lyric mountain
#

like, each time u need to change it just append a new section

split hazel
#

you can also make it use a faster math library

sharp geyser
#

I will just use randomly generated passwords

#

ez

split hazel
#

also does node crypto support contexts?

quartz kindle
#

@earnest phoenixpls implement raw ED25519 keys

earnest phoenix
quartz kindle
#

i already made a workaround for this, but its fugly :^)

earnest phoenix
split hazel
#

they're kinda like prepared structures

#

that have the keys already in binary form and other stuff pre configured

#

which speed things up a lot

#

It goes deeper than that but that's the general gist

#

openssl supports them

split hazel
#

anyways what rsa algorithm do you guys recommend for network traffic

quartz kindle
quartz kindle
sharp geyser
#

So I guess ima just stick with argon2 for hashing my passwords

split hazel
#

is pkc(8?) oas good?

#

don't remember the names

split hazel
#

I reinvent the wheel

earnest phoenix
split hazel
#

says that while he uses tcp

#

since when do algorithms have curves 😳

#

I need to catch up on crypto I'm completely lost

quartz kindle
#

discord webhook interactions are signed with ed25519 and they give you the raw key to use with sodium/libsodium

#

but to use it with node crypto you need an extra workaround

split hazel
#

node gyp time?

quartz kindle
#

nah the workaround is ez

#

just fugly

split hazel
#

yea but is it fast

#

that's what I thought

#

you'll never know if you don't compare

quartz kindle
#

it is faster than calling native code probably

split hazel
#

what if the data is like 1gb

quartz kindle
#

its just for instantiation

#
crypto.createPublicKey({
  key: Buffer.concat([Buffer.from("MCowBQYDK2VwAyEA", "base64"), Buffer.from(RAW_KEY_FROM_DISCORD, "hex")]),
  format: "der",
  type: "spki"
});
#

when it could have been ```js
crypto.createPublicKey({
key: RAW_KEY_FROM_DISCORD,
format: "raw",
type: "spki"
});

split hazel
#

you're the type of guy to write a physical letter to someone and include a signed verification key to make sure the letter wasn't tampered with

quartz kindle
#

lmao nah

#

i dont care much about security tbh

#

this is just discord's requirements

split hazel
#

that's actually a great idea

#

signing isn't only for electronics

quartz kindle
#

there are people who use PGP on their emails

#

i dont care about that

split hazel
#

adding that to my email rn

quartz kindle
#

lmao

split hazel
#

actually I think I already have a similar algorithm enabled on it

quartz kindle
#

host it inside TOR as well

#

and freenet

split hazel
#

it signs the whole email with a special key which is available on the domains DNS server

quartz kindle
#

and i2p

split hazel
#

so if you're verifying it you need to fetch the key from the dns txt record and compare it with the signed key

split hazel
#

that's apparently a thing now

#

kind of

#

web3 is basically dead now

earnest phoenix
#

Soon we'll see a new "web version" every minute just like a new JavaScript framework being made every minute

quartz kindle
#

nobody's talking about web3 anymore because crypto is crashing like crazy

slender thistle
#

What a surprise

#

... not

quartz kindle
#

@split hazelwhat exactly happened to you with oracle again?

#

i just tried to sign up and similar shit happened i think

#

it literally accepted the card verification, i got charged and refunded, it said verification was successful

#

then i clicked "start free trial" and it errored with "unable to process transaction"

#

@_@

sharp geyser
#

What is the point of doing return !!somethingThatEquatesToBool

quartz kindle
#

like Boolean(something)

sharp geyser
#

Ah

#

So it isn't very useful if the value is guaranteed to be a bool?

quartz kindle
#

nop

sharp geyser
#

Gotcha

sharp geyser
#

Anyone notice the problem? Bit of context, this is what gets saved to the session on login

wheat mesa
#

Yeah, what the fuck is that password

sharp geyser
#

It is a hashed password

#

Which shouldn't be in the content being saved to the session

#

I love ts

wheat mesa
#

Why does it look like that

sharp geyser
#

I tell it to Omit the password from the returned data and yet it still gives it back

sharp geyser
#

Which I am likely changing to bcrypt soon

sharp geyser
#

Mmm I could yea

wheat mesa
sharp geyser
#

but ts already has a thing for omitting data from something that gets returned

#

I just gotta use it properly it seems

quartz kindle
#

the omit thing from ts is only for types

#

not for actual data

sharp geyser
#

Mmm I swore it could be used that way

#

I remember using it in a way similar to that fashion I might be a bit wrong on the context tho

wheat mesa
#

You could make a function on your User class that returns a copy of all of the data but with the password set to null

sharp geyser
#

Deleting the password from the object works fine enough

dense patio
#

hey guys, i've got a slash command that sends a message with some buttons, and i've got a collector that collects those interactions. all works fine there, but i'm trying to edit the interaction when the collector ends, nothing i've tried has worked:

buttonCollector.on(`end`, async interaction => {
    buttonCollector.stop();
    interaction.update({ embed: [endEmbed] })
// "interaction" is an empty collection so this doesn't work
});

this is discord.js

wheat mesa
#

because interaction is not an Interaction object

dense patio
#

is there a way for me to edit the interaction?

wheat mesa
#

Just edit the interaction that you pass in from your run function?

dense patio
#

so i did try that actually

#

it would say "Message options is not an object."

tepid canyon
#

interaction.editReply() assuming you've either deferred or replied already before the collector

dense patio
#

not a function

wheat mesa
#

Can you show more of your code? It's difficult to play the guessing game

dense patio
#

yeah i'll try to get the important bits

tepid canyon
#

I'd try on the "end" event async something else, like async i and then try the interaction.editReply().

wheat mesa
#

async collected

#

(It doesn't matter what you name it technically, but collected would be the proper name for this here)

dense patio
#
async run(message) {
  const embed = new Discord.MessageEmbed()
    .setTitle(`cool title`);

  const row = new Discord.MessageActionRow()
    .addComponents(
       new Discord.MessageButton()
        .setCustomId(`info`)
        .setLabel(`Info`)
        .setEmoji(`📰`)
        .setStyle(`PRIMARY`)
    );

    await message.send({ embeds: [embed], components: [row] });
    await message.defer();

    const buttonCollector = message.channel.createMessageComponentCollector({ componentType: `BUTTON`, time: 1000 });

    buttonCollector.on(`collect`, async interaction => {
       await interaction.update({ embeds: [embed], components: [row] })
    });

    buttonCollector.on(`end`, async (collected, reason) => {
      buttonCollector.stop();
      // area of inquiry
    });
}
#

essentially this is what's going on

wheat mesa
#

There's a lot of things wrong with this from what I'm looking at

#

Ok that edit explains a few things

#

Just to point a few others out:
message.defer() is not a real thing
You don't need to do buttonCollector.stop() when the collector ends

dense patio
#

ok and ok

#

i actually don't know why i had that second part now that you mention it

quartz kindle
#

also, you're creating a collector on the channel, not on the message

#

meaning it will collect interactions from buttons on any message

dense patio
#

yeah it wouldn't work any way i tried on the message

#

in my actual code i've got actual custom ids

#

to avoid that issue

tepid canyon
#

someVar.createMessageComponentCollector(...)```should narrow it down to that specific message
dense patio
#

someVar would be a bool in that

tepid canyon
#

someVar would be the message sent in the message.send()

dense patio
#

i would think but i tried and it just said "true"

wheat mesa
#

<Message>.send() returns Promise<Message>

#

If you await it, you'll have the Message object that corresponds to the message you sent.

dense patio
wheat mesa
#

¯_(ツ)_/¯

#

I can tell you for a fact that it returns a message

#

So either you're looking at the wrong thing or there's some weird bug with your ide

#

Or it's somehow implicitly converting to bool

dense patio
#

message is the slash command interaction that the user sends

wheat mesa
#

Well that seems like a confusing name scheme

dense patio
#

makes sense to me so i use it

#

is that where the problem lies?

tepid canyon
#

no naming shouldn't necessarily be what is making your thing return a bool.

#

If this is a slash command, you should be using .reply(), not .send() as that isn't a function

dense patio
#

and you're saying that would return the message, allowing me to edit it afterwards?

tepid canyon
#

It would return an interaction which you can then edit

dense patio
wheat mesa
#

Are you sure message is what you think it is?

quartz kindle
#

where are you even getting that .send() from? the only thing that has .send besides channels is webhook and interactionwebhook

#

are you using discord.js v13?

#

show where you use the run function

dense patio
dense patio
quartz kindle
#

show where you use the run function

dense patio
#

wdym where

dense patio
tepid canyon
#

where you execute command.run() or the similar

wheat mesa
#

He means your command handler

#

Show that

sharp geyser
#

This seems interesting

dense patio
sharp geyser
#

👀

#

But whey

quartz kindle
#

that explains it lol

#

why do you use that?

sharp geyser
#

It's so easy to make your own handler

dense patio
#

it's what i used in v12

#

didn't realize it'd cause issues over here in v13

sharp geyser
#

Honestly I'd recommend making your own handler

quartz kindle
#

its not that it causes issues

#

is that all this time we are thinking you are using discord.js functions but you are not

dense patio
#

i see

sharp geyser
#

^

dense patio
#

so i'm looking at the source of this and interaction.send does return true

sharp geyser
#

That was a poor design feature on that guys part imo

#

I see no reason to return a bool

quartz kindle
#

This will return a boolean if it's an initial response, otherwise a Message will be returned.

#

if you want to use that, then use that

#

but dont mix it up with discord.js

#

for example

#

use that instead of discord.js collectors

#

and that

#

and any other thing you need

dense patio
#

alright that clears it up

#

thanks for the help

wheat mesa
#

I'm disappointed in rust for not having an easy way to make a compile time constant hashmap

slender thistle
#

Skill issue!

sharp geyser
wheat mesa
#

I had to use a dependency :C

sharp geyser
#

L

wheat mesa
#

funny thing is that this dep is made exactly for what I'm using it for

sonic lodge
wheat mesa
slender thistle
#

Huh I see

wheat mesa
#

man there's so many little things that make you appreciate rust ```rs
let text = &self.input[self.start..self.current];
if let Some(kw_type) = KEYWORD_MAP.get(text).cloned() {
self.add_token(kw_type);
} else {
self.add_token(TokenType::Identifier(text.to_string()))
}

#

(Although I still don't like the fact that you have to convert between &str and String so much)

slender thistle
#

Hahahaha

wheat mesa
#

wonderful, it works

#

lexer is almost complete

#

very nice to use a language where my code works first try

sharp geyser
#

👀

#

Waffle don't lie

#

I saw you struggle with something for an hour

wheat mesa
#

Which thing

#

I can't remember

split hazel
# quartz kindle <@374695375287746581>what exactly happened to you with oracle again?

I don't usually put my real billing address on websites and turns out fucking oracle matches the billing address on your card from the bank to the one on your account and so it said "billing address doesn't match try again" and then it kicked me out and when I tried to verify again I always get "card declined" and oracle support won't comment on why

#

I have another card to do it on but like don't need it right now

split hazel
#

can you verify again?

split hazel
#

i think i know what i'll use for my encryption

#

since rsa is very slow the initial handshake will exchange pub and priv keys

#

but the only purpose for RSA is to generate an AES key and exchange it

#

since AES is 10000x faster than rsa

unreal olive
#

Do u have lavalink

#

Anyone

#

24/7 lavalink

slender thistle
#

No

eternal osprey
#

hey is there any way to set a mp4 video as embed image?

sacred aurora
#

convert it to gif?

sick agate
#

Makes senss

#

But you lose voice and time slider

fervent moss
#

How does topgg vote remainders works?

boreal iron
#

They notice when you press the vote button, start a 12h timeout which sends you a message on discord.

fervent moss
dry imp
#

they send you browser notification 12 hrs after voting

fervent moss
#

Hmm...ic thanks

spark flint
#

i have an array like json [ { "id":"serverid", "name":"servername" }, { "id":"serverid", "name":"servername" }, { "id":"serverid", "name":"servername" } ] which returns servers my bot is in

#

and i have an array like

#
[
  {
    "id":"serverid",
    "name":"servername"
  },
  {
    "id":"serverid",
    "name":"servername"
  },
  {
    "id":"serverid",
    "name":"servername"
  }
]``` which retusn the servers the logged in user is in
#

how can I check if the 2nd array contains server IDs from the top one

earnest phoenix
spark flint
#
<% guilds.forEach(function(guild) { %>
      <% if (botGuilds.some(botguild => botguild.id === guild.id)) { %>
            //blah blah html
       <% } else { %>
        //blah blah html
<% }) %>```
#

thats what i'm doing but it returns the else bit every time

earnest phoenix
#

Hmm, maybe try logging both of botguild.id and guild.id and see if they're the expected values?

spark flint
earnest phoenix
spark flint
#

ah alr

#

ty

#

ah

#

ok fixed

#

but now its slow to load

#

nvm fixed

#

tyty

earnest phoenix
#

You're welcome

pine nova
#

💀

solemn latch
#

🤔 how do I convert a discord color integer to hex?

#

nvm, I'm being silly

#

color.toString(16)
that simple ^_^

near stratus
solemn latch
#

ah

quartz kindle
#

color.toString(16).padStart(6, "0")

solemn latch
#

I think that's the opposite of what I want, role colors with 0 are supposed to be white right?
color === 0 ? "FFF" : color.toString(16)

#

or do you have a sneaky way of handling that too?

#

(sneaky as in better)

pale vessel
#

light theme was default at some point

#

so black is what it's supposed to be

quartz kindle
#

i mean from a purely conversion standpoint, converting between hex and int is super easy if 0 is black, if you make it the other way around then you need "correct" it

#

which would defeat the purpose of having a more efficient color format in the first place

solemn latch
#

on light mode it seems to be the same color

quartz kindle
#

yeah apparently you cannot use black

#

i just tried to make a role #000000 and i couldnt

#

but if i make it #000001 i can

#

so discord has 0 reserved for "no color" basically

solemn latch
#

which seems to just be light grey

#

#b2b2b2 or something

quartz kindle
#

something like that i guess

#

2b or not 2b

#

that is the question

proven lantern
#

is it possible that discord will invoke our interaction url twice for one command?

earnest phoenix
proven lantern
lyric mountain
#

it's white on dark theme and black on light theme

solemn latch
lyric mountain
#

that's only on color selector

solemn latch
#

ah

split hazel
#

is this valid base64?

#

the amount of slashes in a row makes me feel nervous

sick agate
#

Try too decode it and see

earnest phoenix
vivid fulcrum
#

you can recognize b64 by trailing equal signs

split hazel
#

im confused with the diffiehellman algorithm

#

its supposed to be an algorithm where you generate a secret without interception which can be used for another algorithm such as AES

#

oh wait

#

idk i just trust its secure

lyric mountain
#

why exactly do u have 2 of the same variable

pine nova
#

💀

#

o wait u mean client and server decleration or diffie ones?

lyric mountain
#

the former

pine nova
#

o

lyric mountain
#

although even the latter is exactly the same

split hazel
#

because its a test

#

apparently if the client and server insert the opposite sides public key into the mechanism the secret will come out the same for both

quartz kindle
#

@split hazel

#

lets see if its gonna work this time lmao

split hazel
#

GOOD FOR YOU TIM

wicked pivot
#
                    console.log(info.guilds.length)
                    let row = []
                    for (i = 0; i < info.guilds.length; i = i + 25) {
                        let components = []
                        for (let a = 0; a < 25; a++) {
                            let options = []
                            if (info.guilds[i + a] !== undefined) {
                                options.push({label: info.guilds[i+a].name, description:'members : ' + info.guilds[i+a].member_count + ' / channel: ' + info.guilds[i+a].channels.length, value: info.guilds[i+a].id})
                            }
                            if (a == 24) {
                                let select = new MessageSelectMenu()
                                .setCustomId(info.user.id + '|guild-select')
                                .setPlaceholder('Nothing selected')
                                .setMaxValues(1)
                                .addOptions(options)
                                components.push(select)
                            }
                        }
                        console.log(components)
                        row.push(new MessageActionRow().addComponents(components))
                    }```

7
[
MessageSelectMenu {
type: 'SELECT_MENU',
customId: '835931865126273054|guild-select',
placeholder: 'Nothing selected',
minValues: null,
maxValues: 1,
options: [],
disabled: false
}
]```

I don't understand why it doesn't add the options

quartz kindle
split hazel
#

lol its fine i can use a second card just cant be bothered to do it now

#

they legit banned my card 💀 and wont tell me why

spark flint
#

i deffo didnt steal topgg docs site but

#

wtf happened here

quartz kindle
split hazel
#

why do businesses still use oracle

#

maybe because its cheaper

#

this company needs to reach near bankrupcy

quartz kindle
split hazel
#

nah this has to be on purpose

quartz kindle
#

maybe they did figure out that their ampere vps are stupid cheap for what they offer and regret offering in the first place

#

but the marketing team decided it would be a better PR move to blame technical issues

#

than to backtrack on their offer

#

lmao

split hazel
#

💀

#

by the way do you happen to know diffe hellman

quartz kindle
#

nop

lyric mountain
split hazel
#

crypto is actual 💀

#

is it because its not worth it migrating 💀

lyric mountain
#

nope, it's because they don't adventure outside of their confortable zones

#

oracle is old 'n """"""trusty"""""", so they stick to it

#

actually the entire mindset is "old = reliable and matured"

#

I'm lucky my boss is tech-happy, can't imagine the pain that is working for someone who fear new techs

#

we also get a table-wide mousepad at work mmLol

quartz kindle
#

my crypto portfolio is down like 50% lmao

#

compared to 2 months ago

wheat mesa
#

everything is down like 50% compared to 2 months ago

split hazel
#

and ayo im actually starting to learn openssl

#

after suffering with it for hours

quartz kindle
#

(ik you meant everything crypto, im just trolling)

wheat mesa
#

the real question though, is brazil's currency up or is the euro down 😉

split hazel
#

brazil has the real currency

lyric mountain
quartz kindle
#

bagnaro

#

pursenaro

#

pouchnaro

quartz kindle
#

so hcaptcha just spammed me with 10 pages of "select all boats" or "select all busses"

#

then gave me this

royal portal
#

bad internet

quartz kindle
#

bad mcdonalds

sharp geyser
#

So how does sending shards to the gateway work?

#

As an example, if you wanted to split the connection between three shards, you'd use the following values for shard for each connection: [0, 3], [1, 3], and [2, 3]. Note that only the first shard ([0, 3]) would receive DMs.
this part here is a bit confusing

lyric mountain
#

shard 0 is the main shard

#

so any non-guild event is received by it

sharp geyser
#

Mmmm

lyric mountain
#

[x,y] x is the shard's id, y is the max count

sharp geyser
#

So am I supposed to increment the id each time a shard is spawned?

lyric mountain
#

ye, no two shards can have the same id

sharp geyser
#

This makes sense tbh

quartz kindle
#

its not just incrementing, you need to make a list and control whether specific ids have already been used or not

#

so you dont get accidental overlaps

sharp geyser
#

Yea

#

I plan on making a collection of already spawned shards

#

and checking against that collection first

split hazel
#

dms should really be made so they're distributed equally to all shards

#

what if you have a dm only bot

lyric mountain
#

but how would it know which shard to receive the dm?

quartz kindle
#

modulo the dm channel id

#

or the user id

boreal iron
quartz kindle
#

but i guess their "data driven statistics" say that dms are very rare

lyric mountain
#

tf

sharp geyser
#

Sharding is very confusing

#

👀

lyric mountain
#

my "dm redirection driven statistics" say otherwise

#

I get about 3-4 simps per day

sharp geyser
#

lmao

quartz kindle
#

lmao

split hazel
#

and

#

i have conquered openssl

#

apparently its easier than those wrapper libraries for it lol

#

you just need to get used to the quirky way it does things and commonly used functions

#

and lastly UNDERSTAND THE ALGORITHM YOU ARE TRYING TO USE

#

in my case i have learnt that for the diffie hellman algorithm both the client and recipient need to negotiate a public "prime number" and "generator number" where they then exchange their public keys where you then generate the secret which if the math is correct both clients will have the same secret which you can then use to establish an AES encrypted connection

quartz kindle
#

@split hazel oracle finally worked lmao

#

running bechmarks rn

#

as i expected, disk speeds are attrocious

#

oracle disks

#

hetzner disks

split hazel
#

they understood your persistence

quartz kindle
#

in the end it only worked with a brazilian address and a brazilian card

split hazel
#

not even joking

quartz kindle
#

ikr

boreal iron
#

Probably

quartz kindle
#

cpu is pretty good tho

split hazel
#

just dont use a database and you'll be fine

quartz kindle
#

4 arm cores

split hazel
#

going to release speedydb memory edition

quartz kindle
#

2 epyc cores (hetzner)

boreal iron
quartz kindle
#

free

split hazel
#

if they ban my second card 💀

boreal iron
#

Proves that you get what you payed for

quartz kindle
#

but it has 24gb ram

split hazel
#

i actually need that

#

i do some machine learning and its not very ram friendly

boreal iron
quartz kindle
#

oracle (left, free), hetzner (right, paid)

split hazel
#

test the ram speeds

quartz kindle
#

trying another benchmark script rn

#

some benchmark scripts dont work on aarch64

split hazel
#

ive noticed the ram speeds vary a lot between hosts

quartz kindle
split hazel
#

did you say arch linux

quartz kindle
#

arm 64

#

for some reason its identified as aarch64, ie arm architecture 64

split hazel
#

are these ram speeds?

quartz kindle
#

disk

boreal iron
#

Oh those are arm processors?

quartz kindle
#

ye

boreal iron
#

Eww

split hazel
#

do ram speeds or else

#

map a part of the ram to a virtual mount point and do a disk speed test on it

quartz kindle
#

its doing network tests rn

#

takes a while

quartz kindle
split hazel
#

dont think so

quartz kindle
sharp geyser
#

I am so hungry rn

#

might go make a sandwich

quartz kindle
#

hetzner's network is more stable, but limited to 1gbps

#

oracle's network seems to have higher limits, but less stability (and no ipv6)

boreal iron
quartz kindle
#

ye

boreal iron
#

But 1gbit is also the guaranteed minimum

quartz kindle
#

ye i rather have that stability

boreal iron
#

While other providers often have like 100 or 200 Mbit

quartz kindle
#

and nothing beats hetzner's ssds

#

and my api does a lot of greps =X

boreal iron
#

Yeah those nvme drives are damn good

#

And I had a lot of drives over the years reaching their tbw limit without smart errors

lyric mountain
#

nvme is basically ssd 2

boreal iron
#

But I usually contact the support to replace them if I hit the limit

#

Which is always for free

quartz kindle
boreal iron
#

And 24/7 available when writing a support ticket or calling the datacenter directly

quartz kindle
#

as expected, epyc wins in single core performance

boreal iron
#

Which you can do as customer

quartz kindle
#

but its 2 cores vs 4 cores

boreal iron
#

Yes but the epic processors aren’t that bad

#

Also the next big upgrade shouldn’t be far away

#

With newer CPUs as there was a sell-off for the amd servers weeks ago

quartz kindle
#

will existing accounts also benefit from it and be upgraded?

boreal iron
#

No

quartz kindle
#

rip then

boreal iron
#

Server owners can switch to other servers with newer hardware

quartz kindle
#

for free?

boreal iron
#

There are basically 5 transfer options

#

A few are for free when upgrading

quartz kindle
#

btw im talking about vps, not dedi

boreal iron
#

Oh

wooden ember
#

*spawns in updated hardware*

#

lol

quartz kindle
#

anyways im pretty impressed with oracle, but im still gonna use hetzner for production

#

probably gonna slap a minecraft server on oracle and thats it

#

now i need to learn how to use this crappy oracle linux

#

which uses yum

#

for some reason debian was not even an option in their image selection

boreal iron
#

I think new hardware options will be available when selecting your server as you still can choose between intel and amd

quartz kindle
#

yum has a nicer ui than apt, i'll give you that

wooden ember
#

anyone know whats causing this?

#

trying to install the node package rtl-sdr

#

and its just spamming errors when it installs

#

hasnt been updated in like 5 years so thats probably it

boreal iron
radiant kraken
boreal iron
#

Which seems to be work in progress

wooden ember
#

welp guess i cant use that then

austere surge
#

activate windows

wooden ember
#

no.

austere surge
#

yes

quartz kindle
#

lmao

solemn latch
#

its so cheap to activate windows 👀

radiant kraken
#

ToObject now requires the v8::Localv8::Context parameter

wooden ember
#

im not giving money to anyone just to activate an operating system i dont want

solemn latch
#

I bought 4 windows keys for $13

wooden ember
#

lol

wooden ember
#

cant game on that

quartz kindle
wooden ember
#

cuz batle eye

quartz kindle
#

🏴‍☠️

austere surge
#

why play games with battleye

wooden ember
#

cuz i like playing them?

austere surge
#

cringe

spark flint
#

With activation servers

solemn latch
#

👀

radiant kraken
austere surge
#

nonono

solemn latch
wooden ember
#

its also free if i just dont bother doing anything

boreal iron
radiant kraken
#

GitHub

spark flint
#

It’s legit and not pirating

austere surge
#

epic

boreal iron
spark flint
#

It uses Activation servers, which are basically network licenses

radiant kraken
#

How to activate windows for free:

  1. Select the linux distro you want to use
  2. Install it on your system
quartz kindle
#

since it eliminates the need for custom activation servers

spark flint
#

Ah ok

quartz kindle
#

but the activation servers method is still required for office

sharp geyser
#

What would be the easiest way to handle gateway rate limits for my lib?

boreal iron
#

MS has started to deactivate a lot of licenses registered to the wrong country

#

And to send out lawsuits

#

As I read

#

Im still not worried in any way but some people got fucked up

#

Oh …

#

Internet gone?!

#

Hello?

sharp geyser
#

Looks like your internet trashed out FakE

quartz kindle
#

lel

#

went through a tunnel?

boreal iron
#

No

#

I went through my country

#

Im missing the word terrible

sharp geyser
#

Bad country?

boreal iron
#

Bad is not bad enough

quartz kindle
#

whats your country? hungary?

#

romania?

#

albania?

#

:^)

boreal iron
#

Those are all far ahead

quartz kindle
#

zimbabwe

boreal iron
#

Even lot of African provinces are

#

lol

quartz kindle
#

lmao

sharp geyser
#

So how should I handle rate limits with the discord gateway

#

or should I just let the user handle em mmLol

quartz kindle
#

the limit is 120 reqs per minute per shard

sharp geyser
#

So as long as they hit 119 I should warn them?

quartz kindle
#

so you can start a timer on first request and count requests

#

either queue them or reject them

sharp geyser
#

Do you think a queue would be better here?

quartz kindle
#

reject as in, return error / promise.reject

#

a queue would make it invisible to the user, ie the user will never know if the limit is being hit or not

#

easier to use, less control

sharp geyser
#

Ah, that is a fair point

wooden ember
#

anyone know how to detect when a bot stops playing sound over the vc?

#

im sure its my internet causing it but the sound will drop out

#

and i have to disconnect it and reconnect it again

#

is there a way to do this automatically

solemn latch
#

I think it'll depend,
what parts actually failing?
audio in, and the audio player both should be restart-able without disconnecting and reconnecting.

wooden ember
#

my code is pretty crude since im just passing through an audeo stream from the mice jack on my server to discord

#

i dont get any errors come up and usually just telling the bot to leave and come back fixes it once i had to compleatly restart the bot but idk

solemn latch
#

I dont think the audio player throws errors, it just emits it on the error event.

#

Its possible your audio player is erroring from time to time and you've just never noticed

wooden ember
#

this is the code ```js
if (command === "mic") {
if (playing == true )return msg.channel.send("music is already playing").catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
playing = true
const play = createAudioPlayer();
const channel = msg.member.voice.channel;
if (!channel) return msg.channel.send("join a vc you mong").catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
Join = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator
});
msg.channel.send("starting audio link...").catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
let micStream = mic.startRecording();
const resource = createAudioResource(micStream);
try {
msg.channel.send("Joining channel...").catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
Join.subscribe(play);
play.play(resource);
msg.channel.send("Playing! do '-stopmic' to stop the bot from playing").catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
} catch (error) {
console.log(error)
msg.channel.send({ content: error.message || "Error" }).catch(e => console.log(chalk.red('[ERROR]:')+ could not send message: ${e}));
}
}

#

as you can see theres not much going on functionally so i dont see what would cause it to disconnect silently but remain in the chat

lyric mountain
#

tf this formatting

wooden ember
#

its the "i copy pasted it into discord and it broke everything so i just redid it in like 5 seconds"

#

"and also i dont have a 1080p screen so idk what it looks like when its not textwraped"

#

but eh doesnt matter

#

anyway in need sleep cuz its 1;30am and ive not had sleep since like 17 hours ago

boreal iron
#

Not to mention how embeds look on mobile

#

thanks discord for nothing

lyric mountain
quartz kindle
#

whats better java 17 or java 1.8?

#

rather whats the difference

wheat mesa
#

java 1.8 is a thing..?

quartz kindle
#

idk

#

im guessing i need this

#

for minecraft?

sharp geyser
#

Can someone explain this code snippet from djs

  async createShards() {
    // If we don't have any shards to handle, return
    if (!this.shardQueue.size) return false;

    const [shard] = this.shardQueue;

    this.shardQueue.delete(shard);
#

I get the first part but the last two makes 0 sense

#

especially sense they delete the shard from the queue and then use shard right after

wheat mesa
sharp geyser
boreal iron
#

The fact that you’re installing a jre on the system makes me nervous

quartz kindle
#

how else can i run a minecraft server

boreal iron
#

Omg Tim

#

Im loosing all my hope

austere surge
#

minecraft topggSunglasses

sharp geyser
#

I don't remember ever needing to install a jre on my system to run a mc server

boreal iron
wheat mesa
#

You can’t run Java without the JVM

boreal iron
#

The headless server needs a JRE, yes

#

Even I know that

sharp geyser
boreal iron
#

"dingus"

#

I need to remember that smirk

#

I like it

sharp geyser
#

in the case of djs shardQueue is a Set

#

does this just get the first item in the set and then delete it?

quartz kindle
#

yes

sharp geyser
#

But then, why do they continue to use shard after deletion?

quartz kindle
#

shard is the shard they took out of the queue

sharp geyser
#

So they take it out, then delete it but it is still saved to the local variable

quartz kindle
#

yes

sharp geyser
#

if (!this.shardQueue.hasNextItem()) return false;
this.shardQueue.hasNextItem() is returning false even tho it does have a next item

#
    hasNextItem(): boolean {
        return !!this.items[1];
    }
#

this is what hasNextItem does

wheat mesa
#

me when misty copies my queue structure I sent him

wheat mesa
#

totally not stolen from some website online

sharp geyser
#

Half my lib's code is stolen from djs rn ngl

#

the sharding shit was confusing so I basically copied the code but used the queue instead of a set

#

But that hasNextItem is returning false when the array is not empty

#

then again I get why now since it is indexing 1 and the item is at 0

quartz kindle
sharp geyser
#

an array of items?

#

to clarify

#

It will take on any type that is passed to ShardQueue<T>

#

I should probably rename it to Queue later as I can use it for more than just shards but still, if I do const shardQueue = new ShardQueue<WebsocketShard> then this.items will be an array of WebSocket shard

#

In reality in my use case hasNextItem isn't doing what it should be as if there is only 1 shard added to the queue to be processed then it should get that item which it doesn't cause it is indexing 1 which is non existent until I add more than 1 shard

wooden ember
shadow void
#

Hi all
Is there a way of having a bot that is "bound" to my discord account and not a particular server?
I'd like to have a bot that I could use across all servers Im member in (saving some messages to Notion).
I know about self-bots but since those are illegal is there another way to achieve this?

slender thistle
#

Impossible

#

Bots are bound to bot accounts, which are then invited to servers. Other ways are a) using a self-bot; b) using a modified Discord client

shadow void
#

Understood. Thanks @slender thistle
Although I'm not happy with this answer 🙂

slender thistle
#

😆

split hazel
#

something to think about: once quantum computers have enough qbits they will likely be able to crack modern encryption ciphers in minutes

boreal iron
#

Already possible

#

Not even sha256 isn’t save

split hazel
#

:o

#

is the nsa spying on us

boreal iron
#

Is this a secret to anybody anymore?

split hazel
#

guess i'll just have to use AES2048 wont i

#

(it doesnt exist)

boreal iron
#

Sad that the 3 founders of … ehm was it called truecrypt?! disappeared magically

slender thistle
#

Is {} a true value in JS?

boreal iron
#

Those guys had managed to merch 3 different encryption variants together into one technically being undecryptable with our current technology

#

An empty object is true, yeah I think so

#

But I can fucking remember the name anymore

slender thistle
boreal iron
#

As soon as things got public all three canceled their work on the project and disappeared from the public

sick agate
wicked pivot
#
                    console.log(info.guilds.length)
                    let row = []
                    for (i = 0; i < info.guilds.length; i = i + 25) {
                        let components = []
                        for (let a = 0; a < 25; a++) {
                            let options = []
                            if (info.guilds[i + a] !== undefined) {
                                options.push({label: info.guilds[i+a].name, description:'members : ' + info.guilds[i+a].member_count + ' / channel: ' + info.guilds[i+a].channels.length, value: info.guilds[i+a].id})
                            }
                            if (a == 24) {
                                let select = new MessageSelectMenu()
                                .setCustomId(info.user.id + '|guild-select')
                                .setPlaceholder('Nothing selected')
                                .setMaxValues(1)
                                .addOptions(options)
                                components.push(select)
                            }
                        }
                        console.log(components)
                        row.push(new MessageActionRow().addComponents(components))
                    }```

7
[
MessageSelectMenu {
type: 'SELECT_MENU',
customId: '835931865126273054|guild-select',
placeholder: 'Nothing selected',
minValues: null,
maxValues: 1,
options: [],
disabled: false
}
]```

I don't understand why it doesn't add the options

earnest phoenix
boreal iron
#

You know something is wrong if your entire mobile screen is a link

spark flint
#

lol

#

thank youtube for those long ass links

#

got it returning song title

#

i can see the url in logs (long and has my ip so not resending) but no play 😔

earnest phoenix
wicked pivot
#
                            if (info.guilds[i + a] !== undefined) {
                                console.log(info.guilds[i+a])
                                options.push({label: info.guilds[i+a].name, description:'members : ' + info.guilds[i+a].member_count + ' / channel: ' + info.guilds[i+a].channels.length, value: info.guilds[i+a].id})
                            }```what I don't understand is that when I console log here, it returns me what I need
tepid canyon
#

The .addOptions doesn't take an array, at least I think depending on the version you're using. It takes rest parameters, like

  label: "some-label",
  description: "desc",
},
{
  label: "something",
  description: "sample",
})```
earnest phoenix
wicked pivot
split hazel
#

@earnest phoenix why is crypto.createCipher() deprecated?

#

crypto.createCipheriv isnt but the aes-128-ecb mode does not need the IV but the non-deprecated function requires it

earnest phoenix
#

Although I'm unsure about that requirement you mentioned

quartz kindle
split hazel
#

maybe i fucked something else up

split hazel
#

since discord could be spying on our messages heres my public key

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnMsBpla3KJgce7Fn+omO
b1JNyGnxIXV0y9iLlnPA34lkiky89ma9J03mGBrIq2ThWav1mg8QgvNTm71kOI9M
kqi9iFjl7b94VEoSa6O5VCXxh7SQfKRtz95j/uO0FSdLxG9eRTMGTbN1USu5/c33
Bv4gOPfCC6F2A4v2uTDm2D3gssoFyclJiUhZvSZIdqjF7CKlWrj9AOfBjUXhI1o6
D1HOlGF7kOztJ7J73l75QiTl1tGD+IqHkC62y8kciWALHaJEwtcZZ+APzHw0RMAZ
cHEofLW7vYKqOT9p9UotWEQQFBF4+Wuluucvz/+Nz0Q4gr8YeCEQI5CdQq3SP6u0
8QIDAQAB
-----END PUBLIC KEY-----```
#

if you wish to talk to me from now on encrypt your message with my public key and send yours too so i can reply

earnest phoenix
round cove
#

"I need your priv key so we can talk privately"

solemn latch
#

That's a bot right there, send a message, bot deletes and encrypts it and sends that.

Useless, sure. But a fun hour long project

boreal iron
rigid maple
#

Hey! I want to use addTopic function in TwitchPS but i am encountering an error

TwitchPS -- 16.06.2022 14:59:54 -- in _connect() --  { type: 'RESPONSE', error: 'ERR_BADAUTH', nonce: '0hq7977bw' }
{
  origin: 'addTopic()',
  error: 'ERR_BADAUTH',
  topic: 'channel-points-channel-v1.233802615'
}

my usage

await TwitchPS.addTopic([{ topic: 'channel-points-channel-v1.233802615', token: "nkuaf7ur3trg7ju37md1y3u5p52s3q" }]) //that was changed
#

When adding a topic, should I enter the token that starts with oauth: in the token part, or is it the "Bearer" token I get by making a request to the twitch api?

earnest phoenix
rigid maple
#

thanks

slender thistle
#

Is there a way to work with cookies in React without making the frontend do SSR?