Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(msg.author.bot) return;
- if(msg.channel.name == "screenshots"){
- //replace ID with ID for gallery text channel.
- const chl = msg.client.channels.find('id', '634920329491251200');
- //for attachments
- if(msg.attachments.size > 0){
- let attachmentsArray = msg.attachments.array();
- msg.channel.send("attachment");
- for(let i=0; i<attachmentsArray.length; i++){
- let fileName = attachmentsArray[i].filename;
- let fileFormat = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length);
- if(fileFormat == "png" || fileFormat == "jpg"){
- chl.send("", {files: [attachmentsArray[i].url]});
- }
- }
- }
- //for embeds
- if(msg.embeds.length > 0){
- let embedsArray = msg.embeds;
- msg.channel.send("embed");
- for(let i=0; i<embedsArray.length; i++){
- if(embedsArray[i].type == "image"){
- chl.send("", {files: [embedsArray[i].url]});
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement