fix: заменил сообщение на реакцию
This commit is contained in:
@@ -44,6 +44,7 @@ public sealed class MessageHandler
|
|||||||
public async Task HandleAsync(Message message, CancellationToken ct)
|
public async Task HandleAsync(Message message, CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (message.From is null) return;
|
if (message.From is null) return;
|
||||||
|
if (message.Chat.Type != ChatType.Private) return;
|
||||||
|
|
||||||
await _mediator.Send(new EnsureUserCommand(
|
await _mediator.Send(new EnsureUserCommand(
|
||||||
message.From.Id,
|
message.From.Id,
|
||||||
@@ -62,7 +63,7 @@ public sealed class MessageHandler
|
|||||||
|
|
||||||
if (source is not null || mediaType == MediaType.Text)
|
if (source is not null || mediaType == MediaType.Text)
|
||||||
{
|
{
|
||||||
await SaveSingleItemAsync(message.From.Id, message.Chat.Id,
|
await SaveSingleItemAsync(message.From.Id, message.Chat.Id, message.MessageId,
|
||||||
source, mediaType,
|
source, mediaType,
|
||||||
message.Caption ?? message.Text, ct);
|
message.Caption ?? message.Text, ct);
|
||||||
}
|
}
|
||||||
@@ -139,7 +140,7 @@ public sealed class MessageHandler
|
|||||||
// ── Одиночный элемент ─────────────────────────────────────────────────────
|
// ── Одиночный элемент ─────────────────────────────────────────────────────
|
||||||
|
|
||||||
private async Task SaveSingleItemAsync(
|
private async Task SaveSingleItemAsync(
|
||||||
long ownerId, long chatId,
|
long ownerId, long chatId, int messageId,
|
||||||
MediaSource? source, MediaType mediaType,
|
MediaSource? source, MediaType mediaType,
|
||||||
string? rawText,
|
string? rawText,
|
||||||
CancellationToken ct)
|
CancellationToken ct)
|
||||||
@@ -156,9 +157,10 @@ public sealed class MessageHandler
|
|||||||
|
|
||||||
_logger.LogInformation("Saved {Type} for user {UserId}, item {ItemId}", mediaType, ownerId, id);
|
_logger.LogInformation("Saved {Type} for user {UserId}, item {ItemId}", mediaType, ownerId, id);
|
||||||
|
|
||||||
await _bot.SendMessage(
|
await _bot.SetMessageReaction(
|
||||||
chatId,
|
chatId,
|
||||||
$"✅ Сохранено!\nТеги: {(tags.Count > 0 ? string.Join(", ", tags.Select(t => "#" + t)) : "нет")}",
|
messageId,
|
||||||
|
[new ReactionTypeEmoji { Emoji = "👍" }],
|
||||||
cancellationToken: ct);
|
cancellationToken: ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user