Questions tagged [keyv]

Keyv is a simple key-value storage with support for multiple backends. Use this tag for questions about the usage of Keyv.

Keyv is a simple key-value storage with support for multiple backends.

9 questions
1
vote
0 answers

How to prevent code from excecuting multiple times

This code ends up spamming messages for one second every time it runs. Does anyone know to prevent that? the variable count is the amount of messages sent in the last hour, and my goal is if more then 15 were sent in the past hour then to send a…
Mighty
  • 11
  • 2
1
vote
0 answers

Discord js keyv throwing ECONNREFUSED

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 =…
M80
  • 191
  • 1
  • 14
0
votes
0 answers

keyv iterator not a fucntion error in npmjs keyv library

I'm using https://www.npmjs.com/package/keyv I'm able to access individual items using key.get, but Im unable to iterator through all items. In the below piece of code, test is printed correctly, but im unable to access keyv.iterator. async function…
user3640030
  • 137
  • 1
  • 8
0
votes
0 answers

MongoNetworkError: connection 2 to 18.185.185.208:27017 closed

const keyv = new Keyv(process.env.mongo); wait(3000) keyv.on('error', err => console.error('Keyv connection error:', err)); const delay = ms => new Promise(res => setTimeout(res, ms)); function wait(ms){ var start = new Date().getTime(); var…
kyan_0045
  • 3
  • 2
0
votes
0 answers

why is ; not stored instead of ! in this code

I use MongoDB as a storage adapter for keyv, After setting the prefix to ;, it again resets to !. according to me there is a error in the logic. Here is the cmd used in…
0
votes
0 answers

Keyv + MongoDb TypeError The "id" argument must be of type string. Received undefined

I'm getting this TypeError while using Keyv and Keyv/mongo. throw new ERR_INVALID_ARG_TYPE(name, 'string', value); ^ TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined When trying to create a new…
Elitezen
  • 6,551
  • 6
  • 15
  • 29
0
votes
1 answer

How can I fix Discord Bot Keyv [Object Promise] error?

Im kind of new to discord.js, and I'm building a bot for the Winter season. I'm building a feature called !gift, which will let you gift stuff to ppl virtually. ( Not with money or anything). I am using Keyv to store how many gifts each user has…
CoolCoder
  • 1
  • 1
0
votes
1 answer

How to fix object 'property undefined' keyv/discordjs

I am currently making the shop for my bot, and I am doing the buy command. I have decided to store the user's inventory as an object in the database, however, when I first try to buy and item from the shop (in this case, the fan), it makes the…
user13944155
-2
votes
1 answer

How can I remove [object Promise] from discord.js?

I am making a balance system, and I created a give command. Whenever I give someone some money ($10 for example), their balance shows as "$10 [object Promise]". How can I remove "[object Promise]"? Full command code: if (command === 'give')…
ethry
  • 731
  • 6
  • 17