Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 914 Bytes

README.md

File metadata and controls

32 lines (28 loc) · 914 Bytes

Discord Menu Library

Use Discord components without unnecessarily long codes.

  • Typescript
  • discord.js v14.3.0

Features

  • Sample discord button component menus
  • Simple discord select menu component menus
  • Simple pagination component

Examples

Yes or No Button

async function yesNoTest(i: ChatInputCommandInteraction) {
  // Send a message with buttons with Yes and No.
  const resI = await i.sendMenu({
    content: "Do you know Gangnam Style?",
    menu: new YesNoMenu(),
  })

  // Returns void if the response time limit has been exceeded.
  if (!resI) return i.editReply({ content: "Timeout!" })

  // You can check which button the user pressed through 'resI.customId'
  switch (resI.customId) {
    case CustomId.YesButton:
      return i.editReply({ content: "You choose Yes!" })
    case CustomId.NoButton:
      return i.editReply({ content: "You choose No!" })
  }
}