示例#1
0
 public async Task SendLocationToTelegram(double lat, double lng, long chatId)
 {
     if (!_started)
     {
         return;
     }
     try
     {
         var msg = new SendVenue(chatId, (float)lat, (float)lng);
         await TelegramBot.MakeRequestAsync(msg);
     }
     catch (Exception)
     {
         //ignore
     }
 }
 public static ValidationResult <SendVenue> CreateValidation(this SendVenue value) => new ValidationResult <SendVenue>(value)
 .ValidateRequired(x => x.ChatId)
 .ValidateRequired(x => x.Latitude)
 .ValidateRequired(x => x.Title)
 .ValidateRequired(x => x.Address)
 .ValidateRequired(x => x.Longitude);