From e0370e44f5a37b3d7542c58b0424b462e2587fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 19 Sep 2022 08:04:43 +0200 Subject: [PATCH 01/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20.NET=20to?= =?UTF-8?q?=207.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet-core.yml | 2 +- Directory.Build.props | 2 +- global.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index af8d5c85..c4389927 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Install dependencies run: dotnet restore - name: Build diff --git a/Directory.Build.props b/Directory.Build.props index b68d3a7a..d8c38bcb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@  2022.4.2 - net6.0 + net7.0 preview enable true diff --git a/global.json b/global.json index 1b8195c4..ef8756fe 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100", + "version": "7.0.*", "rollForward": "latestMinor" } } From 6e3c5bdd25a839da2052f10c8f201c94c00545a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 16:25:40 +0200 Subject: [PATCH 02/39] :arrow_up: Bump DSharpPlus (#420) Bumps [DSharpPlus](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01173 to 4.3.0-nightly-01175. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index aab9af91..ea6ccaf4 100644 --- a/Packages.props +++ b/Packages.props @@ -2,7 +2,7 @@ - + From a9828b1b9d7ebec6e0b25646dc90e346fa928ac4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 16:35:36 +0200 Subject: [PATCH 03/39] :arrow_up: Bump DSharpPlus.Interactivity (#419) Bumps [DSharpPlus.Interactivity](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01173 to 4.3.0-nightly-01175. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.Interactivity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index ea6ccaf4..6663f74e 100644 --- a/Packages.props +++ b/Packages.props @@ -3,7 +3,7 @@ - + From ae074a5cd889b6c5b19f59bde1c54b89d8bb00c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 16:46:56 +0200 Subject: [PATCH 04/39] :arrow_up: Bump DSharpPlus.SlashCommands (#421) Bumps [DSharpPlus.SlashCommands](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01173 to 4.3.0-nightly-01175. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.SlashCommands dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 6663f74e..48adf9c0 100644 --- a/Packages.props +++ b/Packages.props @@ -4,7 +4,7 @@ - + From 00f877bdfb0e783d2cad8690f6906c9e1adfd2b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:24:27 +0100 Subject: [PATCH 05/39] :arrow_up: Bump coverlet.collector from 3.1.2 to 3.2.0 (#426) Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 3.1.2 to 3.2.0. - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/commits/v3.2.0) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 48adf9c0..d53f42d6 100644 --- a/Packages.props +++ b/Packages.props @@ -19,7 +19,7 @@ - + From 14387898d38d342fa3197b6048509f579113c94d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:26:17 +0100 Subject: [PATCH 06/39] :arrow_up: Bump DSharpPlus (#427) Bumps [DSharpPlus](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01175 to 4.3.0-nightly-01180. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index d53f42d6..42ca6c3c 100644 --- a/Packages.props +++ b/Packages.props @@ -2,7 +2,7 @@ - + From 1a0c69f09cd1bd069529233b722de91b0de7bafc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:32:38 +0100 Subject: [PATCH 07/39] :arrow_up: Bump DSharpPlus.Interactivity (#425) Bumps [DSharpPlus.Interactivity](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01175 to 4.3.0-nightly-01180. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.Interactivity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 42ca6c3c..ae767dbe 100644 --- a/Packages.props +++ b/Packages.props @@ -3,7 +3,7 @@ - + From a242b42f42e26abd2dea685cd5c08e2a24cf18b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:34:43 +0100 Subject: [PATCH 08/39] :arrow_up: Bump DSharpPlus.SlashCommands (#424) Bumps [DSharpPlus.SlashCommands](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01175 to 4.3.0-nightly-01180. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.SlashCommands dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index ae767dbe..0597c43f 100644 --- a/Packages.props +++ b/Packages.props @@ -4,7 +4,7 @@ - + From 4432a26fd9bd0e2e5415041d2931be2f03128f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 14 Nov 2022 16:40:25 +0100 Subject: [PATCH 09/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20packages?= =?UTF-8?q?=20to=20.NET=207.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Packages.props | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Packages.props b/Packages.props index ad0f04e8..6cb942f1 100644 --- a/Packages.props +++ b/Packages.props @@ -2,27 +2,27 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + From 5cd4b181a11b4f0d865c7321fcc811c8e048229a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 14 Nov 2022 16:41:23 +0100 Subject: [PATCH 10/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20builder=20?= =?UTF-8?q?to=20.NET=207.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 5d320f7f..7a1f758c 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x - name: Install dependencies run: dotnet restore - name: Build From 78f30a94887c5c13695053cf667a30ba6f3e1441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 14 Nov 2022 16:45:37 +0100 Subject: [PATCH 11/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20projects?= =?UTF-8?q?=20version=20to=20.NET=207.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7fd0d05e..a3b646e6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@  2022.4.3 - net6.0 + net7.0 preview enable true From 22f0a1ad74c5d486b3582643ba05fca361e50775 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 17:08:52 +0100 Subject: [PATCH 12/39] :arrow_up: Bump DSharpPlus (#435) Bumps [DSharpPlus](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01180 to 4.3.0-nightly-01185. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 0597c43f..918fa730 100644 --- a/Packages.props +++ b/Packages.props @@ -2,7 +2,7 @@ - + From 475973280352af9c04d11715ffca1640bbbd2fc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 19:13:49 +0100 Subject: [PATCH 13/39] :arrow_up: Bump DSharpPlus.Interactivity (#434) Bumps [DSharpPlus.Interactivity](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01180 to 4.3.0-nightly-01185. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.Interactivity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 918fa730..2eeb2600 100644 --- a/Packages.props +++ b/Packages.props @@ -3,7 +3,7 @@ - + From 0b50efdfd142c41f26abc029a73aaffa35c7b73b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 12:48:07 +0100 Subject: [PATCH 14/39] :arrow_up: Bump DSharpPlus.SlashCommands (#433) Bumps [DSharpPlus.SlashCommands](https://github.com/DSharpPlus/DSharpPlus) from 4.3.0-nightly-01180 to 4.3.0-nightly-01185. - [Release notes](https://github.com/DSharpPlus/DSharpPlus/releases) - [Commits](https://github.com/DSharpPlus/DSharpPlus/commits) --- updated-dependencies: - dependency-name: DSharpPlus.SlashCommands dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages.props b/Packages.props index 2eeb2600..cd001b62 100644 --- a/Packages.props +++ b/Packages.props @@ -4,7 +4,7 @@ - + From 57224ab32e349bdab39eb4622f48ef1f4114d937 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 19 Nov 2022 19:46:57 +0100 Subject: [PATCH 15/39] roles: Automatically add student senator role --- src/HonzaBotner/appsettings.CvutFit.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HonzaBotner/appsettings.CvutFit.json b/src/HonzaBotner/appsettings.CvutFit.json index 3bf8f586..87553759 100644 --- a/src/HonzaBotner/appsettings.CvutFit.json +++ b/src/HonzaBotner/appsettings.CvutFit.json @@ -84,7 +84,9 @@ "B-18928-SUMA-ZAMESTNANEC": [781137920278528012], "B-18923-SUMA-ZAMESTNANEC": [831601707955388456], "B-18000-SUMA-ZAMESTNANEC": [681574603759681578], - "B-18000-SUMA-PARTNER": [681574603759681578] + "B-18000-SUMA-PARTNER": [681574603759681578], + "B-00000-AS-STUDENT-FIT": [988749617611046952], + "B-18000-AS-STUDENTSKA-SEKCE-CLEN": [988749617611046952] }, "HostRoleIds": [ 714950745635422271, From ca5152cd6fcd2af343c3e7bd9db0fb144c8eee34 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 19 Nov 2022 19:59:57 +0100 Subject: [PATCH 16/39] mentions: Mention new user on special role granted --- .../EventHandlers/Helpers/WelcomeMessageHandler.cs | 1 + .../{DiscordEmvedPublisher.cs => DiscordEmbedPublisher.cs} | 0 src/HonzaBotner/appsettings.CvutFit.json | 5 ----- 3 files changed, 1 insertion(+), 5 deletions(-) rename src/HonzaBotner.Discord.Services/Publisher/{DiscordEmvedPublisher.cs => DiscordEmbedPublisher.cs} (100%) diff --git a/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs b/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs index e7228f19..b4b42c24 100644 --- a/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs +++ b/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs @@ -40,6 +40,7 @@ await channel.SendMessageAsync( new DiscordMessageBuilder() .WithContent(message) .WithFile(new FileStream(filePath, FileMode.Open, FileAccess.Read)) + .WithAllowedMention(new UserMention(eventArgs.Member)) ); } catch (Exception e) diff --git a/src/HonzaBotner.Discord.Services/Publisher/DiscordEmvedPublisher.cs b/src/HonzaBotner.Discord.Services/Publisher/DiscordEmbedPublisher.cs similarity index 100% rename from src/HonzaBotner.Discord.Services/Publisher/DiscordEmvedPublisher.cs rename to src/HonzaBotner.Discord.Services/Publisher/DiscordEmbedPublisher.cs diff --git a/src/HonzaBotner/appsettings.CvutFit.json b/src/HonzaBotner/appsettings.CvutFit.json index 87553759..558eb5ee 100644 --- a/src/HonzaBotner/appsettings.CvutFit.json +++ b/src/HonzaBotner/appsettings.CvutFit.json @@ -112,10 +112,5 @@ "809934141650763816": 921369876176724000, "809934144380862535": 921370314007535616 } - }, - "RolesOptions": { - "Stepech": 238728915647070209, - "Seznamka": 763513679224242197, - "RequiredVotes": 3 } } From 68536b41b2c6bcd7128f75de3b77681d47fc01bd Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 19 Nov 2022 20:45:12 +0100 Subject: [PATCH 17/39] warns: Fix warns referring to "deleted" message --- .../Commands/ModerationCommands.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/HonzaBotner.Discord.Services/Commands/ModerationCommands.cs b/src/HonzaBotner.Discord.Services/Commands/ModerationCommands.cs index 1399eaf4..fa4eb7d3 100644 --- a/src/HonzaBotner.Discord.Services/Commands/ModerationCommands.cs +++ b/src/HonzaBotner.Discord.Services/Commands/ModerationCommands.cs @@ -92,12 +92,11 @@ await modalReason.Result.Interaction.CreateResponseAsync( if (!buttonResponse.TimedOut) { - await modalReason.Result.Interaction.EditOriginalResponseAsync(new DiscordWebhookBuilder().WithContent("Announced")); - await buttonResponse.Result.Interaction.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, - new DiscordInteractionResponseBuilder() + await buttonResponse.Result.Interaction.CreateResponseAsync(InteractionResponseType.UpdateMessage, + new DiscordInteractionResponseBuilder().WithContent("Announced")); + await buttonResponse.Result.Channel.SendMessageAsync(new DiscordMessageBuilder() .WithContent($"{ctx.TargetMember.Mention}" + $" was warned for \"{modalReason.Result.Values[reasonId]}\"") - .AddMention(new UserMention(ctx.TargetMember.Id)) - .AsEphemeral(false)); + .WithAllowedMention(new UserMention(ctx.TargetMember.Id))); } } From ff3075e4994a83fb964d5f967ccb02702f9e331f Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Mon, 21 Nov 2022 16:40:00 +0100 Subject: [PATCH 18/39] dependencies: Update DSharpPlus --- Packages.props | 6 +++--- .../EventHandlers/Helpers/WelcomeMessageHandler.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages.props b/Packages.props index cd001b62..ac6b7c0a 100644 --- a/Packages.props +++ b/Packages.props @@ -2,9 +2,9 @@ - - - + + + diff --git a/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs b/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs index b4b42c24..7755cdec 100644 --- a/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs +++ b/src/HonzaBotner.Discord.Services/EventHandlers/Helpers/WelcomeMessageHandler.cs @@ -39,7 +39,7 @@ public async Task HandleAddedRole( await channel.SendMessageAsync( new DiscordMessageBuilder() .WithContent(message) - .WithFile(new FileStream(filePath, FileMode.Open, FileAccess.Read)) + .AddFile(new FileStream(filePath, FileMode.Open, FileAccess.Read)) .WithAllowedMention(new UserMention(eventArgs.Member)) ); } From eaa749a30b1b7f3a9e0e2fd4e1f8cd33a903030d Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 22 Nov 2022 00:54:58 +0100 Subject: [PATCH 19/39] standup: Allow people to choose if they want to be pinged --- .../EventHandlers/StandupButtonHandler.cs | 71 +++++++++++++++++++ .../Jobs/StandUpJobProvider.cs | 18 +++-- .../Options/ButtonOptions.cs | 1 + src/HonzaBotner/Startup.cs | 1 + src/HonzaBotner/appsettings.BotDev.json | 3 +- src/HonzaBotner/appsettings.CvutFit.json | 3 +- src/HonzaBotner/appsettings.Development.json | 1 + 7 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs diff --git a/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs b/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs new file mode 100644 index 00000000..017327f9 --- /dev/null +++ b/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs @@ -0,0 +1,71 @@ +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DSharpPlus; +using DSharpPlus.Entities; +using DSharpPlus.EventArgs; +using DSharpPlus.Exceptions; +using HonzaBotner.Discord.EventHandler; +using HonzaBotner.Discord.Services.Options; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace HonzaBotner.Discord.Services.EventHandlers; + +public class StandupButtonHandler : IEventHandler +{ + + private readonly ButtonOptions _buttonOptions; + private readonly CommonCommandOptions _commandOptions; + + private readonly ILogger _logger; + + public StandupButtonHandler( + IOptions buttonOptions, + IOptions commandOptions, + ILogger logger) + { + _buttonOptions = buttonOptions.Value; + _commandOptions = commandOptions.Value; + _logger = logger; + } + + + public async Task Handle(ComponentInteractionCreateEventArgs args) + { + if (args.Id != _buttonOptions.StandupSwitchPingId) + { + return EventHandlerResult.Continue; + } + + DiscordMember target = await args.Guild.GetMemberAsync(args.User.Id); + DiscordRole standupPingRole = args.Guild.GetRole(_commandOptions.StandUpRoleId); + StringBuilder response = new (); + + try + { + if (target.Roles.Contains(standupPingRole)) + { + await target.RevokeRoleAsync(standupPingRole, "Doesn't want to be pinged anymore"); + response.Append("Successfully removed ping role"); + } + else + { + await target.GrantRoleAsync(standupPingRole, "Wants to be pinged"); + response.Append("Successfully added ping role"); + } + } + catch (DiscordException e) + { + _logger.LogWarning(e, "Failed while managing standup roles."); + response.Append("Error occured, please contact moderators"); + } + + await args.Interaction.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, + new DiscordInteractionResponseBuilder().WithContent(response.ToString()).AsEphemeral()); + + return EventHandlerResult.Stop; + } + + +} diff --git a/src/HonzaBotner.Discord.Services/Jobs/StandUpJobProvider.cs b/src/HonzaBotner.Discord.Services/Jobs/StandUpJobProvider.cs index 6a6d494d..dfb48a1c 100644 --- a/src/HonzaBotner.Discord.Services/Jobs/StandUpJobProvider.cs +++ b/src/HonzaBotner.Discord.Services/Jobs/StandUpJobProvider.cs @@ -4,6 +4,7 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using DSharpPlus; using DSharpPlus.Entities; using HonzaBotner.Discord.Services.Helpers; using HonzaBotner.Discord.Services.Options; @@ -20,16 +21,18 @@ public class StandUpJobProvider : IJob private readonly DiscordWrapper _discord; + private readonly ButtonOptions _buttonOptions; private readonly CommonCommandOptions _commonOptions; public StandUpJobProvider( ILogger logger, DiscordWrapper discord, - IOptions commonOptions - ) + IOptions commonOptions, + IOptions buttonOptions) { _logger = logger; _discord = discord; + _buttonOptions = buttonOptions.Value; _commonOptions = commonOptions.Value; } @@ -97,17 +100,22 @@ await channel.GetMessagesBeforeAsync(messageList.Last().Id) } } + DiscordRole standupPingRole = channel.Guild.GetRole(_commonOptions.StandUpRoleId); + var content = new DiscordMessageBuilder() .WithContent($@" -Stand-up time, <@&{_commonOptions.StandUpRoleId}>! +Stand-up time @here! Results from : ``` all: {ok.Add(fail)} completed: {ok} failed: {fail} -```"); - +``` +||{standupPingRole.Mention}||") + .AddComponents(new DiscordButtonComponent(ButtonStyle.Primary, _buttonOptions.StandupSwitchPingId, + "Switch ping", emoji:new DiscordComponentEmoji("🔔"))) + .WithAllowedMention(new RoleMention(standupPingRole)); await channel.SendMessageAsync(content); } catch (Exception e) diff --git a/src/HonzaBotner.Discord.Services/Options/ButtonOptions.cs b/src/HonzaBotner.Discord.Services/Options/ButtonOptions.cs index 4980f914..db0b555e 100644 --- a/src/HonzaBotner.Discord.Services/Options/ButtonOptions.cs +++ b/src/HonzaBotner.Discord.Services/Options/ButtonOptions.cs @@ -7,5 +7,6 @@ public class ButtonOptions public string? VerificationId { get; set; } public string? StaffVerificationId { get; set; } public string? StaffRemoveRoleId { get; set; } + public string? StandupSwitchPingId { get; set; } public ulong[]? CzechChannelsIds { get; set; } } diff --git a/src/HonzaBotner/Startup.cs b/src/HonzaBotner/Startup.cs index 8dac05b0..4ed55872 100644 --- a/src/HonzaBotner/Startup.cs +++ b/src/HonzaBotner/Startup.cs @@ -69,6 +69,7 @@ public void ConfigureServices(IServiceCollection services) .AddEventHandler() .AddEventHandler() .AddEventHandler() + .AddEventHandler() ; }, commands => { diff --git a/src/HonzaBotner/appsettings.BotDev.json b/src/HonzaBotner/appsettings.BotDev.json index 2fd9df19..c3668448 100644 --- a/src/HonzaBotner/appsettings.BotDev.json +++ b/src/HonzaBotner/appsettings.BotDev.json @@ -58,7 +58,8 @@ "ButtonOptions": { "VerificationId": "verification-user", "StaffVerificationId": "verification-staff", - "StaffRemoveRoleId": "verification-remove-staff" + "StaffRemoveRoleId": "verification-remove-staff", + "StandupSwitchPingId": "standup-ping-role-switch" }, "BadgeRoleOptions": { "TriggerRoles": [ diff --git a/src/HonzaBotner/appsettings.CvutFit.json b/src/HonzaBotner/appsettings.CvutFit.json index 558eb5ee..d3378490 100644 --- a/src/HonzaBotner/appsettings.CvutFit.json +++ b/src/HonzaBotner/appsettings.CvutFit.json @@ -28,7 +28,7 @@ 691998530151120936, 774247506669600798 ], - "StandUpRoleId": 972019490818768927, + "StandUpRoleId": 1044398883414999061, "StandUpChannelId": 972019138446897162 }, "CustomVoiceOptions": { @@ -97,6 +97,7 @@ "VerificationId": "verification-user", "StaffVerificationId": "verification-staff", "StaffRemoveRoleId": "verification-remove-staff", + "StandupSwitchPingId": "standup-ping-role-switch", "CzechChannelsIds": [507515506073403402] }, "BadgeRoleOptions": { diff --git a/src/HonzaBotner/appsettings.Development.json b/src/HonzaBotner/appsettings.Development.json index 00df2317..bf81f81a 100644 --- a/src/HonzaBotner/appsettings.Development.json +++ b/src/HonzaBotner/appsettings.Development.json @@ -65,6 +65,7 @@ "VerificationId": "verification-user", "StaffVerificationId": "verification-staff", "StaffRemoveRoleId": "verification-remove-staff", + "StandupSwitchPingId": "standup-ping-role-switch", "CzechChannelsIds": [750108543125946448] }, "BadgeRoleOptions": { From 1b4433d9f5336599cdb4370cc39890472946abd8 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 22 Nov 2022 01:01:09 +0100 Subject: [PATCH 20/39] standup: prettify ping switch responses --- .../EventHandlers/StandupButtonHandler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs b/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs index 017327f9..9f4f86b2 100644 --- a/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs +++ b/src/HonzaBotner.Discord.Services/EventHandlers/StandupButtonHandler.cs @@ -47,18 +47,18 @@ public async Task Handle(ComponentInteractionCreateEventArgs if (target.Roles.Contains(standupPingRole)) { await target.RevokeRoleAsync(standupPingRole, "Doesn't want to be pinged anymore"); - response.Append("Successfully removed ping role"); + response.Append("🚫 Successfully removed ping role"); } else { await target.GrantRoleAsync(standupPingRole, "Wants to be pinged"); - response.Append("Successfully added ping role"); + response.Append("✅ Successfully added ping role"); } } catch (DiscordException e) { _logger.LogWarning(e, "Failed while managing standup roles."); - response.Append("Error occured, please contact moderators"); + response.Append("🤖 Error occured, please contact moderators"); } await args.Interaction.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, From 9dd9d58d31729ddbeb65d1a02a058b3785a2e6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 5 Dec 2022 08:50:28 +0100 Subject: [PATCH 21/39] Update global.json Co-authored-by: stepech <29132060+stepech@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index ef8756fe..1bf76a58 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.*", + "version": "7.0.100", "rollForward": "latestMinor" } } From ca48ea26918954369ba3cce957a3e52f0266a79d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 08:01:34 +0000 Subject: [PATCH 22/39] chore(deps): add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..f9c2c327 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} From a234102c045d7816bec9d99d6b43097017e05eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Thu, 8 Dec 2022 14:25:35 +0100 Subject: [PATCH 23/39] =?UTF-8?q?=F0=9F=94=A7=20Group=20renovate=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HonzaBotner.sln | 1 + renovate.json | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/HonzaBotner.sln b/HonzaBotner.sln index 767eed66..ad7949fb 100644 --- a/HonzaBotner.sln +++ b/HonzaBotner.sln @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props CONTRIBUTING.md = CONTRIBUTING.md Packages.props = Packages.props + renovate.json = renovate.json EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HonzaBotner", "src\HonzaBotner\HonzaBotner.csproj", "{04BEA8DF-6FDB-465A-BF6C-D28BADBD572F}" diff --git a/renovate.json b/renovate.json index f9c2c327..ebcbaef7 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,12 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:base" + ], + "packageRules": [ + { + "matchUpdateTypes": ["patch", "minor"], + "groupName": "minor + patch dependencies" + } + ] } From 2044941f9d48da2a70802aba5c68db66e9057b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Thu, 8 Dec 2022 14:28:15 +0100 Subject: [PATCH 24/39] =?UTF-8?q?=F0=9F=91=B7=20Use=20gitmoji=20in=20Renov?= =?UTF-8?q?ate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index ebcbaef7..1a6c0307 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,8 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base" + "config:base", + "gitmoji" ], "packageRules": [ { From 4cdddcd9ecafb0a42501313823091d3d89c63e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Thu, 8 Dec 2022 16:22:45 +0100 Subject: [PATCH 25/39] =?UTF-8?q?=F0=9F=94=A5=20Remove=20Dependabot=20conf?= =?UTF-8?q?ig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index d8abc6b1..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "nuget" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - commit-message: - prefix: "⬆️" - target-branch: "develop" From 47077419d12b542d2f5ad3bc78dda0de8370f807 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:54:18 +0100 Subject: [PATCH 26/39] renovate: move config and add labels for PRs --- renovate.json => .github/renovate.json | 1 + HonzaBotner.sln | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) rename renovate.json => .github/renovate.json (90%) diff --git a/renovate.json b/.github/renovate.json similarity index 90% rename from renovate.json rename to .github/renovate.json index 1a6c0307..2553d2a3 100644 --- a/renovate.json +++ b/.github/renovate.json @@ -4,6 +4,7 @@ "config:base", "gitmoji" ], + "labels": ["dependencies"], "packageRules": [ { "matchUpdateTypes": ["patch", "minor"], diff --git a/HonzaBotner.sln b/HonzaBotner.sln index ad7949fb..767eed66 100644 --- a/HonzaBotner.sln +++ b/HonzaBotner.sln @@ -10,7 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props CONTRIBUTING.md = CONTRIBUTING.md Packages.props = Packages.props - renovate.json = renovate.json EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HonzaBotner", "src\HonzaBotner\HonzaBotner.csproj", "{04BEA8DF-6FDB-465A-BF6C-D28BADBD572F}" From cd47a124012eb04f9cc052793de6c36899e75552 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 10 Dec 2022 18:14:38 +0100 Subject: [PATCH 27/39] renovate: remove rate limit and set updates to weekly --- .github/renovate.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 2553d2a3..e48a6285 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -2,7 +2,9 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:base", - "gitmoji" + "gitmoji", + "schedule:earlyMondays", + ":disableRateLimiting" ], "labels": ["dependencies"], "packageRules": [ From 9ee114e8c1e55c7c36385ea8c1ae0a63eb511c1a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:36:02 +0000 Subject: [PATCH 28/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20minor=20+?= =?UTF-8?q?=20patch=20dependencies=20to=20v4.3.0-nightly-01193?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages.props b/Packages.props index 6a7ba756..200788d3 100644 --- a/Packages.props +++ b/Packages.props @@ -2,9 +2,9 @@ - - - + + + From 9417127c6c8903ac772c9802113bd3600caadfb4 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:49:06 +0100 Subject: [PATCH 29/39] Dependency management: Switch to CPM Central Package Management --- Directory.Build.props | 4 ---- Directory.Packages.props | 31 +++++++++++++++++++++++++++++++ HonzaBotner.sln | 2 +- Packages.props | 28 ---------------------------- 4 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 Directory.Packages.props delete mode 100644 Packages.props diff --git a/Directory.Build.props b/Directory.Build.props index a3b646e6..050fe7ab 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,8 +6,4 @@ enable true - - - $(MSBuildThisFileDirectory)Packages.props - diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..9cec753a --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,31 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HonzaBotner.sln b/HonzaBotner.sln index 767eed66..cd638cd7 100644 --- a/HonzaBotner.sln +++ b/HonzaBotner.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject Directory.Build.props = Directory.Build.props CONTRIBUTING.md = CONTRIBUTING.md - Packages.props = Packages.props + Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HonzaBotner", "src\HonzaBotner\HonzaBotner.csproj", "{04BEA8DF-6FDB-465A-BF6C-D28BADBD572F}" diff --git a/Packages.props b/Packages.props deleted file mode 100644 index 200788d3..00000000 --- a/Packages.props +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 9d4452179b987a4b844b145dbe99be80d4675eca Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Sat, 10 Dec 2022 21:16:36 +0100 Subject: [PATCH 30/39] reminders: Allow moderators to cancel reminders --- .../EventHandlers/ReminderReactionsHandler.cs | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/HonzaBotner.Discord.Services/EventHandlers/ReminderReactionsHandler.cs b/src/HonzaBotner.Discord.Services/EventHandlers/ReminderReactionsHandler.cs index 4f8e0927..614b52f4 100644 --- a/src/HonzaBotner.Discord.Services/EventHandlers/ReminderReactionsHandler.cs +++ b/src/HonzaBotner.Discord.Services/EventHandlers/ReminderReactionsHandler.cs @@ -8,11 +8,13 @@ using HonzaBotner.Services.Contract; using HonzaBotner.Services.Contract.Dto; using Microsoft.Extensions.Options; +using DiscordRole = DSharpPlus.Entities.DiscordRole; namespace HonzaBotner.Discord.Services.EventHandlers; public class ReminderReactionsHandler : IEventHandler { + private readonly CommonCommandOptions _options; private readonly ReminderOptions _reminderOptions; private readonly IRemindersService _service; @@ -20,11 +22,13 @@ public class ReminderReactionsHandler : IEventHandler commonOptions, IOptions options, IRemindersService service, IReminderManager reminderManager ) { + _options = commonOptions.Value; _reminderOptions = options.Value; _service = service; _reminderManager = reminderManager; @@ -51,13 +55,24 @@ public async Task Handle(MessageReactionAddEventArgs argumen } // The owner has canceled the reminder - if (emoji == _reminderOptions.CancelEmojiName && arguments.User.Id == reminder.OwnerId) + if (emoji == _reminderOptions.CancelEmojiName) { - await _service.DeleteReminderAsync(reminder.Id); - await arguments.Message.ModifyAsync("", - await _reminderManager.CreateCanceledReminderEmbedAsync(reminder)); + bool isMod = false; + if (arguments.Guild is not null) + { + DiscordRole moderatorRole = arguments.Guild.GetRole(_options.ModRoleId); + DiscordMember discordMember = await arguments.Guild.GetMemberAsync(arguments.User.Id); + isMod = discordMember.Roles.Contains(moderatorRole); + } - return EventHandlerResult.Stop; + if (reminder.OwnerId == arguments.User.Id || isMod) + { + await _service.DeleteReminderAsync(reminder.Id); + await arguments.Message.ModifyAsync("", + await _reminderManager.CreateCanceledReminderEmbedAsync(reminder)); + + return EventHandlerResult.Stop; + } } // Somebody else wants to be mentioned within the reminder notification From 5a9e4c865a954bc8345fec31f0e12eae4c3f5e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 12 Dec 2022 13:47:21 +0100 Subject: [PATCH 31/39] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20Remove=20unused=20Do?= =?UTF-8?q?ckerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HonzaBotner/Dockerfile | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/HonzaBotner/Dockerfile diff --git a/src/HonzaBotner/Dockerfile b/src/HonzaBotner/Dockerfile deleted file mode 100644 index df850641..00000000 --- a/src/HonzaBotner/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - -FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - -FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build -WORKDIR /src -COPY ["src/HonzaBotner/HonzaBotner.csproj", "src/HonzaBotner/"] -RUN dotnet restore "src/HonzaBotner/HonzaBotner.csproj" -COPY . . -WORKDIR "/src/src/HonzaBotner" -RUN dotnet build "HonzaBotner.csproj" -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish "HonzaBotner.csproj" -c Release -o /app/publish - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "HonzaBotner.dll"] From 89b81af741ebc7c63445e07daac77c5670485176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 12 Dec 2022 13:52:31 +0100 Subject: [PATCH 32/39] =?UTF-8?q?=E2=9C=A8=20Group=20github=20actions=20up?= =?UTF-8?q?dates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/renovate.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index e48a6285..73d17532 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -11,7 +11,12 @@ { "matchUpdateTypes": ["patch", "minor"], "groupName": "minor + patch dependencies" + }, + { + "groupName": "Github Actions", + "matchDatasources": [ + "github-actions" + ] } - ] } From 27d6c70cbedbe5e42ccf68b7eb2869bd174f0f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= Date: Mon, 12 Dec 2022 14:09:13 +0100 Subject: [PATCH 33/39] =?UTF-8?q?=F0=9F=92=9A=20Fix=20Renovate=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 73d17532..014d64c6 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -14,7 +14,7 @@ }, { "groupName": "Github Actions", - "matchDatasources": [ + "matchManagers": [ "github-actions" ] } From 78862e2f489d54902dd33e376e097ae3f5708b7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:10:56 +0000 Subject: [PATCH 34/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20Github=20A?= =?UTF-8?q?ctions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codeql-analysis.yml | 8 ++++---- .github/workflows/dotnet-core.yml | 4 ++-- .github/workflows/releases.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5aecc151..85ac20e9 100755 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -22,11 +22,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -37,7 +37,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -51,4 +51,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index c4389927..04186d48 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - name: Install dependencies diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 7a1f758c..b0860711 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - name: Install dependencies From 94da5bb2e5e83f8ff7f43e5e39b370e337ec7e29 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 01:01:10 +0000 Subject: [PATCH 35/39] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20minor=20+?= =?UTF-8?q?=20patch=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Packages.props | 16 ++++++++-------- global.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9cec753a..f59950f1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,12 +5,12 @@ - - - - - - + + + + + + @@ -18,8 +18,8 @@ - - + + diff --git a/global.json b/global.json index 1bf76a58..6dd433a9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "7.0.101", "rollForward": "latestMinor" } } From 3f2908d71c47bb78506384b18c9897af745b33ed Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 20 Dec 2022 20:51:34 +0100 Subject: [PATCH 36/39] MemberCounter: Fix (hopefully) member counting --- src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs b/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs index 37edd206..115c36d0 100644 --- a/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs +++ b/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs @@ -174,11 +174,11 @@ public MemberCommandsCount(IOptions commonCommandOptions) public async Task CountAllCommandAsync(InteractionContext ctx, [Option("ephemeral", "Hide response? Default false")] bool ephemeral = false) { - DiscordGuild guild = ctx.Guild; + DiscordGuild guild = await ctx.Client.GetGuildAsync(ctx.Guild.Id, true); DiscordRole authenticatedRole = guild.GetRole(_commonCommandOptions.AuthenticatedRoleId); int authenticatedCount = guild.Members.Count(member => member.Value.Roles.Contains(authenticatedRole)); - await ctx.CreateResponseAsync($"Authenticated: {authenticatedCount}, All: {ctx.Guild.Members.Count.ToString()}", ephemeral); + await ctx.CreateResponseAsync($"Authenticated: {authenticatedCount}, All: {guild.MemberCount}", ephemeral); } [SlashCommand("here", "Counts all members who can see this channel")] From 12dd597178201324ee5ed4fc503e21d1ad43fd89 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 20 Dec 2022 21:15:00 +0100 Subject: [PATCH 37/39] MemberCommands: Separate privileged and safe commands --- .../Commands/MemberCommands.cs | 235 +++++++++--------- src/HonzaBotner/appsettings.Development.json | 24 +- 2 files changed, 135 insertions(+), 124 deletions(-) diff --git a/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs b/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs index 115c36d0..1b31d548 100644 --- a/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs +++ b/src/HonzaBotner.Discord.Services/Commands/MemberCommands.cs @@ -14,152 +14,163 @@ namespace HonzaBotner.Discord.Services.Commands; -[SlashCommandGroup("member", "member commands")] -[SlashCommandPermissions(Permissions.ModerateMembers)] -[SlashModuleLifespan(SlashModuleLifespan.Scoped)] + public class MemberCommands : ApplicationCommandModule { - [SlashCommandGroup("info", "Provides info about a member.")] + [SlashCommandGroup("member", "member commands")] + [SlashCommandPermissions(Permissions.ModerateMembers)] [SlashModuleLifespan(SlashModuleLifespan.Scoped)] - public class MemberCommandsInfo : ApplicationCommandModule + public class PrivilegedMemberCommands : ApplicationCommandModule { - private readonly HonzaBotnerDbContext _dbContext; - private readonly IHashService _hashService; - private readonly ILogger _logger; - - public MemberCommandsInfo( - HonzaBotnerDbContext dbContext, - IHashService hashService, - ILogger logger) - { - _dbContext = dbContext; - _hashService = hashService; - _logger = logger; - } - - [SlashCommand("discord", "Provides info about a member by Discord account.")] - public async Task DiscordMemberInfoCommandAsync( - InteractionContext ctx, - [Option("member","Who is the target?")] DiscordUser user) + [SlashCommandGroup("info", "Provides info about a member.")] + [SlashModuleLifespan(SlashModuleLifespan.Scoped)] + public class MemberCommandsInfo : ApplicationCommandModule { - Verification? databaseRecord = await _dbContext.Verifications - .FirstOrDefaultAsync(v => v.UserId == user.Id); - await AnnounceMemberInfoAsync(ctx, databaseRecord); - } - [SlashCommand("ctu", "Provides info about a member by CTU username.")] - public async Task CtuMemberInfoCommandAsync( - InteractionContext ctx, - [Option("username", "Who is the target?")] string cvutUsername) - { - string authId = _hashService.Hash(cvutUsername); - Verification? databaseRecord = await _dbContext.Verifications - .FirstOrDefaultAsync(v => v.AuthId == authId); - await AnnounceMemberInfoAsync(ctx, databaseRecord); - } + private readonly HonzaBotnerDbContext _dbContext; + private readonly IHashService _hashService; + private readonly ILogger _logger; - private async Task AnnounceMemberInfoAsync(InteractionContext ctx, Verification? databaseRecord) - { - if (databaseRecord is null) + public MemberCommandsInfo( + HonzaBotnerDbContext dbContext, + IHashService hashService, + ILogger logger) { - await ctx.CreateResponseAsync("No member record for provided name", true); - return; + _dbContext = dbContext; + _hashService = hashService; + _logger = logger; } - try + [SlashCommand("discord", "Provides info about a member by Discord account.")] + public async Task DiscordMemberInfoCommandAsync( + InteractionContext ctx, + [Option("member", "Who is the target?")] + DiscordUser user) { - DiscordMember member = await ctx.Guild.GetMemberAsync(databaseRecord.UserId); - await member.SendMessageAsync($"Member {ctx.Member.DisplayName} requested information about your account on the FIT CTU Discord server."); + Verification? databaseRecord = await _dbContext.Verifications + .FirstOrDefaultAsync(v => v.UserId == user.Id); + await AnnounceMemberInfoAsync(ctx, databaseRecord); } - catch (Exception e) + + [SlashCommand("ctu", "Provides info about a member by CTU username.")] + public async Task CtuMemberInfoCommandAsync( + InteractionContext ctx, + [Option("username", "Who is the target?")] + string cvutUsername) { - _logger.LogWarning(e, "Couldn't get member {MemberId} or he doesn't accept DMs", - databaseRecord.UserId); + string authId = _hashService.Hash(cvutUsername); + Verification? databaseRecord = await _dbContext.Verifications + .FirstOrDefaultAsync(v => v.AuthId == authId); + await AnnounceMemberInfoAsync(ctx, databaseRecord); } - await ctx.CreateResponseAsync(databaseRecord.ToString()); - } - } - - [SlashCommandGroup("delete", "Erases database record of the member.")] - [SlashModuleLifespan(SlashModuleLifespan.Scoped)] - public class MemberCommandsDelete : ApplicationCommandModule - { - private readonly HonzaBotnerDbContext _dbContext; - private readonly IHashService _hashService; - private readonly ILogger _logger; - private readonly IGuildProvider _guildProvider; - - public MemberCommandsDelete( - HonzaBotnerDbContext dbContext, - IHashService hashService, - ILogger logger, - IGuildProvider guildProvider) - { - _dbContext = dbContext; - _hashService = hashService; - _logger = logger; - _guildProvider = guildProvider; - } + private async Task AnnounceMemberInfoAsync(InteractionContext ctx, Verification? databaseRecord) + { + if (databaseRecord is null) + { + await ctx.CreateResponseAsync("No member record for provided name", true); + return; + } - [SlashCommand("discord", "Erases database record of the member by Discord account.")] - public async Task DiscordMemberEraseCommandAsync( - InteractionContext ctx, - [Option("member", "Who is the target?")] DiscordUser user) - { - Verification? databaseRecord = await _dbContext.Verifications - .FirstOrDefaultAsync(v => v.UserId == user.Id); - await EraseMemberAsync(ctx, databaseRecord); - } + try + { + DiscordMember member = await ctx.Guild.GetMemberAsync(databaseRecord.UserId); + await member.SendMessageAsync( + $"Member {ctx.Member.DisplayName} requested information about your account on the FIT CTU Discord server."); + } + catch (Exception e) + { + _logger.LogWarning(e, "Couldn't get member {MemberId} or he doesn't accept DMs", + databaseRecord.UserId); + } - [SlashCommand("ctu", "Erases database record of the member by CTU username.")] - public async Task CtuMemberEraseCommandAsync( - InteractionContext ctx, - [Option("username", "Who is the target?")] string cvutUsername) - { - string authId = _hashService.Hash(cvutUsername); - Verification? databaseRecord = await _dbContext.Verifications - .FirstOrDefaultAsync(v => v.AuthId == authId); - await EraseMemberAsync(ctx, databaseRecord); + await ctx.CreateResponseAsync(databaseRecord.ToString()); + } } - private async Task EraseMemberAsync(InteractionContext ctx, Verification? databaseRecord) + [SlashCommandGroup("delete", "Erases database record of the member.")] + [SlashModuleLifespan(SlashModuleLifespan.Scoped)] + [SlashCommandPermissions(Permissions.ModerateMembers)] + public class MemberCommandsDelete : ApplicationCommandModule { - if (databaseRecord == null) + private readonly HonzaBotnerDbContext _dbContext; + private readonly IHashService _hashService; + private readonly ILogger _logger; + private readonly IGuildProvider _guildProvider; + + public MemberCommandsDelete( + HonzaBotnerDbContext dbContext, + IHashService hashService, + ILogger logger, + IGuildProvider guildProvider) { - await ctx.CreateResponseAsync("No member record to erase."); - return; + _dbContext = dbContext; + _hashService = hashService; + _logger = logger; + _guildProvider = guildProvider; } - await ctx.DeferAsync(); - - try + [SlashCommand("discord", "Erases database record of the member by Discord account.")] + public async Task DiscordMemberEraseCommandAsync( + InteractionContext ctx, + [Option("member", "Who is the target?")] + DiscordUser user) { - _dbContext.Verifications.Remove(databaseRecord); - await _dbContext.SaveChangesAsync(); - DiscordGuild guild = await _guildProvider.GetCurrentGuildAsync(); - DiscordMember member = await guild.GetMemberAsync(databaseRecord.UserId); - await member.RemoveAsync("User purged from database."); - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Member has been erased.")); + Verification? databaseRecord = await _dbContext.Verifications + .FirstOrDefaultAsync(v => v.UserId == user.Id); + await EraseMemberAsync(ctx, databaseRecord); } - catch (UnauthorizedException e) + + [SlashCommand("ctu", "Erases database record of the member by CTU username.")] + public async Task CtuMemberEraseCommandAsync( + InteractionContext ctx, + [Option("username", "Who is the target?")] + string cvutUsername) { - _logger.LogWarning(e, "Erasing of member failed due to lack of permissions"); - await ctx.EditResponseAsync(new DiscordWebhookBuilder() - .WithContent("User was purged but not kicked due to insufficient permissions\n" + - "Please remove verified role manually to prevent unexpected behaviour.")); + string authId = _hashService.Hash(cvutUsername); + Verification? databaseRecord = await _dbContext.Verifications + .FirstOrDefaultAsync(v => v.AuthId == authId); + await EraseMemberAsync(ctx, databaseRecord); } - catch (Exception e) + + private async Task EraseMemberAsync(InteractionContext ctx, Verification? databaseRecord) { - await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Member erase failed.")); - _logger.LogWarning(e, "Member erase failed"); + if (databaseRecord == null) + { + await ctx.CreateResponseAsync("No member record to erase."); + return; + } + + await ctx.DeferAsync(); + + try + { + _dbContext.Verifications.Remove(databaseRecord); + await _dbContext.SaveChangesAsync(); + DiscordGuild guild = await _guildProvider.GetCurrentGuildAsync(); + DiscordMember member = await guild.GetMemberAsync(databaseRecord.UserId); + await member.RemoveAsync("User purged from database."); + await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Member has been erased.")); + } + catch (UnauthorizedException e) + { + _logger.LogWarning(e, "Erasing of member failed due to lack of permissions"); + await ctx.EditResponseAsync(new DiscordWebhookBuilder() + .WithContent("User was purged but not kicked due to insufficient permissions\n" + + "Please remove verified role manually to prevent unexpected behaviour.")); + } + catch (Exception e) + { + await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Member erase failed.")); + _logger.LogWarning(e, "Member erase failed"); + } } } } - [SlashCommandGroup("count", "Counts members by provided roles.")] + [SlashCommandGroup("member-count", "Counts members by provided roles.")] [SlashModuleLifespan(SlashModuleLifespan.Scoped)] public class MemberCommandsCount : ApplicationCommandModule { diff --git a/src/HonzaBotner/appsettings.Development.json b/src/HonzaBotner/appsettings.Development.json index bf81f81a..3465e49b 100644 --- a/src/HonzaBotner/appsettings.Development.json +++ b/src/HonzaBotner/appsettings.Development.json @@ -8,28 +8,28 @@ } }, "Discord": { - "GuildId": 887815108720467998, - "LogChannelId": 968247366849282062 + "GuildId": 1043604803302981702, + "LogChannelId": 1043604805186240532 }, "CVUT": { "AppBaseUrl": "https://localhost:5001" }, "CommonCommandOptions": { - "ModRoleId": 887978558759264296, - "BotRoleId": 887978852930953246, - "AuthenticatedRoleId": 887977978712174622, + "ModRoleId": 1043604803625943088, + "BotRoleId": 1043604803613376566, + "AuthenticatedRoleId": 1043604803604983844, "HugEmoteName": "", - "BoosterRoleId": 820565262095876158, - "GentlemenChannelId": 820299208120336415, + "BoosterRoleId": 0, + "GentlemenChannelId": 0, "GentlemenFilePath": "Static/gentleman.gif", - "HornyJailRoleId": 760050336366329856, - "HornyJailChannelId": 819986928928686080, + "HornyJailRoleId": 1043604803584016549, + "HornyJailChannelId": 1043604815701360714, "HornyJailFilePath": "Static/hornyjail.mp4", - "StandUpRoleId": 972123386094440498, - "StandUpChannelId": 750108543125946448 + "StandUpRoleId": 1044387139154100355, + "StandUpChannelId": 1043604815701360713 }, "CustomVoiceOptions": { - "ClickChannelId": 887815109165076500, + "ClickChannelId": 1043604816154341398, "RemoveAfterCommandInSeconds": 30 }, "PinOptions": { From 1bb96887304dba99526f22a1ab32f764e04faff5 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 20 Dec 2022 21:26:04 +0100 Subject: [PATCH 38/39] Verification: Add back command to setup buttons --- .../Commands/BotCommands.cs | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/src/HonzaBotner.Discord.Services/Commands/BotCommands.cs b/src/HonzaBotner.Discord.Services/Commands/BotCommands.cs index 5f493c9b..a69d5f38 100644 --- a/src/HonzaBotner.Discord.Services/Commands/BotCommands.cs +++ b/src/HonzaBotner.Discord.Services/Commands/BotCommands.cs @@ -1,7 +1,11 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Threading.Tasks; +using DSharpPlus; using DSharpPlus.Entities; +using DSharpPlus.Exceptions; using DSharpPlus.SlashCommands; +using HonzaBotner.Discord.Managers; using HonzaBotner.Discord.Services.Options; using Microsoft.Extensions.Options; @@ -75,4 +79,67 @@ public async Task PingCommandAsync(InteractionContext ctx) { await ctx.CreateResponseAsync($"Pong! Latency: {ctx.Client.Ping} ms"); } + + [SlashCommandGroup("buttons", "Module used to edit button interactions on messages")] + [SlashCommandPermissions(Permissions.ManageMessages)] + public class ButtonCommands : ApplicationCommandModule + { + private readonly IButtonManager _buttonManager; + + public ButtonCommands(IButtonManager manager) + { + _buttonManager = manager; + } + + [SlashCommand("remove","Deletes all button interactions on the message")] + public async Task RemoveButtons( + InteractionContext ctx, + [Option("message-link", "URL of the message")] string url) + { + DiscordGuild guild = ctx.Guild; + DiscordMessage? message = await DiscordHelper.FindMessageFromLink(guild, url); + if (message is null) + { + throw new ArgumentOutOfRangeException($"Couldn't find message with link: {url}"); + } + + try + { + await _buttonManager.RemoveButtonsFromMessage(message); + } + catch (UnauthorizedException) + { + await ctx.CreateResponseAsync("Error: You can only edit messages by this bot."); + return; + } + + await ctx.CreateResponseAsync("Removed buttons"); + } + + [SlashCommand("setup","Marks message as verification message")] + public async Task SetupButtons( + InteractionContext ctx, + [Option("message-link", "URL of the message")] string url + ) + { + DiscordGuild guild = ctx.Guild; + DiscordMessage? message = await DiscordHelper.FindMessageFromLink(guild, url); + if (message == null) + { + throw new ArgumentOutOfRangeException($"Couldn't find message with link: {url}"); + } + + try + { + await _buttonManager.SetupVerificationButtons(message); + } + catch (UnauthorizedException) + { + await ctx.CreateResponseAsync("Error: You can only edit messages by this bot."); + return; + } + + await ctx.CreateResponseAsync("Added verification buttons to the message."); + } + } } From bc7f333ea311f5c99a1e62df1b5928470fadcf85 Mon Sep 17 00:00:00 2001 From: stepech <29132060+stepech@users.noreply.github.com> Date: Tue, 20 Dec 2022 22:55:43 +0100 Subject: [PATCH 39/39] Bump version --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 050fe7ab..47164618 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@  - 2022.4.3 + 2022.4.4 net7.0 preview enable