Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: added some checks on creating 247 player and on destroy reconnect #306

Merged
merged 1 commit into from
Oct 5, 2022
Merged

Conversation

Xenofic
Copy link
Collaborator

@Xenofic Xenofic commented Oct 5, 2022

on the info of @PandaIN95, Added validations and on player#destroy reconnect if 247 is enabled

@LucasB25 LucasB25 merged commit 516f2b5 into appujet:main Oct 5, 2022
@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 5, 2022

TypeError: Cannot read properties of undefined (reading 'send')
at Lavamusic._sendPayload (/home/XXX/lavamusic/src/structures/Lavamusic.js:309:35)
at Object.send (/home/XXX/lavamusic/src/structures/Lavamusic.js:274:35)
at Object.connect (/home/XXX/lavamusic/node_modules/erela.js/dist/structures/Player.js:147:30)
at AutoConnect (/home/XXX/lavamusic/src/utils/functions.js:54:10)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async module.exports (/home/XXX/lavamusic/src/events/Lavalink/nodeConnect.js:27:5) Promise {
TypeError: Cannot read properties of undefined (reading 'send')
at Lavamusic._sendPayload (/home/XXX/lavamusic/src/structures/Lavamusic.js:309:35)
at Object.send (/home/XXX/lavamusic/src/structures/Lavamusic.js:274:35)
at Object.connect (/home/XXX/lavamusic/node_modules/erela.js/dist/structures/Player.js:147:30)
at AutoConnect (/home/XXX/lavamusic/src/utils/functions.js:54:10)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async module.exports (/home/XXX/lavamusic/src/events/Lavalink/nodeConnect.js:27:5)

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 5, 2022

checkout the origin it's not from the pushed files, else it would not work for me it's in your Lavamusic file

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 6, 2022

checkout the origin it's not from the pushed files, else it would not work for me it's in your Lavamusic file

I checked the truth, it’s from your commit

Repository owner deleted a comment from Xenofic Oct 6, 2022
Repository owner deleted a comment from Xenofic Oct 6, 2022
@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

checkout the origin it's not from the pushed files, else it would not work for me it's in your Lavamusic file

I checked the truth, it’s from your commit

huh which?

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

huh which?

this error

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

TypeError: Cannot read properties of undefined (reading 'send') at Lavamusic._sendPayload (/home/XXX/lavamusic/src/structures/Lavamusic.js:309:35) at Object.send (/home/XXX/lavamusic/src/structures/Lavamusic.js:274:35) at Object.connect (/home/XXX/lavamusic/node_modules/erela.js/dist/structures/Player.js:147:30) at AutoConnect (/home/XXX/lavamusic/src/utils/functions.js:54:10) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) at async module.exports (/home/XXX/lavamusic/src/events/Lavalink/nodeConnect.js:27:5) Promise { TypeError: Cannot read properties of undefined (reading 'send') at Lavamusic._sendPayload (/home/XXX/lavamusic/src/structures/Lavamusic.js:309:35) at Object.send (/home/XXX/lavamusic/src/structures/Lavamusic.js:274:35) at Object.connect (/home/XXX/lavamusic/node_modules/erela.js/dist/structures/Player.js:147:30) at AutoConnect (/home/XXX/lavamusic/src/utils/functions.js:54:10) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) at async module.exports (/home/XXX/lavamusic/src/events/Lavalink/nodeConnect.js:27:5)

i am not facing it ask some other contributors to check it too cuz if i don't face i can't fix it

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

send me your nodeConnect.js

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

This mistake and indeed happened with your commit that you made a few days ago

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

It’s the same one you committed

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

This mistake and indeed happened with your commit that you made a few days ago

send me your nodeConnect.js i wanna see smtj

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

const Model = require("../../schema/247.js");
const { AutoConnect } = require("../../utils/functions.js");
const MusicBot = require("../../structures/Client.js");

/**
 *
 * @param {MusicBot} client
 * @param {Node} node
 * @returns {Promise<void>}
 */
module.exports = async (client, node) => {
  client.logger.log(`Node "${node.options.identifier}" connected.`, "ready");

  // 247 Connection
  const data = await Model.find({ 247: true });

  if (!data) return;

  const ModifyArray = data.map((value) => ({
    guild: value.Guild,
    voicechannel: value.VoiceChannel,
    textchannel: value.TextChannel,
    status: value[247],
  }));

    for (const obj of ModifyArray) {
    await AutoConnect(obj, client);
  }
};

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

const Model = require("../../schema/247.js");
const { AutoConnect } = require("../../utils/functions.js");
const MusicBot = require("../../structures/Client.js");

/**
 *
 * @param {MusicBot} client
 * @param {Node} node
 * @returns {Promise<void>}
 */
module.exports = async (client, node) => {
  client.logger.log(`Node "${node.options.identifier}" connected.`, "ready");

  // 247 Connection
  const data = await Model.find({ 247: true });

  if (!data) return;

  const ModifyArray = data.map((value) => ({
    guild: value.Guild,
    voicechannel: value.VoiceChannel,
    textchannel: value.TextChannel,
    status: value[247],
  }));

    for (const obj of ModifyArray) {
    await AutoConnect(obj, client);
  }
};

ok so does your Lavamusic.js has a private method _sendPayload if so send me that it seems that's undefined in your case

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

it’s the same as this repo

@Xenofic
Copy link
Collaborator Author

Xenofic commented Oct 7, 2022

it’s the same as this repo

it's a cache problem the guild you are sending it for isn't cached i am gonna push this fix in the current pr i opened mins ago

@LucasB25
Copy link
Collaborator

LucasB25 commented Oct 7, 2022

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants