A fork of multiple-purpose Discord bot written in Remora.Discord
This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Octol1ttle f260681b39
Split GuildUpdateService into separate services (#80)
GuildUpdateService is a service that contains way too many
responsibilities with everything strictly coupled to each other. The
code is buggy, hard to refactor and swallows errors. This prompted me to
make this PR, which splits it into three independant services:
- SongUpdateService (responsible for changing songs presence);
- MemberUpdateService (responsible for updating member datas: unbanning
users, adding the default role, sending reminders, filtering nicknames);
- ScheduledEventUpdateService (responsible for updating scheduled
events: sending notifications, automatically starting events).

All of these services and their methods use Results to push errors all
the way up in the stack, making sure no error is missed. To make logging
and debugging easier, an extension method for `ILogger` was created -
`LogResult`. The method checks if the result was successful or if its
failure was caused by a user or environment error before logging
anything - providing cleaner code and logs. `ExceptionError`s will also
have their exception stacktrace and type logged (except in Remora code).

This PR also fixes an issue that prevented banned users from being
unbanned when their punishment was over.

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-08-05 18:02:40 +00:00
.github Force maximum Cognitive Complexity via InspectCode (#60) 2023-07-21 08:54:52 +05:00
CodeAnalysis Add code analysis to prohibit using bad methods and properties (#70) 2023-07-24 20:35:45 +03:00
docs Remove "code quality" badge (#57) 2023-07-20 07:55:02 +00:00
locale Add a new .editorconfig and reformat code (#76) 2023-08-02 20:51:16 +00:00
src Split GuildUpdateService into separate services (#80) 2023-08-05 18:02:40 +00:00
.editorconfig Backfill member data when a guild is loaded or a new member joins it (#77) 2023-08-04 13:52:54 +00:00
.gitignore Switch to Remora.Discord (#41) 2023-07-09 16:32:14 +03:00
Boyfriend.csproj Add logging to file (#75) 2023-08-02 13:25:41 +00:00
Boyfriend.sln Rename solution & project, move the project files one layer up 2023-01-18 20:17:33 +05:00
LICENSE Seal all possible classes, add LICENSE, follow async naming conventions 2022-09-18 19:41:29 +05:00

Boyfriend logo

GitHub License GitHub Workflow Status GitHub last commit

Beep! I'm a general-purpose bot for moderation written by @Octol1ttle in C# and Remora.Discord

Features

  • Banning, muting, kicking, etc.
  • Reminding you about something if you wish
  • Reminding everyone about that new event you made
  • Log everything from joining the server to deleting messages

...and more!

Installing and running Boyfriend

You can read our wiki in order to assemble your Boyfriend™ and moderate the server.

Contributing

When it comes to contributing to the project, the two main things you can do to help out are reporting issues and submitting pull requests. Please refer to the contributing guidelines to understand how to help in the most effective way possible.

Special Thanks

JetBrains Logo (Main) logo

JetBrains, creators of ReSharper and Rider, supports Boyfriend with one of their Open Source Licenses. Rider is the recommended IDE when working with Boyfriend, and everyone on the Boyfriend team uses it. Additionally, ReSharper command-line tools made by JetBrains are used for status checks on pull requests to ensure code quality even when not using ReSharper or Rider.