Add files via upload
This commit is contained in:
parent
d5f1ff4113
commit
8900bb775f
239
README.md
239
README.md
@ -1,6 +1,6 @@
|
||||
<div align="center">
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/logo.png" alt="Pykeyboard">
|
||||
<img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/logo.png" alt="pykeyboard">
|
||||
</p>
|
||||
|
||||
![PyPI](https://img.shields.io/pypi/v/pykeyboard)
|
||||
@ -9,27 +9,31 @@
|
||||
|
||||
</div>
|
||||
|
||||
## Installation
|
||||
# What's new?
|
||||
|
||||
- Added a new method to <b>InlineKeyboard</b> for working with <ins>pagination</ins>. The <b>InlinePaginationKeyboard</b> class will be removed in a future version.
|
||||
|
||||
# Installation
|
||||
|
||||
```shell
|
||||
pip install pykeyboard
|
||||
```
|
||||
|
||||
## Documentation
|
||||
# Documentation
|
||||
|
||||
### Inline Keyboard
|
||||
## Inline Keyboard
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
```
|
||||
|
||||
#### Parameters:
|
||||
##### Parameters:
|
||||
|
||||
- row_width (integer, default 3)
|
||||
|
||||
#### Inline Keyboard add buttons
|
||||
### Inline Keyboard add buttons
|
||||
|
||||
##### Code
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
@ -48,13 +52,13 @@ keyboard.add(
|
||||
)
|
||||
```
|
||||
|
||||
##### Result
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/add_inline_button.png" alt="add_inline_button"></p>
|
||||
|
||||
#### Inline Keyboard row buttons
|
||||
### Inline Keyboard row buttons
|
||||
|
||||
##### Code
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
@ -74,11 +78,103 @@ keyboard.row(
|
||||
)
|
||||
```
|
||||
|
||||
##### Result
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/row_inline_button.png" alt="row_inline_button"></p>
|
||||
|
||||
### Reply Keyboard
|
||||
### Pagination inline keyboard
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
```
|
||||
|
||||
#### Parameters:
|
||||
|
||||
- count_pages (integer)
|
||||
- current_page (integer)
|
||||
- callback_pattern (string) - use of the `{number}` pattern is <ins>required</ins>
|
||||
|
||||
#### Pagination 3 pages
|
||||
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
|
||||
keyboard = InlineKeyboard()
|
||||
keyboard.paginate(3, 3, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_3.png" alt="pagination_keyboard_3"></p>
|
||||
|
||||
#### Pagination 5 pages
|
||||
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
|
||||
keyboard = InlineKeyboard()
|
||||
keyboard.paginate(5, 3, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_5.png" alt="pagination_keyboard_5"></p>
|
||||
|
||||
#### Pagination 9 pages
|
||||
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
|
||||
keyboard = InlineKeyboard()
|
||||
keyboard.paginate(9, 5, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_9.png" alt="pagination_keyboard_9"></p>
|
||||
|
||||
#### Pagination 100 pages
|
||||
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
|
||||
keyboard = InlineKeyboard()
|
||||
keyboard.paginate(100, 100, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_100.png" alt="pagination_keyboard_100"></p>
|
||||
|
||||
#### Pagination 150 pages and buttons
|
||||
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlineKeyboard
|
||||
from pyrogram.types import InlineKeyboardButton
|
||||
|
||||
keyboard = InlineKeyboard()
|
||||
keyboard.paginate(150, 123, 'pagination_keyboard#{number}')
|
||||
keyboard.row(
|
||||
InlineKeyboardButton('Back', 'pagination_keyboard#back'),
|
||||
InlineKeyboardButton('Close', 'pagination_keyboard#close')
|
||||
)
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_150.png" alt="pagination_keyboard_150"></p>
|
||||
|
||||
## Reply Keyboard
|
||||
|
||||
```python
|
||||
from pykeyboard import ReplyKeyboard
|
||||
@ -91,9 +187,9 @@ from pykeyboard import ReplyKeyboard
|
||||
- selective (bool, optional)
|
||||
- row_width (integer, default 3)
|
||||
|
||||
#### Reply Keyboard add buttons
|
||||
### Reply Keyboard add buttons
|
||||
|
||||
##### Code
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import ReplyKeyboard
|
||||
@ -110,13 +206,13 @@ keyboard.add(
|
||||
)
|
||||
```
|
||||
|
||||
##### Result
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/add_reply_button.png" alt="add_reply_button"></p>
|
||||
|
||||
#### Reply Keyboard row buttons
|
||||
### Reply Keyboard row buttons
|
||||
|
||||
##### Code
|
||||
#### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import ReplyKeyboard
|
||||
@ -133,113 +229,6 @@ keyboard.row(KeyboardButton('4', 'reply_keyboard#4'))
|
||||
keyboard.row(KeyboardButton('5', 'reply_keyboard#5'))
|
||||
```
|
||||
|
||||
##### Result
|
||||
#### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/row_reply_button.png" alt="row_reply_button"></p>
|
||||
|
||||
### Pagination inline keyboard
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
```
|
||||
|
||||
#### Parameters:
|
||||
|
||||
- count_pages (integer)
|
||||
- current_page (integer)
|
||||
- callback_pattern (string) - use of the `{number}` pattern is <ins>required</ins>
|
||||
|
||||
#### Pagination 3 pages
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(3, 3, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_3.png" alt="pagination_keyboard_3"></p>
|
||||
|
||||
#### Pagination 5 pages
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(5, 3, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_5.png" alt="pagination_keyboard_5"></p>
|
||||
|
||||
#### Pagination 9 pages
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(9, 5, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_9.png" alt="pagination_keyboard_9"></p>
|
||||
|
||||
#### Pagination 25 pages
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(25, 14, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_25.png" alt="pagination_keyboard_25"></p>
|
||||
|
||||
#### Pagination 100 pages
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(100, 100, 'pagination_keyboard#{number}')
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_100.png" alt="pagination_keyboard_100"></p>
|
||||
|
||||
#### Pagination 150 pages and buttons
|
||||
|
||||
##### Code
|
||||
|
||||
```python
|
||||
from pykeyboard import InlinePaginationKeyboard
|
||||
from pyrogram.types import InlineKeyboardButton
|
||||
|
||||
|
||||
keyboard = InlinePaginationKeyboard(150, 123, 'pagination_keyboard#{number}')
|
||||
keyboard.row(
|
||||
InlineKeyboardButton('Back', 'pagination_keyboard#back'),
|
||||
InlineKeyboardButton('Close', 'pagination_keyboard#close')
|
||||
)
|
||||
```
|
||||
|
||||
##### Result
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/pystorage/pykeyboard/master/docs/source/images/pagination_keyboard_150.png" alt="pagination_keyboard_150"></p>
|
||||
|
@ -1,2 +1,2 @@
|
||||
Pyrogram==1.0.7
|
||||
TgCrypto==1.2.1
|
||||
Pyrogram==1.1.1
|
||||
TgCrypto==1.2.2
|
Reference in New Issue
Block a user