f6d5281af8
PR Checks / test-and-build (pull_request) Successful in 8m46s
Context.Guild in NetCord resolves the Guild object from the gateway client cache (cache.Guilds.GetValueOrDefault(guildId)), not from the interaction JSON payload. After a bot restart, the guild may not yet be cached when the first slash command arrives, causing Context.Guild to be null even though the command is invoked inside a guild channel. This produced "This command can only be used in a guild." Changes: - DiscordListSessionsCommand: use Context.Interaction.GuildId instead of Context.Guild.Id - DiscordNewSessionCommand: use Context.Interaction.GuildId + REST GetGuildAsync/GetGuildUserAsync - DiscordRescheduleCommand: same as above - DiscordSessionInteractionModule: same fix for button interactions (CreateInput) - Add null guard in GetResolvedPermissions for safety - Bump version to 3.0.5 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
16 lines
498 B
XML
16 lines
498 B
XML
<Project>
|
|
<PropertyGroup>
|
|
<Version>3.0.5</Version>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<LangVersion>preview</LangVersion>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="all" />
|
|
</ItemGroup>
|
|
</Project>
|