Bot freezing after evaluate `.client`

- evaluated how eval this.container.client - with which options option? - define "hang" Bot doesn't respond for any command after i evaluated that argument / Freezing - why are you evalling it at all? what is your end goal? possibly there is a better way. to get any properties in my Client
6 Replies
Favna
Favna•14mo ago
Why would you need to eval to get the properties. Just do this.container.client.whatever-property-you-want-goes-here. And if you need to know what properties are available just start writing the code in your editor and if you're writing in TypeScript, or use an editor with a TypeScript Language Server (VSCode, IntelliJ IDEA, Webstorm, etc) then it'll give you the options in the dropdown. Also you have to ask yourself what you want before you do it. What do you want to achieve at all. You shouldn't just go "hey let me check what options are available and then maybe I'll do something with that", instead you should work the way of "I want to do X and for that I need a property Y on my client so I'll write this.container.client.Y"
SEMESTER 5 MENIT TIDUR
SEMESTER 5 MENIT TIDUROP•14mo ago
man, i just wonder why 😄
Favna
Favna•14mo ago
Because there are so many properties to compute and show that your system cannot handle it.
SEMESTER 5 MENIT TIDUR
SEMESTER 5 MENIT TIDUROP•14mo ago
even theres only 27 properties? (i check with Object.getOwnPropertyName)
Favna
Favna•14mo ago
¯\_(ツ)_/¯ If the process hangs just don’t do what makes it hang. It’s as easy as that. And like I said, there is not even a reason to do what you’re doing. Also despite there being only 27 property names some of them are probably getters which may compute more than just simple values. Also again it depends on your eval options. For example if you pass it into util.inspect you may have configured it to go several levels deep. I don’t recall what depth eval does by default.
SEMESTER 5 MENIT TIDUR
SEMESTER 5 MENIT TIDUROP•14mo ago
that makes sense, and my eval deep option is 0
Want results from more Discord servers?
Add your server