Skip to content

Commit

Permalink
Apply new inspection fixes (#329)
Browse files Browse the repository at this point in the history
Rider and R# 2024.2 have introduced new inspections, causing current
builds to fail. This PR applies fixes for issues caught by these
inspections.
  • Loading branch information
Octol1ttle authored Aug 24, 2024
1 parent e457b46 commit d113312
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion TeamOctolings.Octobot/Commands/AboutCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private async Task<Result> SendAboutBotAsync(IUser bot, Snowflake guildId, Cance
return await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[]
{
new ActionRowComponent(new[] { repositoryButton, wikiButton, issuesButton })
new ActionRowComponent([repositoryButton, wikiButton, issuesButton])
}), ct);
}
}
4 changes: 2 additions & 2 deletions TeamOctolings.Octobot/Commands/BanCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public BanCommandGroup(AccessControlService access, IDiscordRestChannelAPI chann
/// </param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the user
/// was banned and vice-versa.
/// was banned and vice versa.
/// </returns>
/// <seealso cref="ExecuteUnban" />
[Command("ban", "бан")]
Expand Down Expand Up @@ -219,7 +219,7 @@ var interactionResult
/// </param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the user
/// was unbanned and vice-versa.
/// was unbanned and vice versa.
/// </returns>
/// <seealso cref="ExecuteBanAsync" />
/// <seealso cref="MemberUpdateService.TickMemberDataAsync" />
Expand Down
2 changes: 1 addition & 1 deletion TeamOctolings.Octobot/Commands/ClearCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ClearCommandGroup(
/// <param name="author">The user whose messages will be cleared.</param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that any messages
/// were cleared and vice-versa.
/// were cleared and vice versa.
/// </returns>
[Command("clear", "очистить")]
[DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task<Result> AfterExecutionAsync(
return ResultExtensions.FromError(await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[]
{
new ActionRowComponent(new[] { issuesButton })
new ActionRowComponent([issuesButton])
}), ct)
);
}
Expand Down
2 changes: 1 addition & 1 deletion TeamOctolings.Octobot/Commands/KickCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public KickCommandGroup(AccessControlService access, IDiscordRestChannelAPI chan
/// </param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member
/// was kicked and vice-versa.
/// was kicked and vice versa.
/// </returns>
[Command("kick", "кик")]
[DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)]
Expand Down
4 changes: 2 additions & 2 deletions TeamOctolings.Octobot/Commands/MuteCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public MuteCommandGroup(AccessControlService access, ICommandContext context, IF
/// </param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member
/// was muted and vice-versa.
/// was muted and vice versa.
/// </returns>
/// <seealso cref="ExecuteUnmute" />
[Command("mute", "мут")]
Expand Down Expand Up @@ -235,7 +235,7 @@ private async Task<Result> TimeoutUserAsync(
/// </param>
/// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member
/// was unmuted and vice-versa.
/// was unmuted and vice versa.
/// </returns>
/// <seealso cref="ExecuteMute" />
/// <seealso cref="MemberUpdateService.TickMemberDataAsync" />
Expand Down
10 changes: 5 additions & 5 deletions TeamOctolings.Octobot/Data/Reminder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace TeamOctolings.Octobot.Data;

public struct Reminder
public sealed record Reminder
{
public DateTimeOffset At { get; init; }
public string Text { get; init; }
public ulong ChannelId { get; init; }
public ulong MessageId { get; init; }
public required DateTimeOffset At { get; init; }
public required string Text { get; init; }
public required ulong ChannelId { get; init; }
public required ulong MessageId { get; init; }
}
2 changes: 1 addition & 1 deletion TeamOctolings.Octobot/Responders/GuildLoadedResponder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ private async Task<Result> SendDataLoadFailed(IGuild guild, GuildData data, IUse
);

return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,
components: new[] { new ActionRowComponent(new[] { issuesButton }) }, ct: ct);
components: new[] { new ActionRowComponent([issuesButton]) }, ct: ct);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private async Task<Result> SendScheduledEventCreatedMessage(

return await _channelApi.CreateMessageWithEmbedResultAsync(
GuildSettings.EventNotificationChannel.Get(settings), roleMention, embedResult: embed,
components: new[] { new ActionRowComponent(new[] { button }) }, ct: ct);
components: new[] { new ActionRowComponent([button]) }, ct: ct);
}

private static Result<string> GetExternalScheduledEventCreatedEmbedDescription(
Expand Down

0 comments on commit d113312

Please sign in to comment.