-
Notifications
You must be signed in to change notification settings - Fork 0
Component Basics

Message Components are what makes the little things on the things do things and in this we'll go over how to make them
They consist of things like embeds, buttons, selections, and action rows
Embeds are probably the simplest of the bunch because it's just this:
let embed = new PSClient.Embed({
description: "this is an embed",
color: PSClient.colors.blurple,
timestamp: PSClient.time.now.embed
});
ctx.reply({ embeds: [embed]});
Action row setup is pretty simple. Let's say for this command we want to make a command to invite someone to something for that we can use this:
PSClient.command( {name: "invite"}, (ctx, cmd) => {
let accept = new PSClient.Button({ id: "accept", style: "success", label: "Accept" });
let decline = new PSClient.Button({ id: "decline", style: "danger", label: "Decline" });
let row = new PSClient.ActionRow([accept, decline]);
let user = PSClient.fetchUser(cmd.args[0]);
PSClient.reply(`Do you accept the invite ${user}?`, {components: [row]});
});
if you want to respond to that when it is pressed you can do this:
PSClient.buttonAction( (ctx) => {
if (ctx.customId == "accept") {
ctx.reply("Accepted!");
}
else if (ctx.customId == "decline") {
ctx.reply("Declined :(");
}
});
For a look at some examples check out the examples folder
If anything with the mod is updated you can look to the releases for info on it
For a look into the development check out the index.js file
This mod is not associated with the creators of Discord, Discord.JS, or Discord.PY this was created out of love for Discord bot development because I wanted to make things easier for people. I do not condone harassment of the original developers and or anyone else involved in the creation of them.
I am not responsible for anything made with this mod and be sure to follow Discord's terms of service and their community guildlines while developing.
Basics
wc.command()
wc.slashCommand()
wc.commandList
wc.slashCommandList
Basics
wc.event()
wc.eventList
wc.commandAction()
wc.buttonAction()
wc.selectionAction()
wc.rowAction()
wc.fetchMessage()
wc.fetchReply()
wc.fetchUser()
wc.fetchGuildUser()
wc.fetchChannel()
wc.fetchGuildChannel()
wc.fetchRole()
wc.fetchGuildRole()
wc.fetchGuild()
wc.parseEmoji()
wc.parseSticker()