This commit is contained in:
CrescentLeaf
2025-11-29 11:23:27 +08:00
parent 3bd0d79fdc
commit e7f0af8e6e

View File

@@ -184,8 +184,8 @@ export default class Message extends BaseClientObject {
if (fileType != null && /tws:\/\/file\?hash=[A-Za-z0-9]+$/.test(href)) { if (fileType != null && /tws:\/\/file\?hash=[A-Za-z0-9]+$/.test(href)) {
const file_hash = /^tws:\/\/file\?hash=(.*)/.exec(href)?.[1]! const file_hash = /^tws:\/\/file\?hash=(.*)/.exec(href)?.[1]!
let file_name: string = /^Video|File|Image=(.*)/.exec(text)?.[1] || text let file_name: string = /^(Video|File|Image)=(.*)/.exec(text)?.[2] || text
file_name.trim() == '' && (file_name = 'Unnamed File') file_name.trim() == '' && (file_name = 'Unnamed_File')
return attachment ? attachment({ text: text, attachment: new ChatAttachment(this.client, { file_hash, file_name }), fileType: fileType, }) : text return attachment ? attachment({ text: text, attachment: new ChatAttachment(this.client, { file_hash, file_name }), fileType: fileType, }) : text
} }
if (mentionType != null && /^tws:\/\/chat\?id=[A-Za-z0-9]+/.test(href)) { if (mentionType != null && /^tws:\/\/chat\?id=[A-Za-z0-9]+/.test(href)) {