From e2ac7975a526d5523f6b6b4e1e89ad1e57f0d6cb Mon Sep 17 00:00:00 2001 From: FlorianDahn Date: Sat, 19 Mar 2022 04:22:07 +0100 Subject: [PATCH] Updating example projects to .NET 6 and latest framework. --- Examples/AsyncFormUpdates/App.config | 14 +++++++++++--- .../AsyncFormUpdates/AsyncFormUpdates.csproj | 17 ++++++++++++----- Examples/AsyncFormUpdates/Program.cs | 7 +++++-- Examples/AsyncFormUpdates/packages.config | 6 ++++-- Examples/JoinHiderBot/JoinHiderBot.csproj | 4 ++-- Examples/JoinHiderBot/Program.cs | 5 ++++- Examples/SystemCommandsBot/Program.cs | 5 ++++- .../SystemCommandsBot/SystemCommandsBot.csproj | 6 +++--- TelegramBotFramework.sln | 13 ++++++++++--- 9 files changed, 55 insertions(+), 22 deletions(-) diff --git a/Examples/AsyncFormUpdates/App.config b/Examples/AsyncFormUpdates/App.config index 56efbc7..436e44f 100644 --- a/Examples/AsyncFormUpdates/App.config +++ b/Examples/AsyncFormUpdates/App.config @@ -1,6 +1,14 @@ - + - + - \ No newline at end of file + + + + + + + + + diff --git a/Examples/AsyncFormUpdates/AsyncFormUpdates.csproj b/Examples/AsyncFormUpdates/AsyncFormUpdates.csproj index 212f87e..5c48fb5 100644 --- a/Examples/AsyncFormUpdates/AsyncFormUpdates.csproj +++ b/Examples/AsyncFormUpdates/AsyncFormUpdates.csproj @@ -8,10 +8,11 @@ Exe AsyncFormUpdates AsyncFormUpdates - v4.7.2 + v4.8 512 true true + AnyCPU @@ -33,19 +34,25 @@ 4 - - ..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + - - ..\..\packages\Telegram.Bot.15.7.1\lib\net45\Telegram.Bot.dll + + ..\..\packages\Telegram.Bot.17.0.0\lib\netstandard2.0\Telegram.Bot.dll diff --git a/Examples/AsyncFormUpdates/Program.cs b/Examples/AsyncFormUpdates/Program.cs index f249391..b12cb83 100644 --- a/Examples/AsyncFormUpdates/Program.cs +++ b/Examples/AsyncFormUpdates/Program.cs @@ -4,18 +4,21 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Timers; +using TelegramBotBase.Builder; namespace AsyncFormUpdates { class Program { - static TelegramBotBase.BotBase bot = null; + static TelegramBotBase.BotBase bot = null; static void Main(string[] args) { String apiKey = "APIKey"; - bot = new TelegramBotBase.BotBase(apiKey); + bot = BotBaseBuilder.Create() + .QuickStart(apiKey) + .Build(); bot.Start(); diff --git a/Examples/AsyncFormUpdates/packages.config b/Examples/AsyncFormUpdates/packages.config index e25dbb0..e9dd729 100644 --- a/Examples/AsyncFormUpdates/packages.config +++ b/Examples/AsyncFormUpdates/packages.config @@ -1,6 +1,8 @@  - + - + + + \ No newline at end of file diff --git a/Examples/JoinHiderBot/JoinHiderBot.csproj b/Examples/JoinHiderBot/JoinHiderBot.csproj index 1c137aa..aa8f8d7 100644 --- a/Examples/JoinHiderBot/JoinHiderBot.csproj +++ b/Examples/JoinHiderBot/JoinHiderBot.csproj @@ -2,11 +2,11 @@ Exe - netcoreapp3.1 + net6.0 - + diff --git a/Examples/JoinHiderBot/Program.cs b/Examples/JoinHiderBot/Program.cs index e3c2ec5..d2d05fe 100644 --- a/Examples/JoinHiderBot/Program.cs +++ b/Examples/JoinHiderBot/Program.cs @@ -1,4 +1,5 @@ using System; +using TelegramBotBase.Builder; namespace JoinHiderBot { @@ -9,7 +10,9 @@ namespace JoinHiderBot String apiKey = ""; - var bot = new TelegramBotBase.BotBase(apiKey); + var bot = BotBaseBuilder.Create() + .QuickStart(apiKey) + .Build(); bot.Start(); diff --git a/Examples/SystemCommandsBot/Program.cs b/Examples/SystemCommandsBot/Program.cs index efe0e93..17ff8b7 100644 --- a/Examples/SystemCommandsBot/Program.cs +++ b/Examples/SystemCommandsBot/Program.cs @@ -1,4 +1,5 @@ using System; +using TelegramBotBase.Builder; namespace SystemCommandsBot { @@ -19,7 +20,9 @@ namespace SystemCommandsBot return; } - var bot = new TelegramBotBase.BotBase(BotConfig.ApiKey); + var bot = BotBaseBuilder.Create() + .QuickStart(BotConfig.ApiKey) + .Build(); bot.Start(); diff --git a/Examples/SystemCommandsBot/SystemCommandsBot.csproj b/Examples/SystemCommandsBot/SystemCommandsBot.csproj index c47ad1b..4e20f6a 100644 --- a/Examples/SystemCommandsBot/SystemCommandsBot.csproj +++ b/Examples/SystemCommandsBot/SystemCommandsBot.csproj @@ -2,12 +2,12 @@ Exe - netcoreapp3.1 + net6.0 - - + + diff --git a/TelegramBotFramework.sln b/TelegramBotFramework.sln index 326160e..a4b6c21 100644 --- a/TelegramBotFramework.sln +++ b/TelegramBotFramework.sln @@ -14,11 +14,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{BFA71E3F-31C0-4FC1-A320-4DCF704768C5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCommandsBot", "Examples\SystemCommandsBot\SystemCommandsBot.csproj", "{FC484952-3060-4F87-9809-4CD66D6961C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemCommandsBot", "Examples\SystemCommandsBot\SystemCommandsBot.csproj", "{FC484952-3060-4F87-9809-4CD66D6961C0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoinHiderBot", "Examples\JoinHiderBot\JoinHiderBot.csproj", "{E804B9E5-7ACC-49D3-9253-806766C1D9A5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JoinHiderBot", "Examples\JoinHiderBot\JoinHiderBot.csproj", "{E804B9E5-7ACC-49D3-9253-806766C1D9A5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelegramBotBase.Extensions.Images", "TelegramBotBase.Extensions.Images\TelegramBotBase.Extensions.Images.csproj", "{B5DDFA45-0E01-46A5-B67D-541300CDD606}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelegramBotBase.Extensions.Images", "TelegramBotBase.Extensions.Images\TelegramBotBase.Extensions.Images.csproj", "{B5DDFA45-0E01-46A5-B67D-541300CDD606}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncFormUpdates", "Examples\AsyncFormUpdates\AsyncFormUpdates.csproj", "{673A56F5-6110-4AED-A68D-562FD6ED3EA6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -46,6 +48,10 @@ Global {B5DDFA45-0E01-46A5-B67D-541300CDD606}.Debug|Any CPU.Build.0 = Debug|Any CPU {B5DDFA45-0E01-46A5-B67D-541300CDD606}.Release|Any CPU.ActiveCfg = Release|Any CPU {B5DDFA45-0E01-46A5-B67D-541300CDD606}.Release|Any CPU.Build.0 = Release|Any CPU + {673A56F5-6110-4AED-A68D-562FD6ED3EA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {673A56F5-6110-4AED-A68D-562FD6ED3EA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {673A56F5-6110-4AED-A68D-562FD6ED3EA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {673A56F5-6110-4AED-A68D-562FD6ED3EA6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -53,6 +59,7 @@ Global GlobalSection(NestedProjects) = preSolution {FC484952-3060-4F87-9809-4CD66D6961C0} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5} {E804B9E5-7ACC-49D3-9253-806766C1D9A5} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5} + {673A56F5-6110-4AED-A68D-562FD6ED3EA6} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {59CB40E1-9FA7-4867-A56F-4F418286F057}