Discord js keyv throwing ECONNREFUSED

657 views Asked by At

I'm trying to use Keyv, following this tutorial: https://discordjs.guide/keyv/#command-handler and I'm using the command handler code as well.

In my index.js, I run something like this: (with the appropriate imports for Keyv of course)

const Keyv = require('keyv');
const mykeyv = new Keyv('redis://user:pass@localhost:6379');
client.on('message', message =>{
    ...//skipping some command handler stuff 
    command.execute(message, args, mykeyv)
})

And then when I run this, I initially get the correct and expected client.on('ready') messages, but then a few seconds after the following error pops up:

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted 'error' event on Keyv instance at:
    at KeyvRedis.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\keyv\src\index.js:43:44)
    at KeyvRedis.emit (events.js:315:20)
    at Redis.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\@keyv\redis\src\index.js:17:38)
    at Redis.emit (events.js:315:20)
    at Redis.silentEmit (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\ioredis\built\redis\index.js:499:26)
    at Socket.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\ioredis\built\redis\event_handler.js:186:14)
    at Object.onceWrapper (events.js:422:26)
    at Socket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}

I'm not sure what this error is about, can someone help me?

0

There are 0 answers