4 ошибки CS1061. Код:
using System;
using System.Threading;
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Args;
using Telegram.Bot.Types;
namespace TelegramBot
{
class Program
{
static ITelegramBotClient botClient;
static void Main()
{
botClient = new TelegramBotClient("token");
botClient.OnMessage += Bot_OnMessage;
botClient.StartReceiving(options, cancellationToken);
Console.ReadLine();
object p = botClient.StopReceiving();
}
private static Task cancellationToken(ITelegramBotClient arg1, Exception arg2, CancellationToken arg3)
{
throw new NotImplementedException();
}
private static Task options(ITelegramBotClient arg1, Update arg2, CancellationToken arg3)
{
throw new NotImplementedException();
}
private static async void Bot_OnMessage(object sender, MessageEventArgs e)
{
if (e.Message.Text.ToLower() == "/anecdote")
{
string[] anecdotes = new string[] {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8.",
"9",
"10",
"11",
"12"
};
Random random = new Random();
string anecdote = anecdotes[random.Next(anecdotes.Length)];
await botClient.SendTextMessageAsync(e.Message.Chat.Id, anecdote);
}
}
}
}