mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
fix: get thread parent from API instead of cache for cross-cluster message edit
This commit is contained in:
parent
6a213fa694
commit
e0ed5b528e
1 changed files with 6 additions and 3 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue