removed ability to send attachments since i think fluxer deletes them from the server when a message is deleted :(

This commit is contained in:
Aster Fialla
2026-02-16 00:11:11 -05:00
parent e1dbba9043
commit 49cab523f0
2 changed files with 7 additions and 5 deletions

View File

@@ -19,7 +19,8 @@ helperEnums.err = {
NO_PROXY_WRAPPER: "You need at least one proxy tag surrounding 'text', either before or after.\nCorrect usage examples: `pf;member jane proxy J:text`, `pf;member jane [text]`", NO_PROXY_WRAPPER: "You need at least one proxy tag surrounding 'text', either before or after.\nCorrect usage examples: `pf;member jane proxy J:text`, `pf;member jane [text]`",
NOT_JSON_FILE: "Please attach a valid JSON file.", NOT_JSON_FILE: "Please attach a valid JSON file.",
NO_MEMBERS_IMPORTED: 'No members were imported.', NO_MEMBERS_IMPORTED: 'No members were imported.',
IMPORT_ERROR: "Please see attached file for logs on the member import process." IMPORT_ERROR: "Please see attached file for logs on the member import process.",
ATTACHMENTS_NOT_ALLOWED: "Unfortunately proxied message attachments aren't possible at this time. If you want to send a file, you can use a file host instead of uploading directly."
} }
helperEnums.help = { helperEnums.help = {

View File

@@ -55,24 +55,25 @@ msgh.parseProxyTags = async function (authorId, content, attachmentUrl= null){
members.filter(member => member.proxy).forEach(member => { members.filter(member => member.proxy).forEach(member => {
const splitProxy = member.proxy.split("text"); const splitProxy = member.proxy.split("text");
if(content.startsWith(splitProxy[0]) && content.endsWith(splitProxy[1])) { if(content.startsWith(splitProxy[0]) && content.endsWith(splitProxy[1])) {
if (attachmentUrl) throw new Error(enums.err.ATTACHMENTS_NOT_ALLOWED);
proxyMessage.proxy = member.proxy; proxyMessage.proxy = member.proxy;
const removePrefix = new RegExp("^" + splitProxy[0]); const removePrefix = new RegExp("^" + splitProxy[0]);
const removeSuffix = new RegExp(splitProxy[1] + "$"); const removeSuffix = new RegExp(splitProxy[1] + "$");
proxyMessage.message = content.replace(removePrefix, "").replace(removeSuffix, ""); proxyMessage.message = content.replace(removePrefix, "").replace(removeSuffix, "");;
if (proxyMessage.message.length === 0) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
if (proxyMessage.message.length === 0 && !attachmentUrl) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
} }
}) })
return proxyMessage; return proxyMessage;
} }
/** /**
* Sends a message as an attachment if it's too long. * Sends a message as an attachment if it's too long.NOT CURRENTLY IN USE
* *
* @async * @async
* @param {string} text - The text of the message. * @param {string} text - The text of the message.
* @param {Message} message - The message object. * @param {Message} message - The message object.
* @throws {Error} If a proxy message is sent with no message within it. * @throws {Error} If a proxy message is sent with no message within it.
*
*/ */
msgh.sendMessageAsAttachment = async function(text, message) { msgh.sendMessageAsAttachment = async function(text, message) {
if (text.length > 2000) { if (text.length > 2000) {