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

Apply new inspection fixes (#329)

Rider and R# 2024.2 have introduced new inspections, causing current
builds to fail. This PR applies fixes for issues caught by these
inspections.
This commit is contained in:
Octol1ttle 2024-08-24 20:48:47 +05:00 committed by GitHub
parent e457b4609e
commit d1133124b8
Signed by: GitHub
GPG key ID: B5690EEEBB952194
9 changed files with 15 additions and 15 deletions

View file

@ -131,7 +131,7 @@ public sealed class AboutCommandGroup : CommandGroup
return await _feedback.SendContextualEmbedResultAsync(embed, return await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[] new FeedbackMessageOptions(MessageComponents: new[]
{ {
new ActionRowComponent(new[] { repositoryButton, wikiButton, issuesButton }) new ActionRowComponent([repositoryButton, wikiButton, issuesButton])
}), ct); }), ct);
} }
} }

View file

@ -62,7 +62,7 @@ public sealed class BanCommandGroup : CommandGroup
/// </param> /// </param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the user /// 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> /// </returns>
/// <seealso cref="ExecuteUnban" /> /// <seealso cref="ExecuteUnban" />
[Command("ban", "бан")] [Command("ban", "бан")]
@ -219,7 +219,7 @@ public sealed class BanCommandGroup : CommandGroup
/// </param> /// </param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the user /// 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> /// </returns>
/// <seealso cref="ExecuteBanAsync" /> /// <seealso cref="ExecuteBanAsync" />
/// <seealso cref="MemberUpdateService.TickMemberDataAsync" /> /// <seealso cref="MemberUpdateService.TickMemberDataAsync" />

View file

@ -51,7 +51,7 @@ public sealed class ClearCommandGroup : CommandGroup
/// <param name="author">The user whose messages will be cleared.</param> /// <param name="author">The user whose messages will be cleared.</param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that any messages /// 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> /// </returns>
[Command("clear", "очистить")] [Command("clear", "очистить")]
[DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)] [DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)]

View file

@ -81,7 +81,7 @@ public sealed class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
return ResultExtensions.FromError(await _feedback.SendContextualEmbedResultAsync(embed, return ResultExtensions.FromError(await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[] new FeedbackMessageOptions(MessageComponents: new[]
{ {
new ActionRowComponent(new[] { issuesButton }) new ActionRowComponent([issuesButton])
}), ct) }), ct)
); );
} }

View file

@ -57,7 +57,7 @@ public sealed class KickCommandGroup : CommandGroup
/// </param> /// </param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member /// 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> /// </returns>
[Command("kick", "кик")] [Command("kick", "кик")]
[DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)] [DiscordDefaultMemberPermissions(DiscordPermission.ManageMessages)]

View file

@ -59,7 +59,7 @@ public sealed class MuteCommandGroup : CommandGroup
/// </param> /// </param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member /// 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> /// </returns>
/// <seealso cref="ExecuteUnmute" /> /// <seealso cref="ExecuteUnmute" />
[Command("mute", "мут")] [Command("mute", "мут")]
@ -235,7 +235,7 @@ public sealed class MuteCommandGroup : CommandGroup
/// </param> /// </param>
/// <returns> /// <returns>
/// A feedback sending result which may or may not have succeeded. A successful result does not mean that the member /// 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> /// </returns>
/// <seealso cref="ExecuteMute" /> /// <seealso cref="ExecuteMute" />
/// <seealso cref="MemberUpdateService.TickMemberDataAsync" /> /// <seealso cref="MemberUpdateService.TickMemberDataAsync" />

View file

@ -1,9 +1,9 @@
namespace TeamOctolings.Octobot.Data; namespace TeamOctolings.Octobot.Data;
public struct Reminder public sealed record Reminder
{ {
public DateTimeOffset At { get; init; } public required DateTimeOffset At { get; init; }
public string Text { get; init; } public required string Text { get; init; }
public ulong ChannelId { get; init; } public required ulong ChannelId { get; init; }
public ulong MessageId { get; init; } public required ulong MessageId { get; init; }
} }

View file

@ -120,6 +120,6 @@ public sealed class GuildLoadedResponder : IResponder<IGuildCreate>
); );
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed, return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,
components: new[] { new ActionRowComponent(new[] { issuesButton }) }, ct: ct); components: new[] { new ActionRowComponent([issuesButton]) }, ct: ct);
} }
} }

View file

@ -229,7 +229,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService
return await _channelApi.CreateMessageWithEmbedResultAsync( return await _channelApi.CreateMessageWithEmbedResultAsync(
GuildSettings.EventNotificationChannel.Get(settings), roleMention, embedResult: embed, 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( private static Result<string> GetExternalScheduledEventCreatedEmbedDescription(