Skip to content
Advertisement

Invite created event (discord.js v12)

I am trying to send an embed whenever a invite is created.

Channel set file

JavaScript

Index.js Modules (PS: I took the most relevant ones.)

JavaScript

Index.js file

JavaScript

I don’t think the two events (inviteCreate, message) belong I did it because I received a error:

JavaScript

Now, the channel set features works as intended but whenever the invite is created the embed doesn’t send.

Advertisement

Answer

You can’t merge all events inside one function.

You only need to keep the inviteCreate event. Then, you have to find a way to get the guild without using the “message” variable. Instead you can use the “invite” parameter that is present inside the inviteCreate event.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement