#development
1 messages · Page 137 of 1
i need to know how i can make it not error
.catch()
bro how many times do i need to say this
if you know why, you will know how
it's unrelated
i gave you the code for that already <3
then show me where it happened
then fix the cause?
idk how
broski
nest it in 10+ try/catch statements
send the damn stack trace
then show code
JUST SEND THE STACK TRACE
you have to delete the error's message if it exists, for security
@hushed robin start from the beginning. Explain your problem like a reasonable human would, and show what you’ve tried, provide your code, and show stacktraces
wait nvm i don't
and show stack trace
let me see if that fixes
noob
make it return a null value or something
i suppose you know how to use the debugger already, no?
then check if the return value is null, return out of the function
but it will continue my code
i already set value to null if user doesn't reply
insert a breakpoint at the error statement and run it in debug mode
set it to something else then
brooooooooooooooooooooooooooo
you mean undefined right?
why would i do all this
you asked how to stop your code temporarily at the error
lmao
process.exit(8)
how tf else can you stop besides using a debugger
no
const pause = (timeout) => new Promise(resolve => setTimeout(() => resolve(), timeout));
hi cassie are you going insane from battleless yet
again, use the damn debugger, insert a breakpoint and run it in debug mode
:^)
Man I’m not even trying to help and I still want to walk into oncoming traffic reading this
no
he's kind of very based im a fan after seeing 'this way is cooler'
every single problem of his ends up being a very entertaining odissey
trust me you'll go insane from him one day
if you don't know how to debug
https://code.visualstudio.com/docs/nodejs/nodejs-debugging
I love every time I come to this channel it's a fight with battleless
there, read it for once
i was never able to get this to work, so i use node --inspect and debug it in the browser
😐
no one is fighting
i just run F5 from the file with entry point
debugging is always slower than logging. just add a bunch of logs
i still don't get why we are trying to help this individual
true, thats what i do most of the time
try stopping and stepping throuhg abunch of djs methods
they go 59 layers deep
insert another breakpoint and hit Continue

:^)
there's also Step Over too i reckon
mfw the bug is of library's internal
ok i am testing your solution now tim
Idk why some people are so against using the debugger. Use logging for simple issues, use the debugger if you need to see what is actually going on
because my code was modifying the libs internals :^)
takes more effort, probably
you... 
nope, logging is always better
Some people are “always use logging” and some are “always use debuggers”, just use both for appropriate situations
someone help
a month ago
i'm going insane
i think it's because of this in my interactionCreate
im already insane, so this shit doesnt affect me :^)
Try logging in a game engine with 100k unique entity IDs that are getting manipulated in a shitty implementation of a quadtree and there is one entity being misplaced

how can i make my catch ignore that error
replace all entities with entitties
Valid
just log the diff ezpz
by not writing shitty code
seriously, don't do unpredictable timeout operation
My situation was more complex than that, hard to explain
Debugger saved my life
if this man do rust the compiler would bust the shit outta him
if you use a finally block, it'll run after the catch OR the not-catch (technical term for the first try closure)
Would’ve spent 10 hours logging 30 different variables instead of being able to step through the methods every frame to see the exact iteration that something went wrong
bro when r u going to shush about this
😐
never heard of not-catch lmao
so you did acknowledge the flaw did exist with that code


shes right tho
deleting a channel with a pending request to operate on said channel is error-prone
please help with current issue
except it relates to that issue i mentioned?
guys it’s okay when he does something wrong it’s because he’s a beginner but he also tells the experts that they’re wrong
ok
try{}catch(ex){console.log(ex.stack)}
exception
console.log(new Error().stack)
Error [ChannelNotCached]: Could not find the channel where this message came from in the cache!
at Message.edit (C:\Users\battleless\Desktop\andreya\node_modules\discord.js\src\structures\Message.js:723:46)
at Object.run (C:\Users\battleless\Desktop\andreya\src\interactions\components\commission.js:82:53)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (C:\Users\battleless\Desktop\andreya\src\events\interactionCreate.js:31:17) {
code: 'ChannelNotCached'
}
there
😐
two locations:
commission.js, line 82
interactionCreate.js, line 31
i have a feeling he removed the lines that pointed to his code
send the block / function containing said lines
bro what
???
send the code
i just removed my full name from the stacktrace
the blocks containing this
go
ok
you need to fetch the channel instead of using the cache
that isn't the issue
oh
second one is my try catfh
and first one is
that was one i was thinking off too
unless the channel was already deleted by the time it gets to it'
just fucking send it
i don't know what the fuck your try catch is
yes this is the issue the channel gets deleted while it's awaiting messages
try running code
then catch error
rings a bell
???
just send the snippets containing said lines
i can't trust your words for it
how the fuck are we supposed to help you if we don't know what the code is
if you want to ignore the error just add a try catch in the settimeout
GIVE ME A MINUTE
it could be prevented
bro just introduced a race condition
store all the timeoutIDs associated with the channel ids. then when you delete the channel also clear the timeout clearTimeout()
ah
the funny thing is, he didn't store

told em to, just didn't do it
fun fact, he can also store the channel reference
bro now my bot even start
yes your bot even start

referencing
#development message
that's the best way
would be funny if the snippets look familiar
if (assets === null) return questionMessage.edit({
embeds: [{
description: Text.TimedOut,
color: Colors.Misc
}]
});
this is line 82
tfw you could have just if (!assets)
what's in the other one
what
interactionCreate.js, line 31
only use undefined. dont make it more complicated than it needs to be
i told u already
you didn't tell me anything???
yes i did
point out then
why do you hate null so much
bruh
i use null over undefined
undefined is objectively more annoying than null
real
WHERE IS IT
i think i find solution myself
thats why im asking
let me test my theory
well, this helped me realize my mistake
theory: remove the code that has to do with the channel the message originates from
typeof null vs typeof undefined
either you didn't fetch the channel, or you are possibly having a race condition
why would you ever do typeof with em?
neither
let me see if my solution works
I can see the concern with that but if you rely on typeof somewhere like that then you probably need to reconsider your decisions
you didn't guarantee the lifetime of your channel object then
you dont even need to use null ever
ah yes null is stored in the heap thus hurting performance 
undefined neither
then why it exist
you dont have to ever use it
null declares no value
x["asdf"]; // undefined, not null
while undefined means no reference
^
things can have meaning and not be useful
ever tried to use undefined in a json?
why would i send undefined?
the inventor of JSON agrees with me
to send an empty value, null is there to save the day
yup
and this ^
sending empty values is a mistake
only send values
guys don’t fight ben on this, he’s far gone on the “code smell” pithole
I noticed
lets goooooo
i appreciate the help guys, it made me realize the mistake
i just had to check if the messages channel existed before editing it
and now i no longer get the error
hope it doesn't break again because that would be very annoying for both of us 
don't swallow your sentence if it breaks
my 220 lines of route matching are barely working 🔥
also if (!assets) > if (assets === null)
skill issue
did you read what i said
why could it return undefined
because i made it
didn't you control that part yourself
yea
🤨
this is the guy that added JSON to javascript. he's talking about null/undefined
anyways, i no longer need that
then either make them all return null or return undefined
so i can just do !assets now
bruh
🗿
yeah i couldn't do it because before it could return null or undefined
but now it doesn't so i can
mfw you don't even know what your code does
then why you don't know whether it returns null or undefined????
your statements are clashing with each other
because i made it return one of them if something specific happens
so i need to check after
oh boy
!?
That’s fucking awful
do they mean anything
why?
so what does it mean?
or even an enum
or just to mean "no assets"?
what does null stands for assets in this case that is different from that of undefined
The data you return doesn’t even represent what happened?
null - received no response
undefined - error occured
mfw you could throw
Don’t return undefined
whats throw?
This the same guy telling Tim that he’s wrong
yea I did
....
Tim is not an all knowing god
he can be wrong 😐
Neither are you, but you pretend to be
and you need to have some javascript basics
🫠
I know javascript
I've been doing it for a few months now
Few months and doesn’t know about throw
yeah I've never had to use it before
This is what discord bots does to people
why do you need to throw? are you making a library?
i've made more than bots
bro is severely lacking
ask them
they're telling me to throw
better than returning null for no value and undefined for error
@proven lantern he made a function that returns null to represent no response, and undefined for an error response
never use null
i've made more than discord bots
Really, that’s what you got out of that statement?
Come on
return an object with the key error. then check for an error that way
Or… throw it…
it's not rust that you can just return an Err
it's either a value, or an error being thrown here
ok?
i use try catch in my code
did you even try to read
no.
they didn't do that
why use undefined when you can just use void 0 :^)
it's very long
whats that ide?
whats that idea?
lets add that in
and goto
its already in
intellij
To me this is a terrible way to do things. Your data is not returned in a consistent format, I understand the reasoning behind just checking obj.error but then the user has to know what your return object looks like in both scenarios
oh it is a keyword
When you could just return a consistent format or throw an error
that JSON guy got the goto keyword removed from JS
I don’t see how that makes him a god
just history
I think any reasonable person could suggest that using goto is a bad idea
why is goto bad
tbh for this part i like rust more than js
Result enum is very nice
Difficult to follow code
goto seriously messes up the code flow
Jumps around all over the place
Same
what is goto
you can do pattern matching with it
go to specific code?
and refactoring is impossible
a thing that some languages have that js doesnt
what it do
goto line and run code
I agree that null is not a great language construct in hindsight but that doesn’t mean you shouldn’t use it ever if it’s in the language
I tried using goto for a loop when I started with js 🥸
I literally never touched anything else than batch before
wow
literally goes to a specific code
google it up
goto is "jump to this statement"
how do i use it?
sftu you are not doing raw assembly
goto [line]?
you dont
it doesnt exist in js
That is the antithesis of useful in modern languages
bru
no
That’s what functions are for
^
with goto i could just go to thhe end of my code t o cancel it
That’s what return is for
Or just use logic for that
I think you'd enjoy the programming language Fortran. Might be hard making discord bots with it though
Goto is absolutely fucking egregious
but if I return in a .then it will continue the code
goto is actually very helpful
^^
use async/await then
lets you escape nested loops
dear god
use async await syntax then
without too much ugly code
Learn to handle promises correctly
what
How did we get to the point of defending goto???
what
Is this 1983?????
yes
i know how to handle promises
mfw break
but i get nervous using goto because i dont know how the compiler handles it stack-wise
might result in ub
const bla = await something();
return
Then they shouldn't hinder the logic flow of your code
then you will know how to stop after .then
what
what
i can't return
what
???
tbh i wouldn't trust their claim for
what
???
it's not
???
?
(I didn't)
rude
lmao
cat ran over my keyboard
then what's the point of
but if I return in a .then it will continue the code
i like your cat
@earnest phoenix you prob know a little about this
lets say you are in a loop and do goto both inside and outside of it, does the compiler know what to do stack-wise and keeps track of everything
or is there potential for undefined behaviour with it?
Me too she's nice
yea
@quartz kindle how bad is this code -10-0?
https://pastes.dev/YtV5P358uN
if you use await, you dont need to use .then() at all, which in turn you will never need to return inside a .then
i would rather break than goto
I know you’re asking out of curiosity but also just don’t use goto
but i want to return specific data
not it all
i do use goto actually
you can easily do that with await
Why
and if it needs to go again, i can use recursion and functions
In what language
please be c / asm
where?
I wouldn’t even think of it as acceptable in c
when im like 3 loops deep its inefficient to do variables outside of it to do stuff like if (broken) break;
c
think of why you get to 3 loops deep
return a().then(x => x.something);
->
const a = await a();
return a.something;
js has labels so you can do stuff like break label so thats cool tho
x and y rows and columns maybe :)
that is what i do...
that's 2
Enjoy changing your goto every time you write code above it
3 loops deep is not unreasonable
then stop using .then
i can't return like that
i just showed you how to do it without .then
then dont return
mfw node 16+ supports top-level await
only when using esm
bruh
you said you cant return inside .then
no i didn't
but 69% of people still use cjs
so dont use .then and you can return all you want
no
you literally said if you use return inside a .then your code will continue, and you didnt want that
waiting for c to support async/await just to fit in with the times
if i return outside of the .then it will end my code...
POV: pathological liar
bro this is for a different situatiomn
stop calling me a pathological liar
We can’t read your damn mind dude
(async () => {
const data = await operation();
// do stuff
})();
yes but as i said i don't want all the data
i just wantr specific data
HUH
then extract it yourself
value extraction is up to implementation and is not related to what we are talking about
const {thing} = allThings
const { content } = await somethingThatReturnsAMessage();
...
reminds me of the "CEO of javascript" guy
what the fuck else do you want?
you wanted the specific stuff from return value
then without .then i would need to use another unnecessary variable
????
Man just show us what you’re talking about
We can’t keep fucking guessing to read your mind when you can’t explain anything
the whole point of not returning in .then is by using await
and if you are not using it, when why even assign?
just ```js
await operation();
const description = await channel.awaitMessages({ filter: m => m.author.id === interaction.user.id, max: 1, time: 300000 })
.then(async message => {
await message.first()?.delete();
return {
content: message.first()?.content || null,
files: message.first()?.attachments.map(attachment => attachment.url) || null
};
});
for example, i only want content and files
wtf are you doing dude
.then AND await??
yea
const message = await channel.awaitMessages({ filter: { author: { id: authorId }} => authorId === interaction.user.id, max: 1, time: 300000 });
let firstMessage = message.first();
await firstMessage?.delete();
return {
content: firstMessage?.content || null,
files: firstMessage?.attachments.map({ url } => url) || null
};
Also I don’t see why you even need || null on either of these here
If there’s no files then you shouldn’t return null, you should return an empty array
if i return it won't run the rest of my code...
...
const description = {
content: firstMessage?.content || null,
files: firstMessage?.attachments.map({ url } => url) || null
};
see
now i need an extra variable
😐
he kinda tried ts
extra what
Eh that’s not really statically typed, it’s pretty easy to get around the ts compiler
firstMessage and description
that's better than calling <MessageCollector>.first three times
ok and
best way to counter any reasonable argument: "ok and"
then what the hell is your problem
my issue has been resolved for a long time now
you just posted it and later on you told that "your problem" runs fine?
posted what?
- it's ugly to have nested promise callback in an async function
- more or not, variables are stack-based; they are dropped the moment the function exits, unless you are returning its references, then it's a game of passing references around; but even then those variables' won't live beyond said function's lifetimes
manage what
ok
i don't see what's harder to manage in readable code
pretend u have 1 employee vs having 10 employees
1 will be easier to manage then 10
here's a thing, the async you did call inside another independent closure
brooooooooo i fixed that
and meanwhile my example all runs under the same closure, same function body, without nesting callbacks
=> easier to debug
no matter how much u try, e0c will never listen
stop calling me e0c
i'm battleless
also i listen all the time
const message = (await channel.awaitMessages({ filter: { author: { id: authorId }} => authorId === interaction.user.id, max: 1, time: 300000 })).first();
await message?.delete();
const description = {
content: message?.content || null,
files: message?.attachments.map({ url } => url) || null
};
// `message` usage stopped beyond this line
ok e0c
2 variables
vs 1 variable
better than two nested await callbacks
i will report you
goodbye guys
nooo dont do it e0c
because you can't
bye

lmao
holy fucking hell
where are you going? make sure to check out the alpha status frequently
The compilers will keep track of the stack correctly unless you manually manipulate the stack yourself which you should almost always avoid
About undefined behavior (UB), goto statements can't really cause them, the code in the labels that the executor jumps to are the ones that might cause UB but that highly varies and not guaranteed to cause UB as they're... well, undefined
Though avoid using goto statements as much as possible, use general control flow statements
Actually that's a pretty valid usage and very widely used, it allows for a specific value to be resolved instead of the user needing to assign the main resolved value, and then use the value that they actually need
For example:
const data = await fetch(...)
.then((res) => res.json());
instead of just assigning the Response instance to the data variable (which in this example we don't need), we can use .then() to only return the JSON value consumed from the body of the said response
But Battleless really made a circus out of here ngl
normal development behaviour
like I said, nobody here is forcing you to help others here
actually not normal
Hello, I am new to bot development and I am developing a discord.py bot
I have noticed that a lot of bots have "Invite bot to your server" on their profile and was wondering how I could add that to my discord bot
To whom is that message directed at?
everyone whos generally around development
there should be a setting within your application dashboard for that
Default Authorization Link
im assuming DOT_ID is Bot ID?
perhaps
I don't think you can just say that when nobody said they are forced to do so, it's just people getting frustrated by someone not listening to the said people that are trying to help them
And when the said someone talks back like that in becomes a circus at this point, the frustration is completely valid IMO
Though I might be misunderstanding what you're exactly pointing at
Nah you're understanding it correct, I do entirely understand its frustrating yes
Am referring to how helping people here is entirely free to do, of course not saying everyone should ignore certain people they dont like helping, but getting frustrated to the point of possibly saying something they might regret in the end (which iirc we had before) isnt good either
Hmm I'm not sure if we actually had such a thing happen before but I do see your point, but I'm sure nobody said something they'd regret later on
but surely been verryyyy close to that 
I suppose 
You can use discordjs guide or this https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal
I don't know how helpful this will be to you
thx
I think this will be enough
Unfortunately not, I personally used the builder from discord.js
receiving or responding?
(ie do you want the structure for receiving a modal submit, or what is included when you respond with a modal?)
receiving a modal submit interaction
https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
Responding to an interaction with a modal
https://discord.com/developers/docs/interactions/receiving-and-responding#responding-to-an-interaction
https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-example
I am a new discord bot developer and I have created a discord bot! Does anyone have any advice to grow my bot? I have my bot in 24 servers and I really want to get it to the 75 needed to verify it. So does anyone have any advice they can share to grow my discord bot!!!! 🙂 thank you!
well, as you have green name I suppose you've added it to top.gg
yes I have!!!!
which is bad if you're unlucky enough to get a lot of servers in a short timeframe
huh.....
it's advised to wait until you're near 75 to then add to top.gg
else you run the risk of getting flagged for unnatural growth by discord
shoot. I've added it to top.gg, discord.bots.gg and discordbotlists.com
well, you can also be lucky enough to have a big gap between invites
if it does happen, you might need to start again as I didn't hear about anyone managing to get unflagged for it
the best tip I can give is create a healthy relationship with your users
ok I see
if your bot and your attention to them are good enough they'll eventually mention about it to other users
thus spreading naturally
uh huh
spreading it naturally
so what advice do you have just like sit back and let it grow (doesn't sound too good...)
it's faster than you imagine
As long as your bot is exceptional in the category it does word of mouth will be powerful
like, find a good server to be a "ground zero", then act naturally until someone starts a topic about bots
my bots an economy bot
then you can mention you have a bot, if the conversation allows then u can even talk about it for a bit
once the bot is there (if they add it), do your best to create a good image about it
I've added things such as real time stock data and crypto currency data 😭 as well as other games
once the foundation is solid enough, and the server has a considerable amount of users it'll start spreading very quickly
so join 1 server that is relatively small and then stay true and like talk to the server
just dont let ur bot fall into forgetfulness
ok wait... 😭 now im confused
not relatively small, you want a good amount of users
like 3-4k
would you say like 50+ total members or whats the thing you'd say
oh...
😭 wait what so then just participate a lot and talk a lot
then slowly ease my bot into the conversation if it allows
yes
and hopefully that server adds it and then the other members of the server add it to their own servers
and it grows in that server
yes, that way both your bot and the server grow together
awesome ok so 3-4k members is the server I should shoot for
around that yeah
your bot needs to be notable in what it does
like, if it's an economy bot make it so you can offer something to the server
like paid roles or minigames
like offer the free "premium" for a couple
ok I see
since its more of a economy bot should I aim for like a gaming server or one of those
yep
keep asking yourself "there are many economy bots, what mine can offer to be notable?"
yeah I've always asked myself that
so I kept thinking of features to add
I added stuff like real time stock and crypto currency data and graphs and all that and then a couple other features
also a thing that REALLY helps, but must be done at the start is i18n
which is having many languages for the bot
but you can always rewrite it later on
kinda hard to explain, but the concept is the same regardless of the language
ah thats goiing to be a lot to impliment isnt it?
you create files with a predictable name (like lang_en, lang_es, etc), then add a configuration to each guild for selecting which u want
ahhh thats smart multiple files and based on what the server sets their languange to call upon that file
yes, then in those files u make a key-pair structure
can be json, yaml, init, whatever
just make sure they user the same keys
then u translate the value
yeah it might have to be JSON for me but yes I undestand how I might have to implimenmt that
u dont need to do it now, but it's easier to do the earlier u are into a project
later on it becomes...awful to implement
yeah cause then from that it'll just be adding it as I go
instead of later one when i have like 50 commands and now have to change all of them
awesome I will do that then!!!! any other advice you have to grow it? I will remmeber to add the languange thing and join a discord server and grow along with it
holy... what bot do you have and how many servers is it in???
currently it's in 7.8k servers, it's a card collecting/moderation/levelling bot
wowww
card collection is amazing
like was it difficult?
not exactly, but it involves a lot of optimization to keep everything snappy
ahh i can imagine... how long did it take to get to 7.8k servers????????
the main feature tho, that one was complex
what was that
I think it's been 3 years since I started, but I don't actively advertise
only top.gg and word of mouth
a tcg, like, an actual tcg
yep
yep
dang that must've took a while
I think I made the MVP in 2 months or so back in 2021, then it was constantly updated until mid 2022
then I started rewriting the bot entirely
what MVP?
oh wow.
but dont give up, once you get the momentum going you'll accumulate servers steadily
dang you are actually really helpful and good at this seriously I appreciate and thank you for helping me and giving some advice I am 150% going to use this to try and grow my discord bot!!!!
then you start needing to worry about being able to supply all those servers
which is around 5k servers I think
awesome sersiously thank you imma keep trying to grow and keep trying to promote and update and add more to the bot
any other advice than that or should I stick true to that and keep repeating it
hm, try to crack your mind as much as you can
the struggle is what teaches you the best ways to do something
Also with the i18n thing mentioned earlier idk if haku said but it’s really easy to implement yourself you don’t need a package
All it is just indexing json files based on what language the server is set at
ok any advice to impliment it because what @lyric mountain told me is it would be easy to impliment using JSON files
Yea json files is the best
it's one option, I personally prefer properties
as I don't need to parse the whole thing
some_key=This is a text
You can name the files lang_shorthand (lang_en) and just grab the json file based on the language set for the server
Then you can save that json file to a variable or map if you want and index that map for any keys you need
seriosuly you guys are both super helpful and im still in school and this is a hobby project so I am hoping to grow it but more importantly grow my own coding experience ... I also made this all by myself and im lowkey proud of it so thats mainly the thing to keep pushing myself to grow it
I have an example of an i18n implementation in a different language but it’s rather easy to comprehend and could be ported over to python
If you want it lmk
yes if possible i'd like to see it!
That’s what this channel is for don’t be afraid to ask for help. A good programmer uses every resource possible
yes thank you!!!
the bot has only been around since March 18th 2023
once you get a considerable amount of texts I recommend using a non-parsed format
as you might start having issues with the size of the json
by big I mean like thousands of lines
yea... i can imagine
right now... ummm lemme show you smtg
4801... lines of code
then I use mongoDB for storage and then some things are stored in JSON files
I recommend looking into cogs if you are using discord.py
It’ll help you keep your code organized
yeah i need to teach myself that 😭
lul yeah, try to split that into multiple files as misty said
Also I hope you arent using json to store constantly accessed data
but everyone starts like that
yes yes
and mongoDB
I don’t recommend using json for any data that is constantly read or written to
Especially if it’s important data
rule of thumb is: db for read/write, json for read-only
ok so here is how I have my stuff let me know what you think
I use mongoDB for my more constantly used storage
and then like approvedGiveawayusers, premium_members, and shop.json, and gamblingStats.json are my only JSON files
I mean technically json is fine to use if it’s not written to at a constant rate but still bad practice to use it for storage of important data
It can be corrupted
[object Object]
oh.
If you’re only reading the json file it’s fine
But once you start writing to it corruption can occur
ok then would those be fine as they barely get updated
ok I see imma hope that doesnt happen 😭
imma have to then move them to mongoDB
possibly but I wouldn’t risk it
awesome I will defenitly switch it over then!
if u want a json-y storage u can also use redis
^
One thing with redis is it’s not persistent by default
It’s more of a caching thing but it can be made to persist
redis?
it's a key-value database that's mostly used for cache purposes
but can also be used in place of a frequently updated json file
ok imma see about that then
Although I think you can use WSL
btw, try to use linux for hosting the bot if possible
windows hogs so much resources to it
If you need hosting lmk
i use an AWS VM
I have a vps I hardly use
aws is linux no?
i think so
AWS has multiple options iirc
If you need hosting lmk
alr alr
I wont charge ya
😭 right now I get my hosting for free
I have a vps I only use for my email server
you managed to get it working lmao
Sure
Barely
get what?
It still interrupts other shit pointed to my VPs
their email server
That’s why my portfolio is broken
oh
It keeps trying to use the SSL cert for my email server
setupping an email is insanely annoying because everyone everywhere questions your authenticity
the smallest slip and you get sent to the spam folder
It’s for my personal use anyways so ye
https://github.com/OtagamerZ/ShiroJBot/blob/rewrite/src/main/resources/locale/lang_en.properties this is my locale file, btw
I prefix all lines with a category, not really necessary
I wonder if people will find it useful for me to port my locale package to python
It’s shit anyone could do themselves but idk
Worth a try
At worst it'll just be a leftover project, at best it'll help someone
what's the correct way to host a discord bot if you want it to be scalable, I'm currently using screen to keep it running 24/7 on my ubuntu vps, is that the correct method or not?
just use pm2
screen is a very crude way of doing it
@wheat mesa it would be better to screenshare what is happening
Uhh I can’t really watch rn
I can take a vid then
Sure
See how I am sliding even after I stop moving (letting go of my WASD keys)
Send the code you’re currently using for that clip rq
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
// Public Variables
[SerializeField] public float movementSpeed = 10;
public Rigidbody playerRigidBody;
//Private Variables
private InputManager inputManager;
private Vector3 moveDirection;
private Transform cameraTransform;
private void Start()
{
inputManager = InputManager.Instance;
cameraTransform = Camera.main.transform;
}
private void Update()
{
Vector2 movement = inputManager.GetPlayerMovement();
Vector3 move = Time.deltaTime * movementSpeed * (new Vector3(movement.x, 0f, movement.y));
move = cameraTransform.forward.normalized * move.z + cameraTransform.right.normalized * move.x;
move.y = 0f;
moveDirection = move;
}
private void FixedUpdate()
{
if (moveDirection.magnitude == 0)
{
playerRigidBody.velocity += Vector3.zero;
}
else
{
playerRigidBody.velocity += moveDirection;
}
}
}
You can't do that
velocity expects a Vector3
Vector3.zero is just new Vector3(0,0,0)
I know

playerRigidBody.velocity = Vector3.zero
👍
Honestly, I prefer screen
Idk, allows me to have separate command histories, and keep everything separate
Also easy access to where I left it in
whats wrong with this embed
{
author: {
name: user.username,
icon_url: user.displayAvatarURL()
},
description: vouch?.content,
fields: {
name: 'Attachments',
value: vouch.files?.map(file => `[Link](${file})`).join(', ') || 'None'
},
footer: {
text: `Want to commission? Make a ticket!`,
icon_url: Images.SGAdvArrow
},
color: Colors.Review
}```
oh wait
nvm i think
Well what is happening that you don't expect
i fixed fields takes an array
i forgor
yep
@wheat mesaidk if you will know this answer, but what do you think would be the best way to tell if the rigidbody is "grounded"
I was thinking of checking collisions but that doesn't necessarily mean they are on something solid and not running into something solid as well
hey
Actually I think the best method is to use a downward raycast
do you know how i can return nothing if there's no files
Wdym
like you see hhere
you mean if vouch.files is null?
if there's no files it'll just set the fields value to None
how can i make it not add the field at all
you can use an if statement or possibly a ternary operator
"but that means I need more variables 😢"
yeah doesn't help me to tell me that
so your saying i need to make an extra variable
🤷♂️
Do you think using a downward raycast to see if the player is touching terrain/floor is a proper method to see if they are grounded waffle?
how can i do it without
💀
sounds about right? That's similar to what I did with my game engine for ground checks vs wall checks, granted it was 2d
same concept should apply though
I see
@wheat mesa
I don't think I will need to check for walls though will I?
As long as a wall has a collider it should make it so my character won't walk/run through it.
I don't see any functional reason to check for walls so I should be fine not doing so right?
likely not
For me it was different because my engine didn't have checks like that
(I am lazy) ((I hate programming quadtrees in java))
Lmao
private bool IsPlayerGrounded()
{
return Physics.Raycast(playerRigidBody.position, Vector3.down);
}
well this returns true
but
public bool PlayerJumped()
{
return playerControls.Player.Jump.triggered;
}
this doesn't
despite me pressing space
😔
Unity's new input system is confusing me
anyone know how i can do the above
getting approved is ez
just follow guidelines
is your bot Proje or Ro-Linker
why is that the applications name
js?
Official Top.gg Node SDK. Latest version: 3.1.5, last published: 2 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 9 other projects in the npm registry using @top-gg/sdk.
you sure you have it bound correctly?
It should be ye
u can use the api
but you'll possibly run into ratelimit issues
i mean
the ratelimit is 60 requests / minute iirc
no api
webhooks don't have a ratelimit
which is why it's preferred
Documentation for @top-gg/sdk
idk
well yeah, webhooks are the ideal option
👍
is there a react library that allows image cropping like this? (uptime kuma)
customize it to your liking
oh pog
hey guys is it possible to have a sort of module in my main file. which will run another bot automatically when the main bot starts?
like i want to have 2 index.js files which each wil contain a client.login but with different tokens ofc
i was thinking about using child_process and using its exec
you didn't try hard enough
literally everything in that library is modifiable, including the aspect ratio
I know, I did apply it, still didnt display it as 1:1, only the crop was 1:1
you're doing something wrong, by modifying the aspect ratio in their codesandbox i get the result you want
give me the link then
just life in general, i naturally got busy because employment 🥲
barely get on my pc anymore because the last thing i want to do after 8 hours of staring at a laptop is stare at another screen
but i at least get paid for my dev time now 🙃
how you been doing
you can still modify it
not like in uptime kuma though
keep the cropping logic from the library, customize it using your own components and css styling
if I force it I cant drag
Oh damn, missed you here, I've been incredibly busy as well (as you might be able to tell from my about me)
that was not my question, if you dont have an answer dont answer
if you're looking for something prebuilt, you won't find it. the lib helps you implement the logic you want
now, whether you know how to do it or not is on you 🤷♂️
i swear js changed completely since i last learnt it
since when were private class attributes and defining attributes outside of a constructor/method a thing??
js is evolving into the master language
soon we'll be programming large language models in js
... once js gets tensors and methods for manipulating large mathematical structures easily maybe even on the gpu????
who knows what the future holds for java holy script



