Migrating to v4
Upgrade a Honocord v3 bot to v4 and v4.1.
Honocord v4 merges the separate cache adapter packages into honocord itself. v4.1 then raises the minimum Node.js version to 24. If your bot doesn’t use a cache adapter and already runs on Node.js 24 or newer, updating the package is all you need to do.
What changed
| Version | Change | Action needed |
|---|---|---|
| 4.0.0 | @honocord/cache-* packages merged into honocord as subpath exports | Update imports, uninstall the old packages |
| 4.0.0 | Unused CacheAdapter interface and CacheSetOptions type removed | Only if you imported them: extend BaseCacheAdapter instead |
| 4.0.0 | mset() entry shape exported as CacheEntry | None (optional: use it to type your entries) |
| 4.0.0 | CommonJS main/types/exports fixed: require("honocord") now resolves | None |
| 4.0.0 | Dependencies updated: @discordjs/builders 1.15.0, @discordjs/core 2.7.0, discord-api-types 0.38.58 | None, unless you pin these packages yourself |
| 4.1.0 | Node.js 24 or newer required (engines.node is >=24) | Upgrade Node.js (Cloudflare Workers are not affected by the Node version) |
| 4.1.0 | AutocompleteHelper exported from honocord | None. It was documented before but could not be imported. |
Upgrade steps
Check your Node.js version. Run
node --version. If it prints anything belowv24, upgrade Node.js first, including on your server or in your CI. Bots on Cloudflare Workers can skip this step.Update Honocord.
Uninstall the old cache packages you had installed. Skip this if you never used a cache adapter.
Update your cache imports. Export names are unchanged; only the paths differ.
Old import New import @honocord/cache-basehonocord/cache@honocord/cache-memoryhonocord/cache/memory@honocord/cache-dohonocord/cache/do@honocord/cache-mongohonocord/cache/mongoKeep
mongooseif you use MongoDB. It is now an optional peer dependency ofhonocord, only needed when you importhonocord/cache/mongo. Make sure it stays in your ownpackage.json.Build and run your type check. Any leftover
@honocord/cache-*import now fails to resolve, so the compiler points you at what is left to change.
Custom cache adapters
If you wrote your own adapter, extend BaseCacheAdapter from honocord/cache. The removed CacheAdapter interface never matched it: its delete() returned a boolean and its set() took an options object. BaseCacheAdapter uses these signatures:
Tip
Autocomplete helper
AutocompleteHelper can now be imported from the package root, as the Handlers guide always showed:
If you worked around the missing export (for example by copying the helper into your project), you can delete your copy.