0
0
Fork 0

wip: ログ

This commit is contained in:
Xeltica 2023-02-24 17:40:05 +09:00
parent d4c3673315
commit 0c3df4245d
9 changed files with 133 additions and 19 deletions

View file

@ -1,5 +1,30 @@
import { User } from '../models/entities/user';
import { api } from './misskey';
import {format} from '../../common/functions/format';
import {getScores} from '../functions/get-scores';
/**
*
* @param user
*/
export const sendAlert = async (user: User) => {
const text = format(user, await getScores(user));
switch (user.alertMode) {
case 'note':
await sendNoteAlert(text, user);
break;
case 'notification':
await sendNotificationAlert(text, user);
break;
case 'both':
await Promise.all([
sendNotificationAlert(text, user),
sendNoteAlert(text, user),
]);
break;
}
};
/**
*