mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-25 00:27:46 +01:00
Updated Internal test bots (markdown)
parent
9b10c7ad7e
commit
c77f3b0384
1 changed files with 17 additions and 1 deletions
|
@ -8,7 +8,7 @@ py_version = 2.7|3.4|3.5|3.6|3.7
|
||||||
bot_username = ptb_{CI.lower()}_{py_platform.lower()}_{py_version.replace('.', '')}_bot
|
bot_username = ptb_{CI.lower()}_{py_platform.lower()}_{py_version.replace('.', '')}_bot
|
||||||
```
|
```
|
||||||
## Script
|
## Script
|
||||||
[Here](https://gist.github.com/jsmnbom/2e8044ca5cc55813a0e0380ad375b320) is a script that does all the setup below in a semi automated way using Telethon.
|
[Here](https://gist.github.com/jsmnbom/2e8044ca5cc55813a0e0380ad375b320) is a script that does all the setup below in a semi automated way using Telethon. Also check [this version](https://gist.github.com/Bibo-Joshi/75f135edf1ca3530decf4c2ae06bd699), which was updated for the animated sticker sets.
|
||||||
|
|
||||||
|
|
||||||
## Setup a new bot
|
## Setup a new bot
|
||||||
|
@ -104,3 +104,19 @@ with open(sticker, 'rb') as f:
|
||||||
assert bot.create_new_sticker_set(me.id, sticker_set_name, sticker_set_title,
|
assert bot.create_new_sticker_set(me.id, sticker_set_name, sticker_set_title,
|
||||||
f, sticker_emoji)
|
f, sticker_emoji)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Create an animated sticker set for the bot
|
||||||
|
|
||||||
|
We need to use the bot api to do this.
|
||||||
|
```
|
||||||
|
me_id = YOURUSERID
|
||||||
|
animated_sticker_set_name = 'test_by_{username}
|
||||||
|
animated_sticker_set_title = 'Test',
|
||||||
|
animated_sticker = 'tests/data/telegram_animated_sticker.png',
|
||||||
|
sticker_emoji = '😄'
|
||||||
|
|
||||||
|
bot = telegram.Bot(token)
|
||||||
|
with open(animated_sticker, 'rb') as f:
|
||||||
|
assert bot.create_new_sticker_set(me.id, animated_sticker_set_name, animated_sticker_set_title,
|
||||||
|
f, sticker_emoji)
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue