mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
upgrade d#+
This commit is contained in:
@@ -51,7 +51,7 @@ internal sealed class DevOnly
|
||||
{
|
||||
var builder = new DiscordMessageBuilder()
|
||||
.WithContent("Regular button vs emoji button")
|
||||
.AddComponents(
|
||||
.AddActionRowComponent(
|
||||
new DiscordButtonComponent(DiscordButtonStyle.Primary, "pt", "✅ Regular"),
|
||||
new DiscordButtonComponent(DiscordButtonStyle.Primary, "pe", "Emoji", emoji: new(DiscordEmoji.FromUnicode("✅")))
|
||||
);
|
||||
|
||||
@@ -116,13 +116,11 @@ internal static class Explain
|
||||
.AsEphemeral()
|
||||
.WithCustomId($"modal:warn:{Guid.NewGuid():n}")
|
||||
.WithTitle("New explanation")
|
||||
.AddComponents(
|
||||
new DiscordTextInputComponent(
|
||||
label,
|
||||
"explanation",
|
||||
style: DiscordTextInputStyle.Paragraph
|
||||
)
|
||||
);
|
||||
.AddTextInputComponent(new(
|
||||
label,
|
||||
"explanation",
|
||||
style: DiscordTextInputStyle.Paragraph
|
||||
));
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
|
||||
InteractivityResult<ModalSubmittedEventArgs> modalResult;
|
||||
@@ -251,14 +249,12 @@ internal static class Explain
|
||||
.AsEphemeral()
|
||||
.WithCustomId($"modal:warn:{Guid.NewGuid():n}")
|
||||
.WithTitle("Updated explanation")
|
||||
.AddComponents(
|
||||
new DiscordTextInputComponent(
|
||||
label,
|
||||
"explanation",
|
||||
value: item.Text,
|
||||
style: DiscordTextInputStyle.Paragraph
|
||||
)
|
||||
);
|
||||
.AddTextInputComponent(new(
|
||||
label,
|
||||
"explanation",
|
||||
value: item.Text,
|
||||
style: DiscordTextInputStyle.Paragraph
|
||||
));
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
|
||||
InteractivityResult<ModalSubmittedEventArgs> modalResult;
|
||||
|
||||
@@ -30,16 +30,14 @@ internal static class ForcedNicknames
|
||||
.AsEphemeral()
|
||||
.WithCustomId($"modal:nickname:{Guid.NewGuid():n}")
|
||||
.WithTitle("Enforcing Rule 7")
|
||||
.AddComponents(
|
||||
new DiscordTextInputComponent(
|
||||
"New nickname",
|
||||
"nickname",
|
||||
suggestedName,
|
||||
suggestedName,
|
||||
min_length: 2,
|
||||
max_length: 32
|
||||
)
|
||||
);
|
||||
.AddTextInputComponent(new(
|
||||
"New nickname",
|
||||
"nickname",
|
||||
suggestedName,
|
||||
suggestedName,
|
||||
min_length: 2,
|
||||
max_length: 32
|
||||
));
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
|
||||
string resultMsg;
|
||||
|
||||
@@ -32,9 +32,8 @@ internal static class MessageMenuCommands
|
||||
var placeholder = StatsStorage.GetExplainStats().FirstOrDefault().name ?? "rule 1";
|
||||
var modal = new DiscordInteractionResponseBuilder()
|
||||
.WithTitle("Explain Prompt")
|
||||
.AddComponents(new DiscordTextInputComponent("Term to explain", "term", placeholder, min_length: 1))
|
||||
.AddTextInputComponent(new("Term to explain", "term", placeholder, min_length: 1))
|
||||
.WithCustomId($"modal:explain:{Guid.NewGuid():n}");
|
||||
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
|
||||
InteractivityResult<ModalSubmittedEventArgs> modalResult;
|
||||
@@ -80,16 +79,14 @@ internal static class MessageMenuCommands
|
||||
.AsEphemeral()
|
||||
.WithCustomId($"modal:report:{Guid.NewGuid():n}")
|
||||
.WithTitle("Message Report")
|
||||
.AddComponents(
|
||||
new DiscordTextInputComponent(
|
||||
"Comment",
|
||||
"comment",
|
||||
"Describe why you report this message",
|
||||
required: false,
|
||||
style: DiscordTextInputStyle.Paragraph,
|
||||
max_length: EmbedPager.MaxFieldLength
|
||||
)
|
||||
);
|
||||
.AddTextInputComponent(new(
|
||||
"Comment",
|
||||
"comment",
|
||||
"Describe why you report this message",
|
||||
required: false,
|
||||
style: DiscordTextInputStyle.Paragraph,
|
||||
max_length: EmbedPager.MaxFieldLength
|
||||
));
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
var modalResult = await interactivity.WaitForModalAsync(modal.CustomId, ctx.User).ConfigureAwait(false);
|
||||
if (modalResult.TimedOut)
|
||||
|
||||
@@ -34,14 +34,12 @@ internal static class WarningsContextMenus
|
||||
.AsEphemeral()
|
||||
.WithCustomId($"modal:warn:{Guid.NewGuid():n}")
|
||||
.WithTitle("Issue new warning")
|
||||
.AddComponents(
|
||||
new DiscordTextInputComponent(
|
||||
"Warning reason",
|
||||
"warning",
|
||||
"Rule #2",
|
||||
min_length: 2
|
||||
)
|
||||
);
|
||||
.AddTextInputComponent(new(
|
||||
"Warning reason",
|
||||
"warning",
|
||||
"Rule #2",
|
||||
min_length: 2
|
||||
));
|
||||
await ctx.RespondWithModalAsync(modal).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blurhash.ImageSharp" Version="4.0.0" />
|
||||
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.4.0" />
|
||||
<PackageReference Include="DSharpPlus" Version="5.0.0-nightly-02478" />
|
||||
<PackageReference Include="DSharpPlus.Commands" Version="5.0.0-nightly-02478" />
|
||||
<PackageReference Include="DSharpPlus.Interactivity" Version="5.0.0-nightly-02478" />
|
||||
<PackageReference Include="DSharpPlus" Version="5.0.0-nightly-02506" />
|
||||
<PackageReference Include="DSharpPlus.Commands" Version="5.0.0-nightly-02506" />
|
||||
<PackageReference Include="DSharpPlus.Interactivity" Version="5.0.0-nightly-02506" />
|
||||
<PackageReference Include="DSharpPlus.Natives.Zstd" Version="1.5.7.21" />
|
||||
<PackageReference Include="Google.Apis.Drive.v3" Version="1.69.0.3778" />
|
||||
<PackageReference Include="MathParser.org-mXparser" Version="6.1.0" />
|
||||
|
||||
@@ -58,7 +58,7 @@ internal static partial class ProductCodeLookup
|
||||
var messageBuilder = new DiscordMessageBuilder().AddEmbed(result.builder);
|
||||
//todo: pass author from context and update OnCheckUpdatesButtonClick in psn check updates
|
||||
if (message is {Author: not null} && channel.IsSpamChannel())
|
||||
messageBuilder.AddComponents(
|
||||
messageBuilder.AddActionRowComponent(
|
||||
new DiscordButtonComponent(
|
||||
DiscordButtonStyle.Secondary,
|
||||
$"{GlobalButtonHandler.ReplaceWithUpdatesPrefix}{result.code}",
|
||||
|
||||
Reference in New Issue
Block a user