#development

1 messages · Page 2003 of 1

austere surge
#

ö

split hazel
#

Bro when I found out react native effectively ported css to android for styling i cried

#

css succckkkssssss

cinder patio
#

what would you rather use?

#

guessed so

simple stump
#

Is it possible to generate an avatar URL that is a png or jpg? The URL always returns a webp format which the API I'm using can't utilize.

sudden geyser
#

If you're referring to Discord just change the extension in the URL

#

Supports png and jpeg

#

And gif if it's one

quartz hill
#

I have a bot (waifu bot). This bot only has one of each character. I wrote another similar bot. In this bot, every character is infinite (finite in their rarity. S rarity 5 A 100 B 1000 etc. ). Now this bot is against the 7th rule(same bot rule)? Then I'll delete my first bot.

modest maple
split hazel
#

bros taking a piss

split hazel
#

guess I'll go back to flutter 💀

earnest phoenix
#
const raisonTicket = interaction.values[0];
client.db.query(`SELECT * FROM "${raisonTicket}" WHERE user = ?`, interaction.user.id, function(err, result){```
i think isn't this method to import raisonTicket into my request
but how ?please
boreal iron
#

errr wtf

#

When using prepared statements, then please consistently anywhere

#

client.db.query(`SELECT * FROM ? WHERE user = ?`, [interaction.values[0], interaction.user.id],

modest maple
#

What is a "raisonTicket"

modest maple
#

Nice try though

boreal iron
#

if that's actually your table

rocky hearth
#

Can I change the username for npm?

modest maple
#

You can only use placeholders for filter values generally

#

Generally to deter people from doing what you're doing

#

Why are your tables dynamic like that?

boreal iron
#

errr yeah fake stupidly answered without thinking

#

🤦‍♂️

earnest phoenix
modest maple
#

?????? What

spark flint
boreal iron
#

what chilli wants to know

earnest phoenix
#

I only do what is asked of me

boreal iron
#

is raisonTicket your actual table name?

earnest phoenix
#

nop

#

const raisonTicket = interaction.values[0];

#

is a select menu

#

with multiples values

boreal iron
#

FROM expects your table or database.table

earnest phoenix
boreal iron
#

nop

So it is your table name... wtf

earnest phoenix
#

yes but i think "${raisonTicket}" is not the correct method

earnest phoenix
boreal iron
#

Yeah it must be table name

earnest phoenix
#

yes

earnest phoenix
#

but my request is not corerct but idk where

boreal iron
#

Just log interaction.values[0] to see what is shows

earnest phoenix
#

ok

boreal iron
#

or raisonTicket

#

doesn't matter which one

earnest phoenix
#

Basically, I'm doing a ticket system and the user has to select the reason from a multi-select menu. For each reason, the value to identify it is the same as the table name in the database

#

@boreal iron

#

So on this point it works

cinder patio
#

why are you storing different ticket reasons in separate tables?

boreal iron
#

Yeah I got that but make sure raisonTicket is the right table name

earnest phoenix
#

Ask that to the project manager, I don't know, he asks me to develop a bot

earnest phoenix
cinder patio
#

No, you have to tell him that it's wrong

earnest phoenix
#

but I'll be sure to tell him

cinder patio
#

Did he write out the specifications for you? Did he explicitly say to have a different table for each different reason?

earnest phoenix
#

He created the database

#

I just take care of the bot

cinder patio
#

well tell him that it's not a good practice

boreal iron
#

What the actual error you get?

earnest phoenix
#

I agree with you but the problem still persists.

#

@earnest phoenix, تو نمیتونی ازین گها بخوری

#

?

#

english pls

earnest phoenix
boreal iron
#

Remove the brackets

earnest phoenix
#

ok

cinder patio
#

double quotes*

boreal iron
#

xD

#

lol yeah

#

wrong word

earnest phoenix
#

here I struggled minutes for this damn problem.. thank you very much!

#

@boreal iron, تو نمیتونی ازین گها بخوری

#

@earnest phoenix, تو نمیتونی ازین گها بخوری

boreal iron
#

english broken today

earnest phoenix
#

stop arabic

#

ENGLISH ONLY HERE

boreal iron
#

@solemn latch

#

better don't translate it

earnest phoenix
#

@boreal iron, تو نمیتونی ازین گها بخوری

#

@solemn latch, تو نمیتونی ازین گها بخوری

cinder patio
#

Lmao "You cannot eat this sometimes"

solemn latch
#

o

boreal iron
#

there we go

solemn latch
#

is it a bot

earnest phoenix
#

ye

#

i think

#

@earnest phoenix, تو نمیتونی ازین گها بخوری

#

lol

solemn latch
#

strange

boreal iron
#

I

#

me

solemn latch
#

@earnest phoenix

boreal iron
#

think

earnest phoenix
#

test

solemn latch
#

🤔

earnest phoenix
#

not a bot

boreal iron
#

hmm weird

solemn latch
#

it acts like a bot

earnest phoenix
#

i a troll

#

i th ink

#

no

boreal iron
#

anyways

earnest phoenix
#

...

solemn latch
#

awh

earnest phoenix
#

i'm sry

boreal iron
#

Did you remove the quotes?

earnest phoenix
#

here I struggled 20 minutes for this damn problem.. thank you very much!

boreal iron
#

Those quotes aren't valid in there anyways

#

If you really follow the strict sytax it would be:

#
SELECT * FROM `table`
#

but SQL doesn't require that backticks

#

(in non strict mode)

earnest phoenix
#

SQL when you show it a proper error message

boreal iron
#

stop blaming SQL because you don't know what you did wrong

earnest phoenix
#

Stop crashing into the block points in the road when you don't know where you were driving to FakE

modest maple
#

the `` naming changes from implementation to implementation

boreal iron
earnest phoenix
#

ONLY

#

Mongoose question

I have a schema in my code
{
id: String
}

And in mongodb it saved as
id: 18392918392

I made my schema
{
id: String,
plugins: Array
}

But it still shows
id: 3829292929

How can i update my schema in mongodb
All docuemnts in mongodb gets plugin

sick agate
#

dafuq?

marble juniper
sudden geyser
#

ft. Belarus for extra fun

lament rock
#

just use built in libs instead of garbage

#

a lot of the code/apps/libs I look at might as well be NFTs since it's all just the same crap just slightly different

cinder patio
#

The amount of libs that secretly mine crypto 😩

lament rock
#

Time to make a lib with the sole purpose of mining crypto for me, logging all of your key strokes, installing bonzi buddy, and sending you pop ups that you've won a free car or something along those lines

quartz kindle
#

holy shit

#

i cant believe node-ipc did it

#

lmfao

#

the only reason i even made net-ipc was because node-ipc was outdated for years at that time, they just recently picked up development again

sudden geyser
#

Massive fiasco

modest maple
#

Why does this seemly happen to the JS ecosystem more than any other ecosystem

quartz kindle
#

because people insist on using garbage packages instead of writing their own stuff

sudden geyser
#

Because JS:

  • Has no real standard library
  • Has a lot more people between the spectrum of experience
#

Java's Maven is like half the size of npm yet you never hear of incidents like this.

#

Which is unfair since Java provides a lot of what an app needs built-in.

#

So does Python, but we don't hear about this as often.

quartz kindle
#

does java have built in is-even and is-odd functions?

#

:^)

sudden geyser
#

no, but wish they did

quartz kindle
#

i wonder if i should piggyback on this scandal and add something like malware free to my lib's description lmfao

slender thistle
#

LMAO

sudden geyser
#

Imagine how cleaner this:

if (Number.isEven(1)) {}

Is to that:

if (1 % 2 == 0) {}

Now I need a class for that americanjoke

quartz kindle
#

there is a limit between cleaniness and usefullness

slender thistle
#

1.isEven() >:()

sudden geyser
#

else you're stuck interning what something x something means

quartz kindle
#

but you have to be somewhat paranoid to feel like making 1 line slightly cleaner makes a big difference

cinder patio
#

isEmpty() > array.length === 0
isEven() > num % 2 === 0

This is stuff you can implement yourself though, no need for a 3rd party library

sudden geyser
#

even the smallest changes can have good effects on maintenance IruSmile

sudden geyser
#

or, more simply, be declarative

split hazel
#

bro has to write an algorithm to generate a huge array of even numbers

spark flint
#

yes

#

there is a good swear word api

#

very sensitive but good

quartz kindle
#

lets see if my lib gets more popular now that many people will likely get rid of node-ipc lmao

#

check this out

keen drift
split hazel
#

is there a better way to check if a number is odd or even idk maybe someone more experienced knows

const evenNumbers = [];
for (let i = 0; i < 100000000000; i++) {
  evenNumbers.push(i * 2);
}

function isEven(num) {
  return evenNumbers.includes(num);
}

isEven(5) // false
isEven(10) // true
quartz kindle
#

lmfao

#

use an object or a map instead of an array, at least like that you have direct index access instead of scanning the array

#

it also makes it use more memory, thus makes it faster

#

:^)

split hazel
#

im also considering using machine learning

neat ingot
#
is_even = ((number << 31) >> 31) == 0;```
keen drift
#

Has Dyno ever released any developer writeups about how their distributed infrastructure works

neat ingot
#

^ only works for 32 bit numbers

quartz kindle
#

use bigints

neat ingot
#
is_even = !(number & 0x01);```
cinder patio
neat ingot
#

cant beat a dedicated api..

quartz kindle
#

lmfao

#

it even returns an ad

neat ingot
#

yea, that dev deserves to make half a cent from an ad 😄

quartz kindle
#

the free version only supports numbers up to 0 - 999,999

#

lmfao

neat ingot
quartz kindle
#

jebus fokin kristus

neat ingot
#

gotta admire the effort this person put into this troll 😄

#

the ads KEKW

craggy pine
quartz kindle
#

that thread is gold

earnest phoenix
split hazel
#

a nice api feature to add

#

as a bonus i'll even let people include multiple numbers to determine if the numbers are odd or even at no extra cost

sudden geyser
#

this is probably the funniest part of the site

#

has to be san francisco and innovation

split hazel
#

oh ok

#

anyways i have a react question

#

so i have a main component and two components: page and auth page

#

if the user is not authed, i want it to show the auth page

#

(aka the auth component)

#

and so i want it so after the auth component is done, for it to update some state such as "auth=true" hence causing a rerender to page

#

is there a way to do that

#

more specifically react native but this is a plain react question

sudden geyser
#

So you probably want to tell some component above you to rerender itself so it doesn't display the auth screen

split hazel
#

something like that

sudden geyser
#

Which is not that easy to do in React by just passing around values

#

You need some sort of environment

split hazel
#

i was thinking i could do something like

sudden geyser
#

I know Redux can do that, but that works by separating the state to my knowledge

split hazel
#

but react doesnt like me passing functions around

earnest phoenix
#

I need some help with discord.js's SelectMenu. So whenever an option is selected it doesn't show in the SelectMenu box. Is there an additional function to do this or is it impossible. Examples:

civic scroll
#

guys
assume that i have an empty array

const arr = [];

then i inserted items at abitrary indexes

arr[2] = true;
arr[4] = true;
arr[10] = true;
> arr
[<2 empty items>, true, <empty item>, true, <4 empty items>, true]

is there a possible way to fill up the empty values (possibly undefined) with any values, given

function fillArray(arrayWithEmptyItems: any[], fillItem: any) {
    //...
}
modest maple
#

it'd be better to use a map in that case

civic scroll
#

i use array since i gotta map it to a 2d matrix

modest maple
#

hmm?

civic scroll
#

and input data were

{
    row: number,
    col: number
}
cinder patio
#

Arrays with holes in them are so much slower than regular arrays. There's a better data structure for this

civic scroll
#

so i assigned those values directly to the array given those are not negative

quartz kindle
civic scroll
quartz kindle
#

then you cant

modest maple
#

use a map

civic scroll
#

the size can only be known after you fill the items up

#

but then that causes extra calls

quartz kindle
#

you can fill it up then replace items at the end

modest maple
#

Map<int, Map<int, V>>

#

for a 2d 'fale' matrix

quartz kindle
#

or do something progressive like if current item index is bigger than array.length, add empty values for all intermediate positions

cinder patio
#

holey arrays are probably gonna be slower than the extra calls ur talking about

civic scroll
#

can't avoid that because of input data

modest maple
#

iterating a filling the array every time gonna be much slower than a hash lookup most likely

#

how come?

civic scroll
#

the output is 2d arary however

modest maple
#

nothing seems odd about your input data?

civic scroll
#

so i assigned those coords directly to the array

modest maple
#

but...

cinder patio
#

You can assign them to a map instead

modest maple
#

just use a map lol

earnest phoenix
modest maple
#

even just Map<(Row, Column), V> and then if you need to turn it into a 2d matrix at the end, just create a stuttering iterator

cinder patio
#

That's not gonna work in JS

#

it has no tuples

civic scroll
#

array moment

#

wait

cinder patio
#

Every array instance has a different address

#

unless you keep the arrays in some other data structure

modest maple
#

Map<"row:column", V> verycool

quartz kindle
#
arr = [];

for(const item of items) {
  const index = item.index;
  if(index >= arr.length) {
    arr.push(...Array(index - arr.length + 1).fill(null));
  }
  arr[index] = item;
}
earnest phoenix
#

ffs why everyone ignoring me

quartz kindle
#

he said he wanted to fill in the "holes"

#

when writing to a non existent index

modest maple
#

well yeah, but that's O(n ^ 2) on every insert

quartz kindle
#

no?

modest maple
#

vs just O(1) insert and then O(n) collection into [][]V

#

Are JS Array.fill not iterative?

quartz kindle
#

it only extends the array if writing to an off-limits index

modest maple
#

yes

#

so worse case thats O(n ^ 2)

quartz kindle
#

well thats what he said he wanted

#

or at least what i understood

modest maple
#

sure.

civic scroll
#

but the thing is

#

the pad doesn't work

modest maple
#

but you can turn it back into an array, once everything is done

civic scroll
#

the first non-empty item got shifted back to index 0

#

let me just post the code i did

modest maple
#

like, there's no use filling it pointlessly if you know it's not continuous

civic scroll
#
interface AttackRange {
    row: number;
    col: number;
}
function padArray<T>(array: T[], fillItem: any)
{
    const arr = new Array(array.length).fill(fillItem);
    for (const i of Object.keys(array).map(Number))
        if (!isNaN(i)) arr[i] = array[i];

    return arr;
}
modest maple
#

You know the easiest solution?

civic scroll
#

so like

cinder patio
#

what the

modest maple
#

👏 Just dont use JS

civic scroll
#

empty items are undefined by default right

civic scroll
#

i can't

#

it's frontend code

cinder patio
#

wellllll you can but should you 🤔

civic scroll
#

don't expect me to compile to wasm or use other libs

#

the point is that it shhould have worked

#

but the empty items are skipped

#

and i couldn't find a way to access them at all

earnest phoenix
civic scroll
#

but problem doesn't lie here

#

so probably that padArray function

cinder patio
#

So in essence padArray just clones an array?? Like that's what you're doing?? Just skipping non-number keys?? Or am I dumb

quartz kindle
#

could you like, provide a sample input data and a sample desired output?

civic scroll
#

the source array has empty items

quartz kindle
#

and you want to preserve the indexes?

civic scroll
#

yeah that

#

i maybe can extend the array by concatenating

quartz kindle
#

so basically you want to turn [{a}, {b}, {}, {c}] into [{a}, {b}, null, {c}]? or what

cinder patio
#

So the array parameter is EXPECTED to have holes in it?

civic scroll
#

like ```
if var_index > array.length
then
array concat len (index - array.length)

civic scroll
#

always have holes

quartz kindle
#

what kind of holes?

#

undefined? null? empty?

civic scroll
civic scroll
#

i just wanna find a way to access it

quartz kindle
#

so why not array.map(x => x || null)?

cinder patio
#

can't you just...

array.map(i => i || fillitem)
civic scroll
quartz kindle
#

are they?

cinder patio
#

oh yeah I think they are

civic scroll
#

they are skipped

cinder patio
#
const arr = [];
for (let i=0; i < array.length; i++) {
  arr[i] = array[i] || fillItem;
}
#

use a for loop then

civic scroll
#

which can only get after putting values in

quartz kindle
civic scroll
#

and the interesting thing is

cinder patio
#

beat u to it ❤️

quartz kindle
#

:^)

civic scroll
#

i fucked up somewher in 2d table creation

spark flint
civic scroll
#

it was supposed to be row 2 col 0

earnest phoenix
#

I was gonna write a more detailed explanation, damn it

sudden geyser
#

why is discord complaining about python files now

cinder patio
#

just don't use arrays for this

civic scroll
#

i use array to iterate

#

wym

earnest phoenix
sudden geyser
#

I click link above

quartz kindle
#

this

sudden geyser
#

I get warning that file may potentially be dangerous

civic scroll
#

possibly i can't map in html

sudden geyser
#

looks like python file

cinder patio
#

Use a Map like Chill said

spark flint
quartz kindle
#

its not just a python file, its a fucking git repo with a python file, it should open in the git viewer, not a direct download, but i guess they screwed up the url rewrite

civic scroll
#

then how you map in html

quartz kindle
civic scroll
#

you still gotta go in array iteration

earnest phoenix
cinder patio
#

You can do map.values() and turn it into an array

sudden geyser
#

simpler terms please

cinder patio
#

or you can do a for of loop

civic scroll
#

for of skips empty values

#

i will sleep, surely i must be dumb since it's 4am

#

i will try fixing it again after wake

cinder patio
#

You can make the whole board display the empty positions, and u just stores the ones which have something in them

#

why bother

civic scroll
earnest phoenix
# sudden geyser simpler terms please

Looking at the Discord data-mining repository, a lot of extensions were added for it, in simpler terms, you could have a configuration to execute certain file types without confirmation, which is something some tech savvy people so, or someone non-tech savvy could download it and execute it without knowing what it does

#

Which the last one is more likely, from what I've seen from Discord users OMEGADANCE

sudden geyser
#

ah

#

yeah still fuck this

#

don't tell me clicking github links pulls up that

earnest phoenix
#

I think it also shows that for any website pointing to a file with a potentially dangerous file extension

lyric mountain
#

funny enough, some scanner sites flag discord as malware source

sudden geyser
#

well it is

#

just look at discord devs

lyric mountain
#

discord dev is ironically the most dangerous server on discord

earnest phoenix
#

If you said that then you're unaware of what goes on in the Discord API server

quartz kindle
#

the guy who made node-ipc delete files in russian servers is claiming that nothing like that ever happened

#

@_@

spark flint
sudden geyser
#

yeah it's funny af

spark flint
#

that dudes stupid af

quartz kindle
#

hes denying it exactly like russia is denying the war

sudden geyser
#

no he's just trolling

quartz kindle
#

wtf

sudden geyser
#

he knows what he's doing

#

and people are thinking he's not joking lol

spark flint
#

if your ip is located in Russia or Belarus then it wipes the drive and fills with peacenotwar.txt

sudden geyser
#

and you better pray you don't get assigned an ip that's mistakenly located in one of those two countries

#

or use a vpn

lyric mountain
#

russia became ba sing se

quartz kindle
#

an american non profit operating in ukraine got fucked over by it, 30k messages deleted

lyric mountain
#

"there's no war in russia"

sudden geyser
#

yeah but part of the blame is on that non profit

neat ingot
#

ngl, i'd be pissed if that happened to my project, wouldnt you be? you update your modules before release, go to iron out any bugs, and lose your entire everything...

sudden geyser
#

how the fuck do you store files so badly you can't recover them

#

on that individual machine

quartz kindle
#

not everyone makes off-server backups of local dbs

#

still their hosting provider should keep backups

#

unless they use a shitty provider that doesnt

#

or perhaps they have a json db :^)

sudden geyser
#

all my homies love jason

earnest phoenix
#

(They were using TXT file databases)

sudden geyser
#

literally

neat ingot
#

...

quartz kindle
#

best db fastest io direct access no middleware

boreal iron
#

I mean the raw file system is always he fastest

neat ingot
#

ngl, if you are using txt files for a database, you deserve to lose your database.

sudden geyser
#

imagine them doing full text search

quartz kindle
#

im actually gonna do a full text search with grep

#

because icba tokenizing them, i cant find a good tokenizer for my use case

#

im just gonna add a cache layer on top and thats it

earnest phoenix
#

Stupid question, but I have taken a break from coding, and have just gotten back into it. I am wanting to run a node command in the terminal again, and I have forgotten how to do so (coding in JavaScript)

#

(Please do not mind the mess below my screen

quartz kindle
#

why take a screenshot with your phone

#

cant you use discord on your pc?

boreal iron
#

Maybe he has forgotten some more stuff

earnest phoenix
#

Yes, but i haven't been on this thing since last year

quartz kindle
#

then please either copy and paste it as text, or take a screen shot of the pc with print screen or something

boreal iron
#

I can’t see anything just pixels

neat ingot
#

I think it shows his bot as connected

quartz kindle
#

yeah

#

there is nothing wrong in that picture you sent anyways

neat ingot
#
connected as: askjdaksjdkajs```
quartz kindle
#

it just shows your program is running

earnest phoenix
#

I haven't got it fully set up yet, I am just testing commands, and need to node another .js file

quartz kindle
#

so what is your question?

earnest phoenix
#

Oh so you just need to cancel the operation, just exit out of the process and run another file with Node.js

#

Thanks

#

Run CTRL+C

#

Yeh

#

Thank you

earnest phoenix
#

Told ya it was a stoopid question

#

Well not really if you're coming back to it after a long while, it's alright; it's common to forget things like these from time to time

#

Nobody is immune to forgetting something mmLol

#

MFs really doing NFT domains now

#

People have too much time in their hands

sudden geyser
#

"No renewable fees" yeah because you already paid $10k in gas fees

#

actually now that I think about it

#

how does nft domains even work given domains are unique

wheat mesa
#

domains are already nfts lmfao

boreal iron
#

It’s pretty easy

#

Stupid people are actually paying for anything

#

Even if it’s nonsense

#

Just hype something and count the cash you make

#

cough nitro cough

dry imp
#

u just broke fake

timber fractal
#

i just added a node.js app to my cpanel, and added code, but whenever i start the application a 503 error will occur and wont go away until i turn off the application. How can I fix this?

rotund light
#

for top.gg py does it only work with dpy or does it work with forks

dry imp
#

works with d.py and d.py forks since basically the same

spark flint
#

Which is a button called something like install

#

devs

fiery stream
#

What’s the point of bot.session

#

In py

quartz kindle
#

what py

fiery stream
bright hornet
#

https://srcb.in/V67zBHSGnK

After testing to array.map the whole data,
It works. the thing is:

  1. The embed will be sent multiple times, (How do i make it as one send?)
  2. v?.length returns undefined (should be numbers)
  3. When I put const members in the code line
message.guild.members.cache.filter(member => member.roles.cache.has(role.id))```

and calling it to `${members?.length}` It will return error:
```js
Cannot access 'members' before initialization```
pearl trail
#

v?.length must be v?.size since it's discordjs Collection

bright hornet
#

ohh

bright hornet
pearl trail
#

oh wait

#

this is not how it supposed to work. you dont need to do .map. Simply make a variable of filtered users, and then you can use for loop or Promise.all and then send the embed. example:

const members = do thing until .filter(x => x.roles.has(...))
await Promise.all(members.map(u => /* u is member itself */ do findoneandupdate here))
send embed(members.size)
#

my bad, Promise.all([...members.values()].map(u => ))

bright hornet
#

wait let me reconstruct the code

pearl trail
#

is the member's wallet or smth that you inc updated?

bright hornet
#

and wdym by this? js send embed(members.size)

pearl trail
#

yeah do your embeds

#

you dont use callback this time

bright hornet
#

${members.size} you mean like this right?

#

not really in the {embeds: [embed]}

pearl trail
#

yeah, but remove this code

bright hornet
#

yays it works

pearl trail
#

nice

bright hornet
#

remove?

pearl trail
#

yeah, is it still sending multiple embeds? it's inside a callback of findOneAndUpdate inside a .map

bright hornet
#

if i put it outside of the .map

#

erm

pearl trail
#

also from the code, you just increment your bank in {$inc: {bank: amount}} and you inc in again with data.bank += amount

pearl trail
bright hornet
#

yep

#

workd

#

worked XD

bright hornet
pearl trail
#

yeah, the {$inc} itself already inc your bank

#

try it, in case im wrong

bright hornet
#

imma try

#

nope didn't add

quartz kindle
fiery stream
quartz kindle
#

to make http requests

fiery stream
#

Huh wym why is it passed on to bot.session

quartz kindle
#

to store it there for reuse

fiery stream
#

Oh i thought aiohttp made a bot faster or something like that

#

I read that somewhere

quartz kindle
#

aiohttp is a library to make http requests

#

for example downloading a file, or accessing an api

#

its considered better/faster than the requests library

fiery stream
#

Yeah ik it’s like axios got node

quartz kindle
#

ye

fiery stream
#

For*^

#

But i read somewhere it made dpy faster idk where

quartz kindle
#

afaik dpy already uses it internally

#

afaki bot.session is not used anywhere internally, its simply a user-defined name to store something in the bot variable, so its easy to access

#

like doing client.axios = require("axios") in node

fiery stream
#

Ofof i thought it had other use internally rather than just for the user yk

boreal iron
#

Now on Tim’s project list: dpy-light

#

Estimated release ~ 2062

quartz kindle
#

ew no

boreal iron
#

True… nobody likes py

quartz kindle
#

that node-ipc issue became a message board for discussing the war lmao

boreal iron
#

Well because everyone needs to share his stupid opinion how “evil” Russia is

quartz kindle
#

why are there ants on my food

boreal iron
#

Because of where you live

quartz kindle
#

they are now

boreal iron
#

Calling green peace right now

quartz kindle
#

the owner of node-ipc keeps deleting comments they dont like lmao

boreal iron
#

You’re fucked

#

Aye why not deleting anything you don’t like?

#

We just live in a perfect world or at least in a perfect bubble

#

No bad words, different opinions or things you don’t like

#

Make the world like you like it!

#

that doesn’t even need sarcasm tags

#

lol API v7 will live even longer now

#

Looks like lots of people were crying about it

bright hornet
#

okay i found the problem lmao

#

HAHAHAHA

#

message.guild => message.guild.id

bright hornet
#

mb mb

boreal iron
#

How are they even able to remove your local files?

#

Malicious dependency?

#

Haven’t read through it yet

quartz kindle
#

he basically force pushed an update that included obfuscated code

#

anyone who updated to the affected version and ran it got hit

#

the obfuscated code used a geolocation api to obtain the user's location from the machine's local ip address

#

then if it matched russia or belarus, it proceeded to run fs.readdirSync + fs.writeFileSync in mass

#

their issues page is gold

#

Instead of shoving hearts up peoples hard drives, how bout you shove those hearts up your ass?

boreal iron
#

1,99 actually is affordable to spam my evil ads freerealestate

quartz kindle
#

lmao

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

There might be a trade off if I buy 10 KEKW

sage bobcat
#

One message removed from a suspended account.

boreal iron
#

Stop crying around

#

Actually funny they even advertise accounts with its full name and tag

#

I wonder discord doesn’t actually care

quartz kindle
#

im laughing my ass out

boreal iron
#

What the heck freerealestate

wintry raptor
boreal iron
#

That’s what you get when using other people’s code/apps etc in 2022

quartz kindle
#

haters taking the opportunity to bash js xD

wintry raptor
#

Do ppl still use PHP 😮

quartz kindle
#

wordpress still exists

boreal iron
#

And facebook

#

Parts of Amazon

#

Etc

#

According to services scanning all public webservers for their signatures PHP still being used in more than 50% on the entire net

bright hornet
#
const mongoose = require('mongoose');

const ecoSchema = new mongoose.Schema({
    guildID: { type: String },
    userID: { type: String },
    wallet: { type: Number, default: 0 },
    bank: { type: Number, default: 0 },
    item: [{
        itemName: { type: String},
        itemDescription: { type: String },
        itemMaxUse: { type: String },
        itemStock: { type: Number, default: 0 },
        itemPrice: { type: Number },
        itemSellingPrice: { type: Number }
    }]
})

module.exports = mongoose.model("economy-main", ecoSchema);``` this is how to create an array right? is it really not going to show in the db?
lament rock
# quartz kindle

Unity Hub (a manager for Unity (the game engine) installs) supposedly depended on node-ipc and they received a ton of backlash until they patched that dep

#

then all of the hate got redirected

boreal iron
#

They must actually have a damn accurate geoip database to only fuck Russians and Belarus

lament rock
#

probably just a public api

#

I know of a few

boreal iron
#

Known to be pretty accurate smirk

quartz kindle
boreal iron
#

That’s why I said it yeah

quartz kindle
#

people complaining about inaccurate geoip making the wrong people be hit

#

some said france often gets confused with russia, geoip-wise

boreal iron
#

Funny enough to target devs in that countries as the right ones to hit

lament rock
#

I feel like people just need to stay in their own lane

boreal iron
#

Yeah people probably forgot what their own country did in the past

#

or still does

#

But complaining about others is easier than dealing with yourself and your own stuff

#

as I noticed (again) a few minutes ago

boreal iron
#

That would be funny tho

quartz kindle
#

xD

#

no u

#

no u

#

no u²

solemn latch
#

a war is developing

inner sapphire
#
    const regex = new RegExp(/(?:[A-z0-9](?:[A-z0-9-]{0,61}[A-z0-9])?\.)+[A-z0-9][A-z0-9-]{0,61}[A-z0-9]/gi);

    if (message.content.match(regex)) {
        let data = await fetch("XXXXXXXXXXXXXXXX", {
            method: "post",
            body: JSON.stringify({ message: message.content }),
            headers: {
                "Content-Type": "application/json",
                "User-Agent": "Nooder Anti-phishing (Tazhys#0001 / 622890595614195722)",
            },

        }).then(res => res.json())
    }
    const phishEmbed = new Discord.MessageEmbed()
        .setAuthor(`Scam/Phish Prevented`, nooder.icons.erroricon)
        .setDescription(`${message.author} tried sending a phishing/scam link!`)
        .setFooter(`User ID: ${message.author.id}`)
        .setColor("RED")
    return message.channel.send(phishEmbed)

does anyone know why this keeps flagging messages not just links?

quartz kindle
#

because you are sending the embed regardless if a match was found or not?

inner sapphire
#

even if i put the } under the embed

#

it does it still

quartz kindle
#

wut

inner sapphire
#
    if (message.content.match(regex)) {
        let data = await fetch("https://anti-fish.bitflow.dev/check", {
            method: "post",
            body: JSON.stringify({ message: message.content }),
            headers: {
                "Content-Type": "application/json",
                "User-Agent": "Nooder Anti-phishing (Tazhys#0001 / 622890595614195722)",
            },

        }).then(res => res.json())

        const phishEmbed = new Discord.MessageEmbed()
            .setAuthor(`Scam/Phish Prevented`, nooder.icons.erroricon)
            .setDescription(`${message.author} tried sending a phishing/scam link!`)
            .setFooter(`User ID: ${message.author.id}`)
            .setColor("RED")
        return message.channel.send(phishEmbed)

    }
#

this still shows the embed with messages

#

lol

quartz kindle
#

did you test your regex?

inner sapphire
#

NVM

#

bruh

#

this wasnt working just a minute ago

#

now it works

#

😭

quartz kindle
#

lel

inner sapphire
#

thanks tim 😂

#

@quartz kindle ok now i need your help

#

wait

#

nvm

#

nvm i do need you @quartz kindle

quartz kindle
#

@_@

inner sapphire
#

wait

#

hang on

quartz kindle
#

and i need sleep

inner sapphire
#

crap

#

go sleep lol

#

im just confused on why its not sending in the channel now since i added my db stuff

clear marlin
inner sapphire
#

yeah

#

this bot hasnt migrated yet

bright hornet
#
const mongoose = require('mongoose');

const ecoSchema = new mongoose.Schema({
    guildID: { type: String },
    userID: { type: String },
    wallet: { type: Number, default: 0 },
    bank: { type: Number, default: 0 },
    item: [{
        id: { type: Number, default: 0 },
        itemName: { type: String },
        itemDescription: { type: String },
        itemMaxUse: { type: String },
        itemStock: { type: Number, default: 0 },
        itemPrice: { type: Number },
        itemSellingPrice: { type: Number }
    }],
    guild: [{
        id: { type: Number, default: 0 },
        guildName: { type: String },
        guildDescription: { type: String },
        statusGuild: { type: Boolean, default: false }
    }],
    married: [{
        memberID: { type: String },
        statusMarriage: { type: Boolean, default: false }
    }]
})

module.exports = mongoose.model("economy-main", ecoSchema);``` is this the right way to create an array?
#

the items are not showing in mongoose db

whole glen
#

for some reason this command randomly stopped working and now just says pong in chat do you know why? (i did turn sharding to auto) ```java
if (interaction.commandName === 'ping') {
const pong = new MessageEmbed();
let days = Math.floor(client.uptime / 86400000);
let hours = Math.floor(client.uptime / 3600000) % 24;
let minutes = Math.floor(client.uptime / 60000) % 60;
let seconds = Math.floor(client.uptime / 1000) % 60;
pong.setColor('ffff00')
pong.setTimestamp()
await interaction.reply( {content: 'Pong', fetchReply: true }).then (async (resultinteraction) =>{
pong.setDescription(Uptime: ${days}d ${hours}h ${minutes}m ${seconds}s\nLatency is ${resultinteraction.createdTimestamp - interaction.createdTimestamp}ms. \nAPI Latency is ${Math.round(client.ws.ping)}ms)
await interaction.editReply({ embeds: [pong] , ephemeral: false });

})

}```

#

no errors happen

boreal iron
#

Log your reply() promise to see if the code inside being executed

#

Catch your editReply() to see if any error occurs

#

Which should be shown anyways but just to make sure

#

I can only think of your interaction has been expired (taking more than 3s)

#

So trying to defer the response in the first place should be worth to try

#

Btw the ws ping is the web socket ping aka gateway ping

#

Not the API latency if I’m not wrong here

#

The API ping actually is the time difference between an API request and it’s response (answer)

deep bolt
#

Hey, Does anyone know how to measure latency between a MongoDB and a Discord bot?

pearl trail
#

use new Date() method and use this to ping mongo_ose_ require("mongoose").connections[0].db.admin().ping()

timber fractal
boreal iron
timber fractal
timber fractal
pearl trail
earnest phoenix
#

The Ticket Tool bot has a transcription system when a ticket is closed which is in the form of an HTML/CSS file. Which module is able to do this? Cordially

slender wagon
#

heya anyone has a clue how to decrease properly on mongodb

cobalt junco
slender wagon
#

doing that but it removes the same amount 2 times

#

idk why tho the thing seems to be just fin3

boreal iron
#

You will probably have to do it by your own.

#

I mean it’s not that big of a deal.

#

Create your HTML template and append to cached messages to the body, for example wrapper in a paragraph tag

slender wagon
#
 console.log(price)
      await DiscordUser.findOneAndUpdate({ discordId: user.discordId }, { $inc: { cips: -price } }, { new: true }, async (err, doc) => {
         if (err) return res.send(500, { error: err });
      })
``` just whyyy
#

i have been trying to solve this for days lmao

#

it removes 2 times the same amount

cobalt junco
boreal iron
#

lol

slender wagon
#

BROOOOOOOOO

#

]

#

all this shit

#

for a fucking awaitttt

#

i don't get mongodb

cobalt junco
slender wagon
#

sometimes it doesn't work without await

#

sometimes it doesn't work with await

cobalt junco
slender wagon
#

lesson learned

onyx jackal
#

Can someone tell me how to make a website like dyno.gg

boreal iron
#

Well… using html, css and a little bit of JavaScript to let people enjoy useless fancy animations

bright hornet
#

can someone give me some idea about creating leaderboard

bright hornet
near stratus
bright hornet
near stratus
bright hornet
near stratus
#

nvm ignore me

#

idk mongodb

bright hornet
#

xd

earnest phoenix
#

how can i search one value in all tables in my SQL ?

#

what is the request

modest maple
#

as in? Like a text search? Or just x = 1

#

and also, what database...

#

what tables...

earnest phoenix
#

That is to say that I have information and I would like to ensure that it searches in all the tables if the information exists

#

yes but before

#

imagine i do :

#

SELECT * FROM ???? WHERE condition

#

What do I put instead of ????

modest maple
#

the table

earnest phoenix
#

if I want to search in all the tables of my database

#

not just one, but all

cobalt junco
#

that will return array of data, from user with the most baz to the least

near stratus
earnest phoenix
#

thx u !!!

lyric mountain
#

unless sql server changed yet another standard thing

#

yep, seems like they did, fuck sqlserver

heavy marsh
#
const regex = /-(\d)$/
                let match = regex.exec(song.name)
                if(match === null) { 
                    currentQueue.queued.push(`\`${id}\` - [${song.name}](${song.url}) \`${song.formattedDuration}\``) 
                } else { 
                    currentQueue.queued.push(`\`${id}\` - [${song.name.split('-').splice(1).join(' ')}](${song.url}) \`${song.formattedDuration}\``) 
                }

Doesnt do what its told

#

Is there something wrong in this

#

Cause no error either

lyric mountain
heavy marsh
#

Its name of the song

lyric mountain
#

"fix" is a hard word

#

any name with - will break your desired result

neat ingot
#

Storing your database objects in cache/memory for 1/2 minutes after they are accessed, with the data being saved each minute while in cache ~ good or bad idea?

cinder patio
#

depends on how often they are requested

neat ingot
#

its not so much that they are requested a lot, its more that the data is sometimes required for some time after initially obtained ~ for example, when a battle begins it needs to keep all user data, and the overall database player object around

#

so i added a simple cache layer that only stores items for at most 1 minute, then it will save the data, and re-query the db on the next time data is fetched

#

I havent had any issues with it in the 2-3 years ive been using it (db cache layer) but I was just thinking, maybe its not even really required.. like, almost everyone else i see in here using mongodb/mongoose just does a query then saves, then repeat

#

and its not like my bot is in millions of servers 😄

#

literally 1 atm 😄

cinder patio
#

I don't think a 1min cache is worth it unless it's requested a lot. You probably use a timeout to remove it, too

neat ingot
#

nah lol

#

cache updates each xx frequency (set to second atm) and checks for cleared items

sudden geyser
#

dekache fun name

bright thorn
#

how to add async in b.reply

sudden geyser
#

confuzzled

#

what's b here

bright thorn
sudden geyser
neat ingot
#

just add await before b.reply?

sudden geyser
#

Awaiting it would probably not be useful here given they're just immediately returning

bright thorn
neat ingot
#

reply returns a promise, a promise can be awaited

#

lmao

#

your overall function is not async

#

so you cannot use await within its scope

#
    // works:
    async function myfunction() {
        await a.thing();
    }
    // errors: 
    function myfunction() {
        await a.thing();
    }
#

collector.on('collect', async(b) => ...)

pearl trail
#

because you are using await inside a non async function

#

you can do return a.thing() instead

#

but still use await when you call the function if you want to

neat ingot
#

I dont really get what the benefit of waiting is though. like, all your doing is replying ~ why do you need to wait for the reply?

bright thorn
#

Thank you

#

i got it

pearl trail
#

no await:

let data = 0;
data = db.find("data")
console.log(data) //dang its <Promise> 

await:

let data = 0;
data = await db.find("data") //it will wait this code to search in db (async) and then continue
console.log(data) // your lovely data here
neat ingot
#

shouldnt the first example return a promise?

pearl trail
#

yes

#

but you wont get the data

neat ingot
#

assuming that db.find was async ofc

pearl trail
#

