1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-17 03:04:45 +03:00

Add a new .editorconfig and reformat code (#76)

*I'll start working on features and bugfixes after this PR, I promise*
very short summary:
- no more braceless statements
- braces are on new lines now
- `sealed` on everything that can be `sealed`
- no more awkwardly looking alignment of fields/parameters
- no more `Service` suffix on service fields. yeah.
- no more `else`s. who needs them?
- code style is now enforced by CI

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-08-03 01:51:16 +05:00 committed by GitHub
parent 4cb39a34b5
commit 84e730838b
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 2917 additions and 623 deletions

View file

@ -11,11 +11,13 @@ namespace Boyfriend;
/// Handles responding to various interactions.
/// </summary>
[UsedImplicitly]
public class InteractionResponders : InteractionGroup {
private readonly FeedbackService _feedbackService;
public class InteractionResponders : InteractionGroup
{
private readonly FeedbackService _feedback;
public InteractionResponders(FeedbackService feedbackService) {
_feedbackService = feedbackService;
public InteractionResponders(FeedbackService feedback)
{
_feedback = feedback;
}
/// <summary>
@ -25,11 +27,15 @@ public class InteractionResponders : InteractionGroup {
/// <returns>An ephemeral feedback sending result which may or may not have succeeded.</returns>
[Button("scheduled-event-details")]
[UsedImplicitly]
public async Task<Result> OnStatefulButtonClicked(string? state = null) {
if (state is null) return new ArgumentNullError(nameof(state));
public async Task<Result> OnStatefulButtonClicked(string? state = null)
{
if (state is null)
{
return new ArgumentNullError(nameof(state));
}
var idArray = state.Split(':');
return (Result)await _feedbackService.SendContextualAsync(
return (Result)await _feedback.SendContextualAsync(
$"https://discord.com/events/{idArray[0]}/{idArray[1]}",
options: new FeedbackMessageOptions(MessageFlags: MessageFlags.Ephemeral), ct: CancellationToken);
}