1.0.3 • Published 4 years ago

richer-embed v1.0.3

Weekly downloads
4
License
ISC
Repository
-
Last release
4 years ago

richer-embed

An extension of Discord.js's RichEmbed class, with more functionality such as setting local images as embed.image and embed.thumbnail and personalizing the embed with a User's profile picture and name. Made for farazkaleemmalik/phoenixwright, a bot made with Discord.js.

RicherEmbed

Kind: global class

new RicherEmbed(channelObj, options)

Returns: RicherEmbed - Returns itself

ParamTypeDescription
channelObjChannel | UserDiscord.js Channel instance for which the embed is being created
optionsObjectAdditional properties to add to embed. An existing embed can also be inserted to turn it into a RicherEmbed instance (may be buggy).

richerEmbed.personalise(authorObj) ⇒ RicherEmbed

Personalises the embed for a User by changing the title and the thumbnail

Kind: instance method of RicherEmbed
Returns: RicherEmbed - Returns itself

ParamTypeDescription
authorObjUserUser to personalise

richerEmbed.setLocalThumbnail(pathName) ⇒ RicherEmbed

Attaches a local image as a thumbnail for the embed

Kind: instance method of RicherEmbed
Returns: RicherEmbed - Returns itself

ParamTypeDescription
pathNameStringPath to image. Relative paths are relative to entry file

richerEmbed.setLocalImage(pathName) ⇒ RicherEmbed

Attaches a local image as the main image for the embed

Kind: instance method of RicherEmbed
Returns: RicherEmbed - Returns itself

ParamTypeDescription
pathNameStringPath to image. Relative paths are relative to entry file

richerEmbed.setContent(title, content) ⇒ RicherEmbed

Sets content for the embed

Kind: instance method of RicherEmbed
Returns: RicherEmbed - Returns itself

ParamTypeDescription
titleStringTitle of embed
contentStringContent of embed, to be set embed.description

richerEmbed.replace(messageToReplace)

Replaces a message with this embed

Kind: instance method of RicherEmbed

ParamTypeDescription
messageToReplaceMessageThe message to replace. Note that this overrides the message channel previously set of the new provided is in a different channel

richerEmbed.send() ⇒ Promise(Message)

Send the message to the channel in embed.channel

Kind: instance method of RicherEmbed

richerEmbed.chat(authorObj, command, imageUrl) ⇒ RicherEmbed

Turns the embed into a chat embed, to be used by a bot command

Kind: instance method of RicherEmbed
Returns: RicherEmbed - Returns itself

ParamTypeDescription
authorObjUserAuthor of chat command
commandStringExact command in the form of "commandName parameters more_parameters". The first word is excluded from the embed's content.
imageUrlStringUrl of main image
1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

5 years ago