Migrate to Telegram.Bot v22 and some minor improvements

This commit is contained in:
2024-11-05 17:25:29 +03:30
parent 0830847336
commit 51747b3e3d
11 changed files with 53 additions and 31 deletions

View File

@@ -14,7 +14,7 @@ public class HandleDbBackup
logger?.LogInformation("Backup requested");
await using Stream stream = System.IO.File.OpenRead("./" + dbname+".json");
var message = await _bot.SendDocumentAsync(adminId, document: InputFile.FromStream(stream, dbname+".json"),
var message = await _bot.SendDocument(adminId, document: InputFile.FromStream(stream, dbname+".json"),
caption: "Backup of " + dbname + "\nCreated at " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss" + "\nCurrent post count: " + _db.AsQueryable().Count()), parseMode: ParseMode.Html);
logger?.LogInformation("Backup sent");