1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Replace 'if' with a ternary operator

This commit is contained in:
Octol1ttle 2022-10-21 11:13:17 +05:00
parent ff166362ae
commit 595e7f6a6d
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -110,10 +110,9 @@ public sealed class SettingsCommand : ICommand {
};
if (value is "reset" or "default") {
if (selectedSetting is "WelcomeMessage")
config[selectedSetting] = Messages.DefaultWelcomeMessage;
else
config[selectedSetting] = Boyfriend.DefaultConfig[selectedSetting];
config[selectedSetting] = selectedSetting is "WelcomeMessage"
? Messages.DefaultWelcomeMessage
: Boyfriend.DefaultConfig[selectedSetting];
} else {
if (value == config[selectedSetting]) {
cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),