mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-17 01:55:27 +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:
@@ -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