fix: get thread parent from API instead of cache for cross-cluster message edit

This commit is contained in:
spiral 2022-03-31 07:23:31 -04:00
parent 6a213fa694
commit e0ed5b528e
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -86,11 +86,14 @@ public class WebhookExecutorService
};
ulong? threadId = null;
var root = await _cache.GetRootChannel(channelId);
if (root.Id != channelId)
var channel = await _cache.GetOrFetchChannel(_rest, channelId);
if (channel.IsThread())
{
threadId = channelId;
channelId = channel.ParentId.Value;
}
var webhook = await _webhookCache.GetWebhook(root.Id);
var webhook = await _webhookCache.GetWebhook(channelId);
return await _rest.EditWebhookMessage(webhook.Id, webhook.Token, messageId,
new WebhookMessageEditRequest { Content = newContent, AllowedMentions = allowedMentions },