|
@@ -26,7 +26,6 @@ namespace Discord.Rest |
|
|
public RestUserMessage Message { get; private set; } |
|
|
public RestUserMessage Message { get; private set; } |
|
|
|
|
|
|
|
|
private object _lock = new object(); |
|
|
private object _lock = new object(); |
|
|
internal override bool _hasResponded { get; set; } = false; |
|
|
|
|
|
|
|
|
|
|
|
internal RestMessageComponent(BaseDiscordClient client, Model model) |
|
|
internal RestMessageComponent(BaseDiscordClient client, Model model) |
|
|
: base(client, model.Id) |
|
|
: base(client, model.Id) |
|
@@ -128,15 +127,12 @@ namespace Discord.Rest |
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
lock (_lock) |
|
|
{ |
|
|
{ |
|
|
if (_hasResponded) |
|
|
|
|
|
|
|
|
if (HasResponded) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("Cannot respond, update, or defer twice to the same interaction"); |
|
|
throw new InvalidOperationException("Cannot respond, update, or defer twice to the same interaction"); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
|
|
|
{ |
|
|
|
|
|
_hasResponded = true; |
|
|
|
|
|
|
|
|
HasResponded = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return SerializePayload(response); |
|
|
return SerializePayload(response); |
|
@@ -223,15 +219,12 @@ namespace Discord.Rest |
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
lock (_lock) |
|
|
{ |
|
|
{ |
|
|
if (_hasResponded) |
|
|
|
|
|
|
|
|
if (HasResponded) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("Cannot respond, update, or defer twice to the same interaction"); |
|
|
throw new InvalidOperationException("Cannot respond, update, or defer twice to the same interaction"); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
|
|
|
{ |
|
|
|
|
|
_hasResponded = true; |
|
|
|
|
|
|
|
|
HasResponded = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return SerializePayload(response); |
|
|
return SerializePayload(response); |
|
@@ -408,15 +401,12 @@ namespace Discord.Rest |
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
lock (_lock) |
|
|
{ |
|
|
{ |
|
|
if (_hasResponded) |
|
|
|
|
|
|
|
|
if (HasResponded) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("Cannot respond or defer twice to the same interaction"); |
|
|
throw new InvalidOperationException("Cannot respond or defer twice to the same interaction"); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
|
|
|
{ |
|
|
|
|
|
_hasResponded = true; |
|
|
|
|
|
|
|
|
HasResponded = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return SerializePayload(response); |
|
|
return SerializePayload(response); |
|
@@ -445,15 +435,12 @@ namespace Discord.Rest |
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
lock (_lock) |
|
|
{ |
|
|
{ |
|
|
if (_hasResponded) |
|
|
|
|
|
|
|
|
if (HasResponded) |
|
|
{ |
|
|
{ |
|
|
throw new InvalidOperationException("Cannot respond or defer twice to the same interaction"); |
|
|
throw new InvalidOperationException("Cannot respond or defer twice to the same interaction"); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lock (_lock) |
|
|
|
|
|
{ |
|
|
|
|
|
_hasResponded = true; |
|
|
|
|
|
|
|
|
HasResponded = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return SerializePayload(response); |
|
|
return SerializePayload(response); |
|
|