discord-giveaways: Cannot read property 'giveaways' of undefined

{
  "stack": "TypeError: Cannot read property 'giveaways' of undefined
    at GcreateCommand.run (/home/container/src/commands/misc/gcreate.js:25:41)
    at module.exports (/home/container/src/events/message.js:52:24)
    at Client.emit (events.js:314:20)
    at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:314:20)"
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

tysm @Nico105, I found the error. GiveawayManager instead of giveawaysManager.

image Just put the manager code in your index or bot .js. if you use this.client then put this.client instead of client in there.