why do i get an error when i try to use my bot's "play" command?

51 Views Asked by At

my bot returns this error:

TypeError: Cannot read properties of undefined (reading 'options')

im trying to make a discord music bot. my code is here:

  execute: async ({ client, interaction }) => {
        let url = interaction.options.getString("url")
        client.distube.play(interaction.member.voice.channel, url, {
          member: interaction.member,
          textChannel: interaction.channel,
          interaction
        })
    }
}

it errors on the line where it says "interaction.options.getString"

0

There are 0 best solutions below