Added feature to track messages sent by the bot by reference so they can be edited

This commit is contained in:
barelyprofessional
2024-08-11 21:11:37 +08:00
parent 2c54ca30dd
commit c0d7f62c61
3 changed files with 129 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
namespace KfChatDotNetBot.Models;
public class SentMessageTrackerModel
{
// Unique GUID for each message
public required string Reference { get; set; }
public required string Message { get; set; }
public required SentMessageTrackerStatus Status { get; set; }
public int? ChatMessageId { get; set; }
// Timespan from when the message was sent until we saw it come back
public TimeSpan? Delay { get; set; }
public DateTimeOffset? SentAt { get; set; }
}
public enum SentMessageTrackerStatus
{
WaitingForResponse,
ResponseReceived,
// If the bot is blocked from sending the message, e.g. due to suppress chat messages being enabled
NotSending,
// Shouldn't happen normally, it's just set before the bot has made a decision on whether to send or not,
Unknown
}