This commit is contained in:
syuilo 2018-12-27 23:43:03 +09:00 committed by GitHub
parent 6ed96a2a26
commit 9c6ede81b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,7 +224,7 @@ export default class FortuneModule implements IModule {
public onMention = (msg: MessageLike) => {
if (msg.includes(['占', 'うらな', '運勢', 'おみくじ'])) {
const date = new Date();
const seed = `${date.getFullYear()}/${date.getMonth()}/${date.getDay()}@${msg.userId}`;
const seed = `${date.getFullYear()}/${date.getMonth()}/${date.getDate()}@${msg.userId}`;
const rng = seedrandom(seed);
const omikuji = omikujis[Math.floor(rng() * omikujis.length)];
const itemPrefix = Math.floor(rng() * 5) != 0 ? itemPrefixes[Math.floor(rng() * itemPrefixes.length)] : '';