- moving TelegramBaseTest to TelegramBotBaseTest
This commit is contained in:
parent
b0e6a8b981
commit
48c62e57f8
@ -1,81 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TelegramBotBase;
|
||||
using TelegramBotBase.Form;
|
||||
using TelegramBaseTest.Tests;
|
||||
|
||||
namespace TelegramBaseTest
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
String APIKey = "{YOUR API KEY}";
|
||||
|
||||
BotBase<Start> bb = new BotBase<Start>(APIKey);
|
||||
|
||||
bb.SystemCalls.Add("/start");
|
||||
bb.SystemCalls.Add("/form1");
|
||||
bb.SystemCalls.Add("/form2");
|
||||
bb.SystemCalls.Add("/params");
|
||||
|
||||
bb.SystemCall += async (s, en) =>
|
||||
{
|
||||
switch (en.Command)
|
||||
{
|
||||
case "/start":
|
||||
|
||||
var start = new Start();
|
||||
|
||||
await en.Device.ActiveForm.NavigateTo(start);
|
||||
|
||||
break;
|
||||
case "/form1":
|
||||
|
||||
var form1 = new TestForm();
|
||||
|
||||
await en.Device.ActiveForm.NavigateTo(form1);
|
||||
|
||||
break;
|
||||
|
||||
case "/form2":
|
||||
|
||||
var form2 = new TestForm2();
|
||||
|
||||
await en.Device.ActiveForm.NavigateTo(form2);
|
||||
|
||||
break;
|
||||
|
||||
case "/params":
|
||||
|
||||
String m = en.Parameters.DefaultIfEmpty("").Aggregate((a, b) => a + " and " + b);
|
||||
|
||||
await en.Device.Send("Your parameters are: " + m, replyTo: en.Device.LastMessageId);
|
||||
|
||||
en.Handled = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
bb.Start();
|
||||
|
||||
|
||||
|
||||
Console.WriteLine("Telegram Bot started...");
|
||||
|
||||
Console.WriteLine("Press q to quit application.");
|
||||
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
bb.Stop();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,12 +3,15 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<PackageProjectUrl>https://github.com/MajMcCloud/TelegramBotFramework</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/MajMcCloud/TelegramBotFramework</RepositoryUrl>
|
||||
<PackageReleaseNotes>- moving from .Net Framework 4.7.2 to .Net Standard 2.1 for the Library and .Net Core 3.0 for the test project!</PackageReleaseNotes>
|
||||
<Configurations>Debug;Release;</Configurations>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
|
||||
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
</configuration>
|
||||
@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29324.140
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelegramBotBase", "TelegramBotBase\TelegramBotBase.csproj", "{0BD16FB9-7ED4-4CCB-83EB-5CEE538E1B6C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelegramBaseTest", "TelegramBaseTest\TelegramBaseTest.csproj", "{9BBFA9F7-64A7-4D7D-86FC-812E6D7578B8}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelegramBotBaseTest", "TelegramBotBaseTest\TelegramBotBaseTest.csproj", "{88EC0E02-583D-4B9D-956C-81D63C8CFCFA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -17,10 +17,10 @@ Global
|
||||
{0BD16FB9-7ED4-4CCB-83EB-5CEE538E1B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0BD16FB9-7ED4-4CCB-83EB-5CEE538E1B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0BD16FB9-7ED4-4CCB-83EB-5CEE538E1B6C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9BBFA9F7-64A7-4D7D-86FC-812E6D7578B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9BBFA9F7-64A7-4D7D-86FC-812E6D7578B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9BBFA9F7-64A7-4D7D-86FC-812E6D7578B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9BBFA9F7-64A7-4D7D-86FC-812E6D7578B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{88EC0E02-583D-4B9D-956C-81D63C8CFCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{88EC0E02-583D-4B9D-956C-81D63C8CFCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88EC0E02-583D-4B9D-956C-81D63C8CFCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{88EC0E02-583D-4B9D-956C-81D63C8CFCFA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user