#development

1 messages · Page 2073 of 1

near stratus
earnest phoenix
near stratus
#
<Guild>.fetchOwner().then(owner => owner.send("......"))
earnest phoenix
earnest phoenix
near stratus
#

not channel

#

use your eyes

mint plume
#

Hello

#

Im new

near stratus
near stratus
mint plume
near stratus
#

no

earnest phoenix
mint plume
#

What you play?

near stratus
#

rn I'm playing Subnautica

sharp geyser
mint plume
#

Oh

near stratus
sharp geyser
#

🤷‍♂️

earnest phoenix
#

guild is not a function

near stratus
#

ofc guild is not a function

earnest phoenix
near stratus
#

it's an object

#

wut?

earnest phoenix
#

like this ?

near stratus
#

guild is not defined

earnest phoenix
#

i didn't sleep enough + iam convert v12 to v13 so sorry if i maked you angry or something

earnest phoenix
#

const guild = channel.guild; ?

near stratus
earnest phoenix
near stratus
#
const owner = await channel.guild.fetchOwner()
owner.send(".....")
#

you have to do like this

#

wait a minute

#

how are you getting a channel on a roleDelete event

forest drift
#

thx

pale vessel
#

Rude

earnest phoenix
sharp geyser
#

Nvm don't pay attention to me got the error codes mixed up

lyric mountain
lyric mountain
#

I hate everythin about that code but oh well

#

where is Announcement_Tapped called?

#

and where are u instantiating AnnouncementPage?

proven escarp
#

Where do you invoke the AnnouncementPage class?

#

where do you use it?

earnest phoenix
#

how to make it delete the message with the delete option

#

code :

lyric mountain
#

and where is authenticationToken declared?

#

print it to see if it does have a value

#

also, isn't there a Navigation.Push or Navigation.PushSync?

#

since it specifically states PushAsync I imagine there is a sync version of it

#

weird, but anyway

#

try catch?

#

try catches wont get empty/null values

#

unless something throws an exception

#

well, then I can't really imagine why would it be null

pearl trail
#

ctx.showModal(modal), make sure it's not deferred

boreal iron
#

Modals can only be shown as response to an interaction

wheat mesa
#

^ this

earnest phoenix
#

How can add website in bot page description?

boreal iron
#

you can either use html and css to build a proper description or use iframes to include your page

#

(which has some downsides but works)

earnest phoenix
#

How define css file likw style.css etc

boreal iron
#

you can't include external files

earnest phoenix
#

Cn we use website link as css

boreal iron
#

that's exactly the same

#

you can't include external files

earnest phoenix
#

Like this

boreal iron
#

you can put your CSS right into the description in proper tags of course

earnest phoenix
#

Hmm

boreal iron
#

write the stuff in your editor and take a look at the preview, once you're done, just insert all into the description text area

#

also you're limited to html and css, no JS

earnest phoenix
#

Understand

mint rock
#

hi, i'm having a little problem with spawn from child_process
i manage to spawn process but cant write to it or receive more than one message from any event

#

is there any way to run it as separate process but still be able to write to it?

feral aspen
#

Quick question. 👋 How do you use template literals in Java? Eyes

wheat mesa
#

template literals?

#

You mean generics?

feral aspen
#

Yes, something like:

console.log(`Hello ${name}.`);
wheat mesa
#

Oh

#

Nevermind that's not what I was thinking of

feral aspen
#

How do you do so in Java?

wheat mesa
#

Java doesn't have that

#

You just have to concatenate

feral aspen
#

Oh, so System.out.println("Hello " + name);?

wheat mesa
#

You could use something like String.format("My name is %s", "Waffle");

wheat mesa
mint rock
#

maybe try format

feral aspen
wheat mesa
#

Or System.out.printf() does the same thing as String.format() except it prints it as well

mint rock
#

oh nvm x

earnest phoenix
boreal iron
#

make sure to just use html, not html and markdown together

earnest phoenix
#

Cn i show you code?

boreal iron
#

sure why not

#

your page is public anyways

#

so nothing private inside

earnest phoenix
#

Check my about section

#

You cn visit there

#

And explain me what is main issue

boreal iron
#

I need to see what your code looks in the description area

#

not your website

earnest phoenix
#

Ss mean?

boreal iron
#

yeah or sourcebin or hastebin

#

whatever you like

earnest phoenix
boreal iron
#

first of all, get rid of the doctype and head element as well as the body tags

#

the website itself already has them and you can't overwrite them anyways

#

also you're still trying to import the style.css

earnest phoenix
boreal iron
#

told you, you can not import external files

earnest phoenix
#

Full here

earnest phoenix
boreal iron
#

ok 5th time now, you can N O T import external files

boreal iron
#

<link rel="stylesheet" href="https://kirabot.site/css/style.css">

earnest phoenix
#

We can't import from link

#

Wow

#

Hmm

boreal iron
#

as I said you can not

earnest phoenix
#

Any way to do that

#

Without important it

boreal iron
#

you can use iframes as alternative way

#

or simply build a html/css description without requiring an external file

#

by putting the css in proper tags

earnest phoenix
#

Hmm both think in one file

boreal iron
#

the possibility to include html and css in your description is meant to style your description properly, not really to build an entire website

#

if you wanna include your already created website, then use iframes

boreal iron
#

the src attribute is your website URL

earnest phoenix
#

Oho easy

#

What is length and breath of topgg description?

boreal iron
#

length and breath

earnest phoenix
boreal iron
#

I don't think there's a limit if you mean that

#

You need to figure out if there's a minimum description when using html code such as an iframe

#

don't think so, but I'm not sure tbh

feral aspen
#

During Minecraft Java learning, I came across this line of Player player = event.getPlayer(); at:

@EventHandler
public void onBedLeave(PlayerBedLeaveEvent event) {
    Player player = event.getPlayer();
    player.sendMessage("Amigo, you just left your bed. ;-;");
    player.setHealth(0.0);
}
nocturne dagger
#

Hey guys

feral aspen
nocturne dagger
#

Anyone know if there is a work around for still using v12 discord.js.

Right now the whole thing crashes if any message is sent in the voice chat text

feral aspen
#

I mean, we made a new player variable and set is as the value of event.getPlayer() which returns the Player object, but why Player before player?

feral aspen
#

Why are you still on that version??

nocturne dagger
#

Besides that lmao...

feral aspen
#

No, update.

nocturne dagger
feral aspen
#

So?

boreal iron
feral aspen
#

It's not like we're not updating even more files.

nocturne dagger
#

its just me, and haven't done it, don't have any features that use new discord stuff so was never needed

nocturne dagger
feral aspen
#

But there are breaking changes.

nocturne dagger
#

