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

24/7 in Voice Channel (Queue End) #8

Closed
karbonedev opened this issue Dec 25, 2022 · 18 comments
Closed

24/7 in Voice Channel (Queue End) #8

karbonedev opened this issue Dec 25, 2022 · 18 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@karbonedev
Copy link

the bot leaves the channel when a radio stops for a few moments. how to make it not quit and just wait for the radio to fix?

@Grizz1e Grizz1e added the help wanted Extra attention is needed label Dec 26, 2022
@Grizz1e Grizz1e self-assigned this Dec 26, 2022
@Grizz1e
Copy link
Owner

Grizz1e commented Dec 26, 2022

How long was your queue? Just one or were there multiple tracks? If it was just one track, when creating queue try setting try setting leaveOnEnd property to false. It is located at /commands/music/radio.js line 28 and line 117. If there were multiple tracks and the bot leaves, it is probably an error with discord-player

@Grizz1e Grizz1e closed this as completed Dec 26, 2022
@Grizz1e Grizz1e reopened this Dec 26, 2022
@karbonedev
Copy link
Author

i only have leaveOnEmpty and it is already on False. what I would like is for the bot to remain 24/7 in voc even if the radio stops.

for example if I put the radio "NRJ RADIO" it leaves the voice 1 day or 2 days later because of any reason. probably a problem coming from the url of the radio which makes think that the queue is finished

@Grizz1e
Copy link
Owner

Grizz1e commented Dec 28, 2022

Add a new leaveOnEnd property and set it to false. You can also add leaveOnStop property and the bot will never disconnect from vc as long as the bot stays on. Here's an example

const queue = player.createQueue(interaction.guild, {
        leaveOnEmpty: false,
        leaveOnEnd: false,
        leaveOnStop: false,
        metadata: {
          channel: interaction.channel
        }
      });

@karbonedev
Copy link
Author

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}
(node:25) Warning: [DiscordPlayerWarning] Unhandled "error" event! Events "error", "connectionError" must have event listeners!

I have this error oddly after the bot is turned on after a day it turns off on its own with this error

@karbonedev
Copy link
Author

