diff --git a/src/functions/format.ts b/src/functions/format.ts index 65c64e5..8a70539 100644 --- a/src/functions/format.ts +++ b/src/functions/format.ts @@ -1,7 +1,4 @@ -import { api } from '../services/misskey'; import { config } from '../config'; -import { User } from '../models/entities/user'; -import { updateUser } from './users'; import { Score } from '../types/Score'; export const format = (score: Score): string => `昨日のMisskeyの活動は diff --git a/src/functions/update-score.ts b/src/functions/update-score.ts index 653500c..afdd32f 100644 --- a/src/functions/update-score.ts +++ b/src/functions/update-score.ts @@ -9,8 +9,8 @@ export const updateScore = async (user: User): Promise => { } await updateUser(user.username, user.host, { - prevNotesCount: miUser.notesCount, - prevFollowingCount: miUser.followingCount, - prevFollowersCount: miUser.followersCount, + prevNotesCount: miUser.notesCount ?? 0, + prevFollowingCount: miUser.followingCount ?? 0, + prevFollowersCount: miUser.followersCount ?? 0, }); }; \ No newline at end of file