Package Exports
- discord-multipurpose
 
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-multipurpose) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Discord Multipurpose
This is a package to help make development of Discord.js bots easier. Also has Type Declarations!
Installation
$npm i discord-multipurpose@latestThat should install the package to your project
Modules & Usage
Discord Emoji
const Multipurpose = require("discord-multipurpose");
console.log(Multipurpose.DiscordEmoji.food.apple);
// Logs "π"Discord Image Manipulation
β You need
canvasinstalled to use these functions, discord.js is not required for these. If you are on Windows and have never used canvas previously, you will probably need to installwindows-build-toolsusingnpm i -g windows-build-toolsalong with GTK-2 & Python. Refer to this for further information βMethods
ping:
- Draws a Discord ping across the user's image
 - Parameters: 
- avatar (Type: string | Buffer, Required: true): The avatar of the user  

 
 - avatar (Type: string | Buffer, Required: true): The avatar of the user  
 
fakeReply:
- Draws a fake reply yk
 - Parameters:
- avatar1 (Type: string | Buffer, Required: true): The avatar of the user who is replying
 - avatar2 (Type: string | Buffer, Required: true): The avatar of the user being replied to
 - username1 (Type: string, Required: true): The nickname/username of the user who is replying
 - username2 (Type: string, Required: true): The nickname/username of the user who is being replied to
 - messageText (Type: string, Required: true): The content of the sent message
 - replyText (Type: string, Required: true): The content of the replied message
 - hex1 (Type: string, Required: false): The colour of the role of the replying user
 - hex2 (Type: string, Required: false): The colour of the role of the replying user
 - mode (Type: string, Options: 'light', 'dark', Required: false, default: dark): The mode you want the stuff to be displayed in  
  
 
 
invert:
- Inverts the Image colours
 - Parameters:
- avatar (Type: string | Buffer): The image, whose colours you want to invert  

 
 - avatar (Type: string | Buffer): The image, whose colours you want to invert  
 
sepia:
- Applies Sepia effect on to the image
 - Parameters:
- avatar (Type: string | Buffer): The image on which you want to apply the effect/filter  

 
 - avatar (Type: string | Buffer): The image on which you want to apply the effect/filter  
 
greyscale:
- Applies greyscale filter on the image
 - Parameters:
- avatar (Type: string | Buffer): The image on which you want to apply the filter  

 
 - avatar (Type: string | Buffer): The image on which you want to apply the filter  
 
blur:
- Blurs an Image
 - Parameters:
- avatar (Type: string | Buffer): The image which you want to blur  

 
 - avatar (Type: string | Buffer): The image which you want to blur  
 
drip:
- Drip, do I need to explain further? π
 - Parameters:
- avatar (Type: string | Buffer): The image which will be Drip's face replacement  

 
 - avatar (Type: string | Buffer): The image which will be Drip's face replacement  
 
Example
const Multipurpose = require("discord-multipurpose"); const Discord = require("discord.js"); const client = new Discord.Client(); client.on("ready", () => console.log(`Logged in as ${client.user.tag}!`)); client.on("message", async (message) => { if(message.author.bot) return; if(message.content.toLowerCase() === ">ping") { const ping = await Multipurpose.Image.ping(message.author.displayAvatarURL({ format: 'png' })); return message.channel.send(new MessageAttachment(ping, "ping.png")); } });
Discord Util
- Works only for Discord.js bots, you need it installed to use these methods
 - Methods
paginateEmbed:
Paginate your Embeds using reactions!
Parameters
- msg (Type: Message, required: true): The message object, which you get from the Message Event
 - pages (Type: MessageEmbed[], required: true) :An array of MessageEmbeds, which you want to be in list
 - emojiList (Type: string[]): An array of left & right arrows, emojiList[0] is left arrow & emojiList[1] is the right arrow. Default: 
["βͺ", "β©"] - timeout (Type: number): The time for which the pagination will be active (in miliseconds)
  Default: 
120000ms (2 minutes) 
β The following example is only there to show how it works, you need to code the commands, you can check the code of the concerned command here. You only get the reaction menu feature.

confirmation:
- Get the confirmation from the user on an action
 - Parameters
- msg (Type: Message, required: true): The message which you want to be reacted upon
 - author (Type: User, required: true): The user whose confirmation is needed
 - validReactions (Type: string[], required: false, length: 2): The emojis for yes and no. validReactions[0] has to be the one for yes & validReactions[1] has to be the one for no Default: ["β", "β"]
 - time (Type: number, required: false): The time for which you want to wait for the reactions (in miliseconds)
  Default: 
60000ms (1 minute) - defaultResponse (Type: boolean, required: false): The result which you want to get if the user does not respond. Default: false
 
 - β  The following example shows an implementation of a command which works on using this function  

 
 
Minigames
- This feature is only for 
Discord.jsBots - Subclasses
- Akinator
- Constructor: (
  message -> Type: Message, required: true,
  region -> Type: Region, required: false, you'll see the options in the intellisense π€«, default: 
"en") - start method starts the Minigame
 β Requires
Embed Linkspermission to run, and there are instances when Aki-API might send errors, so it is suggested that you put it in a try catch block.
 - Constructor: (
  message -> Type: Message, required: true,
  region -> Type: Region, required: false, you'll see the options in the intellisense π€«, default: 
 
 - Akinator
 
- This feature is only for 
 
Post Script
βΉοΈ Contact me at
SpiderBro#8604
Feel free to make an issue or a PR in the GitHub Repository
Credits to Dr. Timeβ’ & Conqueror for contributing!