InputMediaSticker¶
- class telegram.InputMediaSticker(media, emoji=None, *, filename=None, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectRepresents a sticker file to be sent.
See also
Available In
Added in version 22.8.
- Parameters:
media (
str| file object |InputFile|bytes|pathlib.Path|telegram.Sticker) –File to send. Pass a
file_idas String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one. To upload a file, you can either pass a file object (e.g.open("filename", "rb")) or the file contents as bytes. If the bot is running inlocal_mode, passing the path of the file (as string orpathlib.Pathobject) is supported as well.Lastly you can pass an existing
telegram.Stickerobject to send.emoji (
str, optional) – Emoji associated with the sticker; only for just uploaded stickers.
- Keyword Arguments:
filename (
str, optional) – Custom file name for the sticker, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by thetempfilemodule.