wip
This commit is contained in:
parent
2c2385ac59
commit
d94f2c91fb
11 changed files with 160 additions and 30 deletions
|
@ -1,18 +1,7 @@
|
|||
import { config } from '../../config';
|
||||
import { User } from '../models/entities/user';
|
||||
import { Score } from '../../common/types/score';
|
||||
|
||||
/**
|
||||
* デフォルトの投稿用テンプレート
|
||||
*/
|
||||
export const defaultTemplate = `昨日のMisskeyの活動は
|
||||
|
||||
ノート: {notesCount}({notesDelta})
|
||||
フォロー : {followingCount}({followingDelta})
|
||||
フォロワー :{followersCount}({followersDelta})
|
||||
|
||||
でした。
|
||||
{url}`;
|
||||
import { defaultTemplate } from '../../common/default-template';
|
||||
|
||||
/**
|
||||
* 埋め込み変数の型
|
||||
|
|
|
@ -9,6 +9,7 @@ import { toSignedString } from './to-signed-string';
|
|||
* @returns ユーザーのスコア
|
||||
*/
|
||||
export const getScores = async (user: User): Promise<Score> => {
|
||||
// TODO 毎回取ってくるのも微妙なので、ある程度キャッシュしたいかも
|
||||
const miUser = await api<Record<string, number>>(user.host, 'users/show', { username: user.username }, user.token);
|
||||
if (miUser.error) {
|
||||
throw miUser.error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue