This commit is contained in:
mattyatea 2024-02-16 19:35:57 +09:00
parent e074d975e1
commit 81d0709249
2 changed files with 36 additions and 8 deletions

View file

@ -265,6 +265,24 @@ export class NoteCreateService implements OnApplicationShutdown {
}
if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) {
const { DiscordWebhookUrl } = (await this.metaService.fetch());
if (DiscordWebhookUrl) {
const data_disc = { 'username': 'ノートブロックお知らせ',
'content':
'ユーザー名 :' + user.username + '\n' +
'url : ' + user.host + '\n' +
'contents : ' + data.text,
};
await fetch(DiscordWebhookUrl, {
'method': 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data_disc),
});
}
throw new NoteCreateService.ContainsProhibitedWordsError();
}