Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Components V2 (prev: UI Kit) #601

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
79ca918
chore: something ™️
Lulalaby Dec 12, 2024
d57f2cd
chore: some stuff
Lulalaby Dec 14, 2024
58f8a3d
minor inconvinience
Lulalaby Dec 15, 2024
4af87c2
i love breaking stuff
Lulalaby Dec 15, 2024
8d25295
moved common builder base to single file
Lulalaby Dec 15, 2024
b3a5b61
i forgot some places
Lulalaby Dec 16, 2024
58fe723
fix: fix mistakes - oppsie~
Lulalaby Dec 16, 2024
55a6350
chore: more cleanup and more fixes
Lulalaby Dec 16, 2024
d593e98
a
Lulalaby Dec 17, 2024
a6b9cf0
Update DiscordMessageBuilder.cs
Lulalaby Dec 17, 2024
e5b50b2
moved mentions to builder class and guarded real value in internal list
Lulalaby Dec 17, 2024
d913f31
fix some more stuff
Lulalaby Dec 17, 2024
30ac79f
hide callback hints, not released sadly
Lulalaby Dec 17, 2024
4e220ec
Update DiscordMessageBuilder.cs
Lulalaby Dec 17, 2024
11712e4
feat: add new components
Lulalaby Dec 19, 2024
b0c812b
fix: thumbnail is 11, not 16
Lulalaby Dec 19, 2024
3842e53
fix: fix file naming
Lulalaby Dec 19, 2024
797aab1
add more convert
Lulalaby Dec 19, 2024
0e4daa4
fix: add current limits and fix converter
Lulalaby Dec 19, 2024
2539095
Merge branch 'main' into ui-kit
Lulalaby Dec 23, 2024
79bc83f
fix!: Use WithAllowedMentions over AddMentions
Lulalaby Dec 24, 2024
8cddee4
Merge branch 'main' into ui-kit
Lulalaby Dec 24, 2024
beb09df
fix(docs): fix missing closing tag
Lulalaby Dec 24, 2024
8084c91
Merge branch 'main' into ui-kit
Lulalaby Dec 29, 2024
315ef19
feat: add container component
Lulalaby Jan 9, 2025
bfde93f
Merge branch 'main' into ui-kit
Lulalaby Jan 9, 2025
97fad66
Merge branch 'main' into ui-kit
Lulalaby Jan 9, 2025
a7f1a69
Merge branch 'main' into ui-kit
Lulalaby Jan 9, 2025
59a6c45
fix: container components limit is 10
Lulalaby Jan 9, 2025
b644845
chore: bump packages
Lulalaby Jan 9, 2025
ace8fac
fix: fix some stuff
Lulalaby Jan 9, 2025
7ac519b
fix: fix color convert
Lulalaby Jan 9, 2025
42cd50f
fix: fix mention issues
Lulalaby Jan 9, 2025
672c6fb
fix: announced change wasn't made yet
Lulalaby Jan 9, 2025
c5da2cb
fix: add missing primary_guild field
Lulalaby Jan 9, 2025
29d10b8
fix: fix naming
Lulalaby Jan 9, 2025
6219a87
Merge branch 'main' into ui-kit
Lulalaby Jan 9, 2025
99b600d
fix: folder naming
Lulalaby Jan 9, 2025
a873b70
Merge branch 'main' into ui-kit
Lulalaby Jan 9, 2025
9ce60dc
Merge branch 'main' into ui-kit
Lulalaby Jan 10, 2025
361d60b
chore: thumbnail uses media now as property name instead of image
Lulalaby Jan 14, 2025
009d3ef
chore!: deprecated WithFile(s) => replaced by AddFile(s)
Lulalaby Jan 15, 2025
49e4e08
Merge branch 'main' into ui-kit
Lulalaby Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -36,6 +37,7 @@
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions DisCatSharp.CommandsNext/CommandsNextExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public async Task DefaultHelpAsync(CommandContext ctx, [Description("Command to

var helpMessage = helpBuilder.Build();

var builder = new DiscordMessageBuilder().WithContent(helpMessage.Content).WithEmbed(helpMessage.Embed);
var builder = new DiscordMessageBuilder().WithContent(helpMessage.Content).AddEmbed(helpMessage.Embed);

if (!ctx.Config.DmHelp || ctx.Channel is DiscordDmChannel || ctx.Guild == null)
await ctx.RespondAsync(builder).ConfigureAwait(false);
Expand Down Expand Up @@ -531,7 +531,7 @@ public CommandContext CreateContext(DiscordMessage msg, string prefix, Command c
ChannelId = msg.ChannelId
};

if (cmd != null && (cmd.Module is TransientCommandModule || cmd.Module == null))
if (cmd != null && cmd.Module is TransientCommandModule or null)
{
var scope = ctx.Services.CreateScope();
ctx.ServiceScopeContext = new(ctx.Services, scope);
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.CommandsNext/DisCatSharp.CommandsNext.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -45,6 +46,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion DisCatSharp.Common/DisCatSharp.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.1" />
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.Configuration/DisCatSharp.Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -32,6 +33,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.Experimental/DisCatSharp.Experimental.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="Concentus" Version="2.2.2" />
<PackageReference Include="Concentus.Oggfile" Version="1.0.6" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
Expand All @@ -34,6 +35,7 @@
</PackageReference>
<PackageReference Include="DisCatSharp.Attributes" Version="10.6.6" />
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DisCatSharp.Attributes" Version="10.6.6" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.Hosting/DisCatSharp.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -34,6 +35,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions DisCatSharp.Interactivity/DisCatSharp.Interactivity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="ConcurrentHashSet" Version="1.3.0" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -36,6 +37,7 @@
<PackageReference Include="DisCatSharp.Attributes" Version="10.6.6" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DisCatSharp.Interactivity/EventHandling/Paginator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private async Task PaginateAsync(IPaginationRequest p, DiscordEmoji emoji)
var page = await p.GetPageAsync().ConfigureAwait(false);
var builder = new DiscordMessageBuilder()
.WithContent(page.Content)
.WithEmbed(page.Embed);
.AddEmbed(page.Embed);

await builder.ModifyAsync(msg).ConfigureAwait(false);
}
Expand Down
4 changes: 2 additions & 2 deletions DisCatSharp.Interactivity/InteractivityExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public async Task SendPaginatedMessageAsync(

var builder = new DiscordMessageBuilder()
.WithContent(pages.First().Content)
.WithEmbed(pages.First().Embed)
.AddEmbed(pages.First().Embed)
.AddComponents(bts.ButtonArray);

var message = await builder.SendAsync(channel).ConfigureAwait(false);
Expand Down Expand Up @@ -830,7 +830,7 @@ public async Task SendPaginatedMessageAsync(
{
var builder = new DiscordMessageBuilder()
.WithContent(pages.First().Content)
.WithEmbed(pages.First().Embed);
.AddEmbed(pages.First().Embed);
var m = await builder.SendAsync(channel).ConfigureAwait(false);

var timeout = timeoutOverride ?? this.Config.Timeout;
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.Lavalink/DisCatSharp.Lavalink.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -47,6 +48,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DisCatSharp.Attributes" Version="10.6.6" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.7.37357" />
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp.VoiceNext/DisCatSharp.VoiceNext.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.2.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DisCatSharp.Attributes" Version="10.6.6" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Threading.Channels" Version="9.0.1" />
</ItemGroup>

Expand Down
8 changes: 1 addition & 7 deletions DisCatSharp/DisCatSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.1" />
<PackageReference Include="Backport.System.Threading.Lock" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -56,12 +56,6 @@
<ProjectReference Include="..\DisCatSharp.Common\DisCatSharp.Common.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Entities\Interaction\Components\Attachment\" />
<Folder Include="Entities\Interaction\Components\DateTime\" />
<Folder Include="Entities\Interaction\Components\Radio\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
Loading
Loading