evex-dev / linejs

LINEJS is a JavaScript library for creating a LINE SelfBot.
https://linejs.evex.land
MIT License
55 stars 18 forks source link

Error: E2EE Key has not been saved, try register `saveE2EESelfKeyDataByKeyId` or use E2EE Login #41

Closed Suphachock closed 3 weeks ago

Suphachock commented 1 month ago

I got and error when my line API send or reply message

EdamAme-x commented 1 month ago

wait a minute

EdamAme-x commented 1 month ago

Do you use FileStorage? If not understand, please see https://linejs.evex.land

Suphachock commented 1 month ago

Now it error Request internal failed: {"code":"NOT_FOUND","reason":"there is no valid group key"} when call message.send()

EdamAme-x commented 1 month ago

Once you send a message in the group you want to send it to, try it out;
LINE does not generate shared keys by first.

Suphachock commented 1 month ago

Can u example code for send message to group?

EdamAme-x commented 1 month ago

https://github.com/evex-dev/linejs/blob/main/examples/ping.ts

Suphachock commented 1 month ago

Mean I can't send message to specify group by group id?

EdamAme-x commented 1 month ago

Possible. If you cannot follow this procedure, there may be a bug.

Suphachock commented 1 month ago

message.send({ to: "XXXXXXXXXXXXXXXXXX", text: "Hello, this is a message!", }); In first version I use this code for send message by specify group and it work but now in the last version why it cannot work?

piloking commented 1 month ago

linejs does not currently support generating encryption keys for groups. You will first need to generate a key by sending a message to the group in your LINE app.

piloking commented 1 month ago

And to send a message to a specific chat:

client.on("ready", async (user) => {
  console.log(`Logged in as ${user.displayName} (${user.mid})`);
  await client.sendMessage({to:"mid",text:"text!"})
});