mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
Finished embeds
This commit is contained in:
@@ -4,6 +4,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
var Embed = function Embed(data) {
|
||||
_classCallCheck(this, Embed);
|
||||
|
||||
this.url = data.url;
|
||||
this.type = data.type;
|
||||
this.title = data.title;
|
||||
this.thumbnail = data.thumbnail;
|
||||
//width
|
||||
//height
|
||||
//url
|
||||
//proxy_url
|
||||
this.provider = data.provider;
|
||||
//url
|
||||
//name
|
||||
this.description = data.description;
|
||||
this.author = data.author;
|
||||
//url
|
||||
//name
|
||||
};
|
||||
|
||||
module.exports = Embed;
|
||||
19
lib/Embeds/IEmbed.js
Normal file
19
lib/Embeds/IEmbed.js
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
var ImageEmbed = require("./ImageEmbed.js"),
|
||||
VideoEmbed = require("./VideoEmbed.js"),
|
||||
LinkEmbed = require("./LinkEmbed.js");
|
||||
|
||||
exports.createEmbed = function (data) {
|
||||
switch (data.type) {
|
||||
case "image":
|
||||
return new ImageEmbed(data);
|
||||
break;
|
||||
case "video":
|
||||
return new VideoEmbed(data);
|
||||
break;
|
||||
case "link":
|
||||
return new LinkEmbed(data);
|
||||
break;
|
||||
}
|
||||
};
|
||||
@@ -13,6 +13,10 @@ var VideoEmbed = (function (_Embed) {
|
||||
_classCallCheck(this, VideoEmbed);
|
||||
|
||||
_Embed.call(this, data);
|
||||
this.video = data.video;
|
||||
//width
|
||||
//height
|
||||
//url
|
||||
}
|
||||
|
||||
return VideoEmbed;
|
||||
|
||||
Reference in New Issue
Block a user