CreateThemeRequest
Only users can use this method. See code examples.
---functions--- account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme
Returns
| Theme |
This type can only be an instance of:
| Theme |
Parameters
| slug | string | |
| title | string | |
| document | InputDocument | This argument defaults to None and can be omitted. |
| settings | InputThemeSettings | This argument defaults to None and can be omitted. Otherwise, a list must be supplied. |
Known RPC errors
This request can cause 1 known error:
ThemeMimeInvalidError | You cannot create this theme, the mime-type is invalid. |
You can import these from telethon.errors.
Example
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.account.CreateThemeRequest(
slug='some string here',
title='My awesome title',
document=types.InputDocument(
id=-12398745604826,
access_hash=-12398745604826,
file_reference=b'arbitrary\x7f data \xfa here'
),
settings=[types.InputThemeSettings(
base_theme=types.BaseThemeClassic(),
accent_color=42,
message_colors_animated=True,
outbox_accent_color=42,
message_colors=[42],
wallpaper=types.InputWallPaper(
id=-12398745604826,
access_hash=-12398745604826
),
wallpaper_settings=types.WallPaperSettings(
blur=True,
motion=True,
background_color=42,
second_background_color=42,
third_background_color=42,
fourth_background_color=42,
intensity=42,
rotation=42
)
)]
))
print(result.stringify())