This commit is contained in:
syuilo 2019-02-02 01:53:06 +09:00
parent 643f3a3d58
commit 73c2ef516a
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 17 additions and 1 deletions

View file

@ -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` という名前で永続化されます。

View file

@ -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(),

View file

@ -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);