its not resolved yet

neat ingot
#

yea indeed

neat ingot
#

mongodb for lyfe! ShuckleCool

#

or until a better db spawns that i can code everything in the same language as my project 😄

sudden geyser
#

or until a better db spawns
IruSmile datascript is always an opt-

that i can code everything in the same language as my project
damn, maybe another day

lyric mountain
#

better to manually save after modification than saving on a fixed interval

woeful pike
#

ah yes mongodb is commonly known for being written in js

lyric mountain
#

mongodb, the database itself, is written in js?

modest maple
#

mostly

lyric mountain
#

I was worried for a moment

civic scroll
#

@cinder patio @quartz kindle
i fixed
turns out i mapped the indexes of coordinates array instead of values

fiery stream
#

test

copper cradle
spark flint
#

being too good at css

neat ingot
cinder patio
#

That's still not a good idea imo. If you update data very frequently you could have an abstraction which collects changes and updates the db let's say 10s after no changes have been made.

neat ingot
#

either way, i still have to watch all active database items and cache them before saving, either for 10s, or 1 minute (i can easily change it to 10s in my cache settings). its like, the cache will only store the data for upto 1 minute, and then forces a save and cache wipe. it doesnt renew cache data after accessing each item

civic scroll
plucky imp
#

i pog

lyric mountain
#

let's say you for some reason have 2 modifications on the same object at the same time

#

unless you enfoce sync access you risk running into a ton of race conditions

copper cradle
neat ingot
#

yea that is a potential issue/drawback to the solution. but there is no time that the same object should be in the cache twice

#

granted should !== reality 😛

earnest phoenix
#
guild.channels.create(ticketName, {
    type: "GUILD_TEXT",
    permissionOverwrites: [
    {
       id: guild.id,
       deny: [Permissions.FLAGS.VIEW_CHANNEL, Permissions.FLAGS.SEND_MESSAGES]
    },
    {
       id: interaction.user.id,
       allow: [Permissions.FLAGS.VIEW_CHANNEL, Permissions.FLAGS.SEND_MESSAGES, Permissions.FLAGS.ATTACH_FILES],
       deny: [Permissions.FLAGS.MENTION_EVERYONE]
     }
     ]
})```

why my permissions overwrites doesn't work ? no one error
lyric mountain
#

not storing it twice

neat ingot
#

how would accessing the same object twice cause an issue?

for example:

// create cache:
const mycache = new Dekache({name:'you got any cache?', mins: 2})
// initial cache request, returns the callback 
// function value on initial request
const init = await mycache.get('some-identifier', async() => { return 1 });
// mycache.get('some-identifier') calls will now return 1 
// until the number of mins (2) has been reached. 
// after 2 mins is reached, data is saved and then
// removed from the cache
const now = await mycache.get('some-identifier', ()=>{});

the only time I can see that being an issue, would be if the cache'd data was released at the exact same time another request for the same data was made, and for some reason the cache'd data had not saved yet, but the new request had already obtained the data from the db. But that should never happen, as db items are saved before cache releasing, so then whenever the next request happens, its fetching the data 'fresh' ~ which correctly returns the last saved data

dusky notch
#

anyone knows what to use to make a bot and host it ?
currently using replit + uptimerobot but since i am not paying(using the free version)
it goes ofline frequently and i often see myself unable to make some changes to my code or even use the bot, this would cause issues were i cannot it for that time and i would like to avoid that as much as possible from happening

wheat mesa
#

Develop the bot on your computer if possible, and host it using a VPS of some sort (if you want a very basic VPS for free, Oracle provides an always free tier)

lyric mountain
#

isn't it crashing?

wheat mesa
#

(either way replit is not an ideal environment for development and hosting)

dusky notch
#

this is what happens

#

unless there is a bug in my code

#

which i don't believe since i haven't touched it

#

and it was working

earnest phoenix
#

"SELECT * FROM users WHERE email = '$email'"

is this safe?

#

$email is user input

neat ingot
#

sanitize user input before passing to your db

#

~ upon searching for a lib to sanitize input for sql, i found this:

lyric mountain
#

no need for a sanitizing lib, sql supports parameters by default

lyric mountain
#

because that's 100% an exception happening and crashing the bot

earnest phoenix
#

I found it thx anyways

lyric mountain
#

even php, all sql SHOULD support parameters

#

it's like, a fundamental thing

earnest phoenix
#

and don't ask me why I am using php,
it was a requirement kek_laugh

neat ingot
#

for some reason discord api latency was up at 1500ms 😐

#

~ well, 1409... still!

trim perch
#

that's a party

plucky imp
#

uhh so

#

i keep getting this error

#
 let guild = await this.updateGuild(guild);
        ^

SyntaxError: Identifier 'guild' has already been declared
#

but i'm not entirely sure how to fix it lol

trim perch
#

It means guild exists somewhere else in your code.

#

In the same scope

plucky imp
#
 async updateGuild(guildId, ...args) {
    const guilds = this.db.collection('guilds');

    let guild = await guilds.findOne({ id: guildId });

    if (guild === null) {
      await guilds.insertOne({
        id: guildId,
        userWarnings: [],
        lastUser: null
      });

      guild = await guilds.findOne({ id: guildId });
    }

    if (args.length === 0) return guild;

    return await guilds.findOneAndUpdate(...args);
  }

  /**
   * @returns {number} The user's new total warning point value.
   */
  async addWarning(guildId, userId, d, reason, issuer) {
    let guild = await this.updateGuild(guildId);

    guild = guild.userWarnings.some((warning) => warning.id === userId)
      ? await this.updateGuild(
          guildId,
          { id: guildId },
          {
            $push: {
              'userWarnings.$[id].warnings': {
                $each: [{ d, reason, issuer }]
              }
            },
            $set: { lastUser: userId }
          },
          {
            arrayFilters: [{ 'id.id': userId }],
            returnDocument: 'after'
          }
        )
      : await this.updateGuild(
          guildId,
          { id: guildId },
          {
            $push: {
              userWarnings: {
                $each: [{ id: userId, warnings: [{ d, reason, issuer }] }]
              }
            },
            $set: { lastUser: userId }
          },
          { returnDocument: 'after' }
        );

    return guild.userWarnings
      .find((warning) => warning.id === userId)
      .warnings.reduce((all, val) => all + val.points, 0);
  }
``` code btw
#

i know where it exist but i don't know like how to fix it cause the guild is an identifier for like

#

the whole thing

#

iirc

wheat mesa
#

then change the name...?

plucky imp
#

sad but it's supposed to b cleann

#

understandale though

wheat mesa
#

I'm not sure why you would have guild declared in that scope anyways

#

shouldn't these functions be independent of everything else

plucky imp
#

uh

#

probably

plucky imp
#

wait

#

@wheat mesa nothing was wrong

#

it was a skill issue

earnest phoenix
#

ew waffle

austere surge
trim perch
#

okay guys crazy idea but, what if we take macros, built them into javascript, and use them to replace jsx/tsx/whatever syntax transformation we use today

#

heck, template literals are something

plucky imp
#

this guys crazy and i like it

spark flint
#

Lol

earnest phoenix
#

long time not coming, is there a way to store embed in another file?

austere surge
#

json?

earnest phoenix
#

My command has many embeds so storing them in another file and importing would be a better way

earnest phoenix
#

can I?

austere surge
#

yes

#

just need to know how to make an emebd with json instead of builders

earnest phoenix
#

example?

austere surge
#

idk how to

earnest phoenix
#
embed: {
  title: 'Here is your example'
}
austere surge
#

api docs probably sday

earnest phoenix
#

Assuming u mean this

austere surge
#
{
  embed: {
    title: 'title'
    description: 'description'
  }
}

something like that i believe

#

whys there no json code block thing

earnest phoenix
#

there is

#

it just doesn't really color anything

earnest phoenix
#
{
  "embed": {
    "title": "asdasd"  
  }
}
#

If it doesn't have " around it then it wont highlight as what you are sending isn't valid json

austere surge
#

ohhhyeah

#

im forgot

plucky imp
#

okay uh new problem

#

when i use the ping command it says application did not respond but i get no errors

#
import { MessageEmbed, Formatters } from 'discord.js';

const { bold } = Formatters;

export default {
  data: { name: 'ping', description: 'Pong!' },
  /**
   * @param {import('discord.js').Client} client
   * @param {import('discord.js').CommandInteraction} interaction
   */
  async execute(client, interaction) {
    const embed = new MessageEmbed().setColor('RANDOM').setDescription('Ping?');

    const reply = await interaction.reply({
      embeds: [embed],
      fetchReply: true
    });

    let perf = performance.now();

    await client.db.collection('ping').findOne();

    perf = performance.now() - perf;

    const embed_ = new MessageEmbed()
      .setColor('RANDOM')
      .setAuthor({
        name: interaction.user.username,
        iconURL: interaction.user.displayAvatarURL({
          dynamic: true,
          format: 'png'
        })
      })
      .setDescription(
        `${bold('Message latency')}\n![online](https://cdn.discordapp.com/emojis/952437416352964699.webp?size=128 "online") ${
          reply.createdTimestamp - interaction.createdTimestamp
        }ms\n${bold('API latency')}\n![online](https://cdn.discordapp.com/emojis/952437416352964699.webp?size=128 "online") ${Math.floor(
          client.ws.ping
        )}ms\n${bold(
          'Database latency'
        )}\n![online](https://cdn.discordapp.com/emojis/952437416352964699.webp?size=128 "online") ${Math.floor(perf)}ms`
      )
      .setFooter({ text: 'Pong command info' })
      .setTimestamp();

    await reply.edit({ embeds: [embed_] });
  }
};
#

ping command ^^^

#

if you need it heres the interactionCreate code

#
export default {
  name: 'interactionCreate',
  once: false,
  /**
   * @param {import('discord.js').Client} client
   * @param {import('discord.js').Interaction} interaction
   */
  async execute(client, interaction) {
    if (!interaction.isCommand()) return;

    const command = client.commands.get(interaction.commandName);

    if (command === undefined) return;
    console.log(command);

    try {
      await command.execute(client, interaction);
    } catch (err) {
      console.error(
        `An error occured while executing the '${interaction.commandName}' command:`,
        err
      );
    }
  }
};

wheat mesa
#

Try deferring first

plucky imp
#

context

wheat mesa
#

What

plucky imp
#

like can you give context lmao

wheat mesa
#

Defer the interaction

#

Slash commands must be answered within 3 seconds of their creation otherwise they become unavailable

plucky imp
#

ahh

wheat mesa
#

If you defer the interaction you get 15 or 10 mins to reply or something

#

Can’t remember which

#

Might even be longer

plucky imp
#

okay

quartz kindle
#

TIL

#

grep pattern1 file; grep pattern2 file
is faster than
grep pattern1|pattern2 file

bright hornet
#

How can i do this on schema? my codes keeps creating new Object

items: Array
|
-> 1: Object
|
-> itemName: Object
|
-> ""

earnest phoenix
#

unless I am misunderstanding

bright hornet
earnest phoenix
#

So basically

{
  "items": [
    {
      "itemName": {
        "asdasd"
      }
    }
  ]
}

is this what you are trying to do or am I misunderstanding something here witth that last part?

bright hornet
#
items: {
 0: {
   itemName: "Some name"
   itemPrice: "Some price"
},
1: {
   itemName: "Some name"
   itemPrice: "Some price"
}
   
}```

but it seems this is how i need to do it 
```js
if(data) {
                const report = {
                    reason: reason
                }
                data.reason = [...data.reason, report]
                await data.save()
            }```
earnest phoenix
#

Wait what

ember wedge
#

confused lamb noises

earnest phoenix
#

you could just push onto the reason array

#

instead of spreading data.reason

bright hornet
earnest phoenix
#

Okay but you spreading is pointless here just push to data.reason

#

data.reason.push(report)

bright hornet
#

[data.reason.push(report)]?

earnest phoenix
#

No

#

Wtf

ember wedge
#

do you have any experience with javascript?

#
data.report = {
 reason: reason
}
#

can't u do this?

earnest phoenix
#

Not if it is an array

ember wedge
#
// or with an array
data.reason.push(report);
plucky imp
#

pogginggg

boreal iron
#

Slash commands … finally topggGuns

plucky imp
#

ues

#

doing the antiraid rn

dry imp
#

me when slash

boreal iron
#

Next year Discord being introducing a completely new way of interactions

plucky imp
#

i'd actually cry

boreal iron
#

Makes all recent changes obsolete again freerealestate

plucky imp
#

@boreal iron peep the rich presence

boreal iron
#

Huh what?

plucky imp
#

click on profile

boreal iron
#

Huh what am I supposed to see there? Argg I don’t get it

plucky imp
#

holon

#

lol

boreal iron
#

I still don’t get it wtf

#

You’re editing your bot?! Is that what you mean?

plucky imp
#

y e s

#

dang my timer reset

#

i've been making this one command

#

for 4 hours

dry imp
#

go back to skype or boomer shit messenger

boreal iron
#

Eww this name should be a banable offense

#

Never even used it once but still hate it more than you can think of

earnest phoenix
#

The auto mod that takes care of itself

#

Little to no human interaction needed

plucky imp
#

would be pog

earnest phoenix
#

It was originally smth I was going to do

#

just dont have the time

plucky imp
#

understandable

#

currently watching korewa eden lol

dry imp
#

imagine makin ml for a dsc bot

plucky imp
#

what

earnest phoenix
#

come here

dry imp
#

okay

boreal iron
earnest phoenix
#

No but it is grinder

plucky imp
#

w u t

#

pogggg

quartz kindle
#

no this is shitter

plucky imp
#

also bopera bx kek

#

also brb hanim- anime is starting CB_neko_bye

earnest phoenix
#

nerd

plucky imp
#

i watched the whole thing already

#

weeb

earnest phoenix
#

I already finished season 2 like a month or two ago

plucky imp
#

same

#

i'm jus rewatching cs no new season of bofurui sad

slender thistle
plucky imp
#

uhm sure

slender thistle
simple stump
#

Anyone know when DJS is adding message attachments to slash commands lol

boreal iron
elder wolf
#

uh

boreal iron
#

You mean the builder tools?

#

You don’t need them.

elder wolf
#

My bot seems to work pretty well!

#

can’t wait for it to be accepted

#

hopefully

boreal iron
#

You should check your 9k notifications

#

Maybe they are important freerealestate

elder wolf
#

Replit

#

very good db

#

yes

#

Relit

#

Replit

#

Their coding site has uh

#

A built in data base

#

because I am using it

#

:)

#

yes

#

wait why is it horrifying

#

wait but why though

#

oh

#

wait would that mean I would have to change all the er

#

db[“

#

And such

#

I’m not sure I have time for that anymore

#

i mean to change everything again

#

should I still code on Replit though

#

i was thinking of that

#

though would it be hard to switch all the db[“userid”]

#

(This is my first discord bot and I coded it in 4 weeks)