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

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}`);
// リアクションする
if (!msg.isMessage) {
setTimeout(() => { setTimeout(() => {
request.post(`${config.apiUrl}/notes/reactions/create`, { if (msg.isMessage) {
json: { // 既読にする
i: config.i, this.api(`${config.apiUrl}/messaging/messages/read`, {
messageId: msg.id,
});
} else {
// リアクションする
this.api(`${config.apiUrl}/notes/reactions/create`, {
noteId: msg.id, noteId: msg.id,
reaction: 'love' reaction: 'love'
}
}); });
}, 1000);
} }
}, 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);