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:
parent
ff166362ae
commit
595e7f6a6d
1 changed files with 3 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue