devilscord

0.1.4 • Public • Published

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:

Input for Watermark text Output:

Output for Watermark text

Input #2:

Input for Watermark text

Output #2:

Output for Watermark text

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.

Contact: Devils King#3000

Package Sidebar

Install

npm i devilscord

Weekly Downloads

4

Version

0.1.4

License

ISC

Unpacked Size

8 kB

Total Files

6

Last publish

Collaborators

  • devilsking