In LoggerExtensions#LogResult we skip logging the result if the error is
"user or environment error". What matches that criteria is defined by
Remora's implementation.
However, none of errors defined by the implementation should *ever* happen or be ignored:
* CommandNotFoundError: The client shouldn't send us non-existing
commands. This *can* happen because the client's command list can get
out of sync with the server's, but this happens rarely.
* AmbiguousCommandInvocationError: We don't have commands that would
trigger this error
* RequiredParameterValueMissingError: The client shouldn't send us
commands without required paremeters
* ParameterParsingError: See #220
* ConditionNotSatisfiedError: The client shouldn't send us commands that
don't satisfy our conditions
Closes#220
GitInfo's `RepositoryUrl` string depends on origin URL, which is
unvalidated user input that isn't even guaranteed to exist. This can
cause issues that are almost impossible to
debug
Closes#281
This PR has been opened to finally update Octobot's Wiki.
Current changes summary:
- correct minor spelling issues in some command descriptions
- /about: add Octobot's Wiki button
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
i thought there would be a lot of statements that could be merged, but
these are only ones I could find, apparently
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This feature will improve the debugging experience for developers by
providing the information about *where exactly* a result has failed
---------
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This will better align with how a normal moderator would respond to the
log:
Before: "see log" -> "jump to message without knowing what changed" ->
"read message diff"
After: "see log" -> "read message diff" -> "jump to message for context"
In addition, the change improves consistency with how reminders are
shown.
---------
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This change significantly reduces the code space used by properties
while maintaining clarity on types. Since only properties are allowed to
use expression bodies, it is clear to developers that what they are
looking at is a property or not
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
In this PR, I'm disabling the Report Issue button if a "dirty" version
is detected. This is done just in case so that "smart" developers don't
accidentally report a bug that they themselves created.
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
In this PR, I added a NuGet package called GitInfo. It can replace
Octobot.RepositoryUrl and display the bot version as the current branch
and commit.
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
Signed-off-by: Macintxsh <95250141+mctaylors@users.noreply.github.com>
If you go through the locales, sooner or later you will notice `Sound*`,
which is used in `GuildLoadedResponder.cs`. A new contributor (most
likely) will not understand what it is used for at once, because we use
`$"Loaded{i}".Localized()` instead of `Messages.Sound*` directly. Also,
if you change the locale's value, for example the same "Loaded!",
`Sound` will not fit anymore, because "Loaded!" is not a sound, but a
phrase.
Other suggestions are welcome.
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This PR was made to help users who are trying /remind for the first time
by showing an example of the correct time format in the description.
---------
Signed-off-by: Macintxsh <95250141+mctaylors@users.noreply.github.com>
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
@neroduckale was bored so I made this feature.
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
Signed-off-by: Macintxsh <95250141+mctaylors@users.noreply.github.com>
Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
1) the method isn't actually async lulw
2) it always returns success, so might as well just be void
reduces complexity by a bit
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
The ParseTimeSpan method is not needed because we no longer use the
quirky (IMO) and long
`Parser.TryParseAsync(from).AsTask().GetAwaiter().GetResult()` to parse
TimeSpan
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
In this PR, I'm adding a command to modify existing reminders. This can
be useful if you, for example, got the name a bit wrong or set the wrong
reminder time. Just use /editremind and recreating the reminder from
scratch will no longer be necessary.
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
Using Thread.Sleep blocks the _entire_ thread from doing *anything*,
while Task.Delay allows the thread to execute other tasks while the
delay is passing. The inability to cancel Thread.Sleep may also cause
longer shutdowns
tl;dr Thread.Sleep bad, Task.Delay good
made because of
578c03871d
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
Closes#241
Updates:
- Show if the user was kicked by [adding "Kicked" parameter to
MemberData](https://github.com/LabsDevelopment/Octobot/issues/241)
- Change `mctaylors-ru`'s `UserInfoBannedPermanently` string to be
different from `UserInfoBanned`
- Finally add `AppendPunishmentsInformation` method to avoid Cognitive
Complexity
- Use MemberData to check if the user was banned
- Rename variable `isMuted` to `wasMuted` to be consistent with other
variable names
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This PR adds the base classes required for profiling code inside of
Octobot. The implementation of the profiler is similar to Minecraft,
however it is more detailed and provides per-event logs for each event.
This PR does not change any code to be profiled and this is intentional.
Changes required for profiling will come as separate PRs, one for
commands, one for responders, and one for background services.
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
Title. idk why I didn't think of this before.
Also, GuildDataService is now properly registered as an IHostedService,
so it receives start & shutdown events. So this PR gets rid of the
workaround that was needed for save-on-shutdown to function
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
Originally, these classes were services because I thought that all
DI-resolvable classes need to be services. However, this is not true, so
we can make these classes (notably Utility and GuildDataService) not
extend anything. `UtilityService` was renamed to `Utility` for
simplicity
---------
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
In this PR, I made it so that in the Author field instead of the
hardcoded name was the name of the Discord bot. This was done to match
the icon next to it in the same field.
Replaces #224
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
ReSharper inspections have been updated, causing new warnings to appear
in the codebase. This time, the "Use collection expressions" inspection
has been enabled for usecases where the collection is not empty. This PR
fixes the check failures caused by this inspection.
In this PR, the behavior of the developer list display in /about has
been changed. Now, if a developer is not on the same server where the
/about command was executed, their username will have a link to their
GitHub profile.
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
Bumps [DiffPlex](https://github.com/mmanela/diffplex) from 1.7.1 to
1.7.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/mmanela/diffplex/commits">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DiffPlex&package-manager=nuget&previous-version=1.7.1&new-version=1.7.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
In this PR, I've added a "Report an issue" button and a few more
button-related changes:
- Add "Report an issue" button
- Add icon for "Octobot's source code"
- Rename `AboutTitleRepository` to `ButtonOpenRepository`
- Rename `OpenEventInfoButton` to `ButtonOpenEventInfo` to be consistent
with other language string names
- Rename `ColorsList.cs` to `Miscellaneous.cs`
- Add public const strings in `Octobot.cs` to get repository & issues links
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
In this PR, I moved the repository link from the embed to a button in
/about command for better UI/UX
---------
Signed-off-by: Macintxsh <95250141+mctaylors@users.noreply.github.com>