MTPProto GramJS InputCheckPasswordSRP Type Buffer Error

  Kiến thức lập trình

Help, I beg you, I don’t understand anything at all anymore, I’ve been struggling with this for a WEEK.



const allPassData = await client.invoke(new Api.account.GetPassword());
const { srpId, currentAlgo, srp_B } = allPassData;
const { salt1, salt2, g, p } = currentAlgo;

const { A, M1 } = await mtproto.crypto.getSRPParams({
      g,
      p,
      salt1,
      salt2,
      gB: srp_B,
      password: cloudPass, //String cloudpass
});

const result = await client.invoke(
    new Api.channels.EditCreator({
      channel: channel,
      userId: nextUser,
      password: new Api.InputCheckPasswordSRP({
        srpId: srpId,
        a: A,
        m1: M1,
      }),
    })
);


No matter what I try, I get this type of error


CastError: Found wrong type for A. expected buffer but received undefined.If you
 think this is a mistake please report it.
    at VirtualClass.assertType (C:UsersuserDesktopШаманShamanBotsrenamerBo
t_deepDevnode_modulestelegramtlapi.js:352:43)
    at VirtualClass.validate (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:298:30)
    at VirtualClass.getBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:359:26)
    at argToBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepDevnod
e_modulestelegramtlapi.js:113:22)
    at VirtualClass.getBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:415:42)
    at new RequestState (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepD
evnode_modulestelegramnetworkRequestState.js:13:29)
    at Object.invoke (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepDev
node_modulestelegramclientusers.js:34:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
)
    at async giftChannelNextUser (C:UsersuserDesktopШаманShamanBotsrenamer
Bot_deepDevstart.js:221:18)
CastError: Found wrong type for M1. expected buffer but received undefined.If yo
u think this is a mistake please report it.
    at VirtualClass.assertType (C:UsersuserDesktopШаманShamanBotsrenamerBo
t_deepDevnode_modulestelegramtlapi.js:352:43)
    at VirtualClass.validate (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:298:30)
    at VirtualClass.getBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:359:26)
    at argToBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepDevnod
e_modulestelegramtlapi.js:113:22)
    at VirtualClass.getBytes (C:UsersuserDesktopШаманShamanBotsrenamerBot_
deepDevnode_modulestelegramtlapi.js:415:42)
    at new RequestState (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepD
evnode_modulestelegramnetworkRequestState.js:13:29)
    at Object.invoke (C:UsersuserDesktopШаманShamanBotsrenamerBot_deepDev
node_modulestelegramclientusers.js:34:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
)
    at async giftChannelNextUser (C:UsersuserDesktopШаманShamanBotsrenamer
Bot_deepDevstart.js:221:18)
C:UsersuserDesktopШаманShamanBotsrenamerBot_deepDevnode_modulestelegram
tlgenerationHelpers.js:245
            throw Error(Bytes or str expected, not ${data.constructor.name});
                                                           ^

TypeError: Cannot read properties of undefined (reading 'constructor')
`

What does he need? I don’t know what I’m doing wrong, I’ve run out of hair on my head, I smoothed the cat so that he turned from a Maine Coon into a Sphynx with bruises. I beg you, help

passed A and M1 to a template string, and passed it to Buffer.from()

simply passed A and M1 to Buffer.from

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT