Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pgbiel/discordjs-embed-converter
Parse MessageEmbeds (that are Rich embeds) to RichEmbeds in discord.js.
https://github.com/pgbiel/discordjs-embed-converter
Last synced: 6 days ago
JSON representation
Parse MessageEmbeds (that are Rich embeds) to RichEmbeds in discord.js.
- Host: GitHub
- URL: https://github.com/pgbiel/discordjs-embed-converter
- Owner: PgBiel
- License: mit
- Created: 2017-03-11T03:35:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T23:59:09.000Z (over 7 years ago)
- Last Synced: 2024-10-08T09:48:54.707Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discordjs-embed-converter
## Install
`npm install discordjs-embed-converter`
## Usage
### MessageEmbed to RichEmbed
Requiring this directly gives a function that can convert MessageEmbeds to RichEmbeds. Example:```js
const msgEmbedToRich = require("discordjs-embed-converter");
msgEmbedToRich(someMessageEmbed);
```Or, if you think that is too vague or something, it also has a circular named msgEmbedToRich.
```js
const msgEmbedToRich = require("discordjs-embed-converter").msgEmbedToRich;
// or
const { msgEmbedToRich } = require("discordjs-embed-converter");
```### The other way around
There is also a property of the requiring named RichToMsgEmbed, which can convert RichEmbeds to MessageEmbed, however note that it will lose its `.message` property.
```js
const richToMsgEmbed = require("discordjs-embed-converter").richToMsgEmbed;
// or
const { richToMsgEmbed } = require("discordjs-embed-converter");
```then:
```js
richToMsgEmbed(SomeRichEmbed);
```