mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Add message editing command
Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
parent
33cabff359
commit
3d624b39e4
9 changed files with 173 additions and 11 deletions
|
|
@ -76,6 +76,18 @@ namespace PluralKit.Bot
|
|||
return webhookMessage;
|
||||
}
|
||||
|
||||
public async Task<Message> EditWebhookMessage(ulong channelId, ulong messageId, string newContent)
|
||||
{
|
||||
var webhook = await _webhookCache.GetWebhook(channelId);
|
||||
var allowedMentions = newContent.ParseMentions() with {
|
||||
Roles = Array.Empty<ulong>(),
|
||||
Parse = Array.Empty<AllowedMentions.ParseType>()
|
||||
};
|
||||
|
||||
return await _rest.EditWebhookMessage(webhook.Id, webhook.Token, messageId,
|
||||
new WebhookMessageEditRequest {Content = newContent, AllowedMentions = allowedMentions});
|
||||
}
|
||||
|
||||
private async Task<Message> ExecuteWebhookInner(Webhook webhook, ProxyRequest req, bool hasRetried = false)
|
||||
{
|
||||
var guild = _cache.GetGuild(req.GuildId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue