c#


Cant Create Keyboard with NetTelegramBotApi in C#


i want to create a keyboard in telegram bot with c#, but i cant,
when i add the keyboards show me the error.
nuget pakage is : Install-Package NetTelegramBotApi
this is a my own code.
namespace TelegramBotConsole
{
class Program
{
// Keyboards
public static ReplyKeyboardMarkup MainMenu;
// Telegram Bot Token.
private static string BotToken="Bot_Api";
static void Main(string[] args)
{
// Add The Keuboards
MainMenu = new ReplyKeyboardMarkup
{
Keyboard = new[] { new[] { "Amuzeshha" }, new[] { "Rahnama", "About" } }
};
// Running The Bot.
Task.Run(() => RunBot());
// Read The Log of Bot.
Console.ReadLine();
}
// Create Bot.
public static async Task RunBot()
{
var Bot = new TelegramBot(BotToken);
var Me = await Bot.MakeRequestAsync(new GetMe());
// Geting The Infromation of Bot.
Console.WriteLine("Username Is : {0}", Me.Username);
Console.WriteLine("My ID Is : {0}", Me.Id);
Console.WriteLine("My Name Is : {0}", Me.FirstName);
long offset = 0;
while (true)
{
var updates = await Bot.MakeRequestAsync(new GetUpdates() { Offset = offset });
foreach (var update in updates)
{
offset = update.UpdateId + 1;
var text = update.Message.Text;
if (text == "/start")
{
var Req = new SendMessage(update.Message.Chat.Id, "You Should Send Picture") { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(Req);
continue;
}
if(update.Message.Photo == null)
{
var Req = new SendMessage(update.Message.Chat.Id, "Please Send A Picture") { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(Req);
continue;
}
else
{
var Req = new SendMessage(update.Message.Chat.Id, "Thanks") { ReplyMarkup = MainMenu};
await Bot.MakeRequestAsync(Req);
continue;
}
}
}
}
}
this code does not working.
MainMenu = new ReplyKeyboardMarkup
{
Keyboard = new[] { new[] { "Amuzeshha" }, new[] { "Rahnama", "About" } }
};
where is the problem?
and this a screen shot of error.

Related Links

How do you reference a class through xaml?
Find Subimage in larger image in C#
Why does loading a table dynamically using ajax in MVC3 only work in compatability mode?
Detecting or disabling (if possible) console application exit manually
MVVM DynamicObject + Entity Framework STE entities + Property Change Behavior
Setting VisualState on ItemsControl item Templates
HIde a Column in Repeater Control
How to calculate the infinite value of a division? [duplicate]
Nullable object must have a value
IsAssignableFrom in covariance and contravariance
Image to array, dimension loss?
Fastest PNG decoder for .NET
Passing Boolean from main form [duplicate]
Run as Windows Service, Console App, or Wpf App in a single VS2010 project
Generate a unique id
Timeout for BackgroundWorker

Categories

HOME
repository
algolia
azure-documentdb
azure-active-directory
network-programming
wifi
jquery-plugins
data-modeling
crm
itext7
ubuntu-14.04
glympse
liquidsoap
browserstack
scapy
wowza
derby
exchange-transport-agents
openstack-horizon
taxonomy
beacon
passbook
aws-iot
pumping-lemma
uipath
scripting-language
angular-schema-form
snapkit
matlab-compiler
pymunk
android-databinding
hippocms
mockserver
mixed-models
vertical-alignment
api-key
chrome-custom-tabs
encoder
azure-data-catalog
px4
playframework-2.3
richtext
trusted-computing
catalyst
fileopendialog
portaudio
indoor-positioning-system
boost-range
xcode7.1
mate-desktop
cosign-api
vga
syslog4j
django-taggit
3d-rendering
jmap
wizard
alchemy
jquery-draggable
play-json
playn
euro
teamwork
valdr-bean-validation
connection-timeout
numerical-recipes
applinks
nsq
cordova-3
launcher
api-eveonline
worklight-appcenter
sat4j
drawable
django-tests
webshim
jsmpp
fastcgi-mono-server
html5-filesystem
kernel-density
kuka-krl
raddatepicker
typography
extensibility
string-length
system.transactions
cryptarithmetic-puzzle
github-archive
socketasynceventargs
towerjs
digg
symfony-1.2
marathontesting
llblgen
subdirectories
activescaffold
uccapi
dgml
disk-based
j++
stackless

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App