Skip to content

Commit

Permalink
Merge pull request #267 from patrickmonster/release/3.5.0
Browse files Browse the repository at this point in the history
Release. 3.5.0
  • Loading branch information
patrickmonster authored Jun 27, 2024
2 parents 0f9fd6a + 1992813 commit f130aa0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"tabWidth": 4
},
"name": "discord-notification-ts",
"version": "3.4.74",
"version": "3.5.0",
"main": "index.js",
"repository": "https://github.com/patrickmonster/discord-notification-ts.git",
"author": "Soung jin Ryu <neocat@kakao.com>",
Expand Down
2 changes: 1 addition & 1 deletion src/components/notice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const sendTestNotice = async (noticeId: string | number, guildId: string)
embeds: [embed],
username: content.channel?.channelName || '방송알리미',
avatar_url:
content.channel.channelImageUrl ||
content.channel?.channelImageUrl ||
'https://cdn.orefinger.click/post/466950273928134666/d2d0cc31-a00e-414a-aee9-60b2227ce42c.png',
},
},
Expand Down
18 changes: 15 additions & 3 deletions src/components/user/afreeca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,32 @@ export const searchAfreecabeUser = async (keyword: string): Promise<Array<{ name
* @returns
*/
export const convertVideoObject = (videoObject: Content, name?: string): APIEmbed => {
console.log(videoObject);

const {
broad: { broad_title: title, broad_no, user_id },
broad,
station: { user_nick: channelName, broad_start },
profile_image: channelImageUrl,
} = videoObject;
const time = dayjs(broad_start).add(-9, 'h');

let title = '방송 정보가 없습니다!';
let no = 0;
let id = '';
if (broad) {
const { broad_title, broad_no, user_id } = broad;
title = broad_title;
no = broad_no;
id = user_id;
}

return {
title: title || 'LIVE ON',
description: `<t:${time.unix()}:R>`,
url: `https://play.afreecatv.com/${user_id}/${broad_no}`,
url: `https://play.afreecatv.com/${id}/${no}`,
color: 0x0746af,
thumbnail: { url: channelImageUrl.startsWith('http') ? channelImageUrl : `https:${channelImageUrl}` },
image: { url: `https://liveimg.afreecatv.com/m/${broad_no}?${randomIntegerInRange(100, 999)}` },
image: { url: `https://liveimg.afreecatv.com/m/${no}?${randomIntegerInRange(100, 999)}` },
footer: { text: name ?? channelName },
timestamp: time.format(),
};
Expand Down

0 comments on commit f130aa0

Please sign in to comment.