summaryrefslogtreecommitdiff
path: root/src/server/api/bot
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
commitbfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch)
tree8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/api/bot
parentresolve conflict (diff)
downloadsharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz
sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2
sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip
Resolve conflicts
Diffstat (limited to 'src/server/api/bot')
-rw-r--r--src/server/api/bot/core.ts8
-rw-r--r--src/server/api/bot/interfaces/line.ts12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/server/api/bot/core.ts b/src/server/api/bot/core.ts
index 77a68aaee6..ec7c935f9e 100644
--- a/src/server/api/bot/core.ts
+++ b/src/server/api/bot/core.ts
@@ -67,7 +67,7 @@ export default class BotCore extends EventEmitter {
return await this.context.q(query);
}
- if (/^@[a-zA-Z0-9-]+$/.test(query)) {
+ if (/^@[a-zA-Z0-9_]+$/.test(query)) {
return await this.showUserCommand(query);
}
@@ -208,7 +208,7 @@ class SigninContext extends Context {
if (this.temporaryUser == null) {
// Fetch user
const user: IUser = await User.findOne({
- username_lower: query.toLowerCase(),
+ usernameLower: query.toLowerCase(),
host: null
}, {
fields: {
@@ -297,7 +297,7 @@ class TlContext extends Context {
private async getTl() {
const tl = await require('../endpoints/posts/timeline')({
limit: 5,
- until_id: this.next ? this.next : undefined
+ untilId: this.next ? this.next : undefined
}, this.bot.user);
if (tl.length > 0) {
@@ -349,7 +349,7 @@ class NotificationsContext extends Context {
private async getNotifications() {
const notifications = await require('../endpoints/i/notifications')({
limit: 5,
- until_id: this.next ? this.next : undefined
+ untilId: this.next ? this.next : undefined
}, this.bot.user);
if (notifications.length > 0) {
diff --git a/src/server/api/bot/interfaces/line.ts b/src/server/api/bot/interfaces/line.ts
index 5b3e9107f6..1340ac9923 100644
--- a/src/server/api/bot/interfaces/line.ts
+++ b/src/server/api/bot/interfaces/line.ts
@@ -115,7 +115,7 @@ class LineBot extends BotCore {
actions.push({
type: 'uri',
label: 'Twitterアカウントを見る',
- uri: `https://twitter.com/${user.account.twitter.screen_name}`
+ uri: `https://twitter.com/${user.account.twitter.screenName}`
});
}
@@ -130,7 +130,7 @@ class LineBot extends BotCore {
altText: await super.showUserCommand(q),
template: {
type: 'buttons',
- thumbnailImageUrl: `${user.avatar_url}?thumbnail&size=1024`,
+ thumbnailImageUrl: `${user.avatarUrl}?thumbnail&size=1024`,
title: `${user.name} (@${acct})`,
text: user.description || '(no description)',
actions: actions
@@ -142,7 +142,7 @@ class LineBot extends BotCore {
public async showUserTimelinePostback(userId: string) {
const tl = await require('../../endpoints/users/posts')({
- user_id: userId,
+ userId: userId,
limit: 5
}, this.user);
@@ -174,7 +174,7 @@ module.exports = async (app: express.Application) => {
const user = await User.findOne({
host: null,
'account.line': {
- user_id: sourceId
+ userId: sourceId
}
});
@@ -184,7 +184,7 @@ module.exports = async (app: express.Application) => {
User.update(user._id, {
$set: {
'account.line': {
- user_id: sourceId
+ userId: sourceId
}
}
});
@@ -194,7 +194,7 @@ module.exports = async (app: express.Application) => {
User.update(user._id, {
$set: {
'account.line': {
- user_id: null
+ userId: null
}
}
});