skick1234 / DisTube

A powerful Discord.js module for simplifying music commands and effortless playback of various sources with integrated audio filters.
https://distube.js.org
MIT License
423 stars 94 forks source link

beta version bug #86

Closed LackyPal closed 3 years ago

LackyPal commented 3 years ago

Whenever i try to play a song, it's giving the errors channel.send is not a function. It's also not playing anything. There is a problem on error event. I'm using command handler.The following is my error event code

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

module.exports = {
  name: "error",
  execute(bot, message, channel, error) {
    console.error(error);

    const embed = new MessageEmbed()
      .setTitle("❌ An error encountered")
      .setDescription(error)
      .setColor("RED");

    channel.send(embed).then(msg => msg.delete({ timeout: 7000 }).catch(console.error));
  },
};
skick1234 commented 3 years ago

Read the docs first. Beta is the beta of next major version (3.0.0-beta) unknown.png

skick1234 commented 3 years ago

https://distube.js.org/#/docs/DisTube/beta/class/DisTube?scrollTo=e-error

According to the docs, TextChannel is the first param, not the sencond one (is the second param in your situation because you binded bot)

LackyPal commented 3 years ago

That's mean, we cannot use event handler ??

skick1234 commented 3 years ago

That's mean, we cannot use event handler ??

Just delete message param .-.

LackyPal commented 3 years ago

As you say TextChannel is the first param, so does we have to write it as execute(channel, error, bot) ? Or we can write it as execute(bot, channel, error) too

skick1234 commented 3 years ago

As you say TextChannel is the first param, so does we have to write it as execute(channel, error, bot) ? Or we can write it as execute(bot, channel, error) too

According to the docs, TextChannel is the first param, not the second one. But it is the second param in your situation because you bound bot