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
24
src/ai.ts
24
src/ai.ts
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue