Started work on emotes schema and administration endpoints. Improvements to Link/Media embeds in chat.
This commit is contained in:
parent
1ce2fc3c22
commit
12922658b9
9 changed files with 266 additions and 19 deletions
|
|
@ -95,7 +95,7 @@ module.exports = class commandPreprocessor{
|
|||
//this.rawData.links.forEach((link) => {
|
||||
for (const link of this.rawData.links){
|
||||
//Set standard link type
|
||||
var linkType = 'link';
|
||||
var type = 'link';
|
||||
|
||||
//Don't try this at home, we're what you call "Experts"
|
||||
//TODO: Handle this shit simultaneously and send the chat before its done, then send updated types for each link as they're pulled individually
|
||||
|
|
@ -116,14 +116,14 @@ module.exports = class commandPreprocessor{
|
|||
//If the file size is unreported OR it's smaller than 4MB (not all servers report this and images that big are pretty rare)
|
||||
if(fileSize == null || fileSize <= maxSize){
|
||||
//Mark link as an image
|
||||
linkType = 'image';
|
||||
type = 'image';
|
||||
}
|
||||
//If it's a video
|
||||
}else if(fileType.match('video/mp4' || 'video/webm')){
|
||||
//If the server is reporting file-size and it's reporting under 4MB (Reject unreported sizes to be on the safe side is video is huge)
|
||||
if(fileSize != null && fileSize <= maxSize){
|
||||
//mark link as a video
|
||||
linkType = 'video';
|
||||
type = 'video';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ module.exports = class commandPreprocessor{
|
|||
//Add a marked link object to our links array
|
||||
this.links.push({
|
||||
link,
|
||||
type: linkType
|
||||
type
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue