disclient
Version:
A powerfull discord api wrapper.
69 lines (68 loc) • 1.64 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Button = void 0;
class Button {
_type;
_style;
_label;
_emoji;
_custom_id;
_url;
_disabled;
constructor() {
this._type = 2;
this._style = null;
this._label = null;
this._emoji = null;
this._custom_id = null;
this._url = null;
this._disabled = null;
}
async setLabel(label) {
this._label = label;
}
async setID(id) {
this._custom_id = id;
}
async setUrl(url) {
this._url = url;
}
async setDisabled(yesorno) {
this._disabled = yesorno;
}
async setStyle(options) {
switch (options) {
case "Primary":
this._style = 1;
break;
case "Secondary":
this._style = 2;
break;
case "Success":
this._style = 3;
break;
case "Danger":
this._style = 4;
break;
case "Link":
this._style = 5;
break;
}
}
async setEmoji(options) {
this._emoji = options;
}
get create() {
const data = {
type: this._type,
style: this._style,
label: this._label,
emoji: this._emoji,
custom_id: this._custom_id,
url: this._url,
disabled: this._disabled
};
return data;
}
}
exports.Button = Button;