TDHandler
  • 👋TDHandler Guide
  • 🚀Get Started
  • Classes
    • ðŸ“ĶTDInstance
  • Methods
    • ✅init()
    • ðŸĪ–getClient
    • ðŸ—ĢïļgetChannel()
    • 📑log()
    • 📚createEmbed()
    • 🔃loadingVariables
    • 🔘getButton()
  • Organisation
    • 📄Changelog
    • 📋To-Do
  • Handling Files
    • ❗Commands
    • 🧑‍ðŸĶēContext Menus
    • 🔘Buttons
    • ⛹Events
  • 🔘Sending Buttons
Powered by GitBook
On this page
Edit on GitHub

Sending Buttons

How to send a button

PreviousEvents

Last updated 3 years ago

It is really easy to send a button, basically you just get it with the method by its name and send it like in this example:

const { MessageActionRow } = require("discord.js");

module.exports = {
    name: "ping",
    description: "pingi",
    options: null,
    development: false,
    cooldown: 1,
    clientPermissions: null,
    userPermissions: null,

    run: (interaction, client, tdhandler, user, member) => {
        const button = tdhandler.getButton("help")
        const row = new MessageActionRow().addComponents([button])

        interaction.reply({
            content: "hi click the button thx",
            components: [row]
        })
    }
}

How to create the button-file and its code is explained

🔘
getButton
here