mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
fix warnings
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
fcedb762eb
commit
eaf3ddf77e
1 changed files with 12 additions and 12 deletions
|
@ -59,12 +59,10 @@ public class SettingsCommandGroup : CommandGroup {
|
|||
builder.Append(Markdown.InlineCode(setting.Name))
|
||||
.Append(": ");
|
||||
var something = setting.GetValue(cfg);
|
||||
if (something.GetType() == typeof(List<GuildConfiguration.NotificationReceiver>)) {
|
||||
if (something!.GetType() == typeof(List<GuildConfiguration.NotificationReceiver>)) {
|
||||
var list = (something as List<GuildConfiguration.NotificationReceiver>);
|
||||
builder.AppendLine(string.Join(", ", list.Select(v => Markdown.InlineCode(v.ToString()))));
|
||||
} else {
|
||||
builder.AppendLine(Markdown.InlineCode(something.ToString()));
|
||||
}
|
||||
builder.AppendLine(string.Join(", ", list!.Select(v => Markdown.InlineCode(v.ToString()))));
|
||||
} else { builder.AppendLine(Markdown.InlineCode(something.ToString()!)); }
|
||||
}
|
||||
|
||||
var embed = new EmbedBuilder().WithSmallTitle(Messages.SettingsListTitle, currentUser)
|
||||
|
@ -73,8 +71,10 @@ public class SettingsCommandGroup : CommandGroup {
|
|||
.Build();
|
||||
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
|
||||
|
||||
return (Result)await _feedbackService.SendContextualEmbedAsync(built, ct: CancellationToken, options: new FeedbackMessageOptions(MessageFlags: MessageFlags.Ephemeral));
|
||||
return (Result)await _feedbackService.SendContextualEmbedAsync(
|
||||
built, ct: CancellationToken, options: new FeedbackMessageOptions(MessageFlags: MessageFlags.Ephemeral));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A slash command that shows information about this bot.
|
||||
/// </summary>
|
||||
|
@ -101,7 +101,7 @@ public class SettingsCommandGroup : CommandGroup {
|
|||
|
||||
try {
|
||||
foreach (var prop in typeof(GuildConfiguration).GetProperties())
|
||||
if (setting.ToLower() == prop.Name.ToLower())
|
||||
if (string.Equals(setting, prop.Name, StringComparison.CurrentCultureIgnoreCase))
|
||||
property = prop;
|
||||
if (property == null || !property.CanWrite)
|
||||
throw new ApplicationException(Messages.SettingDoesntExist);
|
||||
|
|
Loading…
Add table
Reference in a new issue