[Fix] SocketApplicationCommand missing GuildId (#3063)
This commit is contained in:
@@ -1048,7 +1048,7 @@ namespace Discord.WebSocket
|
|||||||
{
|
{
|
||||||
var model = await InteractionHelper.CreateGuildCommandAsync(Discord, Id, properties, options);
|
var model = await InteractionHelper.CreateGuildCommandAsync(Discord, Id, properties, options);
|
||||||
|
|
||||||
var entity = Discord.State.GetOrAddCommand(model.Id, (id) => SocketApplicationCommand.Create(Discord, model));
|
var entity = Discord.State.GetOrAddCommand(model.Id, (id) => SocketApplicationCommand.Create(Discord, model, Id));
|
||||||
|
|
||||||
entity.Update(model);
|
entity.Update(model);
|
||||||
|
|
||||||
@@ -1068,7 +1068,7 @@ namespace Discord.WebSocket
|
|||||||
{
|
{
|
||||||
var models = await InteractionHelper.BulkOverwriteGuildCommandsAsync(Discord, Id, properties, options);
|
var models = await InteractionHelper.BulkOverwriteGuildCommandsAsync(Discord, Id, properties, options);
|
||||||
|
|
||||||
var entities = models.Select(x => SocketApplicationCommand.Create(Discord, x));
|
var entities = models.Select(x => SocketApplicationCommand.Create(Discord, x, Id));
|
||||||
|
|
||||||
Discord.State.PurgeCommands(x => !x.IsGlobalCommand && x.Guild.Id == Id);
|
Discord.State.PurgeCommands(x => !x.IsGlobalCommand && x.Guild.Id == Id);
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ namespace Discord.WebSocket
|
|||||||
|
|
||||||
IntegrationTypes = model.IntegrationTypes.GetValueOrDefault(null)?.ToImmutableArray();
|
IntegrationTypes = model.IntegrationTypes.GetValueOrDefault(null)?.ToImmutableArray();
|
||||||
ContextTypes = model.ContextTypes.GetValueOrDefault(null)?.ToImmutableArray();
|
ContextTypes = model.ContextTypes.GetValueOrDefault(null)?.ToImmutableArray();
|
||||||
|
|
||||||
|
if (model.GuildId.IsSpecified)
|
||||||
|
GuildId = model.GuildId.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
Reference in New Issue
Block a user