2022-02-21 18:19:40 +00:00
|
|
|
export default function (message: { type: string; url: string }) {
|
2019-05-10 17:09:07 +00:00
|
|
|
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'
|
|
|
|
};
|
|
|
|
}
|