Skip to content

Buttons

paige edited this page Aug 28, 2023 · 4 revisions

Buttons function similarly to how they do in Discord.JS except with a few adjustments to make things generally easier
For more info on buttons and how they're formatted check out this

Creating Buttons

Buttons are classes so they are created like this:

let button = new wc.Button({/* stuff */});

Now we'll go over the new additions

Button Styles

wc has built in button styles for you to use
the styles are primary, secondary, success, danger, and link

{
	style: "primary"
}

Button Structures

If you want more info on how buttons function this is the code:

Button = class {
	constructor(obj) {
		obj.type = 2;
		if (obj.id) {
			obj.custom_id = obj.id;
		}
		if (obj.style) {
			obj.style = this.buttonStyle(obj.style);
		}
		
		return obj;
	}
}
Clone this wiki locally