start working on custom chat handlers

This commit is contained in:
2024-05-29 00:28:17 +03:00
parent 920148e05b
commit 621ce7fbce
7 changed files with 154 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
using Kruzya.TelegramBot.Core.Attributes;
using Newtonsoft.Json;
using Telegram.Bot.Types;
namespace Kruzya.TelegramBot.CustomChatAddOns.Data
{
[AllowedSerializableType("ping")]
public class Ping
{
[JsonProperty("chat_id")]
public long ChatId { get; set; }
[JsonProperty("user_id")]
public long UserId { get; set; }
[JsonProperty("confirmation")]
public string Confirmation { get; set; } = Guid.NewGuid().ToString();
public Ping From(Message message) => new() {
ChatId = message.Chat.Id,
UserId = message.From!.Id
};
}
}