I guess it is time to update then

feral aspen
#

Should've done so a long time ago.

boreal iron
#

update to v14, not to v13 anymore

feral aspen
#

Eh, don't anyways, you can either update now and update again at V14, or struggle till V14 comes out.

wheat mesa
feral aspen
wheat mesa
#

TypeName variableName = optionalInitializerExpression

#

No

#

Well yes

#

It's technically an Object, but almost everything in Java is an object

#

It's a Player type

#

(Which automatically extends Object by default)

earnest phoenix
boreal iron
feral aspen
boreal iron
#

Don't think much more will change but I could be horribly wrong of course

earnest phoenix
boreal iron
#

the already mentioned changes in their guide post doesn't even match their actual code changes, so nothing is up to date anyways

earnest phoenix
#

What is height and width of top.gg description?

boreal iron
#

maybe waiting a bit longer might be the solution here

boreal iron
#

as you want it to be

wintry tendon
#

hello boys n' girls
my bot used to work without slash commands and a lost of people are using it, and they invited it using the link i sent them which didn't include applications.commands scope, do all of them have to reinvite the bot for slash commands to work ?? thanks in advance

earnest phoenix
feral aspen
# wheat mesa `TypeName variableName = optionalInitializerExpression`

Also, quick question, for Java organisation, should I do something like this or the other:

@Override
public void onDisable() {
    System.out.println("The ... plugin has stopped! Uh oh.");
};
@Override
public void onDisable() {

    System.out.println("The ... plugin has stopped! Uh oh.");

};
boreal iron
#

I mean if he hasn't the message intent then he's fucked anyways

#

soon

feral aspen
#

Oh, damn, true.

#

Still, IF he gets accepted, if not, there goes the bot.

earnest phoenix
wintry tendon
earnest phoenix
#

description length must be at least 200 characters long

boreal iron
#

Well then you need to add some text above or below your iframe or simply insert some css code in tags to get rid of the error

earnest phoenix
#

Hhmk

boreal iron
#

or comment out some html code

#

doesn't really matter to get rid of the minimum length

earnest phoenix
boreal iron
#

well will be able doesn't mean they will do

earnest phoenix
#

But then again, you should try to see if the default Discord bot invite links grants that scope if you want to make sure

boreal iron
#

so you should at least check if the app is missing this permissions and either leave the guild or send a message to a channel or the owner

boreal iron
#

requiring a reinvite including your oauth link

wintry tendon
#

thanks voltrex

boreal iron
#

did voltrex do something?

earnest phoenix
boreal iron
#

my gosh just define some random selectors with or without random properties

earnest phoenix
boreal iron
# earnest phoenix But bro when i add css it showing on page

there you go

.some-random-selector-nobody-fucking-uses
{
  content: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et'
}
#

once that becomes a valid class name on the site I don't wanna live anymore

boreal iron
#

just make a screenshot of your description

earnest phoenix
#
<html>
<body>

<iframe 
src="https://kirabot.site"
width="300"
height="200"
title="Kira - The best discord bot">
 </iframe>
