1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 08:51:12 +03:00
A general-purpose Discord bot for moderation written in C#
Find a file
Octol1ttle e2bf083189
Reduce method complexity in /ban, /unban and some other commands (#50)
This PR does numerous things to reduce method complexity:
- Created an extension method
`FeedbackService#SendContextualEmbedResultAsync`, which directly takes a
`Result<Embed>` and checks it once in the extension method instead of
multiple times in all commands;
- Split the command methods for `/ban` and `/unban` into 2 parts:
`Execute(Un)Ban` and `(Un)BanUserAsync`. The former will check all the
needed results and will pass the outputs into the latter;
- Extracted the method for logging an action into Private- and
PublicFeedbackChannels. It now resides in UtilityService. Right now,
only `/ban` and `/unban` make use of that method;
- Created an extension method `Snowflake#EmptyOrEqualTo`, that combines
the task of checking if a Snowflake is empty and checking if that
Snowflake is equal to another Snowflake.

Similar changes will be made to other command groups in future PRs. This
is not done here to make the reviewing process easier.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-19 21:08:44 +00:00
.github Increase thresholds for size labels (#52) 2023-07-19 21:00:11 +00:00
docs The Milestone Commit (#48) 2023-07-18 12:25:02 +00:00
locale The Milestone Commit (#48) 2023-07-18 12:25:02 +00:00
src Reduce method complexity in /ban, /unban and some other commands (#50) 2023-07-19 21:08:44 +00:00
.editorconfig Switch to Remora.Discord (#41) 2023-07-09 16:32:14 +03:00
.gitignore Switch to Remora.Discord (#41) 2023-07-09 16:32:14 +03:00
Boyfriend.csproj The Milestone Commit (#48) 2023-07-18 12:25:02 +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 CodeFactor

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.