Compare commits

...
127 Commits
Author SHA1 Message Date
Florian Zevedei 396a524d94 BotBaseBuilder fix 2024-03-10 16:01:45 +01:00
Florian Zevedei 2db8e2cf63 Merge pull request #63 from MajMcCloud/development
Integrating latest developments into master branch
2024-03-10 15:51:29 +01:00
Florian Zevedei 6b7f2ca273 Merge branch 'master' into development 2024-03-10 15:50:42 +01:00
Florian Zevedei 31d0d9890d Merge pull request #61 from ramax495/RuLocalization
Fix typo
2024-01-31 14:15:44 +01:00
ramax495 b252829296 Fix typo 2024-01-31 10:01:13 +03:00
Florian Zevedei a483bc7c0b Update Russian.cs 2024-01-30 21:57:05 +01:00
Florian Zevedei 4635a96fc7 Removing old comments 2024-01-30 19:24:13 +01:00
Florian Zevedei 727375f7aa Localization fixes 2024-01-30 19:15:11 +01:00
Florian Zevedei 86792af214 Fixing incorrect behaviour with tags 2024-01-30 18:27:48 +01:00
Florian Zevedei b3edb95b55 Adding new total tag and checked tag count 2024-01-30 18:27:05 +01:00
Florian Zevedei 946420f9c6 Fixing InlineKeyboard use
- tags cant be change when using InlineKeyboard mode
2024-01-30 18:26:40 +01:00
Florian Zevedei c8c56a42c0 Bugfix for TaggedButtonGrid 2024-01-30 18:24:31 +01:00
Florian Zevedei 6f930eee8c Adding new constructor and additonal ToRowList method to ButtonForm 2024-01-30 18:23:29 +01:00
Florian Zevedei c4a589d476 Renaming TaggedButtonGrid specific localizations 2024-01-30 18:23:02 +01:00
Florian Zevedei 1b14b7b3cf Adding missing localization to german file 2024-01-30 18:21:25 +01:00
Florian Zevedei cb5fa35269 Fix #60 2024-01-30 16:07:08 +01:00
Florian Zevedei f60e1000c3 Changing datatype of port from string to int 2024-01-30 15:08:40 +01:00
Florian Zevedei 00dafd59a3 Update README.md 2024-01-30 14:47:52 +01:00
Florian Zevedei 848b5d29cf Add missing Russian localization due to PR #58 2024-01-30 14:47:23 +01:00
Florian Zevedei 9cac57b8e7 Update README.md 2024-01-28 19:32:26 +01:00
Florian Zevedei 52517534f8 Update README.md 2024-01-28 19:30:17 +01:00
Florian Zevedei 5e166db243 Adding readme note for IronSoftware extension 2024-01-28 19:25:59 +01:00
Florian Zevedei 71aa0c3d91 Adding nuget references and nuget specs 2024-01-28 19:24:32 +01:00
Florian Zevedei e34c71b42b Update README.md 2024-01-28 19:23:50 +01:00
Florian Zevedei 9927a034b0 First release of IronSoftware drawing extension 2024-01-28 19:22:30 +01:00
Florian Zevedei 2e454d7f5c Removing SQLClient dependency 2024-01-28 19:17:15 +01:00
Florian Zevedei 339319ef2a Update README.md 2024-01-28 18:50:27 +01:00
Florian Zevedei c8b12e9168 Adding credits 2024-01-28 18:49:52 +01:00
Florian Zevedei cbc31b8ff5 adding source path to Readme 2024-01-28 18:48:31 +01:00
Florian Zevedei c514ede03f Adding PostgreSQL extension to Readme 2024-01-28 18:45:17 +01:00
Florian Zevedei c91fbaa16c Downgrade target framework to.NET 6 2024-01-28 18:39:56 +01:00
Florian Zevedei b8125e9aed Merge pull request #58 from Kataane/add-postgresql-serializer
Add PostgreSQL serializer
2024-01-28 18:34:15 +01:00
Florian Zevedei d4af8797fb Add new PostgreSQL extension to solution file 2024-01-28 02:16:55 +01:00
Florian Zevedei 93fda551e1 Merge pull request #57 from Kataane/master
Russian translation added
2024-01-28 02:04:13 +01:00
Kataane b14913362e Update README.md 2024-01-27 13:21:46 +07:00
Kataanee 8b22fd7b74 Fast fix 2024-01-27 13:16:27 +07:00
Kataanee 254c002d4a Add Russian in ILanguageSelectionStage 2024-01-27 13:14:15 +07:00
Kataanee a632440efd Add PostgreSQL serializer 2024-01-26 18:48:43 +07:00
Kataanee 194d8ba317 Revert "Russian translation added"
This reverts commit d833b1e088.
2024-01-26 18:46:49 +07:00
Kataanee d833b1e088 Russian translation added 2024-01-26 12:42:41 +07:00
Florian Zevedei 084395e962 Bugfix, adding missing DeviceSession to UpdateResult 2024-01-24 22:15:16 +01:00
Florian Zevedei b20b3b2826 Bugfix, adding missing DeviceSession to UpdateResult 2024-01-24 22:12:26 +01:00
Florian Zevedei c1d1d5f543 Fix, add missing ThrowPendingUpdates 2024-01-24 17:48:25 +01:00
Florian Zevedei 078bdfb163 Making cancellationTokenSource protected 2024-01-24 17:43:44 +01:00
Florian Zevedei 94c680e036 Timeout fixes
- Fixing wrong timeout setter
- removing timeout setter in "Prepare" method in client which overrides setting
2024-01-24 17:39:18 +01:00
Florian Zevedei dbdc40582a Splitting MessageClient into 2 instances 2024-01-24 03:04:05 +01:00
Florian Zevedei 2d3393aa05 Update README.md 2024-01-17 22:55:11 +01:00
Florian Zevedei fdd814c88e Adding project reference links 2024-01-17 22:54:30 +01:00
Florian Zevedei 2b06fba8ff Adding readme note for IronSoftware extension 2024-01-17 22:51:40 +01:00
Florian Zevedei 8e4bc7a222 Bumps Microsoft.Data.SqlClient from 5.0.0 to 5.1.3. 2024-01-17 22:42:03 +01:00
Florian Zevedei cc4c743721 Merge pull request #56 from MajMcCloud/dependabot/nuget/TelegramBotBase.Extensions.Serializer.Database.MSSQL/Microsoft.Data.SqlClient-5.1.3
Bump Microsoft.Data.SqlClient from 5.0.0 to 5.1.3 in /TelegramBotBase.Extensions.Serializer.Database.MSSQL
2024-01-17 22:41:15 +01:00
dependabot[bot] 4e55fd42d6 Bump Microsoft.Data.SqlClient
Bumps [Microsoft.Data.SqlClient](https://github.com/dotnet/sqlclient) from 5.0.0 to 5.1.3.
- [Release notes](https://github.com/dotnet/sqlclient/releases)
- [Changelog](https://github.com/dotnet/SqlClient/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dotnet/sqlclient/compare/v5.0.0...v5.1.3)

---
updated-dependencies:
- dependency-name: Microsoft.Data.SqlClient
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-16 19:28:47 +00:00
Florian Zevedei deef8dd086 Replacing project references with nuget reference 2024-01-04 14:17:09 +01:00
Florian Zevedei 3aff0aa94b Updating example projects for use of SingleThread/ThreadPool 2024-01-04 14:16:52 +01:00
Florian Zevedei 75064fd64c Adding nuget references and nuget specs 2024-01-04 14:11:21 +01:00
Florian Zevedei 0cafca9aee Update README.md 2024-01-04 13:46:58 +01:00
Florian Zevedei ad40675b87 First release of IronSoftware drawing extension 2024-01-04 13:44:18 +01:00
Florian Zevedei 83e09aec2a Removing System.Drawing.Common dependency 2023-12-29 14:38:11 +01:00
Florian Zevedei 26152ee348 Removing System.Drawing.Common dependency 2023-12-29 14:37:19 +01:00
Florian Zevedei d5ffa914f0 Update README.md 2023-12-28 15:17:43 +01:00
Florian Zevedei a63f71268c Update README.md 2023-12-28 15:17:14 +01:00
Florian Zevedei 7fcaa407ad Adding parallel processing via ThreadPool 2023-12-26 17:40:13 +01:00
Florian Zevedei d56b26a788 Merge pull request #55 from MajMcCloud/development
Integrating development branch into master
2023-12-26 17:32:51 +01:00
Florian Zevedei c1018ac5a0 Adding ThrowPendingUpdates option to builder and Message client. 2023-12-09 14:56:02 +01:00
Florian Zevedei 064399ed77 Replace nuget reference with project for development 2023-12-09 14:54:23 +01:00
Florian Zevedei 121a788c17 Update README.md 2023-12-08 01:52:47 +01:00
Florian Zevedei 40199a1d81 Merge pull request #51 from contributeless/feature/ability-to-log-exceptions-to-any-destination
Added the ReceiveError event to MessageClient to provide the ability to handle exceptions in client code
2023-12-07 17:50:57 +01:00
Florian Zevedei 794dee7f58 improved readability 2023-12-07 17:49:35 +01:00
Florian Zevedei 88309e607b Adding localization notes to Readme file 2023-12-06 15:44:59 +01:00
Florian Zevedei a71eed5054 Merge pull request #54 from MajMcCloud/master
Syncing master and development branch
2023-12-06 15:36:53 +01:00
Florian Zevedei 2a873cc29b Merge pull request #53 from MajMcCloud/development
Integrating development branch into master
2023-12-06 15:23:47 +01:00
Florian Zevedei f401216eff Fixing EditMessage behaviour 2023-12-06 15:19:28 +01:00
Florian Zevedei 0cb4f02a8d Merge pull request #52 from contributeless/fix/get-device-id-from-edited-message
Fix: get chat id from edited message
2023-12-06 15:17:17 +01:00
TCSBANK\e.khudik 62b6bafbd3 Fix: get chat id from edited message 2023-12-05 13:02:53 +03:00
TCSBANK\e.khudik 89332244e3 Added the ReceiveError event to MessageClient to provide the ability to handle exceptions in client code 2023-12-04 15:10:28 +03:00
Florian Zevedei 43f4ab1061 Update README.md 2023-11-26 15:09:42 +01:00
Florian Zevedei 1f438186f4 Merge pull request #50 from MajMcCloud/master
Merging master changes into development branch
2023-11-26 15:08:56 +01:00
Florian Zevedei f447b058d0 Update README.md 2023-11-26 15:08:40 +01:00
Florian Zevedei 40ba9bd8ab Update README.md 2023-11-26 15:07:43 +01:00
Florian Zevedei ca473f78ed Adding /start command handling to test project 2023-11-02 14:52:05 +01:00
Florian Zevedei ab702dbc9f Added missing UsePersian method to interface. 2023-11-01 01:09:35 +01:00
Florian Zevedei 23dc1ff1d6 Merge pull request #48 from mottaghipour/master
[LANGUAGE] implement Persian language class
2023-11-01 01:01:25 +01:00
AmirAbbas e044d725c9 [FEATURE] add UsePersian method to BotBaseBuilder class 2023-10-31 13:25:46 +03:30
AmirAbbas 4825beea7e [FEATURE] implement Persian language class 2023-10-31 13:23:41 +03:30
AmirAbbas 78d65868ff [BASE] Init Persian language class 2023-10-31 13:11:02 +03:30
AmirAbbas d7aca80d59 [REFACTOR] convert language classes to language sealed classes 2023-10-31 13:10:31 +03:30
Florian Zevedei 73863c4154 Adding project files 2023-09-29 18:40:56 +02:00
Florian Zevedei e3b1a32535 Adding missing Program.cs 2023-09-29 18:40:20 +02:00
Florian Zevedei 571049eeb4 Replacing exception text with nameof litteral 2023-09-29 18:34:33 +02:00
Florian Zevedei 30222d640d Adding full DI navigation example for testing purposes.
- adding internal private field into FormBase class
- adding Extension methods into DependencyInjection namespace for use
- adding 2 NavigateTo extension methods for DI using ServiceProvider
- adding example project
- adding to readme as example
2023-09-29 18:34:10 +02:00
Florian Zevedei e6a48115a6 Adding xml comments to BotBase 2023-09-29 18:28:55 +02:00
Florian Zevedei b278015dd4 Replacing static names in exception messages with nameof literal 2023-09-29 18:26:39 +02:00
Florian Zevedei 91e0c54728 Merge pull request #46 from MajMcCloud/development
Migrate development to master
2023-09-16 17:22:01 +02:00
Florian Zevedei 788f935c02 Add latest nuget package instead of local project to extensions 2023-09-16 17:11:40 +02:00
Florian Zevedei d1089fe716 editing Label example project 2023-09-16 17:11:21 +02:00
Florian Zevedei 1d3db0116e Update README.md 2023-09-15 18:52:15 +02:00
Florian Zevedei e95301f727 Update README.md 2023-09-15 18:50:16 +02:00
Florian Zevedei 4ba91803fe Update README.md 2023-09-13 15:13:22 +02:00
Florian Zevedei 9548be4afc Merge pull request #45 from MajMcCloud/development
Integrate development branch into master
2023-09-13 15:01:49 +02:00
Florian Zevedei 30f82cd848 Updating InputFile changes 2023-09-13 14:58:21 +02:00
Florian Zevedei edaa082e93 Renaming label control 2023-09-13 14:51:13 +02:00
Florian Zevedei f99c8ef14c Adding test for ArrayPromptDialog 2023-09-13 14:49:03 +02:00
Florian Zevedei 3817d01836 Removing obsolete code from ArrayPromptDialog 2023-09-13 14:48:48 +02:00
Florian Zevedei 98eba1c5f9 Adding simplified versions for BotBaseBuilder serialization options. 2023-09-12 14:40:12 +02:00
Florian Zevedei d34df46087 Update README.md 2023-09-12 14:27:54 +02:00
Florian Zevedei 95235ea7c7 Updating Readme file and adding links to test project for controls 2023-09-12 14:26:24 +02:00
Florian Zevedei c48ee0a295 Renaming test classes to fit *Form scheme 2023-09-12 14:25:48 +02:00
Florian Zevedei 727d9d5508 Updating project file and version number 2023-09-12 14:15:25 +02:00
Florian Zevedei 89a023e9f0 Delete packages.config 2023-09-12 14:14:58 +02:00
Florian Zevedei 243c9c82a8 Adding new simple label control and example 2023-09-12 14:14:38 +02:00
Florian Zevedei 105ac9fa5b Updating project files 2023-09-12 14:13:17 +02:00
Florian Zevedei 809847ecd4 Fixing some compiler warnings 2023-09-12 14:11:59 +02:00
Florian Zevedei d21a5f8937 Removing Telegram.Bot.Extensions.Polling nuget package 2023-09-10 18:03:33 +02:00
Florian Zevedei f5b441000e Adding Nuget reference to new version 2023-09-10 17:10:41 +02:00
FlorianDahn c7480159c8 Update README.md 2023-09-10 17:04:56 +02:00
FlorianDahn 3b17700ada Create README.md 2023-09-10 17:04:19 +02:00
FlorianDahn f7578384e6 Adding new example project for Inline- and ReplyMarkup combination 2023-09-10 16:58:12 +02:00
FlorianDahn 54e131d852 Fixing copyright 2023-09-09 18:50:13 +02:00
FlorianDahn 0700e1e1ba Fixing class renaming of TelegramBot framework 18 to 19 2023-09-09 18:49:52 +02:00
Florian Zevedei 26182bad55 Merge pull request #44 from MajMcCloud/development
Adding minimal example for WebApplication and TelegramBot side-by-side
2023-09-09 18:33:02 +02:00
FlorianDahn 6369a809b7 Add missing Program.cs file 2023-09-09 18:28:39 +02:00
FlorianDahn 5af308da33 Adding minimal example for WebApplication and TelegramBot side-by-side 2023-09-09 18:28:39 +02:00
FlorianDahn 375362ac46 Add missing Program.cs file 2023-09-09 15:46:13 +02:00
FlorianDahn a4b24d9433 Adding minimal example for WebApplication and TelegramBot side-by-side 2023-09-09 15:41:38 +02:00
FlorianDahn be7d31ca69 Adding Test project to Readme 2023-09-03 17:08:41 +02:00
Florian Zevedei 44cdea43df Update LICENCE.md 2023-08-30 17:39:16 +02:00
Florian Zevedei 5c5b7e7a25 Update README.md 2023-08-30 17:36:14 +02:00
155 changed files with 77080 additions and 226 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TelegramBotBase" Version="5.3.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="BotStuff\Forms\" />
</ItemGroup>
</Project>
@@ -0,0 +1,66 @@
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace BotAndWebApplication.BotStuff
{
public class StartForm : FormBase
{
ButtonGrid? _grid = null;
int MyCounter { get; set; } = 0;
public StartForm()
{
this.Opened += StartForm_Opened;
}
private async Task StartForm_Opened(object sender, EventArgs e)
{
await Device.Send("Welcome to StartForm !");
var form = new ButtonForm();
form.AddButtonRow(new ButtonBase("Increase!", "increase"));
form.AddButtonRow(new ButtonBase("Decrease!", "decrease"));
_grid = new ButtonGrid(form);
_grid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.InlineKeyBoard;
_grid.ButtonClicked += _grid_ButtonClicked;
_grid.Title = $"Increase your counter! (current {MyCounter})";
AddControl(_grid);
}
private Task _grid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
if (e.Button == null || e.Button.Value == null)
return Task.CompletedTask;
switch (e.Button.Value)
{
case "increase":
MyCounter++;
_grid.Title = $"Increase your counter! (current {MyCounter})";
_grid.Updated();
break;
case "decrease":
MyCounter--;
_grid.Title = $"Increase your counter! (current {MyCounter})";
_grid.Updated();
break;
}
return Task.CompletedTask;
}
}
}
@@ -0,0 +1,65 @@
using TelegramBotBase;
using TelegramBotBase.Builder;
namespace BotAndWebApplication.BotStuff.Tasks
{
public class BotBackgroundTask : IHostedService
{
BotBackgroundTask()
{
BotBaseInstance = BotBaseBuilder.Create()
.WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ??
throw new Exception("API_KEY is not set"))
.DefaultMessageLoop()
.WithStartForm<StartForm>()
.NoProxy()
.DefaultCommands()
.NoSerialization()
.UseEnglish()
.Build();
}
public BotBackgroundTask(ILogger<BotBackgroundTask> logger) : this()
{
Logger = logger;
}
public ILogger<BotBackgroundTask>? Logger { get; }
public BotBase BotBaseInstance { get; private set; }
public async Task StartAsync(CancellationToken cancellationToken)
{
if (BotBaseInstance == null)
return;
Logger?.LogInformation("Bot is starting.");
await BotBaseInstance.UploadBotCommands();
await BotBaseInstance.Start();
Logger?.LogInformation("Bot has been started.");
}
public async Task StopAsync(CancellationToken cancellationToken)
{
if (BotBaseInstance == null)
return;
Logger?.LogInformation("Bot will shut down.");
//Let all users know that the bot will shut down.
await BotBaseInstance.SentToAll("Bot will shut down now.");
await BotBaseInstance.Stop();
Logger?.LogInformation("Bot has shutted down.");
}
}
}
@@ -0,0 +1,26 @@
@page
@model ErrorModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace BotAndWebApplication.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
@@ -0,0 +1,10 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace BotAndWebApplication.Pages
{
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
public IndexModel(ILogger<IndexModel> logger)
{
_logger = logger;
}
public void OnGet()
{
}
}
}
@@ -0,0 +1,8 @@
@page
@model PrivacyModel
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace BotAndWebApplication.Pages
{
public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> _logger;
public PrivacyModel(ILogger<PrivacyModel> logger)
{
_logger = logger;
}
public void OnGet()
{
}
}
}
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BotAndWebApplication</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/BotAndWebApplication.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">BotAndWebApplication</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2023 - BotAndWebApplication - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
@@ -0,0 +1,48 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}
@@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
@@ -0,0 +1,3 @@
@using BotAndWebApplication
@namespace BotAndWebApplication.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
+35
View File
@@ -0,0 +1,35 @@
using BotAndWebApplication.BotStuff.Tasks;
internal class Program
{
private static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddHostedService<BotBackgroundTask>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
app.Run();
}
}
@@ -0,0 +1,28 @@
{
"profiles": {
"BotAndWebApplication": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7200;http://localhost:5002"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:34596",
"sslPort": 44396
}
}
}
@@ -0,0 +1,9 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
@@ -0,0 +1,18 @@
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

@@ -0,0 +1,4 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2011-2021 Twitter, Inc.
Copyright (c) 2011-2021 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,427 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
File diff suppressed because one or more lines are too long
@@ -0,0 +1,424 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
direction: ltr ;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v5.1.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
Copyright (c) .NET Foundation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
@@ -0,0 +1,432 @@
// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation'));
} else {
// Browser global
jQuery.validator.unobtrusive = factory(jQuery);
}
}(function ($) {
var $jQval = $.validator,
adapters,
data_validation = "unobtrusiveValidation";
function setValidationValues(options, ruleName, value) {
options.rules[ruleName] = value;
if (options.message) {
options.messages[ruleName] = options.message;
}
}
function splitAndTrim(value) {
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
}
function escapeAttributeValue(value) {
// As mentioned on http://api.jquery.com/category/selectors/
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
}
function getModelPrefix(fieldName) {
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
}
function appendModelPrefix(value, prefix) {
if (value.indexOf("*.") === 0) {
value = value.replace("*.", prefix);
}
return value;
}
function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);
if (replace) {
container.empty();
error.removeClass("input-validation-error").appendTo(container);
}
else {
error.hide();
}
}
function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find("[data-valmsg-summary=true]"),
list = container.find("ul");
if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
$.each(validator.errorList, function () {
$("<li />").html(this.message).appendTo(list);
});
}
}
function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer");
if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer");
if (replace) {
container.empty();
}
}
}
function onReset(event) { // 'this' is the form element
var $form = $(this),
key = '__jquery_unobtrusive_validation_form_reset';
if ($form.data(key)) {
return;
}
// Set a flag that indicates we're currently resetting the form.
$form.data(key, true);
try {
$form.data("validator").resetForm();
} finally {
$form.removeData(key);
}
$form.find(".validation-summary-errors")
.addClass("validation-summary-valid")
.removeClass("validation-summary-errors");
$form.find(".field-validation-error")
.addClass("field-validation-valid")
.removeClass("field-validation-error")
.removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer");
}
function validationInfo(form) {
var $form = $(form),
result = $form.data(data_validation),
onResetProxy = $.proxy(onReset, form),
defaultOptions = $jQval.unobtrusive.options || {},
execInContext = function (name, args) {
var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args);
};
if (!result) {
result = {
options: { // options structure passed to jQuery Validate's validate() method
errorClass: defaultOptions.errorClass || "input-validation-error",
errorElement: defaultOptions.errorElement || "span",
errorPlacement: function () {
onError.apply(form, arguments);
execInContext("errorPlacement", arguments);
},
invalidHandler: function () {
onErrors.apply(form, arguments);
execInContext("invalidHandler", arguments);
},
messages: {},
rules: {},
success: function () {
onSuccess.apply(form, arguments);
execInContext("success", arguments);
}
},
attachValidation: function () {
$form
.off("reset." + data_validation, onResetProxy)
.on("reset." + data_validation, onResetProxy)
.validate(this.options);
},
validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate();
return $form.valid();
}
};
$form.data(data_validation, result);
}
return result;
}
$jQval.unobtrusive = {
adapters: [],
parseElement: function (element, skipAttach) {
/// <summary>
/// Parses a single HTML element for unobtrusive validation attributes.
/// </summary>
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
/// validation to the form. If parsing just this single element, you should specify true.
/// If parsing several elements, you should specify false, and manually attach the validation
/// to the form when you are finished. The default is false.</param>
var $element = $(element),
form = $element.parents("form")[0],
valInfo, rules, messages;
if (!form) { // Cannot do client-side validation without a form
return;
}
valInfo = validationInfo(form);
valInfo.options.rules[element.name] = rules = {};
valInfo.options.messages[element.name] = messages = {};
$.each(this.adapters, function () {
var prefix = "data-val-" + this.name,
message = $element.attr(prefix),
paramValues = {};
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
prefix += "-";
$.each(this.params, function () {
paramValues[this] = $element.attr(prefix + this);
});
this.adapt({
element: element,
form: form,
message: message,
params: paramValues,
rules: rules,
messages: messages
});
}
});
$.extend(rules, { "__dummy__": true });
if (!skipAttach) {
valInfo.attachValidation();
}
},
parse: function (selector) {
/// <summary>
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
/// attribute values.
/// </summary>
/// <param name="selector" type="String">Any valid jQuery selector.</param>
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
// element with data-val=true
var $selector = $(selector),
$forms = $selector.parents()
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
$selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true);
});
$forms.each(function () {
var info = validationInfo(this);
if (info) {
info.attachValidation();
}
});
}
};
adapters = $jQval.unobtrusive.adapters;
adapters.add = function (adapterName, params, fn) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
/// mmmm is the parameter name).</param>
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
/// attributes into jQuery Validate rules and/or messages.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
if (!fn) { // Called with no params, just a function
fn = params;
params = [];
}
this.push({ name: adapterName, params: params, adapt: fn });
return this;
};
adapters.addBool = function (adapterName, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has no parameter values.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, function (options) {
setValidationValues(options, ruleName || adapterName, true);
});
};
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a minimum value.</param>
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a maximum value.</param>
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
/// have both a minimum and maximum value.</param>
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the minimum value. The default is "min".</param>
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the maximum value. The default is "max".</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
var min = options.params.min,
max = options.params.max;
if (min && max) {
setValidationValues(options, minMaxRuleName, [min, max]);
}
else if (min) {
setValidationValues(options, minRuleName, min);
}
else if (max) {
setValidationValues(options, maxRuleName, max);
}
});
};
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has a single value.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
/// The default is "val".</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [attribute || "val"], function (options) {
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
});
};
$jQval.addMethod("__dummy__", function (value, element, params) {
return true;
});
$jQval.addMethod("regex", function (value, element, params) {
var match;
if (this.optional(element)) {
return true;
}
match = new RegExp(params).exec(value);
return (match && (match.index === 0) && (match[0].length === value.length));
});
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
var match;
if (nonalphamin) {
match = value.match(/\W/g);
match = match && match.length >= nonalphamin;
}
return match;
});
if ($jQval.methods.extension) {
adapters.addSingleVal("accept", "mimtype");
adapters.addSingleVal("extension", "extension");
} else {
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
// validating the extension, and ignore mime-type validations as they are not supported.
adapters.addSingleVal("extension", "extension", "accept");
}
adapters.addSingleVal("regex", "pattern");
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
adapters.add("equalto", ["other"], function (options) {
var prefix = getModelPrefix(options.element.name),
other = options.params.other,
fullOtherName = appendModelPrefix(other, prefix),
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
setValidationValues(options, "equalTo", element);
});
adapters.add("required", function (options) {
// jQuery Validate equates "required" with "mandatory" for checkbox elements
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
setValidationValues(options, "required", true);
}
});
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
var value = {
url: options.params.url,
type: options.params.type || "GET",
data: {}
},
prefix = getModelPrefix(options.element.name);
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
var paramName = appendModelPrefix(fieldName, prefix);
value.data[paramName] = function () {
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
// For checkboxes and radio buttons, only pick up values from checked fields.
if (field.is(":checkbox")) {
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
}
else if (field.is(":radio")) {
return field.filter(":checked").val() || '';
}
return field.val();
};
});
setValidationValues(options, "remote", value);
});
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
if (options.params.min) {
setValidationValues(options, "minlength", options.params.min);
}
if (options.params.nonalphamin) {
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
}
if (options.params.regex) {
setValidationValues(options, "regex", options.params.regex);
}
});
adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions);
});
$(function () {
$jQval.unobtrusive.parse(document);
});
return $jQval.unobtrusive;
}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
The MIT License (MIT)
=====================
Copyright Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore;
namespace DependencyInjection.Database;
public class BotDbContext : DbContext
{
public BotDbContext(DbContextOptions options) : base(options)
{
}
public DbSet<User> Users { get; set; }
}
@@ -0,0 +1,7 @@
namespace DependencyInjection.Database;
public class User
{
public long Id { get; set; }
public string LastMessage { get; set; }
}
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.11" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TelegramBotBase\TelegramBotBase.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,67 @@
using DependencyInjection.Database;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Form;
using TelegramBotBase.DependencyInjection;
namespace DependencyInjection.Forms
{
public class ConfirmationForm : FormBase
{
private readonly BotDbContext _dbContext;
public ConfirmationForm(BotDbContext dbContext)
{
_dbContext = dbContext;
}
public override async Task Load(MessageResult message)
{
var user = await _dbContext.Users.FindAsync(Device.DeviceId);
if (user == null)
{
await this.NavigateTo<StartForm>();
return;
}
}
public override async Task Action(MessageResult message)
{
await message.ConfirmAction("Go back");
switch (message.RawData)
{
case "back":
await this.NavigateTo<StartForm>();
break;
}
}
public override async Task Render(MessageResult message)
{
var user = await _dbContext.Users.FindAsync(Device.DeviceId);
if (user == null)
return;
var bf = new ButtonForm();
bf.AddButtonRow("Back", "back");
await Device.Send($"ConfirmationForm: Your last message was: {user.LastMessage}. Click \"Back\" to get back.", bf);
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using DependencyInjection.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using TelegramBotBase.Builder;
namespace DependencyInjection
{
internal class Program
{
static async Task Main(string[] args)
{
var serviceCollection = new ServiceCollection()
.AddDbContext<BotDbContext>(x => x.UseInMemoryDatabase("TelegramBotBase"));
var serviceProvider = serviceCollection.BuildServiceProvider();
var bot = BotBaseBuilder.Create()
.WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ??
throw new Exception("API_KEY is not set"))
.DefaultMessageLoop()
.WithServiceProvider<StartForm>(serviceProvider)
.NoProxy()
.NoCommands()
.NoSerialization()
.DefaultLanguage()
.UseSingleThread()
.Build();
await bot.Start();
await Task.Delay(-1);
}
}
}
+79
View File
@@ -0,0 +1,79 @@
using DependencyInjection.Database;
using DependencyInjection.Forms;
using TelegramBotBase.Base;
using TelegramBotBase.Form;
using TelegramBotBase.DependencyInjection;
namespace DependencyInjection;
public class StartForm : FormBase
{
private readonly BotDbContext _dbContext;
public StartForm(BotDbContext dbContext)
{
_dbContext = dbContext;
}
public override async Task Load(MessageResult message)
{
var user = await _dbContext.Users.FindAsync(Device.DeviceId);
if (user is null)
{
user = new User
{
Id = Device.DeviceId,
LastMessage = "<unknown>"
};
_dbContext.Users.Add(user);
await _dbContext.SaveChangesAsync();
}
if (message.IsAction)
return;
user.LastMessage = string.IsNullOrWhiteSpace(message.MessageText) ? "<unknown>" : message.MessageText;
await _dbContext.SaveChangesAsync();
}
public override async Task Action(MessageResult message)
{
await message.ConfirmAction("Ok");
switch(message.RawData)
{
case "open":
await this.NavigateTo(typeof(ConfirmationForm));
var new_form = await this.NavigateTo<ConfirmationForm>();
if (new_form == null)
{
await Device.Send("Cant open ConfirmationForm");
}
break;
}
}
public override async Task Render(MessageResult message)
{
var user = await _dbContext.Users.FindAsync(Device.DeviceId);
if (user == null)
return;
var bf = new ButtonForm();
bf.AddButtonRow("Open confirmation", "open");
await Device.Send($"Your last message's text was: `{user.LastMessage}`", bf);
}
}
+1
View File
@@ -18,6 +18,7 @@ var bot = BotBaseBuilder.Create()
.NoCommands()
.NoSerialization()
.DefaultLanguage()
.UseSingleThread()
.Build();
await bot.Start();
@@ -0,0 +1,88 @@
using InlineAndReplyCombination.Forms;
using InlineAndReplyCombination.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Attributes;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Baseclasses
{
public class MultipleChoiceForm : AutoCleanForm
{
[SaveState]
public UserDetails? UserDetails { get; set; }
ButtonGrid? ReplyButtonGrid;
public String ReplyButtonTitle { get; set; } = "Restart";
protected int CurrentStep = 1;
protected int MaxSteps = 3;
public MultipleChoiceForm()
{
this.Init += MultipleChoiceForm_Init;
}
private Task MultipleChoiceForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
//Reply keyboard
var bf = new ButtonForm();
bf.AddButtonRow(ReplyButtonTitle, "replyButtonID");
ReplyButtonGrid = new ButtonGrid(bf);
ReplyButtonGrid.Title = $"Step {CurrentStep} / {MaxSteps}";
ReplyButtonGrid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.ReplyKeyboard;
ReplyButtonGrid.ButtonClicked += ReplyButtonGrid_ButtonClicked;
AddControl(ReplyButtonGrid);
return Task.CompletedTask;
}
private async Task ReplyButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
if (e.Button == null)
return;
switch (e.Button.Value)
{
case "replyButtonID":
await PressReplyButton();
break;
}
}
public virtual Task PressReplyButton()
{
return Task.CompletedTask;
}
public override Task NavigateTo(FormBase newForm, params object[] args)
{
//Move user details over to navigating form
if (newForm is MultipleChoiceForm mcf)
{
mcf.UserDetails = UserDetails;
}
return base.NavigateTo(newForm, args);
}
}
}
@@ -0,0 +1,68 @@
using InlineAndReplyCombination.Baseclasses;
using InlineAndReplyCombination.Forms.Steps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Forms
{
public class StartForm : AutoCleanForm
{
ButtonGrid? buttonGrid;
public StartForm()
{
this.Init += StartForm_Init;
}
private Task StartForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
var bf = new ButtonForm();
bf.AddButtonRow("Start registration", "start");
buttonGrid = new ButtonGrid(bf);
buttonGrid.Title = "Welcome to The InlineAndReplyCombination Bot!";
buttonGrid.ButtonClicked += ButtonGrid_ButtonClicked;
buttonGrid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.ReplyKeyboard;
AddControl(buttonGrid);
return Task.CompletedTask;
}
private async Task ButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
if(e.Button == null)
{
return;
}
switch(e.Button.Value)
{
case "start":
var mf = new MainForm();
mf.UserDetails = new Model.UserDetails();
await NavigateTo(mf);
break;
}
}
}
}
@@ -0,0 +1,96 @@
using InlineAndReplyCombination.Baseclasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Forms.Steps
{
public class MainForm : MultipleChoiceForm
{
ButtonGrid? InlineButtonGrid;
public static List<Tuple<String, String>> AllowedInlineInputs;
static MainForm()
{
AllowedInlineInputs = new List<Tuple<string, string>>()
{
new("< 18", "<18"),
new("18 to 25", "18t25"),
new("25 to 35", "25t35"),
new("35 to 50", "35t50"),
new("over 50", "o50")
};
}
public MainForm()
{
Init += MainForm_Init;
ReplyButtonTitle = "Start over";
CurrentStep = 1;
}
private Task MainForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
//Inline Keyboard
var bf_ages = new ButtonForm();
//Add all options in a single column
bf_ages.AddSplitted(AllowedInlineInputs.Select(a => new ButtonBase(a.Item1, a.Item2)), 1);
bf_ages.AddButtonRow("Some invalid input", "Invalid");
InlineButtonGrid = new ButtonGrid(bf_ages);
InlineButtonGrid.ConfirmationText = "Thank you";
InlineButtonGrid.Title = "Please choose your age:";
InlineButtonGrid.ButtonClicked += InlineButtonGrid_ButtonClicked;
InlineButtonGrid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.InlineKeyBoard;
AddControl(InlineButtonGrid);
return Task.CompletedTask;
}
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
//Not found
if (!AllowedInlineInputs.Any(a => a.Item2 == e.Button.Value))
{
await Device.Send("Invalid input!");
return;
}
if (UserDetails == null)
{
return;
}
UserDetails.AgeRange = e.Button?.Value ?? "unknown";
var sf = new SecondForm();
await NavigateTo(sf);
}
public override async Task PressReplyButton()
{
var sf = new StartForm();
await NavigateTo(sf);
}
}
}
@@ -0,0 +1,95 @@
using InlineAndReplyCombination.Baseclasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Forms.Steps
{
public class SecondForm : MultipleChoiceForm
{
ButtonGrid? InlineButtonGrid;
public static List<Tuple<String, String>> AllowedInlineInputs;
static SecondForm()
{
AllowedInlineInputs = new List<Tuple<string, string>>()
{
new("Green", "green"),
new("Yellow", "yellow"),
new("Red", "red"),
new("Purple", "purple"),
new("Black", "black"),
new("Gold", "gold")
};
}
public SecondForm()
{
Init += SecondForm_Init;
ReplyButtonTitle = "Go back";
CurrentStep = 2;
}
private Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
//Inline Keyboard
var bf_ages = new ButtonForm();
//Add all options in a single column
bf_ages.AddSplitted(AllowedInlineInputs.Select(a => new ButtonBase(a.Item1, a.Item2)), 1);
InlineButtonGrid = new ButtonGrid(bf_ages);
InlineButtonGrid.ConfirmationText = "Thank you";
InlineButtonGrid.Title = "Please choose your favourite color:";
InlineButtonGrid.ButtonClicked += InlineButtonGrid_ButtonClicked;
InlineButtonGrid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.InlineKeyBoard;
AddControl(InlineButtonGrid);
return Task.CompletedTask;
}
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
//Not found
if (!AllowedInlineInputs.Any(a => a.Item2 == e.Button.Value))
{
await Device.Send("Invalid input!");
return;
}
if (UserDetails == null)
{
return;
}
UserDetails.FavouriteColor = e.Button?.Value ?? "unknown";
var tf = new ThirdForm();
await NavigateTo(tf);
}
public override async Task PressReplyButton()
{
var mf = new MainForm();
await NavigateTo(mf);
}
}
}
@@ -0,0 +1,84 @@
using InlineAndReplyCombination.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Attributes;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Forms.Steps
{
public class Summary : AutoCleanForm
{
[SaveState]
public UserDetails? UserDetails { get; set; }
ButtonGrid? ReplyButtonGrid { get; set; }
public Summary()
{
Init += Summary_Init;
}
private Task Summary_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
var bf = new ButtonForm();
bf.AddButtonRow("Go back", "back");
bf.AddButtonRow("Return to Start", "start");
ReplyButtonGrid = new ButtonGrid(bf);
ReplyButtonGrid.Title = "Thank you for your time!";
ReplyButtonGrid.ButtonClicked += ReplyButtonGrid_ButtonClicked;
AddControl(ReplyButtonGrid);
return Task.CompletedTask;
}
public override async Task Load(MessageResult message)
{
if (UserDetails == null)
{
var sf = new StartForm();
await NavigateTo(sf);
return;
}
await Device.Send($"Your inputs are:\r\n\r\nYour age: {UserDetails.AgeRange}\r\nYour favourite color: {UserDetails.FavouriteColor}\r\nYour favourite city: {UserDetails.FavouriteCity}");
}
private async Task ReplyButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
switch (e.Button.Value ?? "")
{
case "start":
var sf = new StartForm();
await NavigateTo(sf);
break;
case "back":
var tf = new ThirdForm();
tf.UserDetails = UserDetails;
await NavigateTo(tf);
break;
}
}
}
}
@@ -0,0 +1,95 @@
using InlineAndReplyCombination.Baseclasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace InlineAndReplyCombination.Forms.Steps
{
public class ThirdForm : MultipleChoiceForm
{
ButtonGrid? InlineButtonGrid;
public static List<Tuple<String, String>> AllowedInlineInputs;
static ThirdForm()
{
AllowedInlineInputs = new List<Tuple<string, string>>()
{
new("Berlin", "Berlin"),
new("Vienna", "Vienna"),
new("Rome", "Rome"),
new("London", "London"),
new("Moscow", "Moscow"),
new("Bukarest", "Bukarest")
};
}
public ThirdForm()
{
Init += SecondForm_Init;
ReplyButtonTitle = "Go back";
CurrentStep = 3;
}
private Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
{
//Inline Keyboard
var bf_ages = new ButtonForm();
//Add all options in a single column
bf_ages.AddSplitted(AllowedInlineInputs.Select(a => new ButtonBase(a.Item1, a.Item2)), 1);
InlineButtonGrid = new ButtonGrid(bf_ages);
InlineButtonGrid.ConfirmationText = "Thank you";
InlineButtonGrid.Title = "Please choose your favourite city:";
InlineButtonGrid.ButtonClicked += InlineButtonGrid_ButtonClicked;
InlineButtonGrid.KeyboardType = TelegramBotBase.Enums.EKeyboardType.InlineKeyBoard;
AddControl(InlineButtonGrid);
return Task.CompletedTask;
}
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
{
//Not found
if (!AllowedInlineInputs.Any(a => a.Item2 == e.Button.Value))
{
await Device.Send("Invalid input!");
return;
}
if (UserDetails == null)
{
return;
}
UserDetails.FavouriteCity = e.Button?.Value ?? "unknown";
var sum = new Summary();
sum.UserDetails = this.UserDetails;
await NavigateTo(sum);
}
public override async Task PressReplyButton()
{
var sf = new SecondForm();
await NavigateTo(sf);
}
}
}
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\TelegramBotBase\TelegramBotBase.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InlineAndReplyCombination.Model
{
[DebuggerDisplay("{AgeRange}, {FavouriteColor}, {FavouriteCity}")]
public class UserDetails
{
public String? AgeRange { get; set; }
public String? FavouriteColor { get; set; }
public String? FavouriteCity { get; set; }
}
}
@@ -0,0 +1,67 @@
using InlineAndReplyCombination.Forms;
using TelegramBotBase;
using TelegramBotBase.Builder;
namespace InlineAndReplyCombination
{
internal class Program
{
public static BotBase? BotBaseInstance { get; private set; }
static async Task Main(string[] args)
{
BotBaseInstance = BotBaseBuilder.Create()
.WithAPIKey(Environment.GetEnvironmentVariable("API_KEY") ??
throw new Exception("API_KEY is not set"))
.DefaultMessageLoop()
.WithStartForm<StartForm>()
.NoProxy()
.DefaultCommands()
.UseJSON(Path.Combine(Directory.GetCurrentDirectory(), "states.json"))
.UseEnglish()
.UseSingleThread()
.Build();
await BotBaseInstance.UploadBotCommands();
BotBaseInstance.BotCommand += BotBaseInstance_BotCommand;
await BotBaseInstance.Start();
Console.WriteLine("Telegram Bot started");
Console.ReadLine();
await BotBaseInstance.Stop();
}
private static async Task BotBaseInstance_BotCommand(object sender, TelegramBotBase.Args.BotCommandEventArgs e)
{
switch(e.Command)
{
case "/start":
var start = new StartForm();
await e.Device.ActiveForm.NavigateTo(start);
break;
}
}
}
}
@@ -0,0 +1,16 @@
# InlineAndReplyCombination Example
Here you got a basic example on how to use Inline buttons and a ReplyMarkup at the same time.
I used 2 ButtonGrid controls for this purpose.
One for the ReplyKeyboard and one for the Inline buttons.
The ReplyKeyboard is within the base [*MultipleChoiceForm*](Baseclasses/MultipleChoiceForm.cs) class just for reusing a bit of code.
You can put it into all single forms as well, if you wish. Works the same.
Session serialization is enabled by default via the JSON serializer.
+2 -2
View File
@@ -1,9 +1,9 @@
The MIT License (MIT)
Copyright (c) 2019 Florian Dahn
Copyright (c) 2023 Florian Zevedei
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+133 -2
View File
@@ -10,10 +10,14 @@
**Support group: [@tgbotbase](https://t.me/tgbotbase)**
**Discord Server: [https://discord.gg/V3PxreDYfE](https://discord.gg/V3PxreDYfE)**
**Releases: [GitHub](https://github.com/MajMcCloud/TelegramBotFramework/releases)**
## Donate
Paypal: [https://paypal.me/majmccloud](https://paypal.me/majmccloud)
Bitcoin: `1GoUJYMwAvBipQTfw2FKydAz12J8RDyeJs` / `bc1qqwlp0p5ley29lsu6jhe0qv7s7963kfc7d0m53d`
Etherium: `0xAf3835104c2C3E5b3e721FA2c7365955e87DB931`
@@ -44,6 +48,7 @@ BitTorrent: `TYVZSykaVT1nKZnz9hjDgBRNB9VavU1bpW`
* [PromptDialog](#prompt-dialog)
* [ConfirmDialog](#confirm-dialog)
- [Controls](#controls)
* [Label](#label)
* [ProgressBar](#progress-bar)
* [CalendarPicker](#calendar-picker)
* [MonthPicker](#month-picker)
@@ -54,6 +59,7 @@ BitTorrent: `TYVZSykaVT1nKZnz9hjDgBRNB9VavU1bpW`
* [TaggedButtonGrid](#tagged-button-grid)
* [CheckedButtonList](#checked-button-list)
* [MultiToggleButton](#multi-toggle-button)
- [Localizations](#localizations)
- [Groups](#groups)
* [SplitterForm](#splitter-form)
* [GroupForm](#group-form)
@@ -72,6 +78,7 @@ BitTorrent: `TYVZSykaVT1nKZnz9hjDgBRNB9VavU1bpW`
* [As of Now](#as-of-now)
* [Usage](#usage)
- [Extensions](#extensions)
- [Test Project](#test-project)
- [Examples](#examples)
---
@@ -633,21 +640,36 @@ await this.NavigateTo(cd);
## Controls
### Label
A minimal control which allows to manage a classic "text" message and update its later without having to keep track of the message id.
<img src=".github/images/label.gif?raw=true" style="width:500px" />
Check the example project [TelegramBotBase.Test/Tests/Controls/LabelForm.cs](TelegramBotBase.Test/Tests/Controls/LabelForm.cs)
### Progress Bar
<img src=".github/images/progressbar.PNG?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/ProgressTest.cs](TelegramBotBase.Test/Tests/ProgressTest.cs)
### Calendar Picker
<img src=".github/images/calendarpicker.PNG?raw=true" />
<img src=".github/images/calendarpicker.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/CalendarPickerForm.cs](TelegramBotBase.Test/Tests/Controls/CalendarPickerForm.cs)
### Month Picker
<img src=".github/images/monthpicker1.PNG?raw=true" />
<img src=".github/images/monthpicker2.PNG?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/MonthPickerForm.cs](TelegramBotBase.Test/Tests/Controls/MonthPickerForm.cs)
### Tree View
<img src=".github/images/treeview1.PNG?raw=true" />
@@ -655,30 +677,58 @@ await this.NavigateTo(cd);
<img src=".github/images/treeview3.PNG?raw=true" />
<img src=".github/images/treeview4.PNG?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/TreeViewForms.cs](TelegramBotBase.Test/Tests/Controls/TreeViewForms.cs)
### Toggle Button
<img src=".github/images/togglebutton.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/ToggleButtonForm.cs](TelegramBotBase.Test/Tests/Controls/ToggleButtonForm.cs)
### Button Grid
<img src=".github/images/buttongrid.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/ButtonGridForm.cs](TelegramBotBase.Test/Tests/Controls/ButtonGridForm.cs)
#### Paging & Searching
<img src=".github/images/buttongrid_pagingfilter.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/ButtonGridPadingForm.cs](TelegramBotBase.Test/Tests/Controls/ButtonGridPagingForm.cs)
### Tagged Button Grid
<img src=".github/images/taggedbuttongrid.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/ButtonGridTagForm.cs](TelegramBotBase.Test/Tests/Controls/ButtonGridTagForm.cs)
### Checked Button List
<img src=".github/images/checkedbuttonlist.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/CheckedButtonListForm.cs](TelegramBotBase.Test/Tests/Controls/CheckedButtonListForm.cs)
### Multi Toggle Button
<img src=".github/images/multitogglebutton.gif?raw=true" />
Check the example project [TelegramBotBase.Test/Tests/Controls/MultiToggleButtonForm.cs](TelegramBotBase.Test/Tests/Controls/MultiToggleButtonForm.cs)
## Localizations
The current available languages for controls are:
- English
- German
- Persian
- Russian
You can add other languages easily by creating a subclass of the [TelegramBotBase/Localizations/Localization.cs](TelegramBotBase/Localizations/Localization.cs) class.
To set the default language set the *Language* property on the static [TelegramBotBase/Localizations/Default.cs](TelegramBotBase/Localizations/Default.cs) instance.
## Groups
For groups, there are multiple different tools which help to work with and allows bot also to manage
@@ -990,6 +1040,8 @@ again at 1 (due to `PopAsync` or `PopToRootAsync` calls) it will replace the con
you
have given to the constructor at the beginning.*
---
## Extensions
### TelegramBotBase.Extensions.Images
@@ -999,7 +1051,43 @@ Extends the base package with some additional image methods like SendPhoto (usin
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Images.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images/)
[![Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Images.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images)
[https://www.nuget.org/packages/TelegramBotBase.Extensions.Images/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images/)
Source code: [TelegramBotBase.Extensions.Images/](/TelegramBotBase.Extensions.Images/)
Nuget package: [https://www.nuget.org/packages/TelegramBotBase.Extensions.Images/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images/)
---
### TelegramBotBase.Extensions.Images.IronSoftware
Extends the base package with some additional image methods like SendPhoto (using Bitmap)
Important: This extension uses the IronSoftware drawing library.
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/)
[![Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware)
[https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/)
Source code: [TelegramBotBase.Extensions.Images.IronSoftware/](TelegramBotBase.Extensions.Images.IronSoftware/)
Nuget package: [https://www.nuget.org/packages/TelegramBotBase.Extensions.IronSoftware/](https://www.nuget.org/packages/TelegramBotBase.Extensions.IronSoftware/)
---
Project: [open source](TelegramBotBase.Extensions.Images/)
### TelegramBotBase.Extensions.Images.IronSoftware
Extends the base package with some additional image methods like SendPhoto (using Bitmap)
Important: This extension uses the IronSoftware drawing library.
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/)
[![Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware)
[https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/)
Project: [open source](TelegramBotBase.Extensions.Images.IronSoftware/)
### TelegramBotBase.Extensions.Serializer.Database.MSSQL
@@ -1008,7 +1096,36 @@ A session serializer for Microsoft SQL Server.
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Serializer.Database.MSSQL.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL/)
[![Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Serializer.Database.MSSQL.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL)
[https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL/)
Source code: [TelegramBotBase.Extensions.Serializer.Database.MSSQL/](/TelegramBotBase.Extensions.Serializer.Database.MSSQL/)
Nuget package: [https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.MSSQL/)
---
### TelegramBotBase.Extensions.Serializer.Database.PostgreSql
A session serializer for PostgreSql Server.
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Serializer.Database.PostgreSql.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.PostgreSql/)
[![Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Serializer.Database.PostgreSql.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.PostgreSql)
Source code: [TelegramBotBase.Extensions.Serializer.Database.PostgreSql/](/TelegramBotBase.Extensions.Serializer.Database.PostgreSql/)
Nuget package: [https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.PostgreSql/](https://www.nuget.org/packages/TelegramBotBase.Extensions.Serializer.Database.PostgreSql/)
Credits: [@Kataane](https://github.com/Kataane)
---
Project: [open source](TelegramBotBase.Extensions.Serializer.Database.MSSQL/)
## Test Project
There is a "TelegramBotBase.Test" project inside the repository which includes minimal examples for all controls available.
Check it out to get a brief overview about all possibilities.
- [TelegramBotBase.Test](TelegramBotBase.Test)
## Examples
@@ -1031,3 +1148,17 @@ When you want to update forms async without any user interaction (message/action
method of BotBase.
- [Examples/AsyncFormUpdates](Examples/AsyncFormUpdates)
Having already a web application and want to add a TelegramBot side-by-side with it running ? Here is an example how you could do it.
- [Examples/BotAndWebApplication](Examples/BotAndWebApplication)
Want to use Inline- and ReplyMarkup at the same time ? Here is an example how you can do that:
- [Examples/InlineAndReplyCombination](Examples/InlineAndReplyCombination)
Alpha: Full Dependency Injection example within this framework.
- [Examples/DependencyInjection](Examples/DependencyInjection)
@@ -0,0 +1,73 @@
using IronSoftware.Drawing;
using SixLabors.ImageSharp;
using System.IO;
using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Form;
using TelegramBotBase.Sessions;
using static IronSoftware.Drawing.AnyBitmap;
using SKImage = SixLabors.ImageSharp.Image;
namespace TelegramBotBase.Extensions.Images.IronSoftware
{
public static class ImageExtensions
{
public static Stream ToStream(this AnyBitmap image, ImageFormat format)
{
var stream = new MemoryStream();
image.ExportStream(stream, format);
stream.Position = 0;
return stream;
}
public static async Task<Stream> ToStream(this SKImage image)
{
var stream = new MemoryStream();
await image.SaveAsPngAsync(stream);
stream.Position = 0;
return stream;
}
/// <summary>
/// Sends an image
/// </summary>
/// <param name="image"></param>
/// <param name="name"></param>
/// <param name="buttons"></param>
/// <param name="replyTo"></param>
/// <param name="disableNotification"></param>
/// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, AnyBitmap image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
using (var fileStream = ToStream(image, ImageFormat.Png))
{
var fts = InputFile.FromStream(fileStream, name);
return await session.SendPhoto(fts, caption, buttons, replyTo, disableNotification);
}
}
/// <summary>
/// Sends an image
/// </summary>
/// <param name="image"></param>
/// <param name="name"></param>
/// <param name="buttons"></param>
/// <param name="replyTo"></param>
/// <param name="disableNotification"></param>
/// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, SKImage image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false)
{
using (var fileStream = await ToStream(image))
{
var fts = InputFile.FromStream(fileStream, name);
return await session.SendPhoto(fts, caption, buttons, replyTo, disableNotification);
}
}
}
}
@@ -0,0 +1,12 @@
# TelegramBotBase.Extensions.Images.IronSoftware
[![NuGet version (TelegramBotBase)](https://img.shields.io/nuget/v/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware/)
[![Telegram chat](https://img.shields.io/badge/Support_Chat-Telegram-blue.svg?style=flat-square)](https://www.t.me/tgbotbase)
[![License](https://img.shields.io/github/license/MajMcCloud/telegrambotframework.svg?style=flat-square&maxAge=2592000&label=License)](https://raw.githubusercontent.com/MajMcCloud/TelegramBotFramework/master/LICENCE.md)
[![Package Downloads](https://img.shields.io/nuget/dt/TelegramBotBase.Extensions.Images.IronSoftware.svg?style=flat-square&label=Package%20Downloads)](https://www.nuget.org/packages/TelegramBotBase.Extensions.Images.IronSoftware)
This extension uses the [IronSoftware](https://ironsoftware.com/open-source/csharp/drawing/docs/) drawing library.
Check [https://ironsoftware.com/open-source/csharp/drawing/docs/](https://ironsoftware.com/open-source/csharp/drawing/docs/) for more details on this library.

Some files were not shown because too many files have changed in this diff Show More