a
This commit is contained in:
parent
e074d975e1
commit
81d0709249
2 changed files with 36 additions and 8 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue