fix(discord): resolve slash commands from interaction payload instead of gateway cache
PR Checks / test-and-build (pull_request) Successful in 8m46s
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>
This commit is contained in:
+3
-3
@@ -49,7 +49,7 @@ services:
|
||||
crond -f
|
||||
|
||||
bot:
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-bot:3.0.4
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-bot:3.0.5
|
||||
restart: always
|
||||
depends_on:
|
||||
db:
|
||||
@@ -67,7 +67,7 @@ services:
|
||||
retries: 3
|
||||
|
||||
discord:
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.0.4
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.0.5
|
||||
restart: always
|
||||
depends_on:
|
||||
db:
|
||||
@@ -84,7 +84,7 @@ services:
|
||||
retries: 3
|
||||
|
||||
web:
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-web:3.0.4
|
||||
image: git.codeanddice.ru/toutsu/gmrelay-web:3.0.5
|
||||
restart: always
|
||||
depends_on:
|
||||
db:
|
||||
|
||||
Reference in New Issue
Block a user