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>
This PR adds an extension method to make it easier to pass Result<Embed> to CreateMessageAsync
---------
Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
Me and other .NET developers hold the stance that primary constructors
are not ready for production use, particularly with dependency
injection. There are debates regarding the styling of primary
constructors, but the bigger issue is that a primary constructor
parameter cannot be made `readonly` (which is crucial with dependency
injection). The inspection "Convert to Primary Constructor" was disabled
in ReSharper CLI when we updated to .NET 8, but the warning is still
present for ReSharper and Rider users. This PR disables this warning to
avoid developers accidentally using a primary constructor.
Changes:
- Use timestamps from
[Splatunes](https://splatoonwiki.org/wiki/Splatune_(Splatoon_Original_Soundtrack))
- Increase track count to 20
- Replace Calamari Inkantation 3MIX with OG Calamari Inkantation due to long
duration
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
In this PR, I have added StringBuilder extensions to avoid `.Append`
reuse such as `.Append("- ").AppendLine()`
Closes#205
---------
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>