refactor: example projects
This commit is contained in:
+3
-4
@@ -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,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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user