Skip to content

Commit eceb2bf

Browse files
committed
Fix REAME.md from #228
1 parent a36d46f commit eceb2bf

1 file changed

Lines changed: 39 additions & 22 deletions

File tree

README.md

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# tgbot-cpp
22

3-
[![Travis build Status](https://travis-ci.org/reo7sp/tgbot-cpp.svg?branch=master)](https://travis-ci.org/reo7sp/tgbot-cpp)
4-
<br>
53
[![GitHub contributors](https://img.shields.io/github/contributors/reo7sp/tgbot-cpp.svg)](https://github.com/reo7sp/tgbot-cpp/graphs/contributors)
64

7-
C++14 library for Telegram bot API.
5+
C++ library for Telegram bot API.
86

97
Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
108

@@ -17,6 +15,7 @@ Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
1715
## Sample
1816

1917
Simple echo bot which sends everything it receives:
18+
2019
```cpp
2120
#include <stdio.h>
2221
#include <tgbot/tgbot.h>
@@ -52,15 +51,24 @@ All other samples are located [here](samples).
5251

5352
## Dependencies
5453

55-
Firstly you need to install some dependencies such as Boost and build tools such as CMake. On Debian-based distibutives you can do it with these commands:
54+
Dependencies:
55+
- CMake
56+
- Boost
57+
- OpenSSL
58+
- ZLib
59+
- Libcurl (optional unless you want to use curl-based http client `CurlHttpClient`).
60+
61+
62+
## Library installation on Linux
63+
64+
You can install dependencies on Debian-based distibutives with these commands:
65+
5666
```sh
57-
sudo apt-get install g++ make binutils cmake libssl-dev libboost-system-dev zlib1g-dev
67+
sudo apt-get install g++ make binutils cmake libssl-dev libboost-system-dev zlib1g-dev libcurl4-openssl-dev
5868
```
59-
If you want to use curl-based http client `CurlHttpClient`, you also need to install `libcurl4-openssl-dev` package.
6069

61-
## Library installation
70+
You can compile and install the library with these commands:
6271

63-
If you want to install the library system-wide:
6472
```sh
6573
git clone https://github.com/reo7sp/tgbot-cpp
6674
cd tgbot-cpp
@@ -69,34 +77,39 @@ make -j4
6977
sudo make install
7078
```
7179

72-
You can treat this repository as a submodule of your project, for example, see [echobot-submodule](samples/echobot-submodule/CMakeLists.txt)
80+
Alternatively, you can use Docker to build and run your bot. Set the base image of your's Dockerfile to [reo7sp/tgbot-cpp](https://hub.docker.com/r/reo7sp/tgbot-cpp/).
7381

74-
You can use Docker to build and run your bot. Set the base image of your's Dockerfile to [reo7sp/tgbot-cpp](https://hub.docker.com/r/reo7sp/tgbot-cpp/).
7582

76-
## Installation Windows
83+
## Library installation on MacOS
84+
85+
You can install dependencies with these commands:
86+
87+
```sh
88+
brew install openssl zlib
89+
```
90+
91+
You can compile and install the library like Linux instructions.
92+
93+
94+
## Library installation on Windows
7795

7896
### Download vcpkg and tgbot-cpp
7997

80-
Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows):
98+
Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows).
8199

82100
Prerequisites:
83101
- Windows 7 or newer
84102
- Git
85103
- Visual Studio 2015 Update 3 or greater with the English language pack
86104

87-
First, download and bootstrap vcpkg itself; it can be installed anywhere,
88-
but generally we recommend using vcpkg as a submodule for CMake projects,
89-
and installing it globally for Visual Studio projects.
90-
We recommend somewhere like `C:\src\vcpkg` or `C:\dev\vcpkg`,
91-
since otherwise you may run into path issues for some port build systems.
105+
First, download and bootstrap vcpkg itself; it can be installed anywhere, but generally we recommend using vcpkg as a submodule for CMake projects, and installing it globally for Visual Studio projects. We recommend somewhere like `C:\src\vcpkg` or `C:\dev\vcpkg`, since otherwise you may run into path issues for some port build systems.
92106

93107
```cmd
94108
> git clone https://github.com/microsoft/vcpkg
95109
> .\vcpkg\bootstrap-vcpkg.bat
96110
```
97111

98-
In order to use vcpkg with Visual Studio,
99-
run the following command (may require administrator elevation):
112+
In order to use vcpkg with Visual Studio, run the following command (may require administrator elevation):
100113

101114
```cmd
102115
> .\vcpkg\vcpkg integrate install
@@ -120,22 +133,26 @@ The library will now be installed and Visual Studio should be able to find the v
120133

121134
Use the [example CMakeLists.txt](samples/echobot/CMakeLists.txt) with changes:
122135

123-
Remove `/usr/local/include`
124-
125-
Change `/usr/local/lib/libTgBot.a` to `C:/src/vcpkg/installed/x64-windows/lib/TgBot.lib` or something simmilar according to your own installation path.
136+
1. Remove `/usr/local/include`
137+
2. Change `/usr/local/lib/libTgBot.a` to `C:/src/vcpkg/installed/x64-windows/lib/TgBot.lib` or something simmilar according to your own installation path.
126138

127139

128140
## Bot compilation
129141

130142
### With CMake
143+
131144
[Example CMakeLists.txt](samples/echobot/CMakeLists.txt)
132145

146+
Also, you can treat this repository as a submodule of your project, for example, see [echobot-submodule](samples/echobot-submodule/CMakeLists.txt)
147+
133148
### Without CMake
149+
134150
```sh
135151
g++ telegram_bot.cpp -o telegram_bot --std=c++14 -I/usr/local/include -lTgBot -lboost_system -lssl -lcrypto -lpthread
136152
```
137153

138154
### Build options
155+
139156
```
140157
-DTGBOT_DISABLE_NAGLES_ALGORITHM # Disable 'Nagle's algorithm'
141158
-DTGBOT_CHANGE_SOCKET_BUFFER_SIZE # Socket Buffer Size Expansion

0 commit comments

Comments
 (0)