public async Task <ForwardMessageResponse> forwardMessage(int destinationChatId, int fromChatId, int messageId) { var builder = new HttpRequestBuilder(_baseUri, HttpMethod.Post, null); var request = builder.AddResource("/forwardMessage").AndContent(typeof(ForwardMessageRequest)).Build(); var handler = new HttpRequestHandler <ForwardMessageResponse>(request); var result = await handler.HandleHttpAction(); return(result); }
public async Task <UpdateResponse> getUpdates() { var builder = new HttpRequestBuilder(_baseUri, HttpMethod.Get, null); var request = builder.AddResource("getUpdates").Build(); var handler = new HttpRequestHandler <UpdateResponse>(request); var updates = await handler.HandleHttpAction(); return(updates); }
public async Task <TelegramMessage> sendMessage(int chatId, string messageContent) { var builder = new HttpRequestBuilder(_baseUri, HttpMethod.Post, null); var request = builder.AddResource("/sendMessage").AndContent(typeof(TelegramMessage)).Build(); var handler = new HttpRequestHandler <TelegramMessage>(request); var result = await handler.HandleHttpAction(); return(result); }
public async Task <TelegramObject> getMe() { var builder = new HttpRequestBuilder(_baseUri, HttpMethod.Get, null); var request = builder.AddResource("/getMe").Build(); var handler = new HttpRequestHandler <TelegramObject>(request); var bot = await handler.HandleHttpAction(); return(bot); }