mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
matchAttachmentType fix
This commit is contained in:
parent
870b638225
commit
f208dc3013
1 changed files with 6 additions and 11 deletions
|
@ -28,19 +28,14 @@ export const MatchAttachmentTypeTrigger = automodTrigger<MatchResultType>()({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!context.message.data.attachments) return null;
|
if (!context.message.data.attachments) {
|
||||||
const attachments: any[] = context.message.data.attachments;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
for (const attachment of attachments) {
|
for (const attachment of context.message.data.attachments) {
|
||||||
// FIXME: Hotfix
|
const attachmentType = attachment.url
|
||||||
if (!attachment.filename) {
|
|
||||||
console.warn("No attachment filename:", attachment);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const attachmentType = attachment.filename
|
|
||||||
.split(".")
|
.split(".")
|
||||||
.pop()
|
.pop()!
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
||||||
const blacklist = trigger.blacklist_enabled
|
const blacklist = trigger.blacklist_enabled
|
||||||
|
|
Loading…
Add table
Reference in a new issue