When using /deploy or typing !deploy (with permissions), the error Uncaught Error Error: listen EADDRINUSE: address already in use :::3000 is thrown.
Reason
Because a redeployment creates a new instance of Authentication, a new express app is created that tries to listen to the same port as the previous one
Solution
Make server static and check if it has a value when creating a new Authentication instance. If so, don't listen to the same port again.
Workarounds
Restart the bot if it crashes, it won't crash again until you redeploy again
Problem
When using /deploy or typing !deploy (with permissions), the error
Uncaught Error Error: listen EADDRINUSE: address already in use :::3000
is thrown.Reason
Because a redeployment creates a new instance of Authentication, a new express app is created that tries to listen to the same port as the previous one
Solution
Make server static and check if it has a value when creating a new Authentication instance. If so, don't listen to the same port again.
Workarounds