GuildMemberRemove not running
I just think I'm overlooking something but...
I'm trying to do something if a member leaves the guild, but the event is not running.
I have the following intends:
- Guilds
- GuildMembers
- GuildPresences
I also added the partial "GuildMember".
The Listener looks like this:
6 Replies
@senpai.peace in your main file, before you login, import
Store
from @sapphire/framework
, then add the line Store.logger = console.log
. Then, check the logs to make sure the listener is loading correctly.Are this the right lines?
It looks like you didn't name the listener correctly. The file should be named
guildMemberRemove.ts
Oh wow, that was it... Thought the file naming is unimportant as long as you set the Events.GuildMemberRemove.
Thanks
You're welcome. Unfortunately sapphire doesn't read types. You can either set the event name through the file name or the
event
field in the constructor.Adding to this, sapphire couldn't read types even if it wanted to (it would be cool) because type information is lost when compiling.
The only way this could maybe be achieved is with a tsconfig plugin but I have no idea how those work. Or have a dedicated CLI like Prisma does.
Sadly typescript isn't like Java Spring Boot where you can provide only the interface for a database repository and it automatically implements a whole CRUD repository.