storycraft/node-kakao

there's no url attachment send by mobile client

punch5545 opened this issue · 1 comments

No error logs found.

console.log(data.chat);

Send by PC client

                    ...

  text: ' *이번 카톡 먼저보는 사람이 임자입니다(공지)\n' +
    'http://pf.kakao.com/**mask**/**mask**\n' +
    '▼▽▼▽▼▽▼▽▼ ### 클릭\n' +
    'http://bit.ly/********\n' +
    'http://bit.ly/********\n' +

                   ...

    '▼▽▼▽▼▽▼▽▼ @@@ 클릭\n' +
    'http://bit.ly/********\n' +
    'http://bit.ly/********',
  attachment: {
    urls: [
      'http://pf.kakao.com/********/********',
      'http://bit.ly/********',
      'http://bit.ly/********',
      'http://bit.ly/********',
      'http://bit.ly/********'

                   ...

Send by mobile client

                    ...

  text: ' *이번 카톡 먼저보는 사람이 임자입니다(공지)\n' +
    'http://pf.kakao.com/********/********\n' +
    '▼▽▼▽▼▽▼▽▼ ### 클릭\n' +
    'http://bit.ly/********\n' +
    'http://bit.ly/********\n' +

                   ...

  attachment: {}
                   ...

Is there any solution?

I have filtered about unaccepted URLs,
like this

                   ...
if(data.chat.attachment?.urls){
   if(data.chat.type == 3) return; // Video type has url attachment 
                   ...
}

As mentioned in

/**
* Get url list in chat. Can be used to generate url preview.
* It is not for detecting urls.
*/
the urls property is not for filtering url. Use text property in TalkChatData.