core: parameter for create address command to configure ratchet keys

This commit is contained in:
Evgeny Poberezkin
2026-07-23 19:49:55 +01:00
parent c97871ffbc
commit 3e355c002c
9 changed files with 25 additions and 49 deletions
+4 -3
View File
@@ -88,19 +88,20 @@ Create bot address.
**Parameters**:
- userId: int64
- pqRatchet: bool?
**Syntax**:
```
/_address <userId>
/_address <userId>[ pq_ratchet=on|off]
```
```javascript
'/_address ' + userId // JavaScript
'/_address ' + userId + (typeof pqRatchet == 'boolean' ? ' pq_ratchet=' + (pqRatchet ? 'on' : 'off') : '') // JavaScript
```
```python
'/_address ' + str(userId) # Python
'/_address ' + str(userId) + ((' pq_ratchet=' + ('on' if pqRatchet else 'off')) if pqRatchet is not None else '') # Python
```
**Responses**:
+2 -1
View File
@@ -77,7 +77,7 @@ chatCommandsDocsData :: [(String, String, [(ConsName, [String], Text, [ConsName]
chatCommandsDocsData =
[ ( "Address commands",
"Bots can use these commands to automatically check and create address when initialized",
[ ("APICreateMyAddress", ["server_"], "Create bot address.", ["CRUserContactLinkCreated", "CRChatCmdError"], [], Just UNInteractive, "/_address " <> Param "userId"),
[ ("APICreateMyAddress", ["server_"], "Create bot address.", ["CRUserContactLinkCreated", "CRChatCmdError"], [], Just UNInteractive, "/_address " <> Param "userId" <> OnOffParam "pq_ratchet" "pqRatchet" Nothing),
("APIDeleteMyAddress", [], "Delete bot address.", ["CRUserContactLinkDeleted", "CRChatCmdError"], [], Just UNBackground, "/_delete_address " <> Param "userId"),
("APIShowMyAddress", [], "Get bot address and settings.", ["CRUserContactLink", "CRChatCmdError"], [], Nothing, "/_show_address " <> Param "userId"),
("APISetProfileAddress", [], "Add address to bot profile.", ["CRUserProfileUpdated", "CRChatCmdError"], [], Just UNInteractive, "/_profile_address " <> Param "userId" <> " " <> OnOff "enable"),
@@ -392,6 +392,7 @@ undocumentedCommands =
"APIRejectCall",
"APIReorderChatTags",
"APIReportMessage",
"APIRotateAddressRatchetKeys",
"APISaveAppSettings",
"APISendCallAnswer",
"APISendCallExtraInfo",