mirror of
https://github.com/syuilo/ai.git
synced 2024-11-24 22:01:07 +00:00
Refactoring
This commit is contained in:
parent
6c69ee72b1
commit
29eae273e5
|
@ -7,7 +7,7 @@ function zeroPadding(num: number, length: number): string {
|
||||||
return ('0000000000' + num).slice(-length);
|
return ('0000000000' + num).slice(-length);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class BirthdayModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'birthday';
|
public readonly name = 'birthday';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -9,7 +9,7 @@ const titles = ['さん', 'くん', '君', 'ちゃん', '様', '先生'];
|
||||||
|
|
||||||
const invalidChars = ['@', '#', '*', ':', '(', '[', ' ', ' '];
|
const invalidChars = ['@', '#', '*', ':', '(', '[', ' ', ' '];
|
||||||
|
|
||||||
export default class CoreModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'core';
|
public readonly name = 'core';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Module from '../../module';
|
||||||
import Message from '../../message';
|
import Message from '../../message';
|
||||||
import serifs from '../../serifs';
|
import serifs from '../../serifs';
|
||||||
|
|
||||||
export default class DiceModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'dice';
|
public readonly name = 'dice';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -126,7 +126,7 @@ const faces = [
|
||||||
'👽'
|
'👽'
|
||||||
]
|
]
|
||||||
|
|
||||||
export default class EmojiModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'emoji';
|
public readonly name = 'emoji';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
|
||||||
import Module from '../../module';
|
import Module from '../../module';
|
||||||
import Message from '../../message';
|
import Message from '../../message';
|
||||||
|
|
||||||
export default class FollowModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'follow';
|
public readonly name = 'follow';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -5,7 +5,7 @@ import serifs from '../../serifs';
|
||||||
import * as seedrandom from 'seedrandom';
|
import * as seedrandom from 'seedrandom';
|
||||||
import { blessing, itemPrefixes, items } from './vocabulary';
|
import { blessing, itemPrefixes, items } from './vocabulary';
|
||||||
|
|
||||||
export default class FortuneModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'fortune';
|
public readonly name = 'fortune';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Message from '../../message';
|
||||||
import serifs from '../../serifs';
|
import serifs from '../../serifs';
|
||||||
import getCollection from '../../utils/get-collection';
|
import getCollection from '../../utils/get-collection';
|
||||||
|
|
||||||
export default class GuessingGameModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'guessingGame';
|
public readonly name = 'guessingGame';
|
||||||
|
|
||||||
private guesses: loki.Collection<{
|
private guesses: loki.Collection<{
|
||||||
|
|
|
@ -13,7 +13,7 @@ function kanaToHira(str: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class KeywordModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'keyword';
|
public readonly name = 'keyword';
|
||||||
|
|
||||||
private tokenizer: any;
|
private tokenizer: any;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
|
||||||
import Module from '../../module';
|
import Module from '../../module';
|
||||||
import Message from '../../message';
|
import Message from '../../message';
|
||||||
|
|
||||||
export default class PingModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'ping';
|
public readonly name = 'ping';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Message from '../../message';
|
||||||
import Friend from '../../friend';
|
import Friend from '../../friend';
|
||||||
import getDate from '../../utils/get-date';
|
import getDate from '../../utils/get-date';
|
||||||
|
|
||||||
export default class ReversiModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'reversi';
|
public readonly name = 'reversi';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Module from '../../module';
|
||||||
import serifs from '../../serifs';
|
import serifs from '../../serifs';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
|
|
||||||
export default class ServerModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'server';
|
public readonly name = 'server';
|
||||||
|
|
||||||
private connection?: any;
|
private connection?: any;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Module from '../../module';
|
||||||
import Message from '../../message';
|
import Message from '../../message';
|
||||||
import serifs from '../../serifs';
|
import serifs from '../../serifs';
|
||||||
|
|
||||||
export default class TimerModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'timer';
|
public readonly name = 'timer';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Module from '../../module';
|
||||||
import Friend from '../../friend';
|
import Friend from '../../friend';
|
||||||
import serifs from '../../serifs';
|
import serifs from '../../serifs';
|
||||||
|
|
||||||
export default class ValentineModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'valentine';
|
public readonly name = 'valentine';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import autobind from 'autobind-decorator';
|
import autobind from 'autobind-decorator';
|
||||||
import Module from '../../module';
|
import Module from '../../module';
|
||||||
|
|
||||||
export default class WelcomeModule extends Module {
|
export default class extends Module {
|
||||||
public readonly name = 'welcome';
|
public readonly name = 'welcome';
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
Loading…
Reference in a new issue