From c77f3b03844bf01026ab4b4e98c5801b1c9f151c Mon Sep 17 00:00:00 2001 From: Bibo-Joshi Date: Tue, 31 Mar 2020 22:35:16 +0200 Subject: [PATCH] Updated Internal test bots (markdown) --- Internal-test-bots.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Internal-test-bots.md b/Internal-test-bots.md index 87eb76b..3b65e64 100644 --- a/Internal-test-bots.md +++ b/Internal-test-bots.md @@ -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 ``` ## 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 @@ -104,3 +104,19 @@ with open(sticker, 'rb') as f: assert bot.create_new_sticker_set(me.id, sticker_set_name, sticker_set_title, 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) +```