
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@magicyan/discord-ui
Advanced tools
Install with
npm install @magicyan/discord-ui
pnpm install @magicyan/discord-ui
yarn add @magicyan/discord-ui
bun install @magicyan/discord-ui
This lib provides customized "components" for your discord bot, see how to use it:
import { discordUi } from "@magicyan/discord-ui";
discordUi({
prompts: {
confirm: {
buttons: {
confirm: { label: "Confirm", style: ButtonStyle.Success },
cancel: { label: "Cancel", style: ButtonStyle.Secondary }
}
}
},
menus: {
pagination: {
buttons: {
previous: { style: ButtonStyle.Danger },
home: { label: "Home", emoji: "🏠" },
next: { label: "Next", style: ButtonStyle.Success },
close: { emoji: "❌" }
}
}
}
});
import { confirm } from "@magicyan/discord-ui";
confirm({
components: ({ confirm, cancel }) => [
new ActionRowBuilder({ components: [confirm, cancel] })
],
render: components => interaction.reply({
ephemeral: true, fetchReply: true, components,
content: "Do you want to confirm this action?"
}),
async onClick(interaction, isCancel) {
await interaction.update({ components: [] });
if (isCancel){
interaction.editReply({ content: "This action has been canceled" });
return;
}
interaction.editReply({ content: "Confirmed!" });
},
});
confirm({
// ...
buttons: {
confirm: { label: "Continue", style: ButtonStyle.Primary },
cancel: { label: "Cancel" },
},
render: components => interaction.reply({
ephemeral: true, fetchReply: true, components,
content: "Do you want to continue?"
})
});
confirm({
// ...
time: 60000,
onTimeout() {
interaction.editReply({
content: "Time's up",
components: []
});
},
});
import { pagination } from "@magicyan/discord-ui";
pagination({
embeds: [embed1, embed2, embed3],
components: ({ home, close, next, previous }) => [
new ActionRowBuilder<ButtonBuilder>({
components: [previous, home, next, close]
})
],
render: (embed, components) => interaction.reply({
fetchReply: true, ephemeral: true, embeds:[embed], components
}),
onClick(interaction, embed) {
interaction.reply({ ephemeral: true, embeds: [embed] });
}
});
const roles = Array.from(interaction.member.roles.cache.values());
pagination({
// ...
embeds: roles.map((role, index) => new EmbedBuilder({
description: `${role} ${role.name}`,
color: role.color,
footer: { text: `${index+1}/${roles.size}` }
})),
});
Use the buttons to move forward and backward through the pages
You can customize each individual button using the buttons property
It uses a discord component collector, so you can pass a filter, a timeout and a function for when the time is up
You can set an action button if you want, along with its function, which when executed, does not change the pages but returns the embed of the current page for you to do whatever you want.
pagination({
// ...
components: ({ action, close, ...buttons }) => [
new ActionRowBuilder<ButtonBuilder>({
components: [...Object.values(buttons)]
}),
new ActionRowBuilder<ButtonBuilder>({
components: [action, close]
})
],
// ...
onClick(interaction, embed){
interaction.reply({ ephemeral: true, embeds: [embed] })
}
});
pagination({
// ...
onClose(interaction){
interaction.update({
components: [], embeds: [],
content: "Closed"
})
}
});
FAQs
Discord UI
We found that @magicyan/discord-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.