mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
removed ability to send attachments since i think fluxer deletes them from the server when a message is deleted :(
This commit is contained in:
@@ -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]`",
|
||||
NOT_JSON_FILE: "Please attach a valid JSON file.",
|
||||
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 = {
|
||||
|
||||
@@ -55,24 +55,25 @@ msgh.parseProxyTags = async function (authorId, content, attachmentUrl= null){
|
||||
members.filter(member => member.proxy).forEach(member => {
|
||||
const splitProxy = member.proxy.split("text");
|
||||
if(content.startsWith(splitProxy[0]) && content.endsWith(splitProxy[1])) {
|
||||
if (attachmentUrl) throw new Error(enums.err.ATTACHMENTS_NOT_ALLOWED);
|
||||
proxyMessage.proxy = member.proxy;
|
||||
const removePrefix = new RegExp("^" + splitProxy[0]);
|
||||
const removeSuffix = new RegExp(splitProxy[1] + "$");
|
||||
proxyMessage.message = content.replace(removePrefix, "").replace(removeSuffix, "");
|
||||
|
||||
if (proxyMessage.message.length === 0 && !attachmentUrl) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
|
||||
proxyMessage.message = content.replace(removePrefix, "").replace(removeSuffix, "");;
|
||||
if (proxyMessage.message.length === 0) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
|
||||
}
|
||||
})
|
||||
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
|
||||
* @param {string} text - The text of the message.
|
||||
* @param {Message} message - The message object.
|
||||
* @throws {Error} If a proxy message is sent with no message within it.
|
||||
*
|
||||
*/
|
||||
msgh.sendMessageAsAttachment = async function(text, message) {
|
||||
if (text.length > 2000) {
|
||||
|
||||
Reference in New Issue
Block a user