ユーザーの全プロパティを保存するのは無駄なので必要なプロパティのみ保存するように

This commit is contained in:
syuilo 2019-01-24 09:45:35 +09:00
parent be8583548a
commit 82588a602a
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -3,7 +3,12 @@ import * as loki from 'lokijs';
import Module from '../../module'; import Module from '../../module';
import Message from '../../message'; import Message from '../../message';
import serifs from '../../serifs'; import serifs from '../../serifs';
import { User } from '../../misskey/user';
type User = {
id: string;
username: string;
host: string;
};
type Game = { type Game = {
votes: { votes: {
@ -97,8 +102,13 @@ export default class extends Module {
this.log(`Voted ${num} by ${msg.user.id}`); this.log(`Voted ${num} by ${msg.user.id}`);
// 投票
game.votes.push({ game.votes.push({
user: msg.user, user: {
id: msg.user.id,
username: msg.user.username,
host: msg.user.host
},
number: num number: num
}); });