mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-04 04:16:27 +09:00
Refactoring
This commit is contained in:
@ -3,7 +3,6 @@ import * as loki from 'lokijs';
|
||||
import Module from '../../module';
|
||||
import Message from '../../message';
|
||||
import serifs from '../../serifs';
|
||||
import getCollection from '../../utils/get-collection';
|
||||
|
||||
export default class extends Module {
|
||||
public readonly name = 'guessingGame';
|
||||
@ -19,11 +18,9 @@ export default class extends Module {
|
||||
|
||||
@autobind
|
||||
public install() {
|
||||
//#region Init DB
|
||||
this.guesses = getCollection(this.ai.db, 'guessingGame', {
|
||||
this.guesses = this.ai.getCollection('guessingGame', {
|
||||
indices: ['userId']
|
||||
});
|
||||
//#endregion
|
||||
|
||||
return {
|
||||
mentionHook: this.mentionHook,
|
||||
|
@ -3,7 +3,6 @@ import * as loki from 'lokijs';
|
||||
import Module from '../../module';
|
||||
import Message from '../../message';
|
||||
import serifs from '../../serifs';
|
||||
import getCollection from '../../utils/get-collection';
|
||||
import { User } from '../../misskey/user';
|
||||
|
||||
type Game = {
|
||||
@ -23,7 +22,7 @@ export default class extends Module {
|
||||
|
||||
@autobind
|
||||
public install() {
|
||||
this.games = getCollection(this.ai.db, 'kazutori');
|
||||
this.games = this.ai.getCollection('kazutori');
|
||||
|
||||
this.crawleGameEnd();
|
||||
setInterval(this.crawleGameEnd, 1000);
|
||||
|
@ -3,7 +3,6 @@ import * as loki from 'lokijs';
|
||||
import Module from '../../module';
|
||||
import config from '../../config';
|
||||
import serifs from '../../serifs';
|
||||
import getCollection from '../../utils/get-collection';
|
||||
const MeCab = require('mecab-async');
|
||||
|
||||
function kanaToHira(str: string) {
|
||||
@ -26,11 +25,9 @@ export default class extends Module {
|
||||
public install() {
|
||||
if (!config.keywordEnabled) return {};
|
||||
|
||||
//#region Init DB
|
||||
this.learnedKeywords = getCollection(this.ai.db, '_keyword_learnedKeywords', {
|
||||
this.learnedKeywords = this.ai.getCollection('_keyword_learnedKeywords', {
|
||||
indices: ['userId']
|
||||
});
|
||||
//#endregion
|
||||
|
||||
this.tokenizer = new MeCab();
|
||||
this.tokenizer.command = config.mecab;
|
||||
|
Reference in New Issue
Block a user