mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
start working on custom chat handlers
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Kruzya.TelegramBot.Core.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kruzya.TelegramBot.CustomChatAddOns.Data
|
||||
{
|
||||
[AllowedSerializableType("pong")]
|
||||
public class Pong
|
||||
{
|
||||
[JsonProperty("confirmation")]
|
||||
public string Confirmation { get; set; } = Guid.NewGuid().ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user