#development
1 messages · Page 71 of 1
oh lemme try
where is it though
not sure, but what lib are u using for discord?
Replit will do automatically
yes
they deleted the venv and now all dependencies were gone
i am too smart right ? 😎 i deleted the venv 😂
discord is probably something that comes together with it
hm sure
Pip install discord.py
pip is only not istalled
Or download all of them
Select one to run (or press Ctrl-C to cancel):
python39Packages.pip.out
python39Packages.bootstrapped-pip.out
python38Packages.pip.out
python38Packages.bootstrapped-pip.out
u know which to choose ?
Apt install pip3
bash: Apt: command not found
~/radion-fixing$
~/radion-fixing$
Small a
apt install pip3
Yep
Do they even let you use apt on replit
~/radion-fixing$ apt install pip3
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
~/radion-fixing$
~/radion-fixing$
Sudo apt install pip
sudo on replit?
It will never work
didnt work
No need to be sherlock
Replit will install most available Python and Javascript packages using the universal package manager.
lemme just try uploading my files
Otherwise you can do the shit way by executing
import os
os.system("pip install discord.py")
Eventually the shell you have is different than the one they use to execute 🤷♂️
Though docs says to use that
My god https://replit.com/ is a goddamn seizure when you start scrolling
wouldnt this line grab discord.py instead of pycord?
No reason to use pycord 
can we code the friking folder from our pc in replit ?
i will code in vs studio for the time being
it will be easy there
Replit is just wack
it was a good idea on paper
Complete madness
Heya how do i get all custom emojis from a string like what is regex for it?
I tried 4 regex from https://google.com/ none seem to work
also it represents really well how fucked up some replit projects are
LMAO
(<a?)?:\w+:(\d{18}>)?
Though that will match in different groups
So you won't be able to get the name of the emoji with that
With the different groups
damn I love coding in sqlite
sqlite 
I mean, SQL is compiled and it can be pretty powerful
Yeah i just wanna get I'd of all emojis
Probably not how you should use regex
:Yikes: 

Then should i declare it and then use .match?
Well, a regex most likely goes in a string
And not randomly in your code, as it's not valid JS syntax 
Maybe mb
I am setting up a tent in this channel for the next few months 
installing vs code is it better than replit ?
tornado warning
Returns null after converting it to string
well, it's not inherently better, but yes
It's not really comparable
wont make ur code better, but is more QoL for coding
how does vs terminal runs ?
like uh...a terminal
What if you match with /<:.+?:\d+>/g
like, a terminal is just somewhere u execute commands
u can use it to run your bot, but it'll go offline as soon as u close the window
hm and can we open a whole folder in vs ?
for sure
yeah that as i know
Thankfully, yes
ohk thanks
It's like literally any tool can do that
Tornado of js users

Works fine thanks!

Man... you didn't even add the boundaries of your regex

Who cares
It works
Regex is already madness itself

Isn't even a valid regular expression
You should almost never use the . character class.
[^:] would be better
I'd use <a?:\w+:\d+>
would fail at _s
@lyric mountain does the .replit and the nix file work in vsc ?
\w includes underscores
that's stupid
lol
Anything that works on replit works on your local machine if you set it up correctly
well, it's a valid alphanum character
ok thx
I'd still rather use [^:]
The .replit file will be useless though
@languid raft Just ask how to make a websocket here
matches spaces
and anything else that wouldn't be valid in an emote's name
Then it wouldn't be an emote
someone could have some fun tricking the bot
You say that, but arbitrary input go brr
ong
ain't that how people crashed cloudflare some time ago?
ReDoS is just cool
No, that was excessive backtracking
anyone knows a thing for this yet?
@lyric mountain @earnest phoenix what to select here ?
how would I make a C# websocket to print a response on local IP
Nothing
. can include excessive backtracking so you should never use it
You press ESC
huh how to run then
Now you wait for windows to take its time to load
Because windows and speed doesn't go together
loaded
Now you can tell us why you have like 3 config files, main files, etc.
whats the command to run ?
You need to install python
k see u tom
Yeah, and why what many?
idk i didnt coded this
I'd recommend to learn first before pasting a bot from github randomly

