16 lines
319 B
JavaScript
16 lines
319 B
JavaScript
export default function (message) {
|
|
if (/image/.test(message.type)) {
|
|
return { image_url: message.url };
|
|
}
|
|
if (/audio/.test(message.type)) {
|
|
return { audio_url: message.url };
|
|
}
|
|
if (/video/.test(message.type)) {
|
|
return { video_url: message.url };
|
|
}
|
|
return {
|
|
title_link: message.url,
|
|
type: 'file'
|
|
};
|
|
}
|