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

Re-create auditlog functionality from scratch #377

Closed
wants to merge 121 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
a1df960
fuck audit log
Lulalaby Oct 16, 2023
62ae3ab
nom nom
Lulalaby Oct 16, 2023
57fe070
feat: avatar_decoration_data
Lulalaby Oct 17, 2023
8829c7f
audit log fuckery
Lulalaby Oct 17, 2023
d95e73c
later todo
Lulalaby Oct 17, 2023
6549fc6
nom nom
Lulalaby Oct 17, 2023
d7fa09a
add AvatarDecorationUrl
Lulalaby Oct 17, 2023
c23c36e
chore(deps): update packages
Lulalaby Oct 17, 2023
6b8bce9
internal setters
Lulalaby Oct 17, 2023
22199ab
Update DiscordAuditLogEntry.cs
Lulalaby Oct 17, 2023
4129193
Update DiscordAuditLogChangeObject.cs
Lulalaby Oct 17, 2023
609c8bd
we'll do change sets
Lulalaby Oct 17, 2023
29f9a4e
fun :sparkles:
Lulalaby Oct 17, 2023
72a5f08
role stuff
Lulalaby Oct 17, 2023
da85693
experimental nom
Lulalaby Oct 17, 2023
631a2da
nom
Lulalaby Oct 17, 2023
a7f6419
boop
Lulalaby Oct 17, 2023
8c56f95
aaaaaaa
Lulalaby Oct 17, 2023
b2fecac
aaaaaa
Lulalaby Oct 17, 2023
b609d34
Update DiscordAuditLogEntry.cs
Lulalaby Oct 17, 2023
ae98534
aaaaa
Lulalaby Oct 17, 2023
97e6f84
Update GuildUpdateChangeSet.cs
Lulalaby Oct 17, 2023
95b19c8
Update GuildUpdateChangeSet.cs
Lulalaby Oct 17, 2023
22ff750
aaaaaaaaaaa
Lulalaby Oct 17, 2023
16b4cbf
feat: AutoModerationBlockMessageChangeSet
TheXorog Oct 17, 2023
572b8e1
feat: docs
TheXorog Oct 17, 2023
9eabe11
feat: AutoModerationFlagToChannelChangeSet
TheXorog Oct 17, 2023
74177c2
nom
Lulalaby Oct 17, 2023
0b6729c
Merge branch 'auditfuck' of https://github.com/Aiko-IT-Systems/DisCat…
Lulalaby Oct 17, 2023
c161383
Merge branch 'auditfuck' of https://github.com/Aiko-IT-Systems/DisCat…
TheXorog Oct 17, 2023
a69633e
fix: oop
TheXorog Oct 17, 2023
98340af
feat: AutoModerationRuleCreateChangeSet
TheXorog Oct 17, 2023
420a381
feat: AutoModerationRuleDeleteChangeSet
TheXorog Oct 17, 2023
4378bda
fix: another oopsie
TheXorog Oct 17, 2023
544545c
feat: AutoModerationRuleUpdateChangeSet
TheXorog Oct 17, 2023
af17cf4
feat: AutoModerationUserCommunicationDisabledChangeSet
TheXorog Oct 17, 2023
492f2c2
feat: BotAddChangeSet
TheXorog Oct 17, 2023
7d32f4b
fix: forgot sealed
TheXorog Oct 17, 2023
5726118
feat: ChannelCreateChangeSet
TheXorog Oct 17, 2023
dc975b4
feat: ChannelDeleteChangeSet
TheXorog Oct 17, 2023
c0b8d9c
feat: BotAddChangeSet.Bot
TheXorog Oct 17, 2023
08c0eee
feat: Add missing channel entries
TheXorog Oct 17, 2023
ee47c2c
i meant to amend this :alien:
TheXorog Oct 17, 2023
9a61b7d
feat: ChannelUpdateChangeSet
TheXorog Oct 17, 2023
4556139
fix: seal + internal ctors
TheXorog Oct 17, 2023
0540a82
feat: Integrations
TheXorog Oct 17, 2023
5144227
fix: fix possible nre's
TheXorog Oct 17, 2023
1ce5fa7
feat: Invites
TheXorog Oct 17, 2023
61ced7e
add botaddchangeset description
Lulalaby Oct 18, 2023
65700d0
Update BotAddChangeSet.cs
TheXorog Oct 18, 2023
78ee2c3
Merge branch 'main' into auditfuck
TheXorog Oct 18, 2023
bd6c4dd
feat: Bans
TheXorog Oct 18, 2023
cfd43a3
feat: MemberDisconnectChangeSet
TheXorog Oct 18, 2023
87d8202
feat: MemberKickChangeSet
TheXorog Oct 18, 2023
bc25481
feat: MemberMoveChangeSet
TheXorog Oct 18, 2023
7ca6864
fix: im dumb
TheXorog Oct 18, 2023
3dc9165
feat: MemberPruneChangeSet
TheXorog Oct 18, 2023
06a816f
feat: MemberRoleUpdateChangeSet
TheXorog Oct 18, 2023
c0e166e
feat: MemberUpdateChangeSet
TheXorog Oct 18, 2023
f7aac86
feat: Message Deletions
TheXorog Oct 18, 2023
fdd3907
fix: Full DiscordClient
TheXorog Oct 18, 2023
e42a438
feat: MessagePinChangeSet
TheXorog Oct 18, 2023
54891af
fix: nvm this needs to be public 🕴️
TheXorog Oct 18, 2023
b2bc879
feat: MessageUnpinChangeSet
TheXorog Oct 18, 2023
e39b798
fix(actions): pin docfx again..
Lulalaby Oct 18, 2023
942fa52
Merge branch 'auditfuck' of https://github.com/Aiko-IT-Systems/DisCat…
TheXorog Oct 18, 2023
e842d95
Merge branch 'main' into auditfuck
Lulalaby Oct 21, 2023
fbed3d5
Merge branch 'main' into auditfuck
Lulalaby Oct 22, 2023
80321fc
chore: cleanup
Lulalaby Oct 22, 2023
df20f24
Merge branch 'main' into auditfuck
Lulalaby Oct 22, 2023
5a54dc5
add more audit log change sets and add descriptions
Lulalaby Oct 23, 2023
9127eeb
default to this.User. we get the id anyways.
Lulalaby Oct 23, 2023
aefc6d2
fix: nre
Lulalaby Oct 23, 2023
cd00ee5
more ChangeDescription
Lulalaby Oct 23, 2023
752a9a7
Update DiscordAttachment.cs
Lulalaby Oct 24, 2023
8d88362
Update DiscordMessage.cs
Lulalaby Oct 24, 2023
2f4da41
fix: DiscordMessage.ModifyAsync file nre
TheXorog Oct 24, 2023
9516ae9
Merge branch 'main' into auditfuck
Lulalaby Oct 24, 2023
978c08f
Merge branch 'main' into auditfuck
Lulalaby Oct 24, 2023
1099bb9
Merge branch 'main' into auditfuck
Lulalaby Oct 25, 2023
5930880
Update DiscordClient.Dispatch.cs
Lulalaby Oct 25, 2023
201fbea
docs: use unified summary for part discordclient
Lulalaby Oct 25, 2023
01cb03e
Merge branch 'main' into auditfuck
Lulalaby Oct 25, 2023
8c5b94f
Merge branch 'main' into auditfuck
Lulalaby Oct 26, 2023
cde07c5
fix: missed to update
Lulalaby Oct 26, 2023
c1dffaa
Merge branch 'main' into auditfuck
Lulalaby Oct 26, 2023
b92f338
Merge branch 'main' into auditfuck
Lulalaby Oct 26, 2023
054675b
Update DiscordApiClient.cs
Lulalaby Oct 27, 2023
122e77d
Merge branch 'main' into auditfuck
Lulalaby Oct 27, 2023
6a571ca
Merge branch 'main' into auditfuck
Lulalaby Oct 27, 2023
23e35e7
Merge branch 'main' into auditfuck
Lulalaby Oct 28, 2023
f785f4a
Merge branch 'main' into auditfuck
Lulalaby Oct 28, 2023
f939662
feat!: flagsssssss
Lulalaby Oct 28, 2023
5ea997e
Merge branch 'main' into auditfuck
Lulalaby Oct 28, 2023
8e3a650
Merge branch 'main' into auditfuck
Lulalaby Oct 28, 2023
2574fab
Update ApplicationFlags.cs
Lulalaby Oct 28, 2023
f1720cb
Merge branch 'main' into auditfuck
Lulalaby Oct 28, 2023
7ab4435
Update InteractionResponseType.cs
Lulalaby Oct 28, 2023
eed25fd
feat: roles
TheXorog Oct 29, 2023
165e08f
feat: stickers
TheXorog Oct 29, 2023
1750daa
updates
Lulalaby Nov 6, 2023
b9d94d0
fix: emoji change set descriptions
Lulalaby Nov 7, 2023
4176ef8
feat: webhook changesets + webhook type
Lulalaby Nov 7, 2023
8cb02b8
docs
Lulalaby Nov 7, 2023
c159efa
meow
Lulalaby Nov 7, 2023
21792bc
cleanup code
Lulalaby Nov 8, 2023
5cab45e
Merge branch 'main' into auditfuck
Lulalaby Nov 8, 2023
568368c
Update DiscordAuditLogEntry.cs
Lulalaby Nov 8, 2023
5fde65e
nom
Lulalaby Nov 8, 2023
c001a73
finish voice channel status update and delete change set
Lulalaby Nov 8, 2023
7fe86bb
Update VoiceChannelStatusDeleteChangeSet.cs
Lulalaby Nov 8, 2023
87c2376
[ci skip] a
Lulalaby Nov 8, 2023
6cae3c7
add clyde update change set
Lulalaby Nov 8, 2023
740a540
Merge branch 'main' into auditfuck
Lulalaby Nov 8, 2023
5602c8c
Merge branch 'main' into auditfuck
Lulalaby Nov 8, 2023
adedbe3
feat: clyde
Lulalaby Nov 8, 2023
98d7f85
Merge branch 'main' into auditfuck
Lulalaby Nov 9, 2023
3713a96
fix: sentry fingerprint once again
Lulalaby Nov 9, 2023
eb171c0
Merge branch 'main' into auditfuck
Lulalaby Nov 9, 2023
d13a79a
add msg type 43
Lulalaby Nov 9, 2023
1c6b0c0
fix: avatar url endpoint in guild member
Lulalaby Nov 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 9 additions & 8 deletions .nuget/NuGet.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>

<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
9 changes: 5 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<Project>
<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
</ItemGroup>
<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
</ItemGroup>
<PropertyGroup>
<!--<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/DisCatSharp.Tools/DisCatSharp.ruleset</CodeAnalysisRuleSet>-->
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>
</Project>
365 changes: 186 additions & 179 deletions DisCatSharp.ApplicationCommands/ApplicationCommandsExtension.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal static bool IsCommandCandidate(this MethodInfo method, out ParameterInf
ApplicationCommandsExtension.Logger.LogDebug("Not existent");
return false;
}

if (ApplicationCommandsExtension.DebugEnabled)
ApplicationCommandsExtension.Logger.LogDebug("Checking method {name}", method.Name);

Expand All @@ -96,7 +97,7 @@ internal static bool IsCommandCandidate(this MethodInfo method, out ParameterInf

// check if appropriate return and arguments
parameters = method.GetParameters();
if (!parameters.Any() || (parameters.First().ParameterType != typeof(ContextMenuContext) && parameters.First().ParameterType != typeof(InteractionContext)) || method.ReturnType != typeof(Task))
if (!parameters.Any() || parameters.First().ParameterType != typeof(ContextMenuContext) && parameters.First().ParameterType != typeof(InteractionContext) || method.ReturnType != typeof(Task))
{
if (ApplicationCommandsExtension.DebugEnabled)
ApplicationCommandsExtension.Logger.LogDebug("Missing first parameter with type ContextMenuContext or InteractionContext");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public ContextMenuAttribute(ApplicationCommandType type, string name, bool isNsf
this.IntegrationTypes = integrationTypes?.ToList();
}


/// <summary>
/// Marks this method as a context menu.
/// </summary>
Expand All @@ -93,7 +92,6 @@ public ContextMenuAttribute(ApplicationCommandType type, string name, long defau
this.IntegrationTypes = integrationTypes?.ToList();
}


/// <summary>
/// Marks this method as context menu.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ContextMenuCooldownAttribute(int maxUses, double resetAfter, CooldownBuck
this.MaxUses = maxUses;
this.Reset = TimeSpan.FromSeconds(resetAfter);
this.BucketType = bucketType;
this.Buckets = new ConcurrentDictionary<string, ContextMenuCooldownBucket>();
this.Buckets = new();
}

/// <summary>
Expand All @@ -68,7 +68,11 @@ public ContextMenuCooldownBucket GetBucket(BaseContext ctx)
public TimeSpan GetRemainingCooldown(BaseContext ctx)
{
var bucket = this.GetBucket(ctx);
return bucket == null ? TimeSpan.Zero : bucket.RemainingUses > 0 ? TimeSpan.Zero : bucket.ResetsAt - DateTimeOffset.UtcNow;
return bucket == null
? TimeSpan.Zero
: bucket.RemainingUses > 0
? TimeSpan.Zero
: bucket.ResetsAt - DateTimeOffset.UtcNow;
}

/// <summary>
Expand Down Expand Up @@ -108,7 +112,7 @@ public override async Task<bool> ExecuteChecksAsync(BaseContext ctx)
var bid = this.GetBucketId(ctx, out var usr, out var chn, out var gld);
if (!this.Buckets.TryGetValue(bid, out var bucket))
{
bucket = new ContextMenuCooldownBucket(this.MaxUses, this.Reset, usr, chn, gld);
bucket = new(this.MaxUses, this.Reset, usr, chn, gld);
this.Buckets.AddOrUpdate(bid, bucket, (k, v) => bucket);
}

Expand All @@ -123,8 +127,7 @@ public sealed class ContextMenuCooldownBucket : CooldownBucket
{
internal ContextMenuCooldownBucket(int maxUses, TimeSpan resetAfter, ulong userId = 0, ulong channelId = 0, ulong guildId = 0)
: base(maxUses, resetAfter, userId, channelId, guildId)
{
}
{ }

/// <summary>
/// Returns a string representation of this command cooldown bucket.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public override async Task<bool> ExecuteChecksAsync(BaseContext ctx)
var usr = ctx.Member;
if (usr == null)
return false;

var pusr = ctx.Channel.PermissionsFor(usr);

var bot = await ctx.Guild.GetMemberAsync(ctx.Client.CurrentUser.Id).ConfigureAwait(false);
if (bot == null)
return false;

var pbot = ctx.Channel.PermissionsFor(bot);

var usrok = ctx.Guild.OwnerId == usr.Id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public override async Task<bool> ExecuteChecksAsync(BaseContext ctx)
/// <summary>
/// Defines that usage of this application command is restricted to users with a test entitlement.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false),RequiresFeature(Features.MonetizedApplication)]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false), RequiresFeature(Features.MonetizedApplication)]
public sealed class ApplicationCommandRequirePremiumTestAttribute : ApplicationCommandCheckBaseAttribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public override Task<bool> ExecuteChecksAsync(BaseContext ctx)

return (pusr & Permissions.Administrator) != 0
? Task.FromResult(true)
: (pusr & this.Permissions) == this.Permissions ? Task.FromResult(true) : Task.FromResult(false);
: (pusr & this.Permissions) == this.Permissions
? Task.FromResult(true)
: Task.FromResult(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace DisCatSharp.ApplicationCommands.Attributes;
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)]
public class ChoiceProviderAttribute : Attribute
{

/// <summary>
/// The type of the provider.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public MaximumValueAttribute(double value)
}
}


/// <summary>
/// Sets a minimum value for this slash command option. Only valid for <see cref="string"/> parameters.
/// </summary>
Expand All @@ -93,6 +92,7 @@ public MinimumLengthAttribute(int value)
{
if (value > 600)
throw new ArgumentException("Minimum cannot be more than 6000.");

this.Value = value;
}
}
Expand All @@ -115,6 +115,7 @@ public MaximumLengthAttribute(int value)
{
if (value == 0 || value > 600)
throw new ArgumentException("Maximum length cannot be less than 1 and cannot be more than 6000.");

this.Value = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public SlashCommandCooldownAttribute(int maxUses, double resetAfter, CooldownBuc
this.MaxUses = maxUses;
this.Reset = TimeSpan.FromSeconds(resetAfter);
this.BucketType = bucketType;
this.Buckets = new ConcurrentDictionary<string, SlashCommandCooldownBucket>();
this.Buckets = new();
}

/// <summary>
Expand All @@ -68,7 +68,11 @@ public SlashCommandCooldownBucket GetBucket(BaseContext ctx)
public TimeSpan GetRemainingCooldown(BaseContext ctx)
{
var bucket = this.GetBucket(ctx);
return bucket == null ? TimeSpan.Zero : bucket.RemainingUses > 0 ? TimeSpan.Zero : bucket.ResetsAt - DateTimeOffset.UtcNow;
return bucket == null
? TimeSpan.Zero
: bucket.RemainingUses > 0
? TimeSpan.Zero
: bucket.ResetsAt - DateTimeOffset.UtcNow;
}

/// <summary>
Expand Down Expand Up @@ -108,7 +112,7 @@ public override async Task<bool> ExecuteChecksAsync(BaseContext ctx)
var bid = this.GetBucketId(ctx, out var usr, out var chn, out var gld);
if (!this.Buckets.TryGetValue(bid, out var bucket))
{
bucket = new SlashCommandCooldownBucket(this.MaxUses, this.Reset, usr, chn, gld);
bucket = new(this.MaxUses, this.Reset, usr, chn, gld);
this.Buckets.AddOrUpdate(bid, bucket, (k, v) => bucket);
}

Expand All @@ -129,7 +133,5 @@ public sealed class SlashCommandCooldownBucket : CooldownBucket

internal SlashCommandCooldownBucket(int maxUses, TimeSpan resetAfter, ulong userId = 0, ulong channelId = 0, ulong guildId = 0)
: base(maxUses, resetAfter, userId, channelId, guildId)
{

}
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ internal static class ApplicationCommandEqualityChecks
/// <param name="isGuild">Whether the equal check is performed for a guild command.</param>
internal static bool IsEqualTo(
this DiscordApplicationCommand? ac1,
DiscordApplicationCommand? targetApplicationCommand, DiscordClient client, bool isGuild
DiscordApplicationCommand? targetApplicationCommand,
DiscordClient client,
bool isGuild
)
{
if (targetApplicationCommand is null || ac1 is null)
Expand Down Expand Up @@ -83,8 +85,12 @@ internal static bool IsEqualTo(
/// <param name="localizationEnabled">Whether localization is enabled.</param>
/// <param name="guild">Whether the equal check is performed for a guild command.</param>
internal static bool SoftEqual(
this DiscordApplicationCommand source, DiscordApplicationCommand target,
ApplicationCommandType type, BaseDiscordClient client, bool localizationEnabled = false, bool guild = false
this DiscordApplicationCommand source,
DiscordApplicationCommand target,
ApplicationCommandType type,
BaseDiscordClient client,
bool localizationEnabled = false,
bool guild = false
)
{
bool? sDmPerm = source.DmPermission ?? true;
Expand Down Expand Up @@ -182,8 +188,12 @@ internal static bool AreDictionariesEqual(this Dictionary<string, string> source
/// <param name="sDmPerm">The source dm permission.</param>
/// <param name="tDmPerm">The target dm permission.</param>
internal static bool DeepEqual(
DiscordApplicationCommand source, DiscordApplicationCommand target, BaseDiscordClient client,
bool localizationEnabled = false, bool? sDmPerm = null, bool? tDmPerm = null
DiscordApplicationCommand source,
DiscordApplicationCommand target,
BaseDiscordClient client,
bool localizationEnabled = false,
bool? sDmPerm = null,
bool? tDmPerm = null
)
{
var name = source.Name;
Expand Down Expand Up @@ -218,13 +228,14 @@ internal static bool DeepEqual(
/// <param name="localizationEnabled">Whether localization is enabled.</param>
private static (bool Equal, string? Reason) DeepEqualOptions(
IReadOnlyList<DiscordApplicationCommandOption>? sourceOptions,
IReadOnlyList<DiscordApplicationCommandOption>? targetOptions, bool localizationEnabled
IReadOnlyList<DiscordApplicationCommandOption>? targetOptions,
bool localizationEnabled
)
{
if (sourceOptions == null && targetOptions == null)
return (true, null);

if ((sourceOptions != null && targetOptions == null) || (sourceOptions == null && targetOptions != null))
if (sourceOptions != null && targetOptions == null || sourceOptions == null && targetOptions != null)
return (false, "source or target option null, but not both");

if (sourceOptions!.Count != targetOptions!.Count)
Expand All @@ -251,8 +262,8 @@ private static (bool Equal, string? Reason) DeepEqualOptions(
sourceOption.RawDescriptionLocalizations.AreDictionariesEqual(targetOption
.RawDescriptionLocalizations);

if ((sourceOption.Choices is null && targetOption.Choices is not null) ||
(sourceOption.Choices is not null && targetOption.Choices is null))
if (sourceOption.Choices is null && targetOption.Choices is not null ||
sourceOption.Choices is not null && targetOption.Choices is null)
return (false, "source or target choices null, but not both - " + sourceOption.Name);

if (sourceOption.Choices is not null && targetOption.Choices is not null)
Expand All @@ -263,10 +274,10 @@ private static (bool Equal, string? Reason) DeepEqualOptions(
return (false, "choice mismatch - " + sourceOption.Name);
}

if ((sourceOption.ChannelTypes is null && targetOption.ChannelTypes is not null) ||
(sourceOption.ChannelTypes is not null && targetOption.ChannelTypes is null) ||
(sourceOption.ChannelTypes is not null && targetOption.ChannelTypes is not null &&
!sourceOption.ChannelTypes.OrderBy(x => x).All(targetOption.ChannelTypes.OrderBy(x => x).Contains)))
if (sourceOption.ChannelTypes is null && targetOption.ChannelTypes is not null ||
sourceOption.ChannelTypes is not null && targetOption.ChannelTypes is null ||
sourceOption.ChannelTypes is not null && targetOption.ChannelTypes is not null &&
!sourceOption.ChannelTypes.OrderBy(x => x).All(targetOption.ChannelTypes.OrderBy(x => x).Contains))
return (false, "channel type mismatch - " + sourceOption.Name);

var rec = DeepEqualOptions(sourceOption.Options, targetOption.Options, localizationEnabled);
Expand Down
2 changes: 1 addition & 1 deletion DisCatSharp.ApplicationCommands/Context/BaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,5 @@ public Task<DiscordMessage> GetFollowupMessageAsync(ulong followupMessageId)
/// </summary>
/// <returns>The original interaction response.</returns>
public Task<DiscordMessage> GetOriginalResponseAsync()
=> this.Interaction.GetOriginalResponseAsync();
=> this.Interaction.GetOriginalResponseAsync();
}
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>

<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../DisCatSharp.Targets/Version.targets" />
<Import Project="../DisCatSharp.Targets/DisCatSharp.targets" />
<Import Project="../DisCatSharp.Targets/Package.targets" />
<Import Project="../DisCatSharp.Targets/NuGet.targets" />
<Import Project="../DisCatSharp.Targets/Library.targets" />
<Import Project="../DisCatSharp.Targets/InternalsVisibleTo.targets" />

<PropertyGroup>
<AssemblyName>DisCatSharp.ApplicationCommands</AssemblyName>
<RootNamespace>DisCatSharp.ApplicationCommands</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<PackageId>DisCatSharp.ApplicationCommands</PackageId>
<Description>
DisCatSharp Application Commands Extension

Use it on top of your DisCatSharp powered bot and unleash the power of application commands in discord.

Documentation: https://docs.dcs.aitsys.dev/articles/modules/application_commands/intro.html
</Description>
<PackageTags>DisCatSharp,Discord API Wrapper,Discord,Bots,Discord Bots,AITSYS,Net6,Net7,Application Commands,Context Menu Commands</PackageTags>
<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DisCatSharp.Attributes" Version="10.4.3" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DisCatSharp\DisCatSharp.csproj" />
<ProjectReference Include="..\DisCatSharp.Common\DisCatSharp.Common.csproj" />
</ItemGroup>
<Import Project="../DisCatSharp.Targets/Version.targets" />
<Import Project="../DisCatSharp.Targets/DisCatSharp.targets" />
<Import Project="../DisCatSharp.Targets/Package.targets" />
<Import Project="../DisCatSharp.Targets/NuGet.targets" />
<Import Project="../DisCatSharp.Targets/Library.targets" />
<Import Project="../DisCatSharp.Targets/InternalsVisibleTo.targets" />

<PropertyGroup>
<AssemblyName>DisCatSharp.ApplicationCommands</AssemblyName>
<RootNamespace>DisCatSharp.ApplicationCommands</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<PackageId>DisCatSharp.ApplicationCommands</PackageId>
<Description>
DisCatSharp Application Commands Extension

Use it on top of your DisCatSharp powered bot and unleash the power of application commands in discord.

Documentation: https://docs.dcs.aitsys.dev/articles/modules/application_commands/intro.html
</Description>
<PackageTags>DisCatSharp,Discord API Wrapper,Discord,Bots,Discord Bots,AITSYS,Net6,Net7,Application Commands,Context Menu Commands</PackageTags>
<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DisCatSharp.Analyzer.Roselyn" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DisCatSharp.Attributes" Version="10.4.3" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DisCatSharp\DisCatSharp.csproj" />
<ProjectReference Include="..\DisCatSharp.Common\DisCatSharp.Common.csproj" />
</ItemGroup>
</Project>
Loading
Loading