예제 #1
0
 public async Task <File> SendGetFile(string fileId, CancellationToken cancellationToken)
 {
     return(await SendPostRequest <File>("getFile", HttpContentBuilder.BuildJsonContent(new
     {
         file_id = fileId
     }), cancellationToken));
 }
예제 #2
0
 public async Task <bool> SendUnbanChatMember(string chatId, int userId, CancellationToken cancellationToken)
 {
     return(await SendPostRequest <bool>("unbanChatMember", HttpContentBuilder.BuildJsonContent(new
     {
         chat_id = chatId,
         user_id = userId
     }), cancellationToken));
 }
예제 #3
0
 public async Task <Update[]> SendGetUpdatesAsync(CancellationToken cancellationToken)
 {
     return(await SendPostRequest <Update[]>("getUpdates", HttpContentBuilder.BuildJsonContent(new
     {
         offset = MessageOffset,
         limit = UpdateLimit,
         timeout = PollTimeout
     }), cancellationToken));
 }
예제 #4
0
 public async Task <bool> SendAnswerCallbackQuery(string callbackQueryId, CancellationToken cancellationToken, string pText = "", bool showAlert = false)
 {
     return(await SendPostRequest <bool>("answerCallbackQuery", HttpContentBuilder.BuildJsonContent(new
     {
         callback_query_id = callbackQueryId,
         text = pText,
         show_alert = showAlert
     }), cancellationToken));
 }
예제 #5
0
 public async Task <UserProfilePhotos> SendGetUserProfilePhotos(int userId, CancellationToken cancellationToken, int pOffset = 0, int pLimit = 0)
 {
     return(await SendPostRequest <UserProfilePhotos>("getUserProfilePhotos", HttpContentBuilder.BuildJsonContent(new
     {
         user_id = userId,
         offset = pOffset,
         limit = pLimit
     }), cancellationToken));
 }
예제 #6
0
 public async Task <Message> SendForwardMessageAsync(ForwardMessage message, CancellationToken cancellationToken)
 {
     return(await SendPostRequest <Message>("forwardMessage", HttpContentBuilder.BuildJsonContent(message), cancellationToken));
 }
예제 #7
0
 public async Task <Message> SendContactAsync(ContactMessage message, CancellationToken cancellationToken)
 {
     return(await SendPostRequest <Message>("sendContact", HttpContentBuilder.BuildJsonContent(message), cancellationToken));
 }