ncc.js
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

ncc.js

Naver Cafe Chat Library

Login

Open naver cafe application and turn on OTP Generator

const ncc = new Ncc()
// input code in your way (8 length digit)
const otpcode = await Log.read("OTP")
// success: username, fail: null
const uname = await ncc.loginOTP(otpcode)
if (uname == null) {
    return
}
// gotcha!
console.log(`username: ${uname}`)

Find Chat

// connect to Ncc (simirar enter talk.cafe.naver.com)
await ncc.connect()
// find channel from joined
const openCh = ncc.joinedChannels.find(
    (v) => v.cafe.cafeId === 26686242 && v.channelInfo.name === "채팅방")
if (openCh == null) {
    return
}
// enter now! (socket connect)
const session = await ncc.getConnectedChannel(openCh)

Send Hello Naver~

await session.sendText("안녕, 네이버!")

More at the future (10 years later)

Readme

Keywords

Package Sidebar

Install

npm i ncc.js

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

794 kB

Total Files

127

Last publish

Collaborators

  • craftingmod