its a incomplete skided bot
Won't be of any use
and i fixed more than half of the code
And then you ping us for the most basic questions because you've never learned anything about coding 
😅
Definitely recommend to use Google, learn and make your own bot
i am a lowly skider not coder
Pasting is not useful at all and will mostly lead to you asking the most basic questions
Anybod know how to make a web socket server in C#?
@real rose can you delete that ^, it's just being a clown and making people run unsafe things
mozarilla has a h u g e documentation on c#
mozarella
Trying to understand http 103
We're allowed to meme btw
Not such things, use your grown up brain and get better "memes"
From <:lol: 1045020386464636988> How do i get the emoji id?
Split
Wait its not just :lol12:
What text comes to your bot? Literally just that?
It's like classic form which i can't send for some reasons
If so, there's no way to know the ID
Yeah as said, you split at : or another character
Hmm...
Or if you're already matching with a regex, include a capture group at the part which matches the ID
splitting by a string compiles a regular expression on every use iirc
js keeps compiled literals in cache
but yea, if ur already are running a regex there's literally no reason not to use it for capturing groups too
split and .replace(">", "").trim();
trim clears the whitespace, replace clears the >
bad idea
Any idea what I'm doing wrong? I have no clue what this error is and why I'm getting it
app.post("/sendMail", (req, res) => {
const body = req.body;
res.status(200).send({ message: "test", name: body })
});
Content-Type in the header is set to application/json
he should just get the id as there is a method in the role object anyways. But i'm just answering his question on "How to get it from this string"
he's already running it through a regular expression. You're just wasting cpu cycles
Ik how to do it.. but why .trim()?
Oh next message mb
sendmail aint expecting a post request
app.post("/sendMail"
ye
If it's handled in the number (int, long, etc..) objects, then it's not needed, Otherwise; It'll throw a "NAN" exception
There'll be an extra space
I ain't a js dev so got no idea if it's handled or not, but it should be
Figured it out
replace wont add a space where the char was
it's the space on the starting of the string
in the second replacement array of :
@quartz kindle When you get a hot second, can you help me think of ways to improve https://github.com/DasWolke/SnowTransfer/blob/master/src/http.ts
don't ask why I did it
Wanna make my own FormData implementation to go practically depless, but pain
formdata is easy
it was easy to do it with strings, but I have to do it with Buffers and allocating/concatting buffers is so much fun I don't want to deal with
stuff like payload_json no problem
but Buffer encoding to string doesn't have raw iirc
wdym?
The default encoding of coercing a Buffer to a string is utf-8, but when I tested, a png file was sent, but had missing characters so it was invalid png
Why I coerced it to a string is just for convenience in writing the HTTP requests and form body layout
What does in and of do in a for loop
how do I set the permissions to see the orders that certain roles have? (slash command)
module.exports = {
name: 'clear',
description: 'Allows you to delete a number of messages in a channel.',
options: [{
name: 'number',
description: 'Number of messages to delete',
type: 'NUMBER',
required: true,
}],
run: async (client, interaction) => {}
}```
(v13)
Their both different but in what ways
You do that in server settings, not via the bot
you cant do that, binary stuff cannot be written as text, the encoding always messes it up
for (const key in { "test": false }) {
key === "test" // true
}
for (const entry of ["test"]) {
entry === "test" // true
}
just conveniences of IterableIterators
in = keys
of = values
in only works for objects
of doesn't work on object values though right?
oh okay
yea
wouldn't in work on arrays and provide indexes as the keys
since they are just objects
Easier way to iterate over object keys & async 😉
anyways. For my http client, I'm mostly just looking for places where I can improve performance, like I used to pass chunks to an Array and then concat at the end, but I have gotten word that a linked list would be far more efficient than an Array
which seems to be the case
Also streaming chunks directly into a Buffer if Content-Length is supplied
i never tested array vs linked list
but i did test that creating a new buffer and writing chunks to it is faster than concat
when sending or receiving?
receiving as client
yes you can do that for binary responses
thats what im doing
for text responses it shouldnt make much of a difference compared to toString then concat the strings
in iterates over keys, of iterates over values
if Content-Length is supplied, I'm just streaming chunks
It has been answered already 🥹
What annoys me is that headers can be sent over multiple chunks it seems
in also works for arrays, but kinda meaningless with them
Discord constantly sends me CF array info after the initial response is already received
you need to wait for the newline delimiter that separates headers from body
Yeah \r\n\r\n
I need to fix the logic in another update
For now I only assume first chunk
I have an input in html and I want a button on the right side it
Those 3 dots are the button I wanted added
What would be the best way
The input is in what you could call a div*
Nest both components inside a div, make the "3 dots" position absolute
Then just do right: 0
How would I nest it?
<div>
nested
</div>
@lament rock btw do you ever profile your stuff?
like using node's profiler or using the chrome inspector
yeah. Nothing like node's profiler, but some real world tests I setup in my bot which is where the effect is most noticeable
i like using chrome inspector sometimes
I can't really say I like it too much
i really like how it shows the time taken by specific lines of code (even if it gets it wrong sometimes)
I wish node callsites provided that info
I already abuse the fuck out of call sites
I also wish they provided src map info but nope
i often use this
sometimes the timings are a bit inaccurate, but its pretty useful
then i hyper-optimize the hell out of the most time consuming lines lel
Not at the point of micro optimizing yet. Like iirc, I heard someone say Object.prototype.hasOwnProperty.call is more efficient than double unary negating an access
but I haven't tested
why does an assignment take 5 seconds wtf
oh probably something like gc or thread pauses
or the pic is fake
or that
also thats probably 5 seconds out of several minutes of runtime
How tf did an assignment take 5 seconds to complete?
Ah, I'm too late
Thats literally what I asked 
those are absolutely annoying, also the function inlining size limit

those things always break my benchmarks and introduce non-sensical results
I'd be worried if gc paused my code for 5s 
I'm un-acquainted
minecraft
No day in Tims life exist without doing benchmarks
i had this problem when testing my serializer, that the size of the function's body was affecting the performance
even if i simply added/removed comments
it would massively affect performance
like from 20m to 200ms
i found out there is a function body size limit in v8
that it stops inlining functions if the stack gets too big
what's the size?
and there is a v8 option --stress-inline
which forces aggressive inlining
no idea what the size is
or how the size is even calculated
probably using the bytecode somehow
but it was the strangest thing i've ever seen
like literally adding and removing a comment line, would cause a performance difference of 10x
I've started to use tsup, could probably help since it minifies a ton
Generally the idea of inlining something depends on the amount of instructions or bytecode that specific part of code is going to generate, it does approximate calculations of that and decides whether or not to inline
It's present in almost every compiler or JIT engines
i tried separating the code into smaller functions, but it didnt make a difference, it probably does something with the stack size too
ah another thing i noticed
probably something with v8 code paths
the order of the functions influenced the benchmark
that's dumb
running function A then running function B would produce different results than running function B first
because running function A beforehand would cause function B to deoptimize some code paths
or something like that
doesn't that only happen when the JIT encounters something it guessed incorrectly on
because my functions involved variable input types, for example run it once with strings, then run it with numbers, so v8 loses the optimization it did for a string code path
V8 has an analysis pass that looks for hot paths in your code, depending on the call stack it'll also take that into account of whether to inline or not
oh yup thats it
and it relegates a fixed-type function back to a multi-type function
I have this button component inside a form (react) and it's triggering the onSubmit function from the form, anyway to not make it do that? or to like check if the submit button is the one triggering the onSubmit function?
event.target should have the element that activated the event
use the top.gg vote webhook
which gives you an event when someone votes, then you can use this event to do what you want
oh ok thank you i got it
Hi there, I've run into a bit of trouble
I recently added axios' packages to my project, and when I tried to import the library to my code (by doing const axios = require('axios');), it displayed this error in the console:
^^^^^
SyntaxError: Unexpected identifier```
I've made a research and I'm still not pretty sure about what could be wrong. May you please help me out?
that means axios is now ESM only
What Node.js version are you using?
It would rather say that you can't import an ES module with require() instead of a syntax error, since Node.js reads all of them accordingly
12.16.2 I'm afraid
Update to the latest LTS release (18.12.1 currently)
Welp, I've just done that. The problem persists
What exactly does it say now?
The very same error
^^^^^
SyntaxError: Unexpected identifier```
You're probably still running an old Node.js version
What does node -v output for you?
Voltrex
Thank you very much for your help
i made things even easier and combined pcm files and decoded like that
Oh crab, you're right. It says it's running node's 10.24.1 version
Wtf lmao
gives me the form not the button used
how can I make bot add his role for all guilds channel for some special perms as external emoji or send messages
Then your older Node.js installation is hoisted over the one you just installed, uninstall the older one
Also what platform are you on?
Glitch, just playing around with some code
I tried to create a new project, to see if it had got a more updated version of node, and when I checked the version of that new server it was 14.x
solved, e.nativeEvent.submitter did the trick
That explains it, I thought you were using a VPS or doing it locally or something like that, you should expect that free hosting platforms like Glitch and Replit never ship the latest runtimes, compilers, tools, etc etc
Here's a guide on how to change your Node.js version on Glitch
https://glitch.happyfox.com/kb/article/59-can-i-change-the-version-of-node-js-my-project-uses/
.
try document.activeElement
inside the submit event
its react
I used e.nativeEvent.submitter, did the trick
👍
I see. What a shame.
Thanks for the guide!
Unfortunately I tried to update my node version with the method they stated on there, and then it said that the discord.js version I currently have, was no longer getting supported on the newer node version 🥹
I think I'll have to work on my bot's code rewrite, was being too lazy to update it to v13 from the very beginning, lol
You should make changes to your bot that gets it compatible with v13 changes and right after that go onto v14's changes, note that discord.js v14 requires Node.js v16.9.0 or higher as stated here
https://discordjs.guide/preparations/#installing-node-js
But no worries as Glitch supports it, although you shouldn't use Glitch or Replit or any free hosting platforms, just buy a VPS and use it
There are various cheap VPSs out there
I'm assuming data in mongodb is stored chronologically from oldest-newest. now, i want to create a queue-like system that uses #'s, is there a way to find the position of a document in a database
or if its not stored like that, any way to incorporate a queue system
that i can easily change #'s if someone leaves (shifts to the left)
Is there a similar function in node.js?
if your bot doesn't have the permissions in the first place then you can't give them to yourself
there are bug in the interaction/webhook that why I want to give my bot external emoji perms
Don't use external emojis then 
Error: Client has already been connected. You cannot reuse a client.
const { Client, Collection, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
those are the only clients i am seeing what did i do wrong exactly
One message removed from a suspended account.
One message removed from a suspended account.
why not
it so hard not to ^^
if you're having issues from using them because you aren't allowed to and server staff won't give your bot permissions, then you can't give it to yourself and you can't use them
it not that m not allowed to
the bot have external emojis
but can't post them
Search for login() throughout your source code (you can use your IDE's search functionality, or some text search utility in the terminal like grep), if there is only one instance then something is calling it twice
cuz we webhook inharite permission form the everyone role that why
what I want to do is like the muted role to config in all guild channel
use
POST /channels/:channel_id/messages
instead of
POST /webhooks/:webhook_id/:token/callback
alright thanks
A div in a li element, not showing up
min height and width property are set
background-color property set
<li id="cinput-carrier" style="display: block;"><input id="cinput" class="form-control input-field new-input-field" placeholder=">" autocomplete="off" autocapitalize="off" spellcheck="false" data-np-checked="1" style="height: 28px;"><span style="position: absolute; right: 0px; top: 1px; cursor: pointer; color: rgb(189, 190, 190); opacity: 0.5; width: 14px; height: 25px; text-orientation: sideways-right; writing-mode: vertical-rl; line-height: 5px; font-size: 16px; font-weight: 600; border-left: 2px solid rgba(255, 255, 255, 0.2); text-align: center; margin-top: auto;">...</span><div style="transform: translate(calc(100% + 20px), 0px); width: 170px; min-height: 28px; background-color: rgb(25, 27, 29); position: absolute; top: 0px; right: 0px;"></div></li>```
Javascript injected html*
It's because of the transform
It doesn't want to display what's outside of it's own bound
Any idea on how to fix this?
transform with absolute position doesnt really make sense
absolute position basically does the same as transform translate
no idea why you would want to use both at the same time
position absolute will align itself with the closes relative positioned parent, if none is found, it will align itself with body, so your top 0 right 0 may be aligned with the wrong element
if the position is correct but it doesnt show when out of bounds, then you need to check if one of the parents has a hidden overflow
else you need to set a higher z-index
Z index does the job 
so i have a math question
lets say i have a coordinate xyz, and the equivalent spherical longitude latitude and distance. i can calculate between them no problem.
now i have some speed values, for example longitude speed, latitude speed and distance speed, which translate to an object's current motion. im trying to convert those speeds in spherical coordinates to their equivalent speeds in cartesian/rectangular xyz speeds.
my first idea was to calculate a new xyz point from the spherical coordinates plus their speeds, and subtract the difference between the old xyz and the new xyz, but im getting invalid results
actual example:
{
longitude: 304.6524478037449,
latitude: 4.776131102165254,
distance: 0.0024832595879139487,
longitude_speed: 14.190215417307753,
latitude_speed: -0.4010145636843335,
distance_speed: -0.0000252558145892265
}
``` equivalent xyz:
```js
{
x: 0.0014070710472908051,
y: -0.002035676385474145,
z: 0.00020676291366062392,
x_speed: 0.0004906801111389582,
y_speed: 0.00036799689246692853,
z_speed: -0.000019422911006822898
}
``` im trying to get those x_speed, y_speed, z_speed values from the above spherical values (i already have the result, i just need to find the correct math behind it)
using the mentioned method of creating a new xyz point and subtracting the difference im getting the following results instead, in which the speeds are wrong
{
x: 0.001407071047290805,
y: -0.0020356763854741454,
z: 0.0002067629136606237,
x_speed: 0.0004360229457238661,
y_speed: 0.0004245921599656075,
z_speed: 0.000015035871073111612
}
this is my code
function ecl2cartspd(long, lat, dist, long_spd, lat_spd, dist_spd) {
const t = deg2Rad(long);
const p = deg2Rad(90 - lat);
const sinp = sin(p);
const x = dist * sinp * cos(t);
const y = dist * sinp * sin(t);
const z = dist * cos(p);
const t2 = deg2Rad(long + long_spd);
const p2 = deg2Rad(90 - lat + lat_spd);
const sinp2 = sin(p2);
const dist2 = dist + dist_spd;
const x2 = dist2 * sinp2 * cos(t2);
const y2 = dist2 * sinp2 * sin(t2);
const z2 = dist2 * cos(p2);
return {
x,
y,
z,
x_speed: x2 - x,
y_speed: y2 - y,
z_speed: z2 - z
};
}
EDIT found the issue: 90 - lat + lat_spd should have been 90 - (lat + lat_spd). the final result is still not the same as thought, but much closer
😩
Is there a way to use the top.gg api to display the number of servers my bot is in on my website?
nop
i mean, why would you want to do that?
the top.gg api requires you to send it the number of servers your bot is in
so if you're already sending it to topgg, just send it to your website as well
Is this the formula you're following?
https://dynref.engr.illinois.edu/rvs.html#rvs-ec
sort of, i've found several variations of it
for example i just found these two are equivalent (no idea which one is faster, they seem equal in my benchmarks)
const latitude = 90 - atan2(sqrt(x2 + y2), z) * RAD2DEG;
const latitude = 90 - acos(z/distance) * RAD2DEG;
Pretty interesting, although yeah I don't see how those speed values could be converted to Cartesian speed values
i managed to somewhat fix my issue, 90 - lat + lat_spd should have been 90 - (lat + lat_spd), so now i get much better values, although they are still not the same as the ones given
i've also discovered that the values im using for comparison themselves are not exactly what i though they would be lol, there are some inconsistencies
do i nedd to install python3 to run in vs code ?
I wonder, what are you even making by this?
Yes you need the Python interpreter to be installed to run Python code in VSCode (although has nothing to do with VSCode in general)
astronomy stuff, adding different coordinates support for objects not supported/included by the original libs
i need to run code in vs code
After installing the Python interpreter you can just click the "Run code" button in VSCode or open up the terminal and run python3 path/to/your/program.py
huh ?
i just right
python3 main.py
Yes
dosent that work ?
That would work
That's interesting, good luck with that I suppose
alright
@earnest phoenix do u know a way to upload a folder to replit ?
since i find easy to run on replit
i have a lot of trouble trying to write this as code lmao
no idea what most symbols mean
but i'll get there
g2g sleep now
Click the 3 dots in the file explorer of your Replit project and click on the "Upload folder" button
Goodnight and sweet dreams
it say send too many messages
something like that comes
Show it
I think it's trying to say that the directory you're uploading has too many files
yep
its a multipurpose bot code so ofc it would be very lengthy and have many files and folders
Then don't use Replit, use a VPS
There are various cheap VPSes out there that you can easily spin up and run
theres a widget and an api to fetch bot data
I'll look into it, thank you!
If i use this it won't get animated emojis then if i add a then it won't for non animated 
because you have to use a?
you should really learn regular expressions
is it possible for a bot to edit a github repository
ive been looking through API for forever and I cant find anything on it 🥲
What's happening here / How to fix this? 😄 https://i.callumdev.xyz/FATipOCU56.png
average no space key user
could you try console logging the entire response
Yeah need to use a but if i use a then emojis which aren't animated doesn't get in
Yeah i got you now a?
anybody
or pastebin doesnt have to be github
doesn't axios provide a method to convert the buffer to json
Or maybe handle that stuff yourself because the Buffer to string coercion encoding matters
axios is definitely set to return it as json, and it works with any other api, but as soon as I try discord, it returns like that... using postman with the same auth and headers returns a json
i doubt that's because of a Buffer, even if it's Buffer, it would still be readable since JSON is plain-text
Its definitely some kind of encoded data of some sort by the looks of it
Also undici is better
🥱
just use node.js v18+
no need to install any http client dependency
no
never
so make the bot send messages instead of interactions?
yes
Traceback (most recent call last):
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 178, in wrapped
ret = await coro(*args, **kwargs)
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/ext/commands/help.py", line 858, in command_callback
return await self.send_bot_help(mapping)
File "/home/runner/Radion/cogs/help.py", line 66, in send_bot_help
cog = command.cog
NameError: name 'command' is not defined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/client.py", line 377, in _run_event
await coro(*args, **kwargs)
File "/home/runner/Radion/cogs/errors.py", line 35, in on_command_error
raise error
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 347, in invoke
await ctx.command.invoke(ctx)
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 950, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/runner/Radion/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 187, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'command' is not defined
what to do here ?
@tired jacinth @lament rock can u guys help pls ?
sorry I don't know much of python:3
ok
that's what i said
it's obvious in the error stack
rust lets be friends
bc I got nothing better to do with my life
correction null
yes
"command" is what isn't defined
it's highlighted in the whole message
Unrelated but...,
How do I bring this notepad window full screen or up?
did it
shift right click on task bar window
move the bar somewhere else if that ever happens again
keeps happening to me 
the taskbar can be unlocked anytime, then just drag it somewhere else
some people like to use it on the top or on the sides
@lyric mountain i was waiting for u
@lyric mountain can u look onto it ?
Null already answered that
Ur trying to access command somewhere it doesn't exist
how to fix it man
Well, you define it
Your code is, not wanting to insult, a complete mess
You copied a lot of it from others didn't you?
this code is not mind honestly the whole code
Doing this is the same as grabbing random junk from a dump and trying to assemble a car
it has to run fine untill my friend came and messed it up
You'll get a car, yes, but it'll be barely holding together
only help dosent work
Did you code that command?
Nothing was coded, everything was downloaded from GitHub
PS
It’s hard to answer a programming question without code. In order to help, helpers are going to have to see what the code is. (source: https://idownvotedbecau.se/nocode/).
Please share your code! If it's short, wrap it directly into Discord. If it's long, use a third-party service (e.g. Hastebin).
What an oddly specific url
idk how to use hastebin
nope forked from a repl
You go on hastebin, you paste your code, you save and you share the url
Nothing easier
untill a friend came and deleted some of owner ids credits fotters and core from it
Pretty much the same
ok ? which one though
cogs or lib
Well, where the error occurs..
uh
And that is exactly what happens when you never coded and paste code 
Already told them yesterday
mean ?
him
Make a new project
Delete all the code and make your own bot from zero
ok and clone it ?
No
No you stop cloning
Start from scratch, and code it entirely yourself
You create a new project, and code from zero
then i will remove the skider license 😭
No cloned code, your code
Skider?
skidder*
yep i got the official sidder license
yep
yep
i like it though
A skidder is any type of heavy vehicle used in a logging operation for pulling cut trees out of a forest in a process called "skidding"
👀
You like being called a kiddie?

yep
No need to try to understand some people
But anyway, cloned code is almost always unmaintainable, unless you really study the project in depth
uh i could explain if anybody would be here from apolex or astroz bot support srvr ppl
ok then ig i will fix it myself 
If you manage to
sure i will since i am not just a skidder
i am a pro skidder
ultra pro skidder
Do note that this is only the start, you'll face many more bugs along the way
sure
and i hv my brain and friends brain to help
anyways a question
@lyric mountain
...no need to ping
why does some problems get fixed when typing kill1 in shell ?
Because it's probably a bug that breaks the runtime
Kill 1 kills the process, making it restart in replit
oh then half code is solved
😑
You're just killing the process and restarting it

dosent that mean that some errors which was not there before and now it is can be killed ?
no
You're not killing the error, you're killing the process
It's like throwing your car off a cliff because it ran out of gas
Then buying a new car
what if i pay someone $6 and make them pay for fixing the code
They'll deny
Nobody will fix a mess for only $6
Because they don't want to fix messy and horrible old code, they will make a new bot for you
Hiring devs is costly, expect AT LEAST a few dozen dollars
-needdev btw
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
code cant be same and features also
That for minor issues
Who cares if the code is the same
You can't even read the current code
Features, you can request them and they will do it
yep i can i know which file does what
not the lib ones
but the cogs one
Coding is expensive, nobody will do it for change cash
uh thats just the money i have in my pocket
no
in my hand sorry
Well, that's how capitalism works
You either do it yourself, or pay someone to do it for you
But different tasks have different costs, if you can't pay, too bad
Just start a course and learn programming the right way
Don't try to use shortcuts
im waiting to come to 12 class
i am in 8 bro my school teaches python in 10 class and coding in 12 class
huh ?
One message removed from a suspended account.
You know programming can be self taught?
I've never learned anything from school itself
no
One message removed from a suspended account.
Now you know it can
One message removed from a suspended account.
One message removed from a suspended account.
Book, websites, online courses, articles, projects, etc.
I hate youtube videos, they are mostly misleading or outdated
I'd like to think I became insanely smart by just regularly messing around with stuff and being proactive about optimization.
The only downside are now all of my problems are really complex and require really low level solutions like raw interaction with the network sockets or audio processing (which rarely exists for js)
im at the point of reading the rfc papers for http
if you aren't a masochist yet, you will be
likewise my friend, likewise...
I've got an error
V14 - Discord.js
client.commands.set(command.data.name, command);
Error: index.js
^
TypeError: Cannot read properties of undefined (reading 'name')
at Object.<anonymous> (/home/container/index.js:16:35)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47```
It's not done this for the last 6 months I've been hosting it
That means one of your commands don't have the data property
Oh thank you! mhm, now I got to find out which one, of the 4 I just updated
Found it (Turns out the command file did not have a text input however I don't get why, when i uploaded it from my PC, it was saved with the code inside.)
Its online now, thank you Voltrex.
You're welcome
Can we unsubscribe from the user in discord.js/voice?
I want to unsubscribe events before starting a stream for the user so that it doesn't loop if more than one stream is started
guys is there anyone know a good free website make my bot 24/7 turn on?
None
i must buy a server to turn my bot 24/7 is that true?
and thank you for your help
You could do Heroku, replit or such things but 24/7 online doesn't really exist is what I believe
Once the voice connection or receiver subscribes to the user, it returns a PlayerSubscription instance, which has an unsubscribe() method that you can use
https://discord.js.org/#/docs/voice/main/class/PlayerSubscription?scrollTo=unsubscribe
Is there a way to find out if the bot is already subscribed?
receiver.speaking.removeAllListeners();
i used this
aah created 2 stream, problem not solved
😃
you cant do heroku
not anymore
Didn't and never will use it 
no
oracle and google cloud both have free tiers i think
the former will happily terminate your vps without previous notice
just keep that in mind
idk, having your vps held at gunpoint kinda defeats the advantages of it being free
imagine losing all your data overnight
your better off buying one, free will always be unreliable
galaxygate has 1gb vpses for a few bucks
also replit is very bad theres almost a 100% chance you'll get ip banned
shared ip
yes, all free options have a major drawback
but any will be better than losing all your data
An input element has 2 children instead of 1
One of those children does not have pointer events on none, and so blocking clicking/selecting
The empty div
I believe all elements have a pointer events attribute
Point events it
Same way u did for everything else
Access via js
And how would I?
Navigate the tree until you reach the div, or get by id if it has one
You can see it doesn't have an id
@languid raft It's there magically
(he doesn't have html experience)
Just delete the div then
How would I?
Backspace
..?
Do you use any framework?
No, all raw
Then it's 100% impossible that u didn't add it
Double check your code, it's definitely there
@languid raft I didn't dickhead
Use find in files to look for an empty div
The input was created via javascript
I checked the code, no input.appendChild or similair
well, what exactly is it?
I seem to have found the problem
input.style.height = "25px";
That breaks it
oh well hello
all g
Best way to add spacing on horizontal edges in a span?
inline-block + padding?
This is going to be a very broad question, but since I'm pretty new to frontend, how would I make a 3d piece of geometry that you can interact with in React? I'm not looking for any sort of a camera system or anything, I just need a way to animate 3d rectangles and use them as hyperlinks essentially
Basically I have some isometric rectangles (viewed from the corner) that are going to need to be animated as well as clickable
What if you wanted to go to heaven but god said [object Object]
Where my europe GDPR smart homeis at
finally found a formula that does what i want
was way more complicated than i thought
lmao
true
you can use threejs-fiber
lets you use threejs stuffs as react components
is there a more elegant way to write version.version in js?
js = religion confirmed
v.v
does wanting to rewrite an entire C lib into pure js make me religious?
yes
god bless
because you'll do anything to worship implement something in js
Project count: 2447 + 1
Finished: 12
EST to total finished: 87y
accurate
how can i do tts in android in javascript without browser
I have this problem in discordjs where a .fetchReply() function on a CommandInteraction does not return a Message object but a standard JavaScript object.
This only happens in private messages with the bot but not with interacting with it in a server.
Any idea why?
I have an input that my client wants to have the value (font size) auto scale, aka no overflow
How would I do this?
i.e. a response design? I'd recommend this tool to create fluid font systems https://www.fluid-type-scale.com/
oh, got it
are you using v13?
Why are you using v12?
👀
Bot wasn't updated in a while :), but it still worked
Your bot will keep crashing as v12 doesn't know how to handle much of the newer requests
Update to v14
Ah okay. What are some things that will likely be broken when transferring to V14?
https://discordjs.guide/additional-info/changes-in-v13.html#before-you-start
https://discordjs.guide/additional-info/changes-in-v14.html#before-you-start
will be helpful
nodejs is laggy
Laggy in what scenario?
Node.js 
Node.js doesn't run into segmentation faults blazingly fast 
Should've switched to Brainfuck
Switch to Rust 🚀🔥💪
Tru. The plug-in system for HTML sucks, it only got like this weird CSS and JS thing
I actually got approval from management on Friday to open source our discord bot that’s written in rust
So I’ll probably aim to get that done next week 
blazingly fast discord bot!!!!! 💪
It literally has no good reason to be in rust other than I wanted it to be 
Rust developers trying to not say "blazingly fast" for 5 minutes
Blazingly fast 🥵
blazingly fast and memory safe!!!!!!!!!!!!!
ok so im using this hosting site "something.host", and everytime someone uses the bot in a server where it hasn't gotten it's perms yet, it does this and shuts down, any workarounds?
and then i have to go through the entire process again lol
And another thing where would I find the status of my bot for the site?
"top.gg"
Are custom rich presences against TOS?
No
I would like to download some for games I play or make my own but I want sure
Ahhh okay
Thank you!!
You're welcome
So just to confirm, something like this would be okay?
https://richdestiny.app/
Yeah that's absolutely fine, Discord even provides an SDK to do exactly that, it's called GameSDK
Oh perfect, thanks again for the help! 🙏
It seems like your bot is missing the "Send Messages" permission, check if the bot has that permission, if it doesn't then return
workin on the new link getting put through :)
isnt there a different way to get the link lmao
Yes, catch your exceptions
got it all set
just tryna get the mf active dev badge lmfao
i even swapped all the commands over to "/" instead of -
new Class();
I think that was a brainfart moment, given they solved a second later
actually, it was 4 minutes 🤓☝️
is ur bot verified?
Dunno how to so no lmfao
How do I verify it
and to get verified your bot needs to be in 100+ servers
Bruh
they are not going to just put on some random bot man
But it’s idot cmon
gl
um aksthually
oh ur on about the badge not the app directory
Yeah
just dont know how to add it to its server is all
to be able to do the badge
i think i have to let it run for a day then itll work
code a command which replies with something, use it, then wait a day and claim it at https://discord.com/developers/active-developer
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
That's not how slash commands are made bro
it worked literally 10 minutes ago
guh???
then how do i do that
look at djs guide please
it's a method at the client object, not a js dev
i know the js guide
id rather have live help atm then read a document i cant talk to
all people are gonna say is stuff thats in the guide
If you're really willing to be a developer, you need to read documents
if all you want is the badge and youre not willing to learn a little code at all then there is tools you can use to do the code for you
I don't find why would someone want a developer badge if he ain't at least willing to be a developer
cause they want the super cool awesome badge of course
discord shouldnt have made an another badge
yeah, pointless
im sure the hype around it will die down in a month or something when people cba to maintain it
but who knows, maybe it makes someone start messing up with programming languages or something then turns into a dev, who knows...
yeah i think that was the whole point of it
thats not a slash command though
thats just a normal message command with a / prefix

this is a slash command... :
ok well time to read that doc ig and hope i understand it lmao
been ages since ive worked on this bot so
is deploy-commands.js its own "command"
no
so like i can put it here
idk how you setup your command handler so could be yes
Especially this guide is the worst bullshit you can recommend anybody
Hasn't been updated since the internal built in methods exist
Also doesn't mention and explain a registration is a one time process
oh shit my bad
also doesnt help i have reading comprehension issues 🫠
After creating your array of commands simply register them once after the client is ready
Do not register them on every startup
^
i can read i just dont know what the fuck that means
Take a look at the examples
I feel like you're lacking the basics of the language you're working with then
its been over a year so yes
you forgot /s buddy
sadly no
is that your own code?
yes
mind to tell me why tf that still exists?
idk, how do I make it better then?
may I say, if this bot lived long enough it might be too late to start implementing i18n
localization is something you need to implement right at the beginning
is your problem the switch statement or the fact that translation is hard coded?
because the work to adapt an existing codebase grows exponentially the bigger it gets
both
I mean, translation will be hardcoded anyway, but in a locale file
i18n is essentially just a map so you don’t need a giant if statement for EVERYTHING you want to translate
switch isnt a big problem
but if else hell is
the localizations
switch is equally as bad if u have more than 10 branches
that was actually a if else hell like 10min ago
an example of how to implement i18n:
File: locale_en.properties ```properties
example-1=Hi this is a test
example-2=Hello world
example-3=How are you
File: `locale_es.properties` ```properties
example-1=Hola este es un teste
example-2=Hola mundo
example-3=Como estás
Function: ```js
function getString(key, locale) {
return somethingToReadTheFile(locale_${locale}.properties)[key];
}
I have no idea how to read a props file in js, so ignore that part
uhhhh…. Allow me to introduce you to my lexer
Throw that away, now!
as you can see, with my example u just do getString("example-1", "en") or getString("example-1", "es")
I mean it’s pretty standard as far as lexers go
That's the best way to go about it
it'll get the text from the correct file for you
so you don't need to treat each case individually
Switch and match clause amount does not matter as the JIT or the compiler will optimize it anyway
I mean, at least that lang allows enhanced switches
my problem when I first wanted to implement that was that I didnt know how to treat dynamic content, like you earned x$
case-break switches on the other hand...yikes
Rust >>>>
Pattern matching is nice
You mean concating strings or template strings?
you'd usually use string format for filling replacements, but js doesn't have that iirc
Rust has a lot of modern features that I think should be brought to other langs tbh
template strings, for i18n
I laugh when java has enhanced switches but js doesn't
and python doesn't even have switches
This is what I do
Used to be structured like this but it was just way too much duplication in a lot of cases
https://github.com/AmandaDiscord/Lang/blob/161d834ab25bb9da94bf4b8e27d7b2597c9be211/localizations/pl.js
json isn't the best format you can use for locale because it has to save the whole thing in memory
with formats like yaml or properties you can stream the file and get a specific line
Wut?
if you order the keys by alphabetic order (or some other predictable order) you can also make a custom index so the lookup function doesn't need to read line per line (not a i18n file btw, just the entire portuguese dictionary to exemplify what I mean)
you concat locale strings?
I feel like we're speaking again about different things
we were talking abt implementing i18n in his code
the topic was that he needed a way to use template strings in js
idk what js has that can replace String.format
Looks like im somewhere else
the io hit would be too large at scale
as well as possibly streaming the file many times at the same time
I use a cache layer obviously, so I dont need to stream the file every time I need a key
Then your caching issues are the same
cpp users