there you go
.some-random-selector-nobody-fucking-uses
{
  content: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et'
}
</body>
</html>```
stuck dawn
#

why is this not getting the assets folder?

lyric mountain
stuck dawn
boreal iron
lyric mountain
#

I suppose that code is inside Social.tsx?

stuck dawn
#

yes

earnest phoenix
lyric mountain
#

try simply typing, sometimes the lang (especially non-typed langs) prevent the editor from showing useful results

boreal iron
# earnest phoenix <@243443167704121344> code
<style>
  .some-random-selector-nobody-fucking-uses
  {
    content: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et'
  }
</style>

<iframe src="https://kirabot.site" width="300" height="200" title="Kira - The best discord bot"></iframe>
earnest phoenix
#

Oho

earnest phoenix
#

Thz

boreal iron
#

also remove the html and body tags

#

I said this before, too

lyric mountain
#

The best discord bot
wow that's bold

earnest phoenix
lyric mountain
#

did u try src="" instead of src={""}?

stuck dawn
#

same

lyric mountain
#

press F12 and see what error pops in console

stuck dawn
#

nothing :|

boreal iron
# earnest phoenix Ya done

also might make sense to adjust the iframe a little bit
for example:

<style>
  #iframe-website
  {
    border: 0;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 400px;
    max-height: 400px;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    z-index: 1;
  }
</style>

<iframe id="iframe-website" src="https://kirabot.site"></iframe>
keen coyote
#

im confused

#

i want to use guild.members.read permission

#

but its saying i need a redirect uri

#

what do i set my redirect uri as

#

i want guild.members.read, bot, and applications.commands

lyric mountain
#

it should be your oauth2 handling api

keen coyote
#

what should my oauth2 handling api be

#

what even is that

#

like this thing

lyric mountain
keen coyote
#

bruh i have to write an api

#

what

lyric mountain
#

yes you do

#

it works like this:

keen coyote
#

can it just be local

#

yeah ik how to write an api

#

do i have to host it

lyric mountain
#

you have to make it publicly acessible

keen coyote
#

i want it to me on my machine

#

i dont want to have to host an api

lyric mountain
#

then nobody else will be able to use it unless you expose your machine to the world

keen coyote
#

ok

#

so discord cant access it

#

the discord.js example hosts it locally

lyric mountain
#

discord wont access anything

#

it's the user that will

#

how oauth2 works

#
  • user authorizes
  • your api receives a code to access specified scope
  • you trade that code with discord
  • discord returns the protected resource
keen coyote
#

security🤢

#

ok

#

thanks

lyric mountain
#

well, you would be doxxed frequently if oauth2 (or any other authentication) didn't exist ¯_(ツ)_/¯

keen coyote
#

zamn

lyric mountain
#

also do note, I wouldn't expose my pc if I were you

lament rock
#

public and private key logic fries my brain

#

I need some JS error stacks to test my regular expression against. Can I get some

lyric mountain
#

just browse github for the worst discord bots available

lament rock
#

lmao

lyric mountain
#

chances are they'll have a ton of unhandled errors

lament rock
#

I mean just errors I can quickly copy paste for unit testing

mortal snow
#

Having problems with slash commands, So when the bot gets invited into a new server the slash commands don't register till I restart my bot, any clues?

wheat mesa
#

I mean, are your slash commands not registered globally?

lament rock
#

bone apple the teeth

quartz kindle
#

fuck ts

#

(yes again)

#

i have a function that does res.write(some stuff) for an http server, but it can either be an http server or an http2 server, and if i make res be of type HttpResponse | Http2Response ts gives me an error saying .write is not callable

#

ffs

cinder patio
#

use generics maybe

wheat mesa
#

force cast it unsafely so you can crash your program :troll:

quartz kindle
#

im not sure how i would use generics in this situation, where the http/http2 server is attached to a class and decided based on the class options

#

like if x options, then this.server = new http/http2 server

boreal iron
#

Why the fuck…
interaction?.member.roles throws an can’t read undefined property error if member is null
What in the world, why is optional chaining broke here

quartz kindle
#

interaction?.member?.roles

boreal iron
#

Why the fuck so I need to make any chain optional?

cinder patio
#

for example

boreal iron
#

In this case roles is always a property of member but member can be null

#

What the fuck is that logic

quartz kindle
#

if both interaction and member can be null/undefined, then both need to have the optional chain character

#

if interaction is always defined, then only member needs the optional chain character

boreal iron
#

Isn’t it?

#

Omg i did something horribly wrong

#

It should be interaction.member?.roles

#

Omg i placed the ? At the wrong position

#

ANYWHERE

#

Oh ffs

#

How could that happen

#

time to quit coding

quartz kindle
# cinder patio ```ts interface OptionsA { optionA: string } interface OptionsB { optionB:...

how about this? ```js
class A {
constructor(bla) {
if(bla.x) {
this.server = createServer()
} else {
this.server = createSecureServer()
}
this.server.on("request", this.onRequest.bind(this))
}

/**

  • @param {*} req
  • @param {http.ServerResponse | http2.ServerResponse} res
    */
    onRequest(req, res) {
    res.write() // error callbacks are not compatible with each other, even though both accept the same parameters lol
    }
    }
cinder patio
#

how does bla look like

quartz kindle
#

basically bla is options

#

options.server defines what type of server runs the class

#

then the events are attached to it, all events are exactly the same, regardless of server type

#

and basically every single req/res method doesnt complain

#

res.write is the only one that complains that http and http2 have different callbacks

#

even though they are actually 100% compatible

#

im just gonna remove those types then lol, since all of this is only used internally anyway

#

if i make res be import("http").ServerResponse & import("http2").Http2ServerResponse instead of import("http").ServerResponse | import("http2").Http2ServerResponse then it doesnt complain lol, but thats not really semantically correct

wheat mesa
#

Now that’s some jank if I’ve ever seen it

#

Tim always finding ways to pick a fight with the compiler

quartz kindle
#

indeed

#

for some reason my uses cases always hit the limits of ts's intelligence

#

actually it just feels like node has bad typings sometimes

#

its not the first time that i have issues with node types

keen coyote
#

ok im confused

#

when discord redirects to my oauth2 website

#

it says this

#

localhost sent an invalid response.

eternal osprey
#

Hey guys for some reason if i try to install node v16.6.2 on my 18.04 ubuntu vps it only upgrades to v16.16.0?

boreal iron
#

Isn’t 16.16.0 newer than 16.6.2

#

Wut

#

Or did you mean 16.16.2?

lament rock
#

Poggers. My regular expressions are good

rustic nova
#

I misread that as regular depressions im sorry

quartz kindle
#

most people here are regular depressions

rustic nova
#

indeed

lament rock
#

true

#

regex has given me way too much power

quartz kindle
#

regex is an alien language

#

you are appropriating alien culture

#

canceled

lament rock
#

Less of an alien language than brain fuck

#

Time to work on a nodejs native audio processing library

#

because piping through ffmpeg sucks

lyric mountain
#

regex is a self-encrypting language

#

only the original author can understand it

boreal iron
quartz kindle
#

which calls directly into the ffmpeg C source code from js, instead of running it through a shell script

lament rock
#

There is but I cannot figure out its interface at all

quartz kindle
#

xd

lament rock
#

no literally, it's so bad that I'm looking to the bible for help. I also cannot find jack shit about opus' specification such as how to read the headers

#

Like wtf is this lol

OggS☻

↓l���☺‼OpusHead☺☻8☺��OggS

Lavf57.83.100☺▲encoder=Lavc57.107.100 libopusOggS��

↓l☻U���:����������������������������K��������������}����������������$���c��*��2��ՆwTƬ▲�����N��1y��(5��#��b�d�ƽ�r��i�
�       �→A"�y��'�
▬�ۊ♣���J��̓��5�����]��↕%�w�`{LA\���{��g;♦l¶�`�◄�GO�↔Zσ��b�X��►�fYm>Xx�#�xӻ�9v�ۻ��A:�C�ܡ���ͫ��→�����#���+���G^�↔��*)����j�∟��`W��i��M}����0��� &./◄6�c��s�<���L�GJ�▲�rG���"�e*�s?"��_��6��c>����☺U�h�B�J�
ae♣���Y�;,J`����M�D�_��↨�§���♣���▲f↨F∟��‼*↓c��@NVJ��W��]BN�����t�;7��‼U�        ��v=%6}�,I�|▲Ɠ:�%
Dr►☻�Ɔ>��D��"h+Q��X�$�E�`y▲Q∟[��3�S<7��♣U�p�Qo�Ė�˫��v�▬jj�E�*����a�¶O∟Ze�V�6��►�7Fe�)�t�G��↕�v>ݮE����R_�◄�Jd]��z�B�P☻�
▼uvEQ�~I∟�r$,��↓�\�&����~�#�G����‼�":EW�qϋ��
���X����lCC}�§♦5�b�p���X31��{�ϙ��h`{LA����꺾cE=ݜ���S4�J}|^t�LW��        ��ν�↔�k\▬[KO4)��Iw&[X��6dj@�lz‼�ߔlud�wd�z�z�Շ��d���w*q�v�ŭ���T▬�u�▬q�9J�W[��▲j�x�K�q�n�QM?�u��↕m�SjX�apۭ�♠�3ܹҏ��`{Ly�q��↕�.��Z♣�W��C§�"������r���$d���`☺7T�����z��%↑����nn$3[�(�'�∟��:3Z→R♦CtO�\�*#E�%W☺��_�↑�/q♦r��i�2۬↓i`��V"�cM@N.�-&��үE~k�Ꝩ�/��aw����Wh��I��bg��∟Al�%�Თ♦���-�̤∟��ӭ☻�3��_{ܔb�\o�Ə[�"���↔514'��i4����a<9
֥<K�↨��o�2→��//a▲�̥��Z?�9����d��a�\���y�♥�g��%�▼���
��0↕�☺{�¶%Np9���μ΃Ψ>nz��AC�w2��7`Ra�↑�#��rvB��f��m��♦�8�������f&�9P�46[s��@f��K↓☺♠e���X�֡7�?� �~☻&s/E*j(m☺���U�O�k�&��J�g�]�[�Y3ׄ���>�♥h���h�Ru��jӢ�a+���JQ�Q}���.��|;�+"�-`���☻�`��&▬dI/���B�▼������o���ܭ�Q���|�O�^�ȕ�%���ʭS◄�q�UV���\}▬��G��↕��V���m�,�{�w�:1�������;Hb�,��7;#~��;YU��g=�▼��→O}����x#�%�☻g"�?�H�ۂL��R��4�����L�&+ϲ<~v�↔�͡�ѽ���G�Y�5��J����uP9D▼W48iג������6���ɣvH& Dz��e�VU↓]����#���F◄FMv׸�a��z�ᨿ▼E��2�►`DT�↑��◄�6��Sȏʔ����4
���►▲��ZAd2[Y�▲���Rܾ�ո↕/�J-☺;Op���]<sg��o$�`qC��7��
T�����5H��s�>�Tȧ↑�#�5T�B�a:�U�5�X��Q�-�����#�c���y�N�B��A�@♦ �}�t��;bE7▲.w�!x¶��=���gψ�k����Z����e��▬�et☺U�D�♥� ���}↨?'�q��2��,☺�rA5↓p5��~�`����IE�Pl$▲�►��♣�:n8CK��♣$<�-{��k���-nDž@�jb�t�ݙN/���v����Wfh�
�z�ύ�a;�T������Pu��lY�‼Em|►�lSݣ�X∟�M5�� �k������Q↕��▬��_���an.S��a:�!����oq     �OV��♠vCd��H�~a▲��&`    R��|^-�E�☻�*P����§���m↑�v�Y�GI�v���܌�$y�Q♦tg-�U"�%��~��s��g�p��i�2▼&m��4�U�R%˪�tj�∟#().�Ѥ����8~0↔��`��)j�▼:�f%�'�j���}  �qf�X��¶��J&�↨�X@ҝ�↔f�→o0�8����W*▼DX�̺�ξ�►�_v����fɯ�A�� ^↕;�r��.↨↓D>A���`|[U§��=^:�L☺��})�ƹ{↔��♠F��"��tvx¶�#�
2G4|W�����X�Ҭ�H�O♥�X�r♠y���p↑&fC�_�Z�iJ��/��‼#♣���8X�J��↔� G�>u�0a��Ny�◄T��l
��$@���!`�y↑W�y�;↑�_ه�نf+▬f�I�x��m���§d�r�c�↔��Q¶Lj�@T�<�§J◄X<$)��#������0t�Oe%�^�`y▲�3�!�∟A��/b��>rfY�Or�Na����↕X��ʷ���)�ZWsw���♣�↓;�����Yw�e�=j�^▼&v(��↔→�1�/8���%\?K�!@-+��d*�L�y"l��¶����7
ݸt��G�tp'�↨D�►n�r���!���♠,t5>
��X��e6◄☺�↕@�(�
:�M�p�·♦→f�����RX#��* Hn♠�^D���Q���▼Tt‼ſ�<�3�↑�J N��‼�ы�T�ը�/�▼{͖^���r7▼B���`{Lzf�����(�i��c�ۊ"yD�‼�CG{
T�lt�n����bl�H����u�.P��H�o����a:��↨3�c1��‼���P�‼*- !�2RJ�fu�!�:�↑�}��g��-���↔4q��↓�߹Q}�q�9"�
-ѵˇ�K►�N��7����t�ew��qhz����♣▼�Vs^a�M@��S���x��♥x[��ݲ1��5��hѧ/¶1�9�I�Z��sEw*�{��<�mt��ZӳG§�!Gv/܄�zc�♦#��E�↕\g�◄%↔�HNhAl̀4↑��W��B��"����3���W��H�►�줝����|�򉯫���5���v�L�l�� ↓�&��`{Zj�a��                                                        ̀\��nW��3����X��O�B"��k��oY� ̮T��        `�r^#��~a��I���$�
quartz kindle
#

lmao

#

well you cant really read binary as strings xD

craggy pine
#

Wat da fuck is that

lament rock
#

I mean I need something I can read or understand what to look for, but no info

#

No byte ranges

#

nada

quartz kindle
#

where did you log that from? an ogg file?

lament rock
#

.opus file

#

I guess ogg opus encoded

#

brain frying trying to wrap my head around shit

#

bad idea I guess

quartz kindle
boreal iron
lament rock
#

fr

#

ascii encoded gives a little more at the very least

quartz kindle
lament rock
#

What's the 0-9 at the top

#

bytes?

quartz kindle
quartz kindle
#

i mean, the top ones are bytes

#

the ones under are bits

#

or idk

#

why are they offset by 10 and not 8 wtf

#

it should be all bits then

lament rock
#

Thats why I wasn't sure

quartz kindle
#

0-31 bits

#

it shows each character taking up 8 spaces, so yeah looks like bits

#

A single page can contain up to 65,025
octets of packet data from up to 255 different packets. Packets can
be split arbitrarily across pages and continued from one page to the
next (allowing packets much larger than would fit on a single page).
Each page contains "lacing values" that indicate how the data is
partitioned into packets, allowing a demultiplexer (demuxer) to
recover the packet boundaries without examining the encoded data. A
packet is said to "complete" on a page when the page contains the
final lacing value corresponding to that packet.

#

yeah im out, im never gonna deal with this crap

lament rock
#

Me too wtf

lament rock
#

Interesting, but lame

#

this should have existed already

sharp geyser
#

Yea

sturdy geode
#
<!DOCTYPE html>
<html lang="en">
<head>
<title>Synvatto</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
  font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>

<h1>Synvatto</h1>
<p>Hi i am Synvatto</p>

</body>
</html>```
#

ong i leaked my portfolio source code

boreal iron
#

Hmm... is there actually a known way to get a command option (value) of an button interaction, if this component was send as response to an interaction?

/command option: value -> response incl. components (button) -> pressing button (wanna know the command option value)

#

The button interaction has the message object of the previous interaction but only the basic information, like command name, user and type

sharp geyser
#

You can fetch the command and get the full data iirc

boreal iron
#

yeah I want to avoid fetch if possible

sharp geyser
#

Why?

#

I can't think of any other way as you only get partial data to my knowledge through other ways

boreal iron
#

yeah I hoped this partial interaction data would include the command options

#

but it doesn't

sharp geyser
#

Only way I can think of is fetching

#

Though I haven't used djs that much lately so I don't know of any other way

boreal iron
#

I don't see any way here except fetching it seems

sharp geyser
#

I honestly don't see a problem with fetching why were you so hesitant to do so in the beginning?

boreal iron
#

I provide some data when executing my command and will add the button to see additional data, based on the entered command option

#

don't wanna fetch the entire message if I can get the option somehow else

#

for example by caching the application ID and user and my value

#

once I click the button I can compare the user and app ID and go on with the value

#

might be the easiest way to simply cache this app ID and the value to the cache

#

since both in combination are unique

#

thus I don't need to fetch anything

earnest phoenix
#

Hi, how i could get here the exact numbers of servers and users, without inserting them manually?

sharp geyser
#

You can get the guild count from your bot and same with users as well

surreal sage
#

I have a header background image but it's a little bit big
How do I make it more zoomed out while keeping the property "cover" for background-size?

lyric mountain
surreal sage
#

I'll extend the image's size vertically in that case

lyric mountain
#

yes, until its bounds touch the parent's

#

you can't really "zoom out" because that'd break cover's purpose

#

you can, tho, use containt

#

which is like cover but will stop at the first touching boundary

#

where cover will stop when all boundaries touch

#

this will leave u with holes to the sides tho

#

if the image is going to be always black u can set a background color

surreal sage
#

How would I use contain?

lyric mountain
#

look at the image I sent

surreal sage
#

Not ideal lol

#

oh wait I get it now

#

If I remove the background from the image and just make it the astronaut and the text it'd be good

surreal sage
lyric mountain
surreal sage
#

But it still works xD

#

"If it works, I aint touchin' it"

lyric mountain
#

just a sec lemme grab that cow gif

surreal sage
#

lel

boreal iron
#

true! never touch a running system

quartz kindle
#

couldnt be me :^)

boreal iron
#

without destroying what took hours or days of work to do, you can't live

carmine summit
#

what can yall recommend for a free restful online database

earnest phoenix
#

Hi, how i could get here the exact numbers of servers and users, without inserting them manually?
In html or php

carmine summit
sharp geyser
#

It literally doesn't change how you get the data

#

You just gotta display it

sharp geyser
#

You can just use vanilla js and fetch api

carmine summit
sharp geyser
#

Why

carmine summit
#

don't you need it to get the data?

sharp geyser
#

I do my frontend with my bot so I can just use the client

#

If you don't wanna do the frontend with the bot though you'd have to make an API yes

carmine summit
sharp geyser
#

Tf you talking about

boreal iron
#

bot being hosted in the firefox dev tools

sharp geyser
#

You'd host your site how you'd normally host an html and js site

carmine summit
sharp geyser
#

Although I don't understand why people use vanilla js and html anymore frameworks are honestly just a life saver

boreal iron
#

because people like to do things themselves in order to not look exactly the same like everybody else

#

why do people still develop a bot if one already exists covering those features?

#

why's there more than one car manufacture as we could all use the same model

#

etc.

sharp geyser
#

This argument seems invalid

boreal iron
#

you're invalid, dingus

sharp geyser
#

Using a framework doesn't make it look the same

#

A framework is meant to take the strain off not do everything for you so if you're looking like everyone else you're just lazy and uncreative

sharp geyser
boreal iron
#

🔫

sharp geyser
#

Mad cause wrong

sharp geyser
#

Get food

#

Please

#

I'm hungry

boreal iron
#

omg I'm fucking hungry, too

sharp geyser
#

L bozo

#

I have chips and dip

boreal iron
#

literally ordering some pizza now

sharp geyser
#

I'ma much on those

sharp geyser
#

this is joke I don't have bot

boreal iron
#

can I enter my credit card information and cvc?

sharp geyser
#

Ofc you can

sudden geyser
#

yeah just send it through my dms

boreal iron
#

great!

sharp geyser
#

Sadly our system is broken just like mc Donald's ice cream machine so you have to send it to klay

#

And he will manually enter it

sharp geyser
#

Also if you notice charges of 500 or more they are just verification charges dw

boreal iron
#

I'm curious but fuck it, what can go wrong

#

lmao

sudden geyser
#

If your credit card gets drained don't come crying to your bank

sharp geyser
#

Time to go into debt fake

boreal iron
#

card's full of money, more you can spend

sharp geyser
#

What's the max you can spend on a credit card before the bank says no?

#

Isn't it like 20k or more depending on the bank

boreal iron
#

nah totally depends on your bank and creditworthiness

sharp geyser
#

Icic

#

Either way prepare to be in credit card debt

boreal iron
#

really thinking about to invest into star link, ngl

quartz kindle
#

i have another one with a limit of ~147 dollars

#

you need like at least a decade of credit building and stable income to get anywhere close to 20k limit lol

earnest phoenix
#

whats the best way of obtaining the amount of ram used per shard?

somber ridge
earnest phoenix
#

i use discord.js

eternal osprey
#

hey how do i reset all slash commands

#

remove*

loud shuttle
somber ridge
# earnest phoenix i use discord.js

If shard(s) are running on different processes which I think discord.js does, you will have to broadcast an eval to each shard which in turn should be able to process a os sys call to obtain the usage

earnest phoenix
#

ahh oki

eternal osprey
# loud shuttle if u storage your slash commands in a collection, u should execute `<slashComman...

I am using this: ```js
let commands = []
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
client.commands.set(command.data.name, command);
commands.push(command.data.toJSON());
}
const rest = new REST({ version: '9' }).setToken(n.token);

(async () => {
try {
console.log('Started refreshing application (/) commands.');

await rest.put(
        Routes.applicationGuildCommands(clientId, guildId),
        { body: commands },
    );
    console.log('Successfully reloaded application (/) commands.');
} catch (error) {
    console.error(error);
}

})();```

eternal osprey
pearl trail
carmine summit
#

what can yall recommend for a free restful online database

boreal iron
fast bronze
carmine summit
#

I just want a database that uses jsons

boreal iron
#

wut, a json database oldEyes

fast bronze
boreal iron
#

Stick to sqlite or similar solutions instead of using an external service

carmine summit
#

or something like quick.db but online cause sync

boreal iron
#

cause sync?

#

If you wanna use the database on multiple projects with external access to it host your own database

#

Pretty much the easiest solution

carmine summit
#

isn't there a solution like firebase but not?

boreal iron
#

You won’t be able to read/write on one database file on multiple instances

#

Hosting your own sql database is quite easy if you’re already familiar with sql

carmine summit
#

isnt just there something like mongoose but no schemas

pale vessel
#

MongoDB lol

boreal iron
#

cough sql

carmine summit
sharp geyser
quartz kindle
#

in europe its basically impossible to get a credit card if you dont have a stable job

#

the bank asks you for tax receipts for the last 3-6 months to see if your income is stable

#

and sometimes even your job contract

sick agate
#

weird

boreal iron
#

May depends if you’re already a customer of the bank or not

quartz kindle
#

yeah but i believe the tax receipt requirement is standarized across europe, i might be wrong tho

#

i've seen many banks who dont even work with credit cards at all, only debit

boreal iron
#

Yeah

onyx lantern
onyx lantern
#

@pine nova your a menace

pine nova
winged linden
#

Yo anyone know if we can store Unit8Arrays in mongodb?

#

If yes how can we do that

quartz kindle
#

store it as binary

#

mongodb has a "binData" type for that

tired panther
# boreal iron Not really but okay

There is company in Germany called "Schufa", which has the records if you pay your bill in time, how many contracts you are in and if you ever requested a credit. Quite detailed...

The records are updated for every payment action you do.

And based on that info => a trusty index will be created.

So it is impossible to get a credit....

crystal wigeon
#

hey is it possible to get emote by its id on the web and display the emote?

#

is there an api?

fiery elm
#

whta happen with bot

#

@oak cliff@modern sable

surreal sage
#

I'm trying to optimize my site and I'm having troubs with screen width 479 px to 839 px

#

The element "div" is called "mdl-grid"

#

It's parent element "div" called "grid-holder" has the following code in it's style(s)

.grid-holder {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}```
fiery elm
#

@surreal sagewhta happen with bot

surreal sage
#

?

fiery elm
surreal sage
#

Who?

rugged dawn
surreal sage
#

🙏

surreal sage
knotty bramble
#

'-'

sturdy stratus
#

How do I let the bot know that they voted for it?

lyric mountain
sturdy stratus
lyric mountain
#

at your bot's page there'll be a part related to the api, right to the bottom there'll be a field where you can input your server's url

sturdy stratus
sick agate
#

yup

boreal iron
sudden geyser
#

That's just a bank.

#

All that credit agency is doing is acting as a middle man for the bank

boreal iron
#

Not exclusively for banks

#

Also if you wanna rent an apartment or wanna make a deal with companies your rating and background will be checked

sudden geyser
#

which goes through your bank

boreal iron
#

I’m doing the same before getting into business contracts to get to know with who I am working together, if he’s paying his bills in time etc.

boreal iron
proven escarp
#

right?

#

right?

boreal iron
#

My relationship to auto correct is quite complicated

pale vessel
#

to?

boreal iron
#

Sheeesh, stop blame me for my English skills or I’m gonna cry

sturdy stratus
#

how do i make my bot know who voted for it, so the bot gives charge?

winter pasture
sturdy stratus
winter pasture
winter tapir
#

Does anyone know why I would get a status = 403 error when trying to log votes and testing it with the test webhook button?

winter pasture
winter pasture
#

Any errors?

winter pasture
lyric mountain
sturdy stratus
winter pasture
#

Use the test button in the webhook section to test your bot webhook

sturdy stratus
winter tapir
#

in my auth

winter pasture
winter pasture
winter tapir
#

I do have another question, how would I be able to host and use webhooks on localhost

pine nova
winter pasture
winter pasture
winter tapir
quartz kindle
#

its different for every router

quartz kindle
#

you need to check your router model and you need to have the admin password for it

#

overall its not a very good idea to run a vote webhook server on localhost when free hosting like replit exists

winter pasture
# sturdy stratus

Yeah, above make sure the auth is the same you have in your code, and that the webhook URL is set to a externally accessible IP/URL

#

Then you can use the test button to send a webhook test

sturdy stratus
winter pasture
#

Ok, when you click it. Does it work?

sturdy stratus
winter pasture
#

What does that say in english?

sturdy stratus
winter pasture
#

Yeah that is irrelevant to what we are trying to test now

#

Are the Webhook URL you added to the Top.gg webhook section publicly accessible?

quartz kindle
#

show the url you used in the top.gg settings

sturdy stratus
lyric mountain
winter pasture
sturdy stratus
winter pasture
#

Oh yeah, that is not going to work

#

You need to put the URL to your service

#

The IP/Domain you got running for your bot.

sturdy stratus
winter pasture
#

No. As long as your bot hosting provider allows you to have a http/https endpoint you should be fine

lyric mountain
#

It's not replit is it?

proven escarp
#

Most beginner developers use repl.it cause it's free and works well for them

#

no need to judge them 😉

lyric mountain
proven escarp
#

Does it?

#

Doesn't matter anyway

#

you can have multiple routes

lyric mountain
proven escarp
#

misread

#

nvm

sturdy stratus
#

how do i make webhook url?

quartz kindle
#

what is your host?

sturdy stratus
sturdy stratus
quartz kindle
#

free version?

sturdy stratus
quartz kindle
#

do you have an ip address and port?

sturdy stratus
sturdy stratus
quartz kindle
#

yes

sturdy stratus
#

what it does @pliant gorge ?

quartz kindle
#

gets server info to post on top.gg server list

sturdy stratus
quartz kindle
#

do you have an ip address and port?

sturdy stratus
quartz kindle
#

ok

rocky dagger
#

does anyone know why the rows i added dont appear in the table? If I log g.name and g.id the server names and ids gets logged

vivid fulcrum
#

forEach will not wait for the promises to complete

#

it just loops over the collection and fires the callback

#

and then code execution continues

boreal iron
#

Is there a space in the optional chains or is this a screenshot glitch?

rocky dagger
#

There is

boreal iron
#

You will be rate limited hard if you continue doing that

#

Use global commands once a command is tested and working

rocky dagger
#

There are some commands I only want working in certain servers

boreal iron
#

Also the cache property should always be a collection no matter it’s empty or not, just to say

#

So optional chaining is pointless here

quartz kindle
boreal iron
#

_wow Tim being an artist _

quartz kindle
boreal iron
#

lmfao

rocky dagger
#

And I figured out that there was a rate limit when I used nodemon and auto save

quartz kindle
#

:^)

boreal iron
#

damn I laughed that much I couldn’t see the street for a few seconds

quartz kindle
#

dangerous

boreal iron
#

No risk no fun you know

quartz kindle
#

dont blame me if you crash :^)

boreal iron
#

I do!

quartz kindle
#

lmao

#

im gonna plead not guilty

boreal iron
#

Sending the repair invoice straight to Brazil

quartz kindle
#

it will take 6 months to even arrive here

#

if customs doesnt steal the paper

boreal iron
#

lol

quartz kindle
#

and sell it to recylcing for a couple cents

boreal iron
eternal osprey
#

does anyone know a good equation for my xp-level calculation? i first went with 50 xp = 1 level, however that is not really beneficial as the higher level you are, the easier it is to levelup.

quartz kindle
#

there are a billion different formulas

eternal osprey
#

so basically, the higher level you get, the more xp you need.

quartz kindle
#

how hard do you want it to be?

eternal osprey
quartz kindle
#

also, is xp cumulative or does it reset on every levelw

eternal osprey
eternal osprey
#

Only requirement is that each level it gets significantly harder to levelup.

boreal iron
#

Just increase for example by 10% of the current xp value

quartz kindle
#

so something like next level = current xp * 2

boreal iron
#

Which will lead to an exponential growth

quartz kindle
#

dafuq

boreal iron
#

huh

quartz kindle
#

selfbot warning

eternal osprey
#

huh

boreal iron
#

lmao

quartz kindle
#

@solemn latch

#

lmao

boreal iron
#

Damn I got mentioned 3 times

quartz kindle
#

look at his profile pic and banner

boreal iron
#

I’m more popular than Tim

boreal iron
quartz kindle
#

lmao

eternal osprey
#

anyways, this is how i have it coded rn: js let popularity = Number(user.xp) / 50 How would that new system be coded in?

quartz kindle
#

@oak cliffyou're the last active mod on general, so take a look above ^

oak cliff
#

@tacit jolt

#

u a self bot

#

whats my question?

quartz kindle
#

self bot + porn profile pic

vivid fulcrum
#

a lot of xp systems take a logarithmic approach to leveling

quartz kindle
#

lmao

oak cliff
#

EW

quartz kindle
#

thats an unusual combo

solemn latch
#

pong

#

thanks xiuh

eternal osprey
#

I think that i would have to just code all 100 levels in manually.

boreal iron
#

Woo always late pepowot

solemn latch
#

nala cuddles 😔

#

not my fault

quartz kindle
#

just give us an example of like 5 levels and the xp you want for each

#

and we can come up with a code for that

eternal osprey
#

uhhhm let me think

#
level 1 = 0
level 2 = 20
level 3 = 50
level 4 = 90
level 5 = 140```
#

so an increase diff of like 10

sturdy stratus
quartz kindle
#

you need an ip and port to use top.gg webhooks

sturdy stratus
quartz kindle
#

ah i see now

eternal osprey
#

it's basically calculating newlevel-oldlevel + 10

quartz kindle
#

so basically
next level xp = current level xp + next level * 10

eternal osprey
#

only thing is, i don't need to calculate the xp, but the level based on the xp.

#

So if a user has like 35 xp, it would have to calculate that it's level 2.

quartz kindle
#

hmm thats a bit trickier

#

not sure how that could be done mathematically, without iterating through all levels from 0 until reaching the level where the xp reaches the target

eternal osprey
#

hmmi see

#

I will just manually code it in then.

#

Thanks for the help tho tim!

quartz kindle
#

you still dont need to manually code it

#

just use loops

ancient nova
#

do bots still use mute and unmute commands with roles or is it all timeouts now?

eternal osprey
ancient nova
#

I have both in my bot just incase

lament rock
#

All guilds have timeouts now

boreal iron
#

I don’t see a reason to create roles and permission overwrites anymore since this features exists as it allows to block users from any sort of interaction with guilds, messages, channels, members etc

lament rock
#

the role way is impossible to get right

#

timeouts are way more robust

proven escarp
#

But role method works correctly too.

lament rock
#

If a permission is allowed on any role or overwrite, then it cannot be denied unless the allowed permission is nulled

#

For roles, that's really inconvenient

#

makes donor channels impossible to timeout someone

#

unless all donors were in overrides

ancient nova
#

I mean if I got both then it's up to the server owner to choose which one to use

#

I need a sort of documentation, might need ot make a website to explain how to use the bot

boreal iron
#

That’s what slash commands and their descriptions are made for as well as developer should create things as user friendly as possible

pearl trail
#

for some reason, mute with role system is not the best for those who don't know how to manage role permissions since there is like hierarchy or their roles are already messy, meanwhile timeout will work for everyone without setting up anything.

boreal iron
#

While some sort of help command could already give you an idea what you can do

boreal iron
ancient nova
#

anyone wanna fix my badly coded hangman game?

sharp crescent
#

Apagou pq?

#

Só esperando vc falar pq apagou

#

Vou estar olhando suas conversas até lá

#

desapareça na névoa lentamente

quartz kindle
#

english only here pls

#

also "homem" not "homen" (your status)

ancient nova
sharp crescent
ancient nova
ancient nova
quartz kindle
#

error, code too big to be rated

ancient nova
wheat mesa
#

So many comments

ancient nova
#

weirdly enough I only do that when I write javascript code I never do that with any other language

sharp geyser
#

Line 9-10 has a redundant check

#

You already check author ID against whatever owner is in the env

#

No need to do it twice

pearl trail
ancient nova
sharp geyser
#

🤔

ancient nova
#

anyway I was checking some node.js process variable and it returned a couple functions can anyone tell me what they do?

  1. reallyExit()
  2. _kill()
  3. nextTick()
sharp geyser
#

Then don't show us code that isn't completed

#

Dingus

ancient nova
sharp geyser
#

Why we'd end up telling you stuff you are already going to remove

ancient nova
#

cause I'm either too stupid or too lazy to fix it

ancient nova
sharp geyser
ancient nova
#

well that's true

quartz kindle
ancient nova
#

yeah it seems to be an actual thing

quartz kindle
#

it doesnt show up in the docs

sharp geyser
#

It was meant for internal use only yes

#

they were talking about renaming it to something more suitable to what it does

#

And prefixing it with _ so people know it isn't something to really be ran yourself

quartz kindle
#

often times public/documented methods do a bunch of other things besides the actual thing their names suggest they do, like safety checks, resetting, closing, etc... then use another internal method to actually do the thing after all those are completed

oak cliff
#

Is it better to have one model for "guild" or to have many models for each function of the bot

for example, having a model for "autoroles", "selfroles", "other roles" etc and each being looked up by GuildID

or having one model with the guildID that has all of the settings inside it

ashen orbit
#

i did mine the second way

#

have it stored in db

#

db.get("guildid").autoroles

oak cliff
#

yeah

#

im using mongodb/mongoose

ashen orbit
#

ok

#

im out of convo

#

i use quick.db 😆

oak cliff
#

thats what i thought

#

but iwasnt sure if that was best practice

#

or inefficient

proven escarp
ashen orbit
#

dont be ride

#

rude

proven escarp
#

not really ideal if you want to scale the bot

ashen orbit
#

i hardly use it

#

i dont think i even use onc

#

e

proven escarp
#

you should use something more efficient like mongodb

pearl trail
#

if its only for configs, i'd prefer save it to guild schema, and separate the data/s to their own schema. if you save the configs on each schemas, it'd take a bit time to fetch from all the schemas

oak cliff
#

well so what i had before was like

autoroles

guildID
array of roles

selfroles

guildID
array of roles

and im wondering if its better to do

guild

guildID
array of autoroles
array of selfroles
array of othersettings etc

#

is it better to have them seperated or all in one

#

do you have any other schemas that also use GuildID?

#

like do you have a schema for each "feature"

pearl trail
#

mine is the same with thundxr's, have a separated config schema for all those "feature"s, and I save something like language and other guild preferences to guild

uneven tartan
oak cliff
uneven tartan
#

using mongo all i have to do is this:

<collection>.guild.guildID``` and such
#

also i think its better on storage

oak cliff
#

can you export more than one model per file

uneven tartan
#

yes but i havent needed to and dont remember how

#

actually i just store everything under guild id and just get guild from id

oak cliff
#

something like module.exports = { mongoose.model("Selfrole", selfroleSchema); mongoose.model("Autorole", autoroleSchema); };

#

this seems to error tho

#

oh cause i used ; instead of ,

quartz kindle
#

well you used ;

oak cliff
#

im dumb

quartz kindle
#

exdee

uneven tartan
#

💀

#

tim

#

wanna see cursed

oak cliff
#

👀

#

why does it expect a ,

quartz kindle
#

its an object

uneven tartan
quartz kindle
#

needs keys

#

use array instead

#

or give it keys

oak cliff
#

oh im

#

so smart

quartz kindle
oak cliff
#
module.exports = {
    selfrole: mongoose.model("Selfrole", selfroleSchema)
};```
#

this works right?

quartz kindle
#

yep

oak cliff
#

then i would access it by doing .selfrole

quartz kindle
#

i mean, the vsc eslint extension should be able to auto fix on save, and shit like that

#

ofc unless you dont want to have eslint installed at all

uneven tartan
#

probs should lmao

quartz kindle
#

lel

#

it shows errors live inside vsc

uneven tartan
#

only took like 90 seconds to do all 28 files

quartz kindle
#

like ts

oak cliff
#

i guess its like preference really? idk

#

until you get too big of a file lmao

round cove
quartz kindle
#

there is no reason to separate them unless you can have multiple sets of roles for each guild id

round cove
#

For a single guild mongo object and all the ids you're pulling you're probably not expecting a single guild to have 483248929842389 role ids attached to it.

quartz kindle
#

also, is mongo capable of retrieving partial documents?

round cove
#

Yes(?)

quartz kindle
#

if so, then further reason to not needing separation

round cove
#

Like GQL or?

oak cliff
#

ive never messed with partials

quartz kindle
#

something like that yeah

round cove
#

Just means it doesn't have all the data potentially

quartz kindle
#

one of the reasons for separating values in key-val databases is to avoid a single key having too much data and becoming slow to retrieve

#

but im sure mongo doesnt have such issues

round cove
#

Nah it doesn't and again if we're being realistic with her usecase it's going to be fine.

#

That's what one of the big fancy MongoDB partners tried to convince me of at a DevUp conference meeting anyway.

oak cliff
#

lol

round cove
#

You'll be fine to put it all in a single guild object xiuh.

#

early onset carpel tunnel

oak cliff
#

well so another concern i had was updated said schema/object

#

if i decide to add something down the line, i have to update all of my objects to include that new section, right?

pearl trail
oak cliff
#

cause if i try to assign an object a value that doesn't exist, it errors, right?

round cove
#

Not with mongo.

#

If you update the schema to say, include autoJoinRoles which is some object, or string array. Whatever you want

#

You can just add to it

#

And mongo will populate existing objects with some default value you give it

#

Or undefined

#

Which again you can override.

oak cliff
#

so if i originally have

guild

guildID
selfroles

and then an object is created with that schema
and later i update my schema to

guild

guildID
selfroles
autoroles

and try to assign a value to autoroles on the original object that was created with the original schema, itll accept it?

#

i thought id tried that before and it didnt like it

round cove
#

Yes

#

It should again just populate existing documents with some default value for the new property.

sharp geyser
#

Doesn't adding onto a schema erase any past data to keep in check with the current schema?

pearl trail
#

do you use updateOne to update it?

sharp geyser
#

Idk if mongo has a migrations concept

oak cliff
#

yeah ive been using updateOne

round cove
oak cliff
#

i can specify default values, right?

sharp geyser
#

I see

round cove
sharp geyser
#

At least that's one benefit to mongo

oak cliff
#

lemme look into that cause im not currently doing that

round cove
#

one of my old bots that still use mongo

oak cliff
#

ooooo

sharp geyser
#

I know migrations are a bit weird in postgres I've had times where adding a new field completely wipes the db

oak cliff
#

thats very helpful

#

this works with JS right, doesnt have to be TS

round cove
#

Right

oak cliff
#

i maybe gave up on TS shy

#

lmao

round cove
#

Xd

round cove
oak cliff
#

what does the "index" option do

sharp geyser
#

Anything in js works with ts so it's pretty easy to translate it over

oak cliff
#

is that what the default ID is

round cove
#

index is how mongo index's the object and how it'll mainly search for it when I search this specific schema

oak cliff
#

that makes sense

round cove
#

yeah it's pretty small

#

Considering almost all the properties are just strings

sharp geyser
oak cliff
#

so if i update my schema and include the defaults, when the object is fetched next itll populate with any new values i put into the schema?

round cove
round cove
oak cliff
#

thats very pog

round cove
#

yeah

pearl trail
#

i did this without default 💀 ```js
data?.autoMod ? await autoModel.findOneAndUpdate({ guildId: ctx.guildId! }, { $set: { autoMod: { ...data.autoMod, enabled: subCommandGroup === "enable" } } } as any, { upsert: true }) : await autoModel.findOneAndUpdate({ guildId: ctx.guildId! }, { ...data, autoMod: { enabled: subCommandGroup === "enable", logs: [], keys: [] } } as any, { upsert: true });

sharp geyser
#

Yea it did, I just don't like using vscode too often I only use it when collabing as not everyone has jet brains kek

round cove
#

I use VSCode for personal stuff and Rider for work / C# and CLion for C++

sharp geyser
#

I only dislike vscode not having an auto save feature (at least not in the way jet brains does it)

round cove
#

okay jetbrains autosave is a FAKE autosave and WILL lose progress if something crashes or goes wrong

sharp geyser
#

Vscode just saves on an interval while jet brains saves when you leave the scope of the file

#

I haven't had any issues with it

round cove
#

he missed the convo 😔

sharp geyser
#

doesn't that just essentially make guildId the primary key

round cove
#

yes

pearl trail
sharp geyser
round cove
sharp geyser
#

The way vscode handles auto save is annoying though as it is buggy sometimes

round cove
#

But our codebase is probably hundreds of times larger than anytihng you will have

sharp geyser
#

And for it to be useful you'd have to set the rate super low

oak cliff
#

i feel fancy