Layer 220
AccountCreateTheme
Create a theme
method
Users
account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Slug | string | Unique theme ID used to generate theme deep links, can be empty to autogenerate a random ID. |
| Title | string | Theme name |
| Document | flags.2?InputDocument | Theme file |
| Settings | Vector<InputThemeSettings> | Theme settings, multiple values can be provided for the different base themes (day/night mode, etc). |
Returns
ThemePossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | THEME_MIME_INVALID | The theme's MIME type is invalid. |
| 400 | THEME_TITLE_INVALID | The specified theme title is invalid. |
Gogram Example
// AccountCreateTheme - using Params struct result, err := client.AccountCreateTheme(&tg.AccountCreateThemeParams{ Slug: "...", Title: "...", // Optional fields: // Document: &tg.InputDocument{ID: int64(0), AccessHash: int64(0), FileReference: []byte{}}, // Settings: []tg.InputThemeSettings{&tg.InputThemeSettings{}}, }) if err != nil { // handle error } // result is *tg.Theme