NPC와 알림 메시지의 장수 아이콘 경로를 공통 처리

This commit is contained in:
2026-09-07 15:28:24 +00:00
parent d57fd3e553
commit d8c9a63915
11 changed files with 116 additions and 13 deletions
+1 -4
View File
@@ -7,8 +7,6 @@ const DEFAULT_NATION = {
color: '#000000',
};
const DEFAULT_SHARED_ICON_PUBLIC_URL = 'https://sam-image.hided.net/icons';
export const resolveNationInfo = async (
db: DatabaseClient,
nationId: number
@@ -25,14 +23,13 @@ export const resolveNationInfo = async (
export const buildTargetFromGeneral = async (db: DatabaseClient, general: GeneralRow): Promise<MessageTarget> => {
const nation = await resolveNationInfo(db, general.nationId);
const picture = general.picture?.trim() || 'default.jpg';
return {
generalId: general.id,
generalName: general.name,
nationId: general.nationId,
nationName: nation.name,
color: nation.color,
icon: general.imageServer ? `d_pic/${picture}` : `${DEFAULT_SHARED_ICON_PUBLIC_URL}/${picture}`,
icon: resolveMessageTargetIcon({ picture: general.picture, imageServer: general.imageServer }),
};
};