devilscord
v0.1.4
Published
An easy and quick way to perform simple tasks which are bit complicated when using discord.js!
Downloads
4
Maintainers
Readme
DevilsCord
An easy and quick way to perform simple tasks which are bit complicated when using discord.js!
Watermark Event (Requires Discord.js & Canvas)
const {Watermark}=require('devilscord');
const { MessageEmbed, MessageAttachment } = require('discord.js')
module.exports = {
name : "watermark",
run : async (client, message, args) => {
const watermark=new Watermark(client);
const bg =args[0];
const water='https://cdn.discordapp.com/attachments/921255534252949554/936122159749820416/unknown.png';
message.channel.send('Putting Watermark! Please Wait....').then(async msg=>{
var watah=await watermark.put(water,bg);
if(watah=="UNSUPPORTED_WATERMARK_TYPE")
{
msg.edit('File type of Watermark provided is unsupported!');
return;
}
else if(watah=="UNSUPPORTED_BACKGROUND_TYPE")
{
msg.edit('File type of Target provided is unsupported!');
return;
}
else{
msg.delete();
message.channel.send({files:[watah]});}
})
}
}
Input:
Output:
Input #2:
Output #2:
Same watermark was used for both the inputs, package automatically resizes watermark according to the target!
Supported File Formats for Watermark and Backgrounds: png,jpeg,jpg. If any error occurs package will return it as String.
Variables passed: watermark.put() has 3 variables-
Watermark- URL with watermark to be passed in this variable.
Background- URL of the target to be watermarked should be passed in this variable.
Error Console Message- Boolean variable to show detailed message of error if any occurs. By default it is set to true
. If disabled, method will only return a string type error and will not console a message.