summaryrefslogtreecommitdiff
path: root/src/server/api/bot/core.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-08 02:30:37 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-08 02:30:37 +0900
commita1b490afa756a71b9cef4afa424575bc223bc612 (patch)
tree06de4d839e17b1e08e0891542af7360c701a154a /src/server/api/bot/core.ts
parentMerge pull request #1392 from syuilo/greenkeeper/element-ui-2.3.3 (diff)
downloadsharkey-a1b490afa756a71b9cef4afa424575bc223bc612.tar.gz
sharkey-a1b490afa756a71b9cef4afa424575bc223bc612.tar.bz2
sharkey-a1b490afa756a71b9cef4afa424575bc223bc612.zip
Post --> Note
Closes #1411
Diffstat (limited to 'src/server/api/bot/core.ts')
-rw-r--r--src/server/api/bot/core.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/api/bot/core.ts b/src/server/api/bot/core.ts
index a44aa9d7bc..1cf0522349 100644
--- a/src/server/api/bot/core.ts
+++ b/src/server/api/bot/core.ts
@@ -3,7 +3,7 @@ import * as bcrypt from 'bcryptjs';
import User, { IUser, init as initUser, ILocalUser } from '../../../models/user';
-import getPostSummary from '../../../renderers/get-post-summary';
+import getNoteSummary from '../../../renderers/get-note-summary';
import getUserName from '../../../renderers/get-user-name';
import getUserSummary from '../../../renderers/get-user-summary';
import parseAcct from '../../../acct/parse';
@@ -83,7 +83,7 @@ export default class BotCore extends EventEmitter {
'me: アカウント情報を見ます\n' +
'login, signin: サインインします\n' +
'logout, signout: サインアウトします\n' +
- 'post: 投稿します\n' +
+ 'note: 投稿します\n' +
'tl: タイムラインを見ます\n' +
'no: 通知を見ます\n' +
'@<ユーザー名>: ユーザーを表示します\n' +
@@ -109,10 +109,10 @@ export default class BotCore extends EventEmitter {
this.signout();
return 'ご利用ありがとうございました <3';
- case 'post':
+ case 'note':
case '投稿':
if (this.user == null) return 'まずサインインしてください。';
- this.setContext(new PostContext(this));
+ this.setContext(new NoteContext(this));
return await this.context.greet();
case 'tl':
@@ -190,7 +190,7 @@ abstract class Context extends EventEmitter {
public static import(bot: BotCore, data: any) {
if (data.type == 'guessing-game') return GuessingGameContext.import(bot, data.content);
- if (data.type == 'post') return PostContext.import(bot, data.content);
+ if (data.type == 'note') return NoteContext.import(bot, data.content);
if (data.type == 'tl') return TlContext.import(bot, data.content);
if (data.type == 'notifications') return NotificationsContext.import(bot, data.content);
if (data.type == 'signin') return SigninContext.import(bot, data.content);
@@ -254,13 +254,13 @@ class SigninContext extends Context {
}
}
-class PostContext extends Context {
+class NoteContext extends Context {
public async greet(): Promise<string> {
return '内容:';
}
public async q(query: string): Promise<string> {
- await require('../endpoints/posts/create')({
+ await require('../endpoints/notes/create')({
text: query
}, this.bot.user);
this.bot.clearContext();
@@ -269,12 +269,12 @@ class PostContext extends Context {
public export() {
return {
- type: 'post'
+ type: 'note'
};
}
public static import(bot: BotCore, data: any) {
- const context = new PostContext(bot);
+ const context = new NoteContext(bot);
return context;
}
}
@@ -296,7 +296,7 @@ class TlContext extends Context {
}
private async getTl() {
- const tl = await require('../endpoints/posts/timeline')({
+ const tl = await require('../endpoints/notes/timeline')({
limit: 5,
untilId: this.next ? this.next : undefined
}, this.bot.user);
@@ -306,7 +306,7 @@ class TlContext extends Context {
this.emit('updated');
const text = tl
- .map(post => `${getUserName(post.user)}\n「${getPostSummary(post)}」`)
+ .map(note => `${getUserName(note.user)}\n「${getNoteSummary(note)}」`)
.join('\n-----\n');
return text;