mirror of
https://github.com/syuilo/ai.git
synced 2024-11-24 22:01:07 +00:00
ユーザーの全プロパティを保存するのは無駄なので必要なプロパティのみ保存するように
This commit is contained in:
parent
be8583548a
commit
82588a602a
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue