-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
33 lines (30 loc) · 975 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using sisbase;
using sisbase.Configuration;
using sisbase.Utils;
namespace siscode_bot {
class Program {
private static CancellationTokenSource Cts { get; } = new CancellationTokenSource();
private static async Task Main()
{
Console.CancelKeyPress += (sender, e) =>
{
if (!Cts.IsCancellationRequested)
Cts.Cancel();
e.Cancel = true;
};
var config = new Sisbase(Directory.GetCurrentDirectory());
config.AddCustomConfiguration<Json>("another config", new Json());
var sisbase = new SisbaseBot(
config
);
sisbase.RegisterBot(typeof(Program).Assembly);
await sisbase.StartAsync();
while (!Cts.IsCancellationRequested)
await Task.Delay(1);
}
}
}