diff --git a/README.md b/README.md index 9775649..3109a9e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Misskey用の日本語Botです。 "mecab": "MeCab のインストールパス (ソースからインストールした場合、大体は /usr/local/bin/mecab)" } ``` -`npm install` して `npm run build` して `node built` すれば起動できます +`npm install` して `npm run build` して `npm start` すれば起動できます ## 記憶 藍は記憶の保持にインメモリデータベースを使用しており、藍のインストールディレクトリに `memory.json` という名前で永続化されます。 diff --git a/src/index.ts b/src/index.ts index 978aacb..16ff0e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +// AiOS bootstrapper + import 藍 from './ai'; import config from './config'; import _log from './utils/log'; @@ -30,6 +32,8 @@ log(chalk.bold('Ai v1.0')); promiseRetry(retry => { log(`Account fetching... ${chalk.gray(config.host)}`); + + // アカウントをフェッチ return request.post(`${config.apiUrl}/i`, { json: { i: config.i @@ -43,6 +47,7 @@ promiseRetry(retry => { log('Starting AiOS...'); + // 藍起動 new 藍(account, [ new EmojiModule(), new FortuneModule(), diff --git a/src/module.ts b/src/module.ts index 4cae850..331861d 100644 --- a/src/module.ts +++ b/src/module.ts @@ -17,11 +17,22 @@ export default abstract class Module { this.ai.log(`[${this.name}]: ${msg}`); } + /** + * コンテキストを生成し、ユーザーからの返信を待ち受けます + * @param key コンテキストを識別するためのキー + * @param isDm トークメッセージ上のコンテキストかどうか + * @param id トークメッセージ上のコンテキストならばトーク相手のID、そうでないなら待ち受ける投稿のID + * @param data コンテキストに保存するオプションのデータ + */ @autobind protected subscribeReply(key: string, isDm: boolean, id: string, data?: any) { this.ai.subscribeReply(this, key, isDm, id, data); } + /** + * 返信の待ち受けを解除します + * @param key コンテキストを識別するためのキー + */ @autobind protected unsubscribeReply(key: string) { this.ai.unsubscribeReply(this, key);