refactor: example projects

This commit is contained in:
ZavaruKitsu
2022-10-15 18:51:26 +03:00
parent b9a177c152
commit a2b75654d8
61 changed files with 271 additions and 795 deletions
@@ -1,9 +1,8 @@
using System.Threading.Tasks;
using Telegram.Bot.Types.Enums;
using Telegram.Bot.Types.Enums;
using TelegramBotBase.Args;
using TelegramBotBase.Form;
namespace JoinHiderBot.forms;
namespace JoinHiderBot.Forms;
public class GroupManageForm : GroupForm
{
@@ -19,4 +18,4 @@ public class GroupManageForm : GroupForm
await Device.DeleteMessage(m);
}
}
}
@@ -1,8 +1,7 @@
using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Base;
using TelegramBotBase.Form;
namespace JoinHiderBot.forms;
namespace JoinHiderBot.Forms;
public class Start : SplitterForm
{
+3 -1
View File
@@ -3,10 +3,12 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TelegramBotBase" Version="5.0.0"/>
<ProjectReference Include="..\..\TelegramBotBase\TelegramBotBase.csproj"/>
</ItemGroup>
</Project>
+6 -8
View File
@@ -1,21 +1,19 @@
using System;
using JoinHiderBot.forms;
using JoinHiderBot.Forms;
using TelegramBotBase.Builder;
namespace JoinHiderBot;
internal class Program
{
private static void Main(string[] args)
private static async Task Main(string[] args)
{
var apiKey = "";
var bot = BotBaseBuilder.Create()
.QuickStart<Start>(apiKey)
.QuickStart<Start>(Environment.GetEnvironmentVariable("API_KEY") ??
throw new Exception("API_KEY is not set"))
.Build();
bot.Start();
await bot.Start();
Console.ReadLine();
}
}
}