-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (30 loc) · 856 Bytes
/
Program.cs
File metadata and controls
35 lines (30 loc) · 856 Bytes
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
34
35
using Core;
using Telegram.Bot;
using Telegram.Bot.Types.Enums;
using TelegramBotHelper.Core;
namespace TelegramBotHelper
{
internal class Program
{
static string BotToken = "5991496923:AAFjhww7PhZUX9SKAn3tOQ4UAGfAk8hQOps";
public static ITelegramBotClient Bot = new TelegramBotClient(BotToken);
static void Main(string[] args)
{
BotBuilder botBuilder = new BotBuilder(Bot);
botBuilder.AddRoute("/start", UpdateType.Message, (pipeline) =>
{
pipeline.Use(async (update) =>
{
await Bot.SendTextMessageAsync(update.Message.Chat.Id,"Hello You");
await Bot.SendTextMessageAsync(update.Message.Chat.Id, "Write Something");
});
pipeline.Use(async (update) =>
{
await Bot.SendTextMessageAsync(update.Message.Chat.Id, "Hello world");
});
});
botBuilder.Start();
Console.ReadLine();
}
}
}