Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }