forked from TeamInklings/Octobot
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 (value is "reset" or "default") {
|
||||||
if (selectedSetting is "WelcomeMessage")
|
config[selectedSetting] = selectedSetting is "WelcomeMessage"
|
||||||
config[selectedSetting] = Messages.DefaultWelcomeMessage;
|
? Messages.DefaultWelcomeMessage
|
||||||
else
|
: Boyfriend.DefaultConfig[selectedSetting];
|
||||||
config[selectedSetting] = Boyfriend.DefaultConfig[selectedSetting];
|
|
||||||
} else {
|
} else {
|
||||||
if (value == config[selectedSetting]) {
|
if (value == config[selectedSetting]) {
|
||||||
cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),
|
cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),
|
||||||
|
|
Reference in a new issue