Browse Source

Update documentation

Painor 1 year ago
parent
commit
e61fbcbaf7
2 changed files with 9 additions and 3 deletions
  1. 6 0
      gramjs/client/telegramBaseClient.ts
  2. 3 3
      gramjs/tl/custom/message.ts

+ 6 - 0
gramjs/client/telegramBaseClient.ts

@@ -592,6 +592,12 @@ export abstract class TelegramBaseClient {
 
 
     /**
     /**
      * Custom error handler for the client
      * Custom error handler for the client
+     * @example
+     * ```ts
+     * client.onError = async (error)=>{
+     *         console.log("error is",error)
+     *     }
+     * ```
      */
      */
     set onError(handler: (error: Error) => Promise<void>) {
     set onError(handler: (error: Error) => Promise<void>) {
         this._errorHandler = async (error: Error) => {
         this._errorHandler = async (error: Error) => {

+ 3 - 3
gramjs/tl/custom/message.ts

@@ -69,13 +69,13 @@ interface MessageBaseInterface {
  *    await message.click(row, column)
  *    await message.click(row, column)
  *
  *
  *    # Click by text
  *    # Click by text
- *    await message.click(text='👍')
+ *    await message.click({text:'👍'})
  *
  *
  *    # Click by data
  *    # Click by data
- *    await message.click(data=b'payload')
+ *    await message.click({data:'payload'})
  *
  *
  *    # Click on a button requesting a phone
  *    # Click on a button requesting a phone
- *    await message.click(0, share_phone=True)
+ *    await message.click(0, {share_phone:true})
  * ```
  * ```
  */
  */