Skip to content

Commit

Permalink
fix & bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Jul 8, 2023
1 parent 696bf99 commit bf57c6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="C:\Users\mihag\Downloads\PackageLogo.png">
<None Include="..\PackageLogo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Discord.Net.Interactions" Version="3.9.0" />
<PackageReference Include="Discord.Net.Interactions" Version="3.11.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ public static class InteractionServiceExtensions
/// <returns></returns>
public static async Task RegisterCommandsAsync(this InteractionService service, bool deleteMissing = true)
{
await service.AddModulesGloballyAsync(deleteMissing, service.Modules.Where
(
x => !x.Attributes.Any(attr => attr is GuildModuleAttribute) &&
!x.Attributes.Any(attr => attr is DontAutoRegisterAttribute)
).ToArray());
var registrableModules = service.Modules
.Where(x => (x.IsSlashGroup && x.IsTopLevelGroup || !x.IsSubModule)
&& !x.Attributes.Any(attr => attr is DontAutoRegisterAttribute)).ToArray();

await service.AddModulesGloballyAsync(deleteMissing, registrableModules
.Where(x => !x.Attributes.Any(attr => attr is GuildModuleAttribute)).ToArray());

var moduleGroups = new Dictionary<ulong, List<ModuleInfo>>();

foreach (var module in service.Modules.Where(x => x.Attributes.Any(attr => attr is GuildModuleAttribute) &&
!x.Attributes.Any(attr => attr is DontAutoRegisterAttribute)))
foreach (var module in registrableModules.Where(x => x.Attributes.Any(attr => attr is GuildModuleAttribute)))
{
var attribute = (GuildModuleAttribute)module.Attributes.First(x => x is GuildModuleAttribute);

Expand Down
Binary file added PackageLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf57c6c

Please sign in to comment.