Preconditions Usage
i read docs but i didn't understand some point
my file structure is this
13 Replies
index.d.ts
moderator.ts
but it doesn't work
OnlyMods
is not moderator
oh should i use file name
for that ?
and make it not
index.d.ts
but just put it just in index.ts
well the file name dictates the precondition name at runtime
so if you dont match those, TS may accept it but it wont work in runtimeahh isee
but it doesn't throw error
it works but
ah wait
yea members can't see message
is there something to do
like error handling
We have a guide page dedicated to handling precondition denials
oh oaky
i put this inside of "listeners" folder
it doesn't send my error message
is it because of my chatinput command or something like this
or file structure, etc.
name of the file?
if it's
chatInputCommandDenied.ts
(case sensitive!!) then it should be fineshould i name my files with name of classes?
or is this special for this one
and are there any guide for file naming or directory structure for this kind of files
the name is always the name of the piece (unless set otherwise) and in the case of listeners the name of the piece is also the name of the event to bind it on (unless set otherwise)
for events there is the events enum which is on the sapphire docs
like this
i'll try it
ah yea it works