account.createTheme
Create a theme
func (c *Client) AccountCreateTheme(ctx context.Context, request *AccountCreateThemeRequest) (*Theme, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountCreateTheme(ctx, &tg.AccountCreateThemeRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *Theme
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Slug | string | yes | Unique theme ID used to generate theme deep links, can be empty to autogenerate a random ID. |
Title | string | yes | Theme name |
Document | InputDocumentClass | — | Theme file |
Settings | []InputThemeSettings | — | Theme settings, multiple values can be provided for the different base themes (day/night mode, etc). |
Returns
Possible 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. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.createTheme#652e4400