chore: init commit from GitHub
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.Text;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
using Telegram.Bot.Types.Enums;
|
||||
|
||||
namespace TelegramBot.Commands.CommandMessages;
|
||||
|
||||
public class ChangelogCommandMessage : CommandMessage
|
||||
{
|
||||
public const string CommandName = "/changelog";
|
||||
public override async Task InvokeFromMessage(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)
|
||||
{
|
||||
var text = new StringBuilder();
|
||||
foreach (var log in Program.Config.Changelog)
|
||||
{
|
||||
text.Append($"Нововведения от <b>{log.Date}</b>:\n\n{log.Caption}\n\n");
|
||||
}
|
||||
await botClient.SendTextMessageAsync(update.Message?.Chat!, text.ToString(), cancellationToken: cancellationToken, parseMode: ParseMode.Html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user