TrojanerHD / TrojanerBot

My discord bot
MIT License
4 stars 2 forks source link

express-port setting keeps reappearing even though it is optional #54

Open TrojanerHD opened 2 years ago

TrojanerHD commented 2 years ago

Problem

Upon deleting the setting express-port in settings.json, the bot automatically overwrites the settings and adds the setting back

Reason

https://github.com/TrojanerHD/TrojanerBot/blob/6d401e8a34869fea5a39857018a3e4b293adf821/src/Settings.ts#L44-L57 This code checks if the new settings do not include a key of the old settings, takes all of the values that the new settings changed but reapplies the old settings

Workaround

Set the express port to a non-positive value (like 0)