Exemple #1
0
        public byte[] DownloadFile(string filePath)
        {
            var client = new Client(_fileUri + filePath);
            var request = new GetRequest();

            return client.SendSync(request);
        }
Exemple #2
0
        public Order(int i, Client c, OrderItem[] items, float price)
        {
            client = c;
            order_items = new OrderItemArray(items);
            total_price = price;

            id = i;

            order_status = status.encomendada;
            delivery_team = "";
        }
Exemple #3
0
        public File GetFile(string fileId)
        {
            var parameters = new Dictionary<string, string>
            {
                { "file_id", fileId }
            };

            var client = new Client(_uri + "getFile");
            var request = new GetRequest(parameters);
            var response = client.Send(request);

            return _responseParser.Parse<File>(response);
        }
Exemple #4
0
        public Message SendMessage(int chatId, string message)
        {
            var parameters = new Dictionary<string, string>
            {
                { "chat_id", chatId.ToString() },
                { "text", message },
            };

            var client = new Client(_uri + "sendMessage");
            var request = new PostRequest(parameters);
            var response = client.Send(request);

            return _responseParser.Parse<Message>(response);
        }
Exemple #5
0
        public Update[] GetUpdates(int offset = 0, int limit = 100, int timeout = 0)
        {
            var parameters = new Dictionary<string, string>
            {
                { "offset", offset.ToString() },
                { "limit", limit.ToString() },
                { "timeout", timeout.ToString() }
            };

            var client = new Client(_uri + "getUpdates");
            var request = new GetRequest(parameters);
            var response = client.Send(request);

            return _responseParser.Parse<Update[]>(response);
        }