using Kruzya.TelegramBot.Core.Extensions;
using Telegram.Bot;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
namespace West.TelegramBot.ChatManagement;
public class Notifier
{
public static async void WarnNotify(ITelegramBotClient bot, Chat chat, User from, User to, int count, bool isBanned = false)
{
await bot.SendTextMessageAsync(chat.Id, $"{to.ToHtml()}, Вам выдано предупреждение! " +
$"Текущее кол-во: {count}/3",
disableNotification: true,
parseMode: ParseMode.Html);
if (isBanned)
{
await bot.SendTextMessageAsync(
chat.Id,
$"{from.ToHtml()} заблокировал {to.ToHtml()} на 7 дней",
disableNotification: true, parseMode: ParseMode.Html);
}
}
public static async void UnWarnNotify(ITelegramBotClient bot, Chat chat, User from, User to, int count)
{
await bot.SendTextMessageAsync(chat.Id,
$"{to.ToHtml()}, с Вас снято предупреждение! " +
$"Текущее кол-во: {count}/3",
disableNotification: true,
parseMode: ParseMode.Html);
}
}