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.
Kind: global class
- RicherEmbed
- new RicherEmbed(channelObj, options)
- .personalise(authorObj) ⇒
RicherEmbed
- .setLocalThumbnail(pathName) ⇒
RicherEmbed
- .setLocalImage(pathName) ⇒
RicherEmbed
- .setContent(title, content) ⇒
RicherEmbed
- .replace(messageToReplace)
- .send() ⇒
Promise(Message)
- .chat(authorObj, command, imageUrl) ⇒
RicherEmbed
Returns: RicherEmbed
- Returns itself
Param | Type | Description |
---|---|---|
channelObj | Channel | User |
Discord.js Channel instance for which the embed is being created |
options | Object |
Additional 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
Param | Type | Description |
---|---|---|
authorObj | User |
User 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
Param | Type | Description |
---|---|---|
pathName | String |
Path 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
Param | Type | Description |
---|---|---|
pathName | String |
Path 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
Param | Type | Description |
---|---|---|
title | String |
Title of embed |
content | String |
Content of embed, to be set embed.description |
Replaces a message with this embed
Kind: instance method of RicherEmbed
Param | Type | Description |
---|---|---|
messageToReplace | Message |
The message to replace. Note that this overrides the message channel previously set of the new provided is in a different channel |
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
Param | Type | Description |
---|---|---|
authorObj | User |
Author of chat command |
command | String |
Exact command in the form of "commandName parameters more_parameters". The first word is excluded from the embed's content. |
imageUrl | String |
Url of main image |