From ecba11b65463d94575f5dd5683b7e3b576fa1254 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 23 Aug 2020 11:31:35 +0900 Subject: [PATCH] Update dependencies --- .vscode/settings.json | 3 +++ README.md | 2 +- package.json | 34 +++++++++++++++++----------------- src/ai.ts | 4 ++-- src/index.ts | 8 ++++---- src/message.ts | 5 +++-- src/modules/reversi/index.ts | 2 +- src/utils/log.ts | 2 +- 8 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..68ecdba --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules\\typescript\\lib" +} \ No newline at end of file diff --git a/README.md b/README.md index 38a005d..ff7fc61 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Misskey用の日本語Botです。 ``` json { "host": "https:// + あなたのインスタンスのURL (末尾の / は除く)", - "i": "藍として動かしたいアカウントのAPIキー", + "i": "藍として動かしたいアカウントのアクセストークン", "keywordEnabled": "キーワードを覚える機能 (MeCab が必要) を有効にする場合は true を入れる (無効にする場合は false)", "chartEnabled": "チャート機能を無効化する場合は false を入れてください", "reversiEnabled": "藍とリバーシで対局できる機能を有効にする場合は true を入れる (無効にする場合は false)", diff --git a/package.json b/package.json index 07ff20e..c1add63 100644 --- a/package.json +++ b/package.json @@ -7,30 +7,30 @@ }, "dependencies": { "@types/chalk": "2.2.0", - "@types/lokijs": "1.5.2", - "@types/node": "10.0.5", + "@types/lokijs": "1.5.3", + "@types/node": "14.6.0", "@types/promise-retry": "1.1.3", "@types/random-seed": "0.3.3", - "@types/request-promise-native": "1.0.16", + "@types/request-promise-native": "1.0.17", "@types/seedrandom": "2.4.28", - "@types/uuid": "3.4.4", - "@types/ws": "6.0.1", + "@types/uuid": "8.3.0", + "@types/ws": "7.2.6", "autobind-decorator": "2.4.0", - "canvas": "2.5.0", - "chalk": "2.4.2", - "lokijs": "1.5.6", + "canvas": "2.6.1", + "chalk": "4.1.0", + "lokijs": "1.5.11", "mecab-async": "0.1.2", "misskey-reversi": "0.0.5", - "promise-retry": "1.1.1", + "promise-retry": "2.0.1", "random-seed": "0.3.0", - "reconnecting-websocket": "4.1.10", - "request": "2.88.0", - "request-promise-native": "1.0.7", - "seedrandom": "2.4.3", + "reconnecting-websocket": "4.4.0", + "request": "2.88.2", + "request-promise-native": "1.0.9", + "seedrandom": "3.0.5", "timeout-as-promise": "1.0.0", - "ts-node": "8.0.3", - "typescript": "3.4.5", - "uuid": "3.3.2", - "ws": "6.2.1" + "ts-node": "9.0.0", + "typescript": "4.0.2", + "uuid": "8.3.0", + "ws": "7.3.1" } } diff --git a/src/ai.ts b/src/ai.ts index cc2fade..1c60743 100644 --- a/src/ai.ts +++ b/src/ai.ts @@ -4,8 +4,8 @@ import * as fs from 'fs'; import autobind from 'autobind-decorator'; import * as loki from 'lokijs'; import * as request from 'request-promise-native'; -import chalk from 'chalk'; -import * as uuid from 'uuid/v4'; +import * as chalk from 'chalk'; +import { v4 as uuid } from 'uuid'; const delay = require('timeout-as-promise'); import config from './config'; diff --git a/src/index.ts b/src/index.ts index 1b66e8d..05f835b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,9 @@ // AiOS bootstrapper +import * as chalk from 'chalk'; +import * as request from 'request-promise-native'; +const promiseRetry = require('promise-retry'); + import 藍 from './ai'; import config from './config'; import _log from './utils/log'; @@ -22,10 +26,6 @@ import ValentineModule from './modules/valentine'; import MazeModule from './modules/maze'; import ChartModule from './modules/chart'; -import chalk from 'chalk'; -import * as request from 'request-promise-native'; -const promiseRetry = require('promise-retry'); - console.log(' __ ____ _____ ___ '); console.log(' /__\\ (_ _)( _ )/ __)'); console.log(' /(__)\\ _)(_ )(_)( \\__ \\'); diff --git a/src/message.ts b/src/message.ts index cc1f900..891d490 100644 --- a/src/message.ts +++ b/src/message.ts @@ -1,12 +1,13 @@ import autobind from 'autobind-decorator'; +import * as chalk from 'chalk'; +const delay = require('timeout-as-promise'); + import 藍 from './ai'; import Friend from './friend'; import { User } from './misskey/user'; import includes from './utils/includes'; import or from './utils/or'; -import chalk from 'chalk'; import config from './config'; -const delay = require('timeout-as-promise'); export default class Message { private ai: 藍; diff --git a/src/modules/reversi/index.ts b/src/modules/reversi/index.ts index 6314ec1..d34e073 100644 --- a/src/modules/reversi/index.ts +++ b/src/modules/reversi/index.ts @@ -129,7 +129,7 @@ export default class extends Module { } }); - ai.on('message', msg => { + ai.on('message', (msg: Record) => { if (msg.type == 'put') { gw.send('set', { pos: msg.pos diff --git a/src/utils/log.ts b/src/utils/log.ts index 8b9eba8..0c1b9a9 100644 --- a/src/utils/log.ts +++ b/src/utils/log.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import * as chalk from 'chalk'; export default function(msg: string) { const now = new Date();