1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00
Commit graph

28 commits

Author SHA1 Message Date
22d6076e32
Merge remote-tracking branch 'origin/40-rename-users-who-attempt-to-hoist-themselves' into 40-rename-users-who-attempt-to-hoist-themselves 2023-07-23 16:24:30 +03:00
7166376740
no i mean i hate those guys but what about functionality 2023-07-23 16:23:55 +03:00
1e41e34ea1
Allow U+0401 (Ё) and U+0451 (ё) in nicknames
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-21 15:31:45 +05:00
62545f8c08
move regex 2023-07-21 10:27:57 +03:00
afdad004ad
fine i'll do it myself
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-21 11:40:41 +05:00
0fa8219f35
good luck with that @mctaylors
Signed-off-by: mctaylors <95250141+mctaylors@users.noreply.github.com>
2023-07-21 08:21:23 +03:00
363a1df95c
where did that come from
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-21 09:07:03 +05:00
8be33794a9
Merge branch 'master' into 40-rename-users-who-attempt-to-hoist-themselves
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-21 09:01:21 +05:00
27b8f15e3b
Force maximum Cognitive Complexity via InspectCode (#60)
This PR uses a new feature of the InspectCode action: extensions. By
adding the `Cognitive Complexity` extension, InspectCode can provide
warnings and force the contributors to follow standards regarding
complex methods. This functionality was previously provided by
CodeFactor, but it is no longer used. Here's the full changelog of this
PR:
- Allowed Actions to run on push for any branch, not just `master`;
- Added `Cognitive Complexity` plugin for InspectCode;
- Significantly reduced complexity of KickCommandGroup, MuteCommandGroup
and GuildUpdateService

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-21 08:54:52 +05:00
1d936aa674
fym nuh-uh
Signed-off-by: mctaylors <95250141+mctaylors@users.noreply.github.com>
2023-07-21 03:51:48 +03:00
8261a502f5
nuh-uh
Signed-off-by: mctaylors <95250141+mctaylors@users.noreply.github.com>
2023-07-21 02:53:40 +03:00
fd0c84d834
where tf is GlobalName
Signed-off-by: mctaylors <95250141+mctaylors@users.noreply.github.com>
2023-07-21 02:49:16 +03:00
4aa2a90902
didn't see that coming
Signed-off-by: mctaylors <95250141+mctaylors@users.noreply.github.com>
2023-07-21 00:01:46 +03:00
cd13be1325
Merge branch 'master' into 40-rename-users-who-attempt-to-hoist-themselves
Signed-off-by: Macintosh II <95250141+mctaylors@users.noreply.github.com>
2023-07-20 23:56:51 +03:00
553622f823
Force maximum Cognitive Complexity via InspectCode (#60)
This PR uses a new feature of the InspectCode action: extensions. By
adding the `Cognitive Complexity` extension, InspectCode can provide
warnings and force the contributors to follow standards regarding
complex methods. This functionality was previously provided by
CodeFactor, but it is no longer used. Here's the full changelog of this
PR:
- Allowed Actions to run on push for any branch, not just `master`;
- Added `Cognitive Complexity` plugin for InspectCode;
- Significantly reduced complexity of KickCommandGroup, MuteCommandGroup
and GuildUpdateService

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
Co-authored-by: Macintosh II <95250141+mctaylors@users.noreply.github.com>
2023-07-20 23:41:02 +03:00
306c1702ba
Merge branch 'master' into 40-rename-users-who-attempt-to-hoist-themselves 2023-07-20 11:17:16 +03:00
4624b59a8a
Reduce method complexity of /clear (#56)
Depends on #54

This PR reduces the method complexity of
`ClearCommandGroup#ClearMessagesAsync` by doing the following:
- Splitting the command method into 2 parts: ExecuteClear and
ClearMessagesAsync. The former will check all the needed results and
will pass the outputs into the latter;
- Using the recently extracted method `UtilityService#LogActionAsync` to
log deletion of messages.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-20 10:44:07 +03:00
daa1dd4184
General fixes (#54)
Depends on #55

These changes are really small and I don't know how to reasonably split
them into multiple PRs, but here's the changelog:
- The result of the `UtilityService#LogActionAsync` call in
`BanCommandGroup#BanUserAsync` is no longer ignored and it's errors will
now prevent feedback from being sent;
- Converted `if` statement to a `return` with ternary in
`LanguageOption`;
- Slightly decreased method complexity of
`MessageDeletedResponder#RespondAsync` by cleverly using Results;
- Changed the order of parameters for `UtilityService#LogActionAsync` to
flow better;
- Removed the exemption for `ConvertIfToReturnStatement` for
InspectCode.

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-20 07:36:21 +00:00
685688bbe8
Reduce method complexity of UtilityService#CheckInteractionsAsync (#55)
This PR reduces method complexity in
`UtilityService#CheckInteractionsAsync` by splitting the method into two
parts, similar to `/ban` and `/unban`. Additionally, it converts the
last `if` statement to a `return` with ternary.

After this is merged, status checks on #54 should succeed and that PR
should be merged.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-20 07:25:03 +00:00
2aee8a9c02
Fix issues found by ReSharper CLI pt.2 2023-07-20 04:49:31 +05:00
f4fc771432
Fix issues found by ReSharper CLI 2023-07-20 04:43:54 +05:00
165bab524a
Rename users to "nickname" who attempt to hoist theimselves pt.2 2023-07-20 04:37:01 +05:00
146e1b7b87
Rename users to "nickname" who attempt to hoist themselves 2023-07-20 04:34:47 +05:00
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
c825848d7e
Split error logging events into separate files (#51)
This PR splits `LoggingPreparationErrorEvent` and
`ErrorLoggingPostExecutionEvent` classes into separate files and puts
these files in a separate namespace: `Boyfriend.Commands.Events`. This
makes these classes easier to find and distinguish from commands groups.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-19 21:01:53 +00:00
f75926c604
Do not allow certain commands to be used in DMs (#49)
This PR prevents usage of `/about`, `/ping` and `/remind` inside DMs.
While it may look like these commands do not require a guild attached to
them, the language system depends on having a guild to fetch settings
from, so it is not possible to use these commands in DMs.

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-18 14:18:35 +00:00
c6dd3727c3
The Milestone Commit (#48)
mctaylors:
- updated readme 7 times (and only adding new logo from /about)
-
[removed](aeeb3d4399)
bot footer from created event embed on the second try
-
[changed](4b9b91d9e4)
cdn from discord to upload.systems

Octol1ttle:
- Guild settings code has been overhauled. Instead of instances of a
`GuildConfiguration` class being (de-)serialized when used with listing
and setting options provided by reflection, there are now multiple
`Option` classes responsible for the type of option they are storing.
The classes support getting a value, validating and setting values with
Results, and getting a user-friendly representation of these values.
This makes use of polymorphism, providing clean and easier to use and
refactor code.
- Gateway event responders have been split into their own separate
files, which should make it easier to find and modify responders when
needed.
- Warning suppressions regarding unused and never instantiated classes
have been replaced by `[ImplicitUse]` annotations provided by
`JetBrains.Annotations`. This avoids hiding real issues and provides a
better way to suppress false warnings while being explicit.
- It is no longer possible to execute some slash commands if they are
run without the correct permissions
- Dependencies are now more explicitly defined

neroduckale:
 - Made easter eggs case-insensitive

---------

Signed-off-by: Macintosh II <95250141+mctaylors@users.noreply.github.com>
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
Co-authored-by: nrdk <neroduck@vk.com>
2023-07-18 12:25:02 +00:00
3eb17b96c5
Tidy up project structure, fix bug with edit logging (#47)
The project structure has been changed because the previous one had
everything in 1 folder. From this PR onwards, the following is true:
- The source code is stored in `src/`
- `*.resx` and `Messages.Designer.cs` is stored in `locale/`
- Documentation is stored on the wiki and in `docs/`
- Miscellaneous files, such as dotfiles, are stored in the root folder
of the repository

This PR additionally fixes an issue that would cause logs of edited
messages to not be syntax highlighted. This happened because the
responder of edited messages was changed to use the universal
`InBlockCode` extension method which did not support syntax highlighting
until this PR

This PR additionally changes CODEOWNERS to be more reliable. Previously,
it would be possible for some PRs to be unable to be approved because
the only person who can approve them is the same person who opened the
PR.

---------

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
2023-07-09 22:36:44 +05:00