<ref *1> Queue {
  tracks: [],
  previousTracks: [
    Track {
      id: '1057685811144691713',
      title: 'Energy (NRJ) DIGITAL',
      author: '',
      url: 'http://185.52.127.170/de/55659/mp3_128.mp3?adws_out_b2&access_token=100fb09b6e4749789b56f39ea8576114',
      thumbnail: 'https://icons.iconarchive.com/icons/google/noto-emoji-objects/1024/62807-radio-icon.png',
      duration: '0:00',
      views: 0,
      requestedBy: [User],
      playlist: null
    },
    Track {
      id: '1057685814844067842',
      title: 'Erik Dalı / Sendemi Oldun Ankaralı / Huriyem',
      author: 'Ömer Faruk Bostan - Topic',
      url: 'https://www.youtube.com/watch?v=P6KTCcdLZAE',
      thumbnail: 'https://i.ytimg.com/vi_webp/P6KTCcdLZAE/maxresdefault.webp',
      duration: '07:22',
      views: 115790508,
      requestedBy: [User],
      playlist: undefined
    }
  ],
  playing: false,
  metadata: {
    channel: TextChannel {
      type: 0,
      guild: [Guild],
      guildId: '1044222843837227099',
      parentId: '1047238544990683226',
      permissionOverwrites: [PermissionOverwriteManager],
      messages: [MessageManager],
      threads: [GuildTextThreadManager],
      nsfw: false,
      flags: [ChannelFlagsBitField],
      id: '1047240993700851794',
      name: 'commands',
      rawPosition: 9,
      topic: null,
      lastMessageId: '1057685934226813030',
      rateLimitPerUser: 0
    }
  },
  repeatMode: 3,
  id: '1057685810620403712',
  _streamTime: 0,
  _cooldownsTimeout: Collection(0) [Map] {},
  _activeFilters: [],
  _filtersUpdate: undefined,
  onBeforeCreateStream: null,
  player: Player {
    _events: [Object: null prototype] {
      trackStart: [AsyncFunction (anonymous)]
    },
    _eventsCount: 1,
    _maxListeners: undefined,
    options: {
      autoRegisterExtractor: true,
      ytdlOptions: [Object],
      connectionTimeout: 20000,
      smoothVolume: true,
      lagMonitor: 30000
    },
    queues: Collection(1) [Map] { '1044222843837227099' => [Circular *1] },
    voiceUtils: VoiceUtils { cache: [Collection [Map]] },
    extractors: Collection(4) [Map] {
      'Attachment' => [ExtractorModel],
      'Facebook' => [ExtractorModel],
      'Reverbnation' => [ExtractorModel],
      'Vimeo' => [ExtractorModel]
    },
    requiredEvents: [ 'error', 'connectionError' ],
    client: Client {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: 10,
      options: [Object],
      rest: [REST],
      ws: [WebSocketManager],
      actions: [ActionsManager],
      voice: [ClientVoiceManager],
      shard: null,
      users: UserManager {},
      guilds: GuildManager {},
      channels: ChannelManager {},
      sweepers: [Sweepers],
      presence: [ClientPresence],
      user: [ClientUser],
      application: [ClientApplication],
      readyTimestamp: 1672242339470,
      commands: [Collection [Map]],
      function: [Object],
      [Symbol(kCapture)]: true
    },
    [Symbol(kCapture)]: false
  },
  guild: <ref *2> Guild {
    id: '1044222843837227099',
    name: "Karbone's Lounge",
    icon: '0c4b54ab8e90aeaf0d0a74f7b13cac1c',
    features: [ 'COMMUNITY', 'NEWS' ],
    commands: GuildApplicationCommandManager {
      permissions: [ApplicationCommandPermissionsManager],
      guild: [Circular *2]
    },
    members: GuildMemberManager { guild: [Circular *2] },
    channels: GuildChannelManager { guild: [Circular *2] },
    bans: GuildBanManager { guild: [Circular *2] },
    roles: RoleManager { guild: [Circular *2] },
    presences: PresenceManager {},
    voiceStates: VoiceStateManager { guild: [Circular *2] },
    stageInstances: StageInstanceManager { guild: [Circular *2] },
    invites: GuildInviteManager { guild: [Circular *2] },
    scheduledEvents: GuildScheduledEventManager { guild: [Circular *2] },
    autoModerationRules: AutoModerationRuleManager { guild: [Circular *2] },
    available: true,
    shardId: 0,
    splash: null,
    banner: null,
    description: null,
    verificationLevel: 1,
    vanityURLCode: null,
    nsfwLevel: 0,
    premiumSubscriptionCount: 0,
    discoverySplash: null,
    memberCount: 32,
    large: false,
    premiumProgressBarEnabled: true,
    applicationId: null,
    afkTimeout: 300,
    afkChannelId: null,
    systemChannelId: null,
    premiumTier: 0,
    widgetEnabled: null,
    widgetChannelId: null,
    explicitContentFilter: 2,
    mfaLevel: 1,
    joinedTimestamp: 1671811308907,
    defaultMessageNotifications: 1,
    systemChannelFlags: SystemChannelFlagsBitField { bitfield: 0 },
    maximumMembers: 500000,
    maximumPresences: null,
    maxVideoChannelUsers: 25,
    approximateMemberCount: null,
    approximatePresenceCount: null,
    vanityURLUses: null,
    rulesChannelId: '1046900858572505088',
    publicUpdatesChannelId: '1046903573675511829',
    preferredLocale: 'en-US',
    ownerId: '853646350256308244',
    emojis: GuildEmojiManager { guild: [Circular *2] },
    stickers: GuildStickerManager { guild: [Circular *2] }
  },
  options: {
    leaveOnEnd: false,
    leaveOnStop: false,
    leaveOnEmpty: false,
    leaveOnEndCooldown: 1000,
    leaveOnEmptyCooldown: 1000,
    autoSelfDeaf: true,
    ytdlOptions: { highWaterMark: 33554432, requestOptions: [Object] },
    initialVolume: 100,
    bufferingTimeout: 3000,
    spotifyBridge: true,
    disableVolume: false,
    volumeSmoothness: 0.08
  },
  connection: StreamDispatcher {
    _events: [Object: null prototype] {
      error: [Function (anonymous)],
      debug: [Function (anonymous)],
      start: [Function (anonymous)],
      finish: [AsyncFunction (anonymous)]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    connectionTimeout: 20000,
    readyLock: false,
    voiceConnection: VoiceConnection {
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      rejoinAttempts: 0,
      _state: [Object],
      joinConfig: [Object],
      packets: [Object],
      receiver: [VoiceReceiver],
      debug: null,
      onNetworkingClose: [Function: bound onNetworkingClose],
      onNetworkingStateChange: [Function: bound onNetworkingStateChange],
      onNetworkingError: [Function: bound onNetworkingError],
      onNetworkingDebug: [Function: bound onNetworkingDebug],
      [Symbol(kCapture)]: false
    },
    audioPlayer: AudioPlayer {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _state: [Object],
      subscribers: [Array],
      behaviors: [Object],
      debug: [Function (anonymous)],
      [Symbol(kCapture)]: false
    },
    channel: VoiceChannel {
      type: 2,
      guild: [Guild],
      guildId: '1044222843837227099',
      parentId: '1047238647478505655',
      permissionOverwrites: [PermissionOverwriteManager],
      messages: [MessageManager],
      nsfw: false,
      flags: [ChannelFlagsBitField],
      id: '1047238732891312148',
      name: 'Music 🎵',
      rawPosition: 3,
      rtcRegion: null,
      bitrate: 64000,
      userLimit: 10,
      videoQualityMode: null,
      lastMessageId: '1051429943311077436',
      rateLimitPerUser: 0
    },
    paused: false,
    audioResource: AudioResource {
      playStream: [Encoder],
      edges: [Array],
      metadata: [Track],
      volume: [VolumeTransformer],
      encoder: [Encoder],
      audioPlayer: undefined,
      playbackDuration: 0,
      started: false,
      silencePaddingFrames: 5,
      silenceRemaining: -1
    },
    [Symbol(kCapture)]: false
  }
} Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:917:11)
    at Socket._write (node:net:929:8)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at PassThrough.ondata (node:internal/streams/readable:766:22)
    at PassThrough.emit (node:events:513:28)
    at Readable.read (node:internal/streams/readable:539:10) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}
(node:19556) Warning: [DiscordPlayerWarning] Unhandled "error" event! Events "error", "connectionError" must have event listeners!
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19556) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
<ref *1> Queue {
  tracks: [],
  previousTracks: [
    Track {
      id: '1057685811144691713',
      title: 'Energy (NRJ) DIGITAL',
      author: '',
      url: 'http://185.52.127.170/de/55659/mp3_128.mp3?adws_out_b2&access_token=100fb09b6e4749789b56f39ea8576114',
      thumbnail: 'https://icons.iconarchive.com/icons/google/noto-emoji-objects/1024/62807-radio-icon.png',
      duration: '0:00',
      views: 0,
      requestedBy: [User],
      playlist: null
    },
    Track {
      id: '1057685814844067842',
      title: 'Erik Dalı / Sendemi Oldun Ankaralı / Huriyem',
      author: 'Ömer Faruk Bostan - Topic',
      url: 'https://www.youtube.com/watch?v=P6KTCcdLZAE',
      thumbnail: 'https://i.ytimg.com/vi_webp/P6KTCcdLZAE/maxresdefault.webp',
      duration: '07:22',
      views: 115790508,
      requestedBy: [User],
      playlist: undefined
    },
    Track {
      id: '1057685814844067842',
      title: 'Erik Dalı / Sendemi Oldun Ankaralı / Huriyem',
      author: 'Ömer Faruk Bostan - Topic',
      url: 'https://www.youtube.com/watch?v=P6KTCcdLZAE',
      thumbnail: 'https://i.ytimg.com/vi_webp/P6KTCcdLZAE/maxresdefault.webp',
      duration: '07:22',
      views: 115790508,
      requestedBy: [User],
      playlist: undefined
    },
    Track {
      id: '1057685829431857155',
      title: "Ankara'nın Bağları",
      author: 'Ankaralı Coşkun',
      url: 'https://www.youtube.com/watch?v=QWQdBIbn6K4',
      thumbnail: 'https://i.ytimg.com/vi/QWQdBIbn6K4/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAxvFO0LcTdDFFvEElkha_BFZ2yIw',
      duration: '04:53',
      views: 4459976,
      requestedBy: [User],
      playlist: undefined
    }
  ],
  playing: false,
  metadata: {
    channel: TextChannel {
      type: 0,
      guild: [Guild],
      guildId: '1044222843837227099',
      parentId: '1047238544990683226',
      permissionOverwrites: [PermissionOverwriteManager],
      messages: [MessageManager],
      threads: [GuildTextThreadManager],
      nsfw: false,
      flags: [ChannelFlagsBitField],
      id: '1047240993700851794',
      name: 'commands',
      rawPosition: 9,
      topic: null,
      lastMessageId: '1057685948399366235',
      rateLimitPerUser: 0
    }
  },
  repeatMode: 3,
  id: '1057685810620403712',
  _streamTime: 0,
  _cooldownsTimeout: Collection(0) [Map] {},
  _activeFilters: [],
  _filtersUpdate: undefined,
  onBeforeCreateStream: null,
  player: Player {
    _events: [Object: null prototype] {
      trackStart: [AsyncFunction (anonymous)]
    },
    _eventsCount: 1,
    _maxListeners: undefined,
    options: {
      autoRegisterExtractor: true,
      ytdlOptions: [Object],
      connectionTimeout: 20000,
      smoothVolume: true,
      lagMonitor: 30000
    },
    queues: Collection(1) [Map] { '1044222843837227099' => [Circular *1] },
    voiceUtils: VoiceUtils { cache: [Collection [Map]] },
    extractors: Collection(4) [Map] {
      'Attachment' => [ExtractorModel],
      'Facebook' => [ExtractorModel],
      'Reverbnation' => [ExtractorModel],
      'Vimeo' => [ExtractorModel]
    },
    requiredEvents: [ 'error', 'connectionError' ],
    client: Client {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: 10,
      options: [Object],
      rest: [REST],
      ws: [WebSocketManager],
      actions: [ActionsManager],
      voice: [ClientVoiceManager],
      shard: null,
      users: UserManager {},
      guilds: GuildManager {},
      channels: ChannelManager {},
      sweepers: [Sweepers],
      presence: [ClientPresence],
      user: [ClientUser],
      application: [ClientApplication],
      readyTimestamp: 1672242339470,
      commands: [Collection [Map]],
      function: [Object],
      [Symbol(kCapture)]: true
    },
    [Symbol(kCapture)]: false
  },
  guild: <ref *2> Guild {
    id: '1044222843837227099',
    name: "Karbone's Lounge",
    icon: '0c4b54ab8e90aeaf0d0a74f7b13cac1c',
    features: [ 'COMMUNITY', 'NEWS' ],
    commands: GuildApplicationCommandManager {
      permissions: [ApplicationCommandPermissionsManager],
      guild: [Circular *2]
    },
    members: GuildMemberManager { guild: [Circular *2] },
    channels: GuildChannelManager { guild: [Circular *2] },
    bans: GuildBanManager { guild: [Circular *2] },
    roles: RoleManager { guild: [Circular *2] },
    presences: PresenceManager {},
    voiceStates: VoiceStateManager { guild: [Circular *2] },
    stageInstances: StageInstanceManager { guild: [Circular *2] },
    invites: GuildInviteManager { guild: [Circular *2] },
    scheduledEvents: GuildScheduledEventManager { guild: [Circular *2] },
    autoModerationRules: AutoModerationRuleManager { guild: [Circular *2] },
    available: true,
    shardId: 0,
    splash: null,
    banner: null,
    description: null,
    verificationLevel: 1,
    vanityURLCode: null,
    nsfwLevel: 0,
    premiumSubscriptionCount: 0,
    discoverySplash: null,
    memberCount: 32,
    large: false,
    premiumProgressBarEnabled: true,
    applicationId: null,
    afkTimeout: 300,
    afkChannelId: null,
    systemChannelId: null,
    premiumTier: 0,
    widgetEnabled: null,
    widgetChannelId: null,
    explicitContentFilter: 2,
    mfaLevel: 1,
    joinedTimestamp: 1671811308907,
    defaultMessageNotifications: 1,
    systemChannelFlags: SystemChannelFlagsBitField { bitfield: 0 },
    maximumMembers: 500000,
    maximumPresences: null,
    maxVideoChannelUsers: 25,
    approximateMemberCount: null,
    approximatePresenceCount: null,
    vanityURLUses: null,
    rulesChannelId: '1046900858572505088',
    publicUpdatesChannelId: '1046903573675511829',
    preferredLocale: 'en-US',
    ownerId: '853646350256308244',
    emojis: GuildEmojiManager { guild: [Circular *2] },
    stickers: GuildStickerManager { guild: [Circular *2] }
  },
  options: {
    leaveOnEnd: false,
    leaveOnStop: false,
    leaveOnEmpty: false,
    leaveOnEndCooldown: 1000,
    leaveOnEmptyCooldown: 1000,
    autoSelfDeaf: true,
    ytdlOptions: { highWaterMark: 33554432, requestOptions: [Object] },
    initialVolume: 100,
    bufferingTimeout: 3000,
    spotifyBridge: true,
    disableVolume: false,
    volumeSmoothness: 0.08
  },
  connection: StreamDispatcher {
    _events: [Object: null prototype] {
      error: [Function (anonymous)],
      debug: [Function (anonymous)],
      start: [Function (anonymous)],
      finish: [AsyncFunction (anonymous)]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    connectionTimeout: 20000,
    readyLock: false,
    voiceConnection: VoiceConnection {
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      rejoinAttempts: 0,
      _state: [Object],
      joinConfig: [Object],
      packets: [Object],
      receiver: [VoiceReceiver],
      debug: null,
      onNetworkingClose: [Function: bound onNetworkingClose],
      onNetworkingStateChange: [Function: bound onNetworkingStateChange],
      onNetworkingError: [Function: bound onNetworkingError],
      onNetworkingDebug: [Function: bound onNetworkingDebug],
      [Symbol(kCapture)]: false
    },
    audioPlayer: AudioPlayer {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _state: [Object],
      subscribers: [Array],
      behaviors: [Object],
      debug: [Function (anonymous)],
      [Symbol(kCapture)]: false
    },
    channel: VoiceChannel {
      type: 2,
      guild: [Guild],
      guildId: '1044222843837227099',
      parentId: '1047238647478505655',
      permissionOverwrites: [PermissionOverwriteManager],
      messages: [MessageManager],
      nsfw: false,
      flags: [ChannelFlagsBitField],
      id: '1047238732891312148',
      name: 'Music 🎵',
      rawPosition: 3,
      rtcRegion: null,
      bitrate: 64000,
      userLimit: 10,
      videoQualityMode: null,
      lastMessageId: '1051429943311077436',
      rateLimitPerUser: 0
    },
    paused: false,
    audioResource: AudioResource {
      playStream: [Encoder],
      edges: [Array],
      metadata: [Track],
      volume: [VolumeTransformer],
      encoder: [Encoder],
      audioPlayer: undefined,
      playbackDuration: 0,
      started: false,
      silencePaddingFrames: 5,
      silenceRemaining: -1
    },
    [Symbol(kCapture)]: false
  }
} Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:917:11)
    at Socket._write (node:net:929:8)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at PassThrough.ondata (node:internal/streams/readable:766:22)
    at PassThrough.emit (node:events:513:28)
    at Readable.read (node:internal/streams/readable:539:10) {
  errno: -4047,
  code: 'EPIPE',
  syscall: 'write'
}
(node:19556) Warning: [DiscordPlayerWarning] Unhandled "error" event! Events "error", "connectionError" must have event listeners!

