Create Program.cs
This commit is contained in:
parent
7d8895850a
commit
d66df4978d
36
Examples/SystemCommandsBot/Program.cs
Normal file
36
Examples/SystemCommandsBot/Program.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace SystemCommandsBot
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
public static config.Config BotConfig { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
|
||||||
|
BotConfig = config.Config.load();
|
||||||
|
|
||||||
|
if (BotConfig.ApiKey == null || BotConfig.ApiKey.Trim() == "")
|
||||||
|
{
|
||||||
|
Console.WriteLine("Config created...");
|
||||||
|
Console.ReadLine();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bot = new TelegramBotBase.BotBase<forms.StartForm>(BotConfig.ApiKey);
|
||||||
|
|
||||||
|
bot.Start();
|
||||||
|
|
||||||
|
Console.WriteLine("Bot started");
|
||||||
|
|
||||||
|
Console.ReadLine();
|
||||||
|
|
||||||
|
|
||||||
|
bot.Stop();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user