#Property messages does not exist on type
1 messages ยท Page 1 of 1 (latest)
Can't really help because the "awaits" inside brackets are awfully hard to read ๐
The nested ifs aren't very helpful either
Don't take it as a criticism, please. I just wanted to provide feedback. Clean code makes it easier for others and for you, cause you'll get the answer quicker
I can't really remove those. Keyv usually fails to get data when I'm not using await
oh wait I can set variables
whoops
Yup, that's what I meant - use variables
The await is fine. Just put it in a different place
you need to typeguard the channel
either check <Channel>.type or use <Channel>.isTextBased()
I see you have ?.isTextBased but don't call it
also I don't believe typescript will typeguard like that
?
oh wait here's a better image
you should store it in a variable first before typeguarding it
isTextBased() would be fine as well
Like this?
Still says that message isn't a property of channel
use the one you stored and typeguarded
oh oops
Why do you use an exclamation mark at the end of Client. channels.cache.get (channeldata)!?
it's a non-null assertion
I assume that means either they know the channel will be there, or they want it to error if it's not
nevermind
Thanks! It doesn't give me any errors!
Which is a bad thing
because it doesn't remove the message either ๐
that'd be because fetch is asynchronous, so you're comparing <Promise>.author to a User object
consider awaiting that promise too and also comparing ids rather than User objects
So I'll have to await the author?
already did that
then that's fine
but again compare the ids instead of the User objects
so author.id == interaction.user.id?
ye
Slash commands senders have authors, right?
wdym?
this refferal message has an author, right?
Oh well I'm stupid
Time to think of a way to get the author ig