this is the full log

@Grizz1e
Copy link
Owner

Grizz1e commented Dec 28, 2022

How can I reproduce this error?

@karbonedev
Copy link
Author

How can I explain to you how to reproduce the error

@karbonedev
Copy link
Author

description: null,
    verificationLevel: 0,
    vanityURLCode: null,
    nsfwLevel: 0,
    premiumSubscriptionCount: 0,
    discoverySplash: null,
    memberCount: 8,
    large: false,
    premiumProgressBarEnabled: false,
    applicationId: null,
    afkTimeout: 300,
    afkChannelId: null,
    systemChannelId: '1057608875806830684',
    premiumTier: 0,
    widgetEnabled: null,
    widgetChannelId: null,
    explicitContentFilter: 0,
    mfaLevel: 0,
    joinedTimestamp: 1672224993124,
    defaultMessageNotifications: 0,
    systemChannelFlags: SystemChannelFlagsBitField { bitfield: 0 },
    maximumMembers: 500000,
    maximumPresences: null,
    maxVideoChannelUsers: 25,
    approximateMemberCount: null,
    approximatePresenceCount: null,
    vanityURLUses: null,
    rulesChannelId: null,
    publicUpdatesChannelId: null,
    preferredLocale: 'en-US',
    ownerId: '823814730996908102',
    emojis: GuildEmojiManager { guild: [Circular *2] },
    stickers: GuildStickerManager { guild: [Circular *2] }
  },
  options: {
    leaveOnEnd: false,
    leaveOnStop: false,
    leaveOnEmpty: false,
    leaveOnEndCooldown: 1000,
    leaveOnEmptyCooldown: 1000,
    autoSelfDeaf: true,
    ytdlOptions: { highWaterMark: 33554432, requestOptions: [Object] },
    initialVolume: 100,
    bufferingTimeout: 3000,
    spotifyBridge: true,
    disableVolume: false,
    volumeSmoothness: 0.08
  },
  connection: StreamDispatcher {
    _events: [Object: null prototype] {
      error: [Function (anonymous)],
      debug: [Function (anonymous)],
      start: [Function (anonymous)],
      finish: [AsyncFunction (anonymous)]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    connectionTimeout: 20000,
    readyLock: false,
    voiceConnection: VoiceConnection {
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      rejoinAttempts: 0,
      _state: [Object],
      joinConfig: [Object],
      packets: [Object],
      receiver: [VoiceReceiver],
      debug: null,
      onNetworkingClose: [Function: bound onNetworkingClose],
      onNetworkingStateChange: [Function: bound onNetworkingStateChange],
      onNetworkingError: [Function: bound onNetworkingError],
      onNetworkingDebug: [Function: bound onNetworkingDebug],
      [Symbol(kCapture)]: false
    },
    audioPlayer: AudioPlayer {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _state: [Object],
      subscribers: [Array],
      behaviors: [Object],
      debug: [Function (anonymous)],
      [Symbol(kCapture)]: false
    },
    channel: VoiceChannel {
      type: 2,
      guild: [Guild],
      guildId: '1057608875806830682',
      parentId: '1057608876255612949',
      permissionOverwrites: [PermissionOverwriteManager],
      messages: [MessageManager],
      nsfw: false,
      flags: [ChannelFlagsBitField],
      id: '1057608876255612951',
      name: 'Játék',
      rawPosition: 5,
      rtcRegion: null,
      bitrate: 64000,
      userLimit: 8,
      videoQualityMode: null,
      lastMessageId: '1057804911326285885',
      rateLimitPerUser: 0
    },
    paused: false,
    audioResource: AudioResource {
      playStream: [Encoder],
      edges: [Array],
      metadata: [Track],
      volume: [VolumeTransformer],
      encoder: [Encoder],
      audioPlayer: undefined,
      playbackDuration: 0,
      started: false,
      silencePaddingFrames: 5,
      silenceRemaining: -1
    },
    [Symbol(kCapture)]: false
  }
} Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:823:11)
    at Socket._write (node:net:835:8)
    at writeOrBuffer (node:internal/streams/writable:390:12)
    at _write (node:internal/streams/writable:331:10)
    at Socket.Writable.write (node:internal/streams/writable:335:10)
    at PassThrough.ondata (node:internal/streams/readable:777:22)
    at PassThrough.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:324:12) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}
(node:25) Warning: [DiscordPlayerWarning] Unhandled "error" event! Events "error", "connectionError" must have event listeners!
Error: spawn ENOMEM
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:700:9)
    at Function.create (/home/container/node_modules/prism-media/src/core/FFmpeg.js:156:25)
    at new FFmpeg (/home/container/node_modules/prism-media/src/core/FFmpeg.js:45:27)
    at createFFmpegStream (/home/container/node_modules/discord-player/dist/utils/FFmpegStream.js:45:24)
    at Queue.play (/home/container/node_modules/discord-player/dist/Structures/Queue.js:722:68)
    at StreamDispatcher.<anonymous> (/home/container/node_modules/discord-player/dist/Structures/Queue.js:203:22)
    at StreamDispatcher.emit (node:events:527:28)
    at AudioPlayer.<anonymous> (/home/container/node_modules/discord-player/dist/VoiceInterface/StreamDispatcher.js:97:31)
    at AudioPlayer.emit (node:events:527:28) {
  errno: -12,
  code: 'ENOMEM',
  syscall: 'spawn'
}

New error

@Grizz1e
Copy link
Owner

Grizz1e commented Dec 29, 2022

Can you explain step-by-step what you did that caused this error? Then, I'll be able to check it in my own system. That would help a lot

