LiF-Lee / shareKakao

카카오톡 공유하기 모듈 - shareKakao
MIT License
31 stars 7 forks source link
javascript kakao rhino

shareKakao

JavaScript License

2021/09/12 정상 작동
카카오톡 버전 9.4.5 기준

Warning

해당 모듈을 사용하여 얻는 모든 불이익에 대해 아무런 책임을 지지 않습니다.

오픈소스 라이선스

KakaoAuthCracker
Github
Copyright 2020 supersunkist
MIT License

Example - Kakao.share()

Alt text Alt text

  • Share Simple Text - [Type: 1]
    
    const shareKakao = require("share.js");
    const Kakao = new shareKakao();
    Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", { type: 1, message: "example", attachment: {} });


* Share Shout Text - [Type: 1]
``` javascript
const shareKakao = require("share.js");
const Kakao = new shareKakao();
Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", {
    type: 1,
    message: "Example",
    attachment: {
        shout: true
    }
});
  • Share Mention Text - [Type: 1]
    
    const shareKakao = require("share.js");
    const Kakao = new shareKakao();
    Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", { type: 1, message: "@Example", attachment: { mentions: [{ at: [1], len: 7, user_id: user_id // string 형식으로 넣으면 작동하지 않습니다.. (21년 11월 08일 수정) }] } });

/ (2021년 10월 달 이후 작동하지 않음) Kakao.share("chat_id", { type: 1, message: "@", // 1. 닉네임 없이 @. attachment: { mentions: [{ at: [1], len: 0, // 2. 닉네임 길이를 0. user_id: "user_id" // 1, 2번처럼 해두고 user_id만 넣으면 멘션 가능합니다. }] } }); /


* Share Long Text - [Type: 1]
``` javascript
const shareKakao = require("share.js");
const Kakao = new shareKakao();
Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", {
    type: 1,
    message: "Example", // 미리보기 텍스트.
    attachment: {
        type: "text/plain",
        mt: "text/txt",
        path: "path" /* talkm/bla/bla.txt */
    }
});
  • Share Simple Image - [Type: 2]
    
    const shareKakao = require("share.js");
    const Kakao = new shareKakao();
    Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", { type: 2, message: "사진", attachment: { type: "image/jpeg", w: 210, h: 210, path: "path" / talkm/bla/bla.jpeg / } });


* Share Simple File - [Type: 18]
``` javascript
const shareKakao = require("share.js");
const Kakao = new shareKakao();
Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");

Kakao.share("chat_id", {
    type: 18,
    message: "Example",
    attachment: {
        name: "bla.zip", // 확장자 입력 필수.
        size: 1572864, // 바이트 기준, 1572864 입력시 출력 -> 1.5 MB
        path: "path" /* talkf/bla/bla.zip */
    }
});

Available Types - Kakao.share()

{
    "text": 1,
    "image": 2,
    "video": 3,
    "tel": 4,
    "audio": 5,
    "map": 16,
    "file": 18
}

Example - Kakao.shareSharp()

Alt text Alt text

  • Share Sharp Search - [Type: list]
    
    const shareKakao = require("share.js");
    const Kakao = new shareKakao();
    Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");
    Kakao.setUserId("myUserId");

Kakao.shareSharp("chat_id", { type: "list", query: "Example", web_url: "", object: { content: [ { title: "ㅇㅅㅇ", description: "...", web_url: "" } ], button: [ { title: "ABC", web_url: "" }, { title: "DEF", web_url: "" } ] } });


* Share Sharp Search - [Type: image]
``` javascript
const shareKakao = require("share.js");
const Kakao = new shareKakao();
Kakao.setPackage("com.kakao.talk", "KakaoTalkVersion");
Kakao.setUserId("myUserId");

Kakao.shareSharp("chat_id", {
    type: "image",
    query: "Example",
    web_url: "",
    object: {
        content: [
            {
                image_url: "http://blabla.com/abc.jpg",
                width: "500",
                height: "400",
                web_url: ""
            }
        ],
        button: []
    }
});

Available Types - Kakao.shareSharp()

[
    "feed",
    "list",
    "image",
    "media"
]