Telegram.Bot
Telegram.Bot copied to clipboard
Is is possible to use this library in Xamarin.Android?
I'm trying to create an Android app to communicate with a Telegram Bot. Is is possible to use this library in Xamarin.Android?
@sinasaeedi should be
Here is a sample in Xamarin.Android for those who are interested:
public class MainActivity : Activity
{
private static readonly TelegramBotClient Bot = new TelegramBotClient("xxxxxxxx");
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Bot.OnMessage += BotOnMessageReceived;
Bot.StartReceiving();
}
private static async void BotOnMessageReceived(object sender, MessageEventArgs messageEventArgs)
{
Telegram.Bot.Types.Message message = messageEventArgs.Message;
await Bot.SendTextMessageAsync(message.Chat.Id, "From Xamarin");
}
}