@karbonedev
Copy link
Author

exactly, I don't know. before i had no problem.
I can send you my code if you want but I don't know how I could send it to you. Can I do a Github repositories?

@karbonedev
Copy link
Author

by the way, is it possible to make the bot leave the channel when nobody is around and join the channel when someone is around?

@Grizz1e
Copy link
Owner

Grizz1e commented Jan 1, 2023

exactly, I don't know. before i had no problem. I can send you my code if you want but I don't know how I could send it to you. Can I do a Github repositories?

Since I cannot reproduce this error, I can only assume that it is caused by the stream URL not supported by Discord-player. Try to not use that stream and I think it should work properly

@Grizz1e
Copy link
Owner

Grizz1e commented Jan 1, 2023

by the way, is it possible to make the bot leave the channel when nobody is around and join the channel when someone is around?

you can use the voiceStateUpdate event to track when the user joins/leaves the voice channel and make the bot play/stop the stream accordingly. I recommend you to check the Discord.js documentation on how you can customize that behaviour

@Grizz1e Grizz1e closed this as completed Jan 1, 2023
@karbonedev
Copy link
Author

Is it normal for the bot to consume too many resources? my hosts all told me

@Grizz1e
Copy link
Owner

Grizz1e commented Jan 1, 2023

Yes, music bots usually take more resources than normal bots. Streaming audio requires more resources than sending text messages

@karbonedev
Copy link
Author

Is it normal if it consumes more than that?
50% vCPU ● 512 MiB RAM ● 1 GiB disk

@Grizz1e
Copy link
Owner

Grizz1e commented Jan 2, 2023

when the bot is idle? No. When the bot is streaming audio? Yes

@karbonedev
Copy link
Author

Okay Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants