added support for .env file and improved validation

This commit is contained in:
2024-09-14 21:34:21 +03:30
parent 2f2ab5f944
commit 77f1a931fd
6 changed files with 67 additions and 31 deletions

View File

@@ -24,7 +24,7 @@ namespace mstdnCats.Services
// Send approve or reject message to admin
foreach (var media in post.MediaAttachments)
{
await _bot.SendPhotoAsync(Environment.GetEnvironmentVariable("ADMIN_NUMID"), media.PreviewUrl, caption: $"<a href=\"" + post.Url + "\"> Mastodon </a>", parseMode: ParseMode.Html
await _bot.SendPhotoAsync(DotNetEnv.Env.GetString("ADMIN_NUMID"), media.PreviewUrl, caption: $"<a href=\"" + post.Url + "\"> Mastodon </a>", parseMode: ParseMode.Html
, replyMarkup: new InlineKeyboardMarkup().AddButton("Approve", $"approve-{media.MediaId}").AddButton("Reject", $"reject-{media.MediaId}"));
}