Skip to content

Commit

Permalink
Page y,m,d,h,m,s
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 10, 2020
1 parent c903cf5 commit 1f99679
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/misc/aiscript/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export class ASEvaluator {
MY_FOLLOWING_COUNT: opts.user ? opts.user.followingCount : 0,
SEED: opts.randomSeed ? opts.randomSeed : '',
YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`,
YEAR: date.getFullYear(),
MON: date.getMonth() + 1,
DAY: date.getDate(),
HOUR: date.getHours(),
MIN: date.getMinutes(),
SEC: date.getSeconds(),
NULL: null
};
}
Expand Down
6 changes: 6 additions & 0 deletions src/misc/aiscript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ export const envVarsDef: Record<string, Type> = {
MY_FOLLOWING_COUNT: 'number',
SEED: null,
YMD: 'string',
YEAR: 'number',
MON: 'number',
DAY: 'number',
HOUR: 'number',
MIN: 'number',
SEC: 'number',
NULL: null,
};

Expand Down

0 comments on commit 1f99679

Please sign in to comment.