mirror of
https://github.com/syuilo/ai.git
synced 2024-11-22 05:08:00 +00:00
受け取ったメッセージを既読にするように
This commit is contained in:
parent
cc35412cb5
commit
b54e5aaf80
16
src/ai.ts
16
src/ai.ts
|
@ -84,18 +84,20 @@ export default class 藍 {
|
|||
private onMention = (msg: MessageLike) => {
|
||||
console.log(`mention received: ${msg.id}`);
|
||||
|
||||
// リアクションする
|
||||
if (!msg.isMessage) {
|
||||
setTimeout(() => {
|
||||
request.post(`${config.apiUrl}/notes/reactions/create`, {
|
||||
json: {
|
||||
i: config.i,
|
||||
if (msg.isMessage) {
|
||||
// 既読にする
|
||||
this.api(`${config.apiUrl}/messaging/messages/read`, {
|
||||
messageId: msg.id,
|
||||
});
|
||||
} else {
|
||||
// リアクションする
|
||||
this.api(`${config.apiUrl}/notes/reactions/create`, {
|
||||
noteId: msg.id,
|
||||
reaction: 'love'
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
this.modules.filter(m => m.hasOwnProperty('onMention')).some(m => {
|
||||
return m.onMention(msg);
|
||||
|
|
Loading…
Reference in a new issue