4.1.0-beta.11 changelog
Published
Entries marked Breaking change a working bot; the migration guide says what to do about them. Every release of the line is in the changelog.
Minor Changes
#401
ae9d548Thanks @l7aromeo! - MeoCord asks fordiscord.js14.27.0 or later anddotenv18.0.5 or later as peers. A bot on an olderdiscord.js14 ordotenv18 upgrades them with MeoCord:npm install discord.js@^14.27.0 dotenv@^18.0.5, or the same with your package manager.MeoCord's own dependencies move to their latest stable releases, and
meocord createmakes the new app's first commit by runninggitdirectly, so installing MeoCord no longer pulls insimple-git. A new app starts on the latest stable releases of its tools, with TypeScript held at 6.0.3.
Patch Changes
#403
ec97a2fThanks @l7aromeo! - A self-contained build that copies one package intodist/node_modulessays "holds 1 package", not "1 packages".#407
4d91448Thanks @l7aromeo! -require('meocord/common'), and every other entry point a CommonJS project loads withrequire(), logs again:Logger'slog(),info(),verbose()anddebug()threwTypeErrorthere, as the CommonJS build readchalk, a package that ships only as an ES module, without its default export. A bot built withmeocord buildwas not affected, since its bundle loads the ES module build.#410
ca34a30Thanks @l7aromeo! - A decorator applied where it can't work is now named where it applies, directly or inside anapplyDecoratorscomposite:- A decorator that goes only on a method, on a class, stops the bot as the class loads, with one line naming the class:
Shop: @Defer goes on a method, not on a class.This covers@Command,@Autocomplete,@MessageHandler,@ReactionHandler,@On,@Once,@Validate,@UsePipeand@Defer, and@Inject, which goes on a constructor parameter or a property.@Defer,@Validate,@UsePipe,@Onand@Oncedid nothing there, and the handler decorators failed with aTypeError. @Interceptor,@Catch,@Pipeand@Observeron a method stop the bot the same way:Shop.buy: @Interceptor goes on a class, not on a method.@Controller,@Service,@Guard,@CommandBuilderand@MeoCordon a method still apply nothing, as in 4.0, and now log a warning once:@Guard on the method Shop.buy is deprecated; in the next major version (5.0) it is refused. Use @Guard on a class instead.Move the decorator to the class.
Decorators that go on a class or a method, such as
@UseGuard,@Cooldown,@UseThemeand thosecreateMetadatamakes, apply as before. See Custom decorators.- A decorator that goes only on a method, on a class, stops the bot as the class loads, with one line naming the class:
#409
ca62ec5Thanks @l7aromeo! -createChatInputOptionsreads options as discord.js does, and throws discord.js's own errors: each aDiscordjsTypeErrorwith discord.js's code and message.- A getter of another type throws discord.js's type error, such as
Option "x" is of type: 4; expected 3., with or withoutrequired:getString()on a number,getInteger()on a fraction,getChannel()on a user. A user or member read as a role, or a role read as a user or member, isnull, or that error whenrequired, as the option may be a mentionable one. - A missing required option throws
Required option "x" not found.,getSubcommand()throwsNo subcommand specified for interaction.unless givenfalse, as in discord.js,getSubcommandGroup(true)andgetFocused()throw discord.js's messages, andgetChannel()checks the channel types it's given. get()returns the option as discord.js does, andgetMessage()reads no option of a slash command.- Options assigned to a mock interaction after it is created, as with
interaction.options = createChatInputOptions({ target }), belong to it, sogetMember()is the server's cached member, ornullin a DM.
- A getter of another type throws discord.js's type error, such as
#406
6958c64Thanks @l7aromeo! - MeoCord keeps its own metadata under keys beginningmeocord:, soSetMetadatatakes any key a 4.0 bot used, such as'guards'or'commandType', and stores it as 4.0 did. It refuses only a key beginningmeocord:and the two keys dependency injection reads,design:paramtypesand inversify's injectable flag. A 4.1 beta refused'guards','commandType'and'inversify:container', so a 4.0 bot that set one of them failed to load.Code that read MeoCord's guard list or a builder's command type under
'guards'or'commandType'no longer finds them there. To read the guards a handler runs, useinspectHandlerfrommeocord/testing.Every key MeoCord keeps its metadata under is now such a string, so a test or a tool that loads both meocord's CommonJS and ES module entries sees a controller one of them decorated from the other, where it found none.
#402
2be278aThanks @l7aromeo! - - A bot that imports two or more WebAssembly modules builds again. Each imported module is written todist/assetsunder a content hash, as<hash>.module.wasm. A wasm file read throughnew URL('./file.wasm', import.meta.url)keeps its own name.new URL('./file', import.meta.url)for a bundled file gives afile:URL on Windows. It was built on the bundle's directory as a disk path, which a URL reads as schemec:, sofileURLToPaththrewERR_INVALID_URL_SCHEME. The URL is now relative to the bundle on every platform.