Moving experiment files to external class library for use in production systems

This commit is contained in:
Florian Zevedei 2024-01-25 14:56:18 +01:00
parent d910b42473
commit 45b05d301b
14 changed files with 41 additions and 20 deletions

View File

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\TelegramBotBase\TelegramBotBase.csproj" /> <ProjectReference Include="..\..\..\TelegramBotBase\TelegramBotBase.csproj" />
<ProjectReference Include="..\TelegramBotBase.Experiments\TelegramBotBase.Experiments.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,14 +1,13 @@
using DemoBot.ActionManager; using DemoBot.Forms;
using DemoBot.Extensions;
using DemoBot.Forms;
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types.ReplyMarkups; using Telegram.Bot.Types.ReplyMarkups;
using TelegramBotBase.Builder; using TelegramBotBase.Builder;
using TelegramBotBase.Commands; using TelegramBotBase.Commands;
using TelegramBotBase.Form; using TelegramBotBase.Form;
using DemoBot.ActionManager.Navigation;
using DemoBot.ActionManager.Actions;
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Experiments.ActionManager;
using TelegramBotBase.Experiments.ActionManager.Actions;
using TelegramBotBase.Experiments.ActionManager.Navigation;
namespace DemoBot namespace DemoBot
{ {
@ -142,7 +141,7 @@ namespace DemoBot
var bb = BotBaseBuilder.Create() var bb = BotBaseBuilder.Create()
.WithAPIKey(Token) .WithAPIKey(Token)
.ActionMessageLoop(eam2) //.CustomMessageLoop(cfb) .ActionMessageLoop(eam2)
.WithStartForm<Forms.StartForm>() .WithStartForm<Forms.StartForm>()
.NoProxy() .NoProxy()
.CustomCommands(a => .CustomCommands(a =>

View File

@ -1,7 +1,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Actions namespace TelegramBotBase.Experiments.ActionManager.Actions
{ {
public class EndsWithAction : IExternalAction public class EndsWithAction : IExternalAction

View File

@ -1,7 +1,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Actions namespace TelegramBotBase.Experiments.ActionManager.Actions
{ {
public class GuidAction : IExternalAction public class GuidAction : IExternalAction
{ {

View File

@ -1,7 +1,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Actions namespace TelegramBotBase.Experiments.ActionManager.Actions
{ {
public class StartWithAction : IExternalAction public class StartWithAction : IExternalAction

View File

@ -1,6 +1,6 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
namespace DemoBot.ActionManager namespace TelegramBotBase.Experiments.ActionManager
{ {
public partial class ExternalActionManager public partial class ExternalActionManager
{ {

View File

@ -1,6 +1,6 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
namespace DemoBot.ActionManager namespace TelegramBotBase.Experiments.ActionManager
{ {
public interface IExternalAction public interface IExternalAction

View File

@ -2,7 +2,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Navigation namespace TelegramBotBase.Experiments.ActionManager.Navigation
{ {
public class EndsWithNavigation : IExternalAction public class EndsWithNavigation : IExternalAction
{ {

View File

@ -2,7 +2,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Navigation namespace TelegramBotBase.Experiments.ActionManager.Navigation
{ {
public class GuidNavigation : IExternalAction public class GuidNavigation : IExternalAction
{ {

View File

@ -2,7 +2,7 @@
using TelegramBotBase.Base; using TelegramBotBase.Base;
using TelegramBotBase.Form; using TelegramBotBase.Form;
namespace DemoBot.ActionManager.Navigation namespace TelegramBotBase.Experiments.ActionManager.Navigation
{ {
public class StartWithNavigation : IExternalAction public class StartWithNavigation : IExternalAction
{ {

View File

@ -1,5 +1,4 @@
using System.ComponentModel; using System.ComponentModel;
using DemoBot.ActionManager;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using TelegramBotBase; using TelegramBotBase;
using TelegramBotBase.Args; using TelegramBotBase.Args;
@ -7,7 +6,7 @@ using TelegramBotBase.Base;
using TelegramBotBase.Interfaces; using TelegramBotBase.Interfaces;
using TelegramBotBase.Sessions; using TelegramBotBase.Sessions;
namespace DemoBot namespace TelegramBotBase.Experiments.ActionManager
{ {
public class CustomFormBaseMessageLoop : IMessageLoopFactory public class CustomFormBaseMessageLoop : IMessageLoopFactory
{ {

View File

@ -1,5 +1,4 @@
using DemoBot.ActionManager; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -7,7 +6,7 @@ using System.Threading.Tasks;
using TelegramBotBase.Builder.Interfaces; using TelegramBotBase.Builder.Interfaces;
using TelegramBotBase.Interfaces; using TelegramBotBase.Interfaces;
namespace DemoBot.Extensions namespace TelegramBotBase.Experiments.ActionManager
{ {
public static class StaticExtensions public static class StaticExtensions
{ {

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\TelegramBotBase\TelegramBotBase.csproj" />
</ItemGroup>
</Project>

View File

@ -40,6 +40,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Experiments", "Experiments"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoBot", "Experiments\ExternalActionManager\DemoBot\DemoBot.csproj", "{5184D3F8-8526-413D-8EB0-23636EA7A4EF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoBot", "Experiments\ExternalActionManager\DemoBot\DemoBot.csproj", "{5184D3F8-8526-413D-8EB0-23636EA7A4EF}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelegramBotBase.Experiments", "Experiments\ExternalActionManager\TelegramBotBase.Experiments\TelegramBotBase.Experiments.csproj", "{625F84FE-6809-4CA4-9C58-3453382D1C65}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExternalActionManager", "ExternalActionManager", "{359F7D60-362C-4F42-9606-A138FB1293E9}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -98,6 +102,10 @@ Global
{5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Release|Any CPU.Build.0 = Release|Any CPU {5184D3F8-8526-413D-8EB0-23636EA7A4EF}.Release|Any CPU.Build.0 = Release|Any CPU
{625F84FE-6809-4CA4-9C58-3453382D1C65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{625F84FE-6809-4CA4-9C58-3453382D1C65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{625F84FE-6809-4CA4-9C58-3453382D1C65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{625F84FE-6809-4CA4-9C58-3453382D1C65}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -113,7 +121,9 @@ Global
{067E8EBE-F90A-4AFF-A0FF-20578216486E} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5} {067E8EBE-F90A-4AFF-A0FF-20578216486E} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5}
{689B16BC-200E-4C68-BB2E-8B209070849B} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5} {689B16BC-200E-4C68-BB2E-8B209070849B} = {BFA71E3F-31C0-4FC1-A320-4DCF704768C5}
{DC521A4C-7446-46F7-845B-AAF10EDCF8C6} = {E3193182-6FDA-4FA3-AD26-A487291E7681} {DC521A4C-7446-46F7-845B-AAF10EDCF8C6} = {E3193182-6FDA-4FA3-AD26-A487291E7681}
{5184D3F8-8526-413D-8EB0-23636EA7A4EF} = {2E1FF127-4DC2-40A1-849C-ED1432204E8A} {5184D3F8-8526-413D-8EB0-23636EA7A4EF} = {359F7D60-362C-4F42-9606-A138FB1293E9}
{625F84FE-6809-4CA4-9C58-3453382D1C65} = {359F7D60-362C-4F42-9606-A138FB1293E9}
{359F7D60-362C-4F42-9606-A138FB1293E9} = {2E1FF127-4DC2-40A1-849C-ED1432204E8A}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {59CB40E1-9FA7-4867-A56F-4F418286F057} SolutionGuid = {59CB40E1-9FA7-4867-A56F-4F418286F057}