受け取ったメッセージを既読にするように

This commit is contained in:
syuilo 2018-08-11 21:16:52 +09:00
parent cc35412cb5
commit b54e5aaf80

View file

@ -84,18 +84,20 @@ export default class 藍 {
private onMention = (msg: MessageLike) => { private onMention = (msg: MessageLike) => {
console.log(`mention received: ${msg.id}`); console.log(`mention received: ${msg.id}`);
// リアクションする setTimeout(() => {
if (!msg.isMessage) { if (msg.isMessage) {
setTimeout(() => { // 既読にする
request.post(`${config.apiUrl}/notes/reactions/create`, { this.api(`${config.apiUrl}/messaging/messages/read`, {
json: { messageId: msg.id,
i: config.i,
noteId: msg.id,
reaction: 'love'
}
}); });
}, 1000); } else {
} // リアクションする
this.api(`${config.apiUrl}/notes/reactions/create`, {
noteId: msg.id,
reaction: 'love'
});
}
}, 1000);
this.modules.filter(m => m.hasOwnProperty('onMention')).some(m => { this.modules.filter(m => m.hasOwnProperty('onMention')).some(m => {
return m.onMention(msg); return m.onMention(msg);