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

Im having an error on my command text even though the command text is right when i test it in the SQL console
Asp DetailsView - using currently logged in user as control parameter?
Multiple Series on a third Y-Axis (Winforms Chart)
migrate from inline to MVP
XML Serialization modifications
C# WPF MouseLeftButtonUp event not firing when also using MouseMove
When selecting data from database and the condition is date, I receive this message that data type mismatches in criteria expression
Write text using outputstream in file
How to export DataTable to excel but keep the formatting
List Collection Class
appsettings in .net core sql server
How to unprotect an excel cell in C# without knowing the worksheet's password? [duplicate]
Deserialize - String JSON to List of Dictionary
Unable to click login button on angular site in IE (Selenium)
Can I show the label and make the User not able to interact with a DropDownList?
RabbitMQ Client (DotNet Core) preventing application from closing

Categories

HOME
repository
postgresql
redux
stata
azure-active-directory
system-calls
gaussian
spotfire
lithium
sdk
genexus
ephesoft
oms
apache-httpclient-4.x
http-status-codes
opengrok
popup
box2d
css-float
reportlab
samba
powerpivot
draw2d
legend-properties
android-navigation-drawer
dev-c++
beaker-notebook
ng-tags-input
aws-iot
rvm
aspxgridview
datastax-enterprise
pydub
openoffice-impress
wercker
rtos
android-geofence
console.readline
oracle-bpm-suite
anypoint-studio
const
var
stdin
blueimp
vertical-alignment
php-mongodb
amazon-fire-tv
serverless-architecture
remap
jsfl
extjs3
senti-wordnet
foreground
change-password
sprockets
vitamio
usps
jmh
jcalendar
cloud-storage
cyberduck
dpkt
avrcp
polarion
xmla
chunks
caption
illegalargumentexception
qf-test
go-gin
im4java
msdropdown
visual-c#-express-2010
scjp
pyalgotrade
enquire.js
data-layers
flask-mongoengine
android-jack-and-jill
carrier
xtify
mysql-error-1146
raddatepicker
azure-pack
source-depot
google-checkout
ftpwebrequest
generator-expression
auctex
google-email-audit-api
sup
stl-algorithm
capitalization
virtual-printer
parallel-python
jquery-click-event
sipdroid
cpack
text-manipulation
system-analysis
web-widget
user-preferences
content-delivery-network

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