-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
bugSomething isn't workingSomething isn't working
Description
🐞 Bug: client.fetchUsers() fails due to getContactsV3 being unavailable
💡 Summary
Calling client.fetchUsers() after successful login using @evex/linejs results in an error:
API method not capable: 'getContactsV3'
🔁 Steps to Reproduce
import { loginWithPassword } from "@evex/linejs";
import 'dotenv/config';
async function testLineJS() {
try {
const email = process.env.LINE_EMAIL;
const password = process.env.LINE_PASSWORD;
const client = await loginWithPassword({
email,
password,
onPincodeRequest(pincode) {
console.log('Enter this pincode to your LINE app:', pincode);
}
}, { device: "DESKTOPMAC" });
const users = await client.fetchUsers();
console.log("取得したユーザー数:", users.length);
} catch (error) {
console.error("エラーが発生しました:", error);
}
}
testLineJS();📎 Error Output
InternalError [RequestError]: Request internal failed, getContactsV3(/RE4) -> {"be":"API method not capable: 'getContactsV3'","ce":1}
at RequestClient.requestCore (<project-root>/node_modules/@evex/linejs/base/request/mod.ts:235:10)
at async RelationService.getContactsV3 (<project-root>/node_modules/@evex/linejs/base/service/relation/mod.ts:55:10)
at async Client.fetchUsers (<project-root>/node_modules/@evex/linejs/client/client.ts:129:15)
⚙️ Environment
- OS: Windows 11
- Node.js: v20.x
- Package:
@evex/linejs(latest version) - Execution:
npx tsx src/index.ts
💬 Additional Notes
- Login and PIN code request succeed without issues.
✅ Workaround
Instead of using client.fetchUsers() (which internally calls getContactsV3 and fails), the following alternative works successfully:
// Get all contact IDs manually
const mids = await client.base.talk.getAllContactIds({
syncReason: "INTERNAL",
});
// Use getContacts instead of getContactsV3
const contacts = await client.base.talk.getContacts({ mids });This approach retrieves the list of contacts correctly and avoids the getContactsV3 API call.
nmt3325
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working