Added message select menues (mentionable not available)

This commit is contained in:
ION606
2023-04-16 19:50:45 -04:00
parent ed16d4aeca
commit 7996d6af7c
16 changed files with 313 additions and 51 deletions
+10 -1
View File
@@ -27,10 +27,19 @@ export class Button {
toObj() {
var obj = {type: 2};
for (const i in this) {
if (i == "url" && this.style != MessageButtonStyles.LINK) {
if (this.url != undefined) throw "CUSTOM ID MISSING";
}
if (i == "custom_id" && this.style == MessageButtonStyles.LINK) {
if (this.custom_id != undefined) throw "BUTTONS OF TYPE \"LINK\" CAN NOT HAVE A CUSTOM ID";
}
obj[i] = this[i];
}
return obj;
}
constructor() {}
/**
* @param {MessageButtonStyles} style
*/
constructor(style = undefined) { this.style = style; }
}