#development
1 messages · Page 2073 of 1
then channel.fetchOwner.send()
no it's async
<Guild>.fetchOwner().then(owner => owner.send("......"))
i will try
Hi new I'm aki
Do you play roblox?
no
What you play?
rn I'm playing Subnautica
Gotta await it
Oh
I literally gave him the code and he still decided to mess it up
🤷♂️
it will get an error
guild is not a function
ofc guild is not a function
so i need to add a new parameter
guild is not defined
i didn't sleep enough + iam convert v12 to v13 so sorry if i maked you angry or something
so what should i do
const guild = channel.guild; ?
channel.guild.fetchOwner()
but i already did this
you did it without await
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
thx
Rude
Nvm don't pay attention to me got the error codes mixed up
the bot doesn't have the required scope
I hate everythin about that code but oh well
where is Announcement_Tapped called?
and where are u instantiating AnnouncementPage?
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
ctx.showModal(modal), make sure it's not deferred
Modals can only be shown as response to an interaction
^ this
How can add website in bot page description?
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)
How define css file likw style.css etc
you can't include external files
Cn we use website link as css
you can put your CSS right into the description in proper tags of course
Hmm
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
Understand
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?
Quick question. 👋 How do you use template literals in Java? 
Yes, something like:
console.log(`Hello ${name}.`);
How do you do so in Java?
Oh, so System.out.println("Hello " + name);?
You could use something like String.format("My name is %s", "Waffle");
But yeah that's the way I usually do it
maybe try format
Fair enough.
Or System.out.printf() does the same thing as String.format() except it prints it as well
oh nvm x
It not saving html codes in description
make sure to just use html, not html and markdown together
Cn i show you code?
Ss mean?
Hmm okay
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
told you, you can not import external files
Full here
I change it checkout source bin
ok 5th time now, you can N O T import external files
Where?
<link rel="stylesheet" href="https://kirabot.site/css/style.css">
as I said you can not
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
Hmm both think in one file
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
Inframes?
Size of description
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
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);
}
Hey guys
So, quick question, what exactly is Player?
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
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?
What? Use Discord.JS V13?
Why are you still on that version??
Besides that lmao...
No, update.
Got like 3000 files
So?
your app only crashs if you don't handle errors
It's not like we're not updating even more files.
its just me, and haven't done it, don't have any features that use new discord stuff so was never needed
Its on the messageCreate event I can't change that
But there are breaking changes.
I guess it is time to update then
Should've done so a long time ago.
update to v14, not to v13 anymore
Eh, don't anyways, you can either update now and update again at V14, or struggle till V14 comes out.
It's the type of the variable
Oh, so it's type Object referring Player?
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)
Discord.js v14 is still unstable, so I wouldn't recommend
Very unstable tbh, but I said update to v14 not move to v14 already
Alright, fair.
Don't think much more will change but I could be horribly wrong of course
Updating to v14 is the same as moving to it, you'd have to change a shit ton of things, even though it's still unstable
the already mentioned changes in their guide post doesn't even match their actual code changes, so nothing is up to date anyways
true but at this state I wouldn't move to v13 anymore if I would have to do a lot of changes
maybe waiting a bit longer might be the solution here
you need to work with css to "style" the iframe element
as you want it to be
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
We never know how long it'll take until v14 is released, it might take months even; so if they want it up and running then nothing much else can be done
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.");
};
sadly true
I mean if he hasn't the message intent then he's fucked anyways
soon
That scope will be granted for all Discord bots by default soon enough, so they won't have to reinvite it
#discord-news message
so i have to keep the old way, otherwise it won't work ? cause i deleted them already 😄
Giving issue in save while using inframe
description length must be at least 200 characters long
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
Hhmk
or comment out some html code
doesn't really matter to get rid of the minimum length
I'm unsure if they work at the moment, but all members of Discord servers that have the Manage Server permission will be able to grant the applications.commands scope with a prompt soon enough if the Discord bots weren't invited with the said scope
#discord-news message
well will be able doesn't mean they will do
But then again, you should try to see if the default Discord bot invite links grants that scope if you want to make sure
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
Hmmk
requiring a reinvite including your oauth link
thanks voltrex
But bro when i add css it showing on page
my gosh just define some random selectors with or without random properties
Yeah, check the semicolons in your code I replaced with a Greek question mark
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
Still showing uff
just make a screenshot of your description
<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>```
why is this not getting the assets folder?
@boreal iron code
show the project tree
put css code in css code tags
I suppose that code is inside Social.tsx?
yes
Where friend?
try simply typing, sometimes the lang (especially non-typed langs) prevent the editor from showing useful results
<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>
Oho
What does the ./ relative path suggest in your case? Does it suggest the files in components directory or the root directory of the project?
Thz
nothing as well
The best discord bot
wow that's bold
doesn't work either
Ya done
did u try src="" instead of src={""}?
same
press F12 and see what error pops in console
nothing :|
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>
Hmmk thx
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
it should be your oauth2 handling api
an api that handles oauth2 
you have to make it publicly acessible
then nobody else will be able to use it unless you expose your machine to the world
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
well, you would be doxxed frequently if oauth2 (or any other authentication) didn't exist ¯_(ツ)_/¯
zamn
also do note, I wouldn't expose my pc if I were you
public and private key logic fries my brain
I need some JS error stacks to test my regular expression against. Can I get some
just browse github for the worst discord bots available
lmao
chances are they'll have a ton of unhandled errors
I mean just errors I can quickly copy paste for unit testing
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?
I mean, are your slash commands not registered globally?
bone apple the teeth
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
use generics maybe
force cast it unsafely so you can crash your program :troll:
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
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
interaction?.member?.roles
Why the fuck so I need to make any chain optional?
interface OptionsA {
optionA: string
}
interface OptionsB {
optionB: string
}
class Test<Option extends OptionsA | OptionsB> {
thing?: Option extends OptionsA ? string : number
constructor(options: Option) {}
}
for example
In this case roles is always a property of member but member can be null
What the fuck is that logic
the optional thing only checks the current var
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
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
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
}
}
how does bla look like
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
Now that’s some jank if I’ve ever seen it
Tim always finding ways to pick a fight with the compiler
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
ok im confused
when discord redirects to my oauth2 website
it says this
localhost sent an invalid response.
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?
Poggers. My regular expressions are good
I misread that as regular depressions im sorry
most people here are regular depressions
indeed
Less of an alien language than brain fuck
Time to work on a nodejs native audio processing library
because piping through ffmpeg sucks

isnt there an napi-based ffmpeg thingy already?
which calls directly into the ffmpeg C source code from js, instead of running it through a shell script
There is but I cannot figure out its interface at all
xd
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���$�
Wat da fuck is that
I mean I need something I can read or understand what to look for, but no info
No byte ranges
nada
where did you log that from? an ogg file?
.opus file
I guess ogg opus encoded
brain frying trying to wrap my head around shit
bad idea I guess
More readable than what some people post known as their code

should be bits
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
Thats why I wasn't sure
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
Me too wtf
Yea
<!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
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
You can fetch the command and get the full data iirc
yeah I want to avoid fetch if possible
Why?
I can't think of any other way as you only get partial data to my knowledge through other ways
yeah I hoped this partial interaction data would include the command options
but it doesn't
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
I don't see any way here except fetching it seems
I honestly don't see a problem with fetching why were you so hesitant to do so in the beginning?
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
Hi, how i could get here the exact numbers of servers and users, without inserting them manually?
You can get the guild count from your bot and same with users as well
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?
I mean, cover is the only way to fit to parent regardless of image size or shape
I'll extend the image's size vertically in that case
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
How would I use contain?
look at the image I sent
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
in html i mean
Thank you!
you could separate the astronaut into a different element and use an actual text instead of an image
lel
true! never touch a running system
couldnt be me :^)
without destroying what took hours or days of work to do, you can't live
what can yall recommend for a free restful online database
Hi, how i could get here the exact numbers of servers and users, without inserting them manually?
In html or php
you need use express.js in your discord bot application (if it is node.js), then configure it to respond with the data using REST GET, you then need to go to your website, make a javascript file, code it so it requests to your node.js application, get the ids of the placeholders, then edit the .textContent of the placeholders

It literally doesn't change how you get the data
You just gotta display it
Also technically you don't need express
You can just use vanilla js and fetch api
yeah but you have to store your bot token somewhere
Why
don't you need it to get the data?
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
so you need to dedicate a chrome tab that is 24/7 open so that your bot can run?
Tf you talking about
You'd host your site how you'd normally host an html and js site
aint that possible? no?
Although I don't understand why people use vanilla js and html anymore frameworks are honestly just a life saver
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.
This argument seems invalid
you're invalid, dingus
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
No u
🔫
Mad cause wrong
omg I'm fucking hungry, too
literally ordering some pizza now
I'ma much on those
Imagine not ordering pizza through my bot that totally doesn't log your address
this is joke I don't have bot
can I enter my credit card information and cvc?
Ofc you can
yeah just send it through my dms
great!
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
Also if you notice charges of 500 or more they are just verification charges dw
If your credit card gets drained don't come crying to your bank
Time to go into debt fake
card's full of money, more you can spend
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
nah totally depends on your bank and creditworthiness
i was given a credit card with a limit of ~27 dollars
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
whats the best way of obtaining the amount of ram used per shard?
Depends on what library you are using and how your shards are distributed
i use discord.js
if u storage your slash commands in a collection, u should execute <slashCommandCollection>.clear()
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
ahh oki
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);
}
})();```
i tried it but it's saying that it can't read property commands of undefined
make a PUT request to https://discordapp.com/api/v10/applications/{applicationId}/guilds/{guildId}/commands or https://discordapp.com/api/v10/applications/{applicationId}/commands with [] as body
what can yall recommend for a free restful online database
djs: client.applications.commands.set([]);
i use mongo db atlas the free version is pretty good
the schemas worries me. I dunno what to put in there
I just want a database that uses jsons
wut, a json database 
popular bots do use it , its pretty good
Stick to sqlite or similar solutions instead of using an external service
or something like quick.db but online cause sync
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
do I really need to host my own database to use it for multiple projects
isn't there a solution like firebase but not?
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
isnt just there something like mongoose but no schemas
MongoDB lol
doesn't that need a dedicated host to run?
I've seen people in America just apply for cards and spend a fuck ton so idk
i've never seen that anywhere else lmao
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
weird
Not really but okay
May depends if you’re already a customer of the bank or not
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
Yeah
firebase 
NAHHHHH
MONGODB
@pine nova your a menace

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....
hey is it possible to get emote by its id on the web and display the emote?
is there an api?
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;
}```
@surreal sagewhta happen with bot
?
he eat 1 level
Who?
if you need help regarding something head to #support
🙏
Fixed
Attempted to fix multiple times but forgot px at a @media only
'-'
How do I let the bot know that they voted for it?
how do I do that?
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
i wanted to know who voted to give reward to user automatically
yup
Yeah, scoring and rating your life is what a lot of companies do not only banks
That's just a bank.
All that credit agency is doing is acting as a middle man for the bank
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
which goes through your bank
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.
No?! Why wouldn’t it
to?
Sheeesh, stop blame me for my English skills or I’m gonna cry
how do i make my bot know who voted for it, so the bot gives charge?
Webhooks 🙂 https://docs.top.gg/resources/webhooks/
do you have any example scripts?
Here it is in JS https://docs.top.gg/libraries/javascript/#webhooks
Does anyone know why I would get a status = 403 error when trying to log votes and testing it with the test webhook button?
does not work
Have you added the correct secret to both your code and the top.gg webhook settings?
yes
Mind telling me what those are?
Things aren't usually as simple as copypasting example code
#site-status Its a known issue atm
Use the test button in the webhook section to test your bot webhook
but the webhook has to configure in the chat settings
Not sure what you mean by that, but you should not need to configure webhooks in the chat settings
Ah, nice 😛
I do have another question, how would I be able to host and use webhooks on localhost

Its not possible unless you port forward on your router
Site is down atm. Give it a few minutes
Do you have any reliable sources on port forwarding?
its different for every router
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
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
token and webhook auth are right
Ok, when you click it. Does it work?
only this appears
What does that say in english?
Posted stats to Top.gg!
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?
insert the webhook link on the web and it gives this
Careful with that btw, make sure u only allow top.gg
Can you take a screenshot of the top.gg webhook section. Just the URL you entered there
that?
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.
If you want to use https://webhook-topgg.com/, you need to contact their support. As it is not owned by Top.gg
do i have to contact my bot host?
No. As long as your bot hosting provider allows you to have a http/https endpoint you should be fine
It's not replit is it?
What's wrong with repl.it?
Most beginner developers use repl.it cause it's free and works well for them
no need to judge them 😉
replit only allows 1 port
also I'm not judging anyone, I know some cant afford a vps. doesn't change the fact that replit is a single step better than nothing
how do i make webhook url?
what is your host?
Square Cloud
free version?
N
do you have an ip address and port?
paid version
from the host?
yes
what it does @pliant gorge ?
i just wanted my bot to know who voted and give a charge
do you have an ip address and port?
I'm waiting for the host's response
ok
forEach will not wait for the promises to complete
it just loops over the collection and fires the callback
and then code execution continues
Is there a space in the optional chains or is this a screenshot glitch?
There is
You will be rate limited hard if you continue doing that
Use global commands once a command is tested and working
There are some commands I only want working in certain servers
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
Aha alright, then make sure to only update them if needed as there are still limits per guild and globally
_wow Tim being an artist _
I am
lmfao
And I figured out that there was a rate limit when I used nodemon and auto save
:^)
damn I laughed that much I couldn’t see the street for a few seconds
dangerous
No risk no fun you know
dont blame me if you crash :^)
I do!
Sending the repair invoice straight to Brazil
lol
and sell it to recylcing for a couple cents

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.
there are a billion different formulas
so basically, the higher level you get, the more xp you need.
how hard do you want it to be?
I tried searching the internet but couldn't really find a suitable one
also, is xp cumulative or does it reset on every levelw
Could be pretty easy.
it's cumulative.
Only requirement is that each level it gets significantly harder to levelup.
Just increase for example by 10% of the current xp value
so something like next level = current xp * 2
Which will lead to an exponential growth
dafuq
huh
selfbot warning
huh
lmao
Damn I got mentioned 3 times
look at his profile pic and banner
I’m more popular than Tim
lmao I would miss that if you didn’t say
lmao
anyways, this is how i have it coded rn: js let popularity = Number(user.xp) / 50 How would that new system be coded in?
@oak cliffyou're the last active mod on general, so take a look above ^
self bot + porn profile pic
a lot of xp systems take a logarithmic approach to leveling
lmao
EW
thats an unusual combo
yeah i see
I think that i would have to just code all 100 levels in manually.
Woo always late 
no lol
pls dont
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
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
the bot has no port and id
thats why i asked if your host has ip and port
you need an ip and port to use top.gg webhooks
but only website have port and ip
the diff from 4 to 5 is different than the diff of the other levels
ah i see now
it's basically calculating newlevel-oldlevel + 10
so basically
next level xp = current level xp + next level * 10
currentlvlxp + nextlvlxp *1.1 right?
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.
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
do bots still use mute and unmute commands with roles or is it all timeouts now?
Bro I just realized lol.
I have both in my bot just incase
All guilds have timeouts now
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
It is. But indeed timeouts work better
But role method works correctly too.
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
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
That’s what slash commands and their descriptions are made for as well as developer should create things as user friendly as possible
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.
While some sort of help command could already give you an idea what you can do
Which just underlines that the timeout feature perfectly matches the requirements
anyone wanna fix my badly coded hangman game?
Apagou pq?

Só esperando vc falar pq apagou
Vou estar olhando suas conversas até lá

desapareça na névoa lentamente
tu hablo espanol o portugues
Português (brasil)
qué bonito I'm learning to speak spanish
https://pastebin.com/WwJAVPZk can you rate this code 
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
error, code too big to be rated

So many comments
I have a habit of commenting literally everything 🤣
weirdly enough I only do that when I write javascript code I never do that with any other language
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
plot twist he is using copilot 
yea the first check is temp I'll remove it once I finish the game and the second one just lets me bypass permission requirement
🤔
something similar to it 
anyway I was checking some node.js process variable and it returned a couple functions can anyone tell me what they do?
- reallyExit()
- _kill()
- nextTick()
that's the pointttt though
cause I'm either too stupid or too lazy to fix it
well... I wanted feedback mostly on the latter part
You could Google these and get the answer faster
well that's true
1 and 2 are custom things whoever wrote the code made
3 is similar to setTimeout and setImmediate, its used to break synchronicity and give breathing room to the event loop
1 and 2 seem to be built into node.js so not quite sure who could've wrote that but the author
yeah it seems to be an actual thing
looks like internal/undocumented stuff then
it doesnt show up in the docs
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
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
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
wtf
not really ideal if you want to scale the bot
you should use something more efficient like mongodb
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
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"
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
personally i would store everything under guild. it makes everything much manageable for me

using mongo all i have to do is this:
<collection>.guild.guildID``` and such
also i think its better on storage
can you export more than one model per file
yes but i havent needed to and dont remember how
actually i just store everything under guild id and just get guild from id
something like module.exports = { mongoose.model("Selfrole", selfroleSchema); mongoose.model("Autorole", autoroleSchema); };
this seems to error tho
oh cause i used ; instead of ,
well you used ;
im dumb
exdee
its an object
enjoy this
well thats just being lazy
module.exports = {
selfrole: mongoose.model("Selfrole", selfroleSchema)
};```
this works right?
yep
then i would access it by doing .selfrole
doesnt vsc do that for you already?
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
i havent looked at an eslint extension
probs should lmao
only took like 90 seconds to do all 28 files
like ts
Depends on how much data you're pulling realistically.
there is no reason to separate them unless you can have multiple sets of roles for each guild id
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.
also, is mongo capable of retrieving partial documents?
Yes(?)
if so, then further reason to not needing separation
Like GQL or?
ive never messed with partials
something like that yeah
Just means it doesn't have all the data potentially
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
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.
lol
You'll be fine to put it all in a single guild object xiuh.
early onset carpel tunnel
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?
i do have that issue once with my player schema, there is one guild that have 10k arrays with 7 keys each object, it took about 2 minutes to load, well ig it depend where you host the mongo,
cause if i try to assign an object a value that doesn't exist, it errors, right?
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.
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
Yes
It should again just populate existing documents with some default value for the new property.
Doesn't adding onto a schema erase any past data to keep in check with the current schema?
do you use updateOne to update it?
No
Idk if mongo has a migrations concept
yeah ive been using updateOne
Mongo is just a add a new property whenever you want or take it away and we'll handle it
i can specify default values, right?
I see
correct
At least that's one benefit to mongo
lemme look into that cause im not currently doing that
one of my old bots that still use mongo
ooooo
I know migrations are a bit weird in postgres I've had times where adding a new field completely wipes the db
Right
Xd
Might be worth looking into prisma
what does the "index" option do
Anything in js works with ts so it's pretty easy to translate it over
is that what the default ID is
index is how mongo index's the object and how it'll mainly search for it when I search this specific schema
that makes sense
I looked into Prisma a while back just didn't have the patience to continue using it as there wasn't a lot of support for it in my IDE of choice
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?
I see, I know VSCode got better recently
right, interms of the default value
thats very pog
yeah
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 });
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
😔 fair
I use VSCode for personal stuff and Rider for work / C# and CLion for C++
I only dislike vscode not having an auto save feature (at least not in the way jet brains does it)
okay jetbrains autosave is a FAKE autosave and WILL lose progress if something crashes or goes wrong
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
he missed the convo 😔
doesn't that just essentially make guildId the primary key
yes
it's like saving save timeout into variable, and clearTimeout if there are any changes
I've never experienced progress loss
Hopefully you wont, have had issues at work with it.
The way vscode handles auto save is annoying though as it is buggy sometimes
But our codebase is probably hundreds of times larger than anytihng you will have
And for it to be useful you'd have to set the rate super low
i feel fancy


