Repository navigation
docs(4.1): match the theming, cooldowns, testing, services and troubleshooting pages to 4.1.0 - #233
Conversation
l7aromeo
left a comment
There was a problem hiding this comment.
I checked every changed claim at 263fc9c against meocord b6113d30. Quoted messages match the source, and every removed line was wrong or incomplete. Three claims wait on the two meocord fixes this PR names, so I left them unjudged: invoke's subcommand-path refusal, Translator in a stage class, and Client in a stage class.
Lines to fix:
- cooldowns.md, early check. "must fetch a member, user, role or channel": a role is never fetched. It is in the cache at parse or the call is invalid (
message-params.ts, "Roles are cached with the Guilds intent"), andMessageEntityRef.resolve()returns the cached role without a request (message-entities.ts,this.kind === 'role'). Suggested: "must fetch a member, user or channel its params name, or a value of one of the app's own types". - cooldowns.md,
dmOnCooldown. "the author gets the same wait by DM, inmeocord.dm.cooldown" holds for a command sent in a server. For one sent in a DM,fallback.tsanswers there with the plain cooldown text (if (!message.guild) return presentedReply(… errorText(…)), which givesmeocord.cooldown.until). Suggested: "the author of a command sent in a server gets the same wait by DM, inmeocord.dm.cooldown, which names the command, channel and server; a command sent in a DM is answered there withmeocord.cooldown.until." - services.md, heading. "A class without
@Service()can't be injected if its constructor takes parameters" is broader than the check.undecoratedConstructorfires only when the parameters have no recorded types and no@Injecttoken, and TypeScript recordsdesign:paramtypesfor a class whose constructor parameter carries a decorator. Suggested: "A class without a decorator can't be injected if its constructor takes parameters. With no decorator on the class or on a parameter, TypeScript records none of their types, so the bot stops, naming the class:" - services.md and troubleshooting.md, "
Loggerand MeoCord's errors aren't injected". The advice map (meocord-classes.ts) coversLogger,CooldownError,CooldownStoreError,GuardDeniedError,MessageUsageError,UserErrorandValidationError, but notCommandNotFoundError. Its constructor has a default message, so its length is 0 and it passes the check. Suggested: "Loggerand errors such asUserError". - troubleshooting.md, refusal prefixes. "
App:for@MeoCord's options, the app class's name, …" reads as two prefixes. The prefix is always${target.name}:(app.decorator.ts,meocord-factory.ts). Suggested: "the app class's name, such asApp:, for@MeoCord's options,meocord.config.ts:for its settings, …"
Optional:
- lifecycle-hooks.md: the "unless" list for stage classes leaves out a guard listed in
providers, and one injected by an observer, thethemeForclass or the store. "Unless the app also binds it: listed inservicesorproviders, or injected by a class that gets hooks" covers them. - invoke-and-dispatch.md: a message passed alone matches after the app's prefix, the handler's own prefix, or a mention.
- testing-recipes.md: a test's own
CooldownStoreprovider can be one instance shared between modules.
Out of the docs, now being fixed in meocord: registration checks a context menu's localised names against 100 characters (command-localizations.ts, chatInputName ? 32 : 100), where Discord allows 32. The localisation.md sentence is right once that lands.
content:check and examples:check pass on the head.
l7aromeo
left a comment
There was a problem hiding this comment.
Rechecked 202d7f9. The five fixes and three optional notes all match meocord b6113d30:
- the role-free early check;
- the DM notice scoped to commands sent in a server;
- the undecorated-class heading;
- "errors such as
UserError"; - the app-name prefix;
- the hooks "unless the app also binds it" list;
- the handler's own prefix or a mention;
- the test's own
CooldownStoreprovider.
No blockers left beyond the three claims waiting on #418 and #419.
…eshooting pages to 4.1.0 Checked every claim on these pages against the 4.1.0 code: - cooldowns: which handlers @cooldown applies to, when a message command is checked early, why a stranger's press leaves the owner's count alone, and how a refused message command is told; - cooldown stores: bypassed cooldowns and dmOnCooldown notices; - theming: the inheritStages limit, the app theme after a failed start, the 10 s failure backoff, and the testing links; - localisation and i18n-bot: name rules, Translator in stages, and which catalogs are compile-checked; - testing, testing recipes, mocks, invoke and dispatch: the app's store, message options, Client in stages, UserError answers, option getters, deleted messages, options in overrides, message params, command routing and emit's AggregateError; - services and troubleshooting: the undecorated-class refusal, decorators on the wrong target, ExecutionContext in shared classes, and message command intents; - lifecycle hooks: shared guards and the themeFor class; - security: the Logger redacts the token.
…ted-class rule The early check fetches no role; a cooldown DM goes only to commands sent in a server; a parameter decorator also records types; errors without parameters aren't in the 'not injected' advice; the app class's name is the prefix for @meocord's options. Lifecycle hooks name providers, invoke names the handler prefix and mentions, and testing recipes says how a provided store is shared.
Translator is refused for pipes and the presenter too, naming the class; a testing module's missing Client names every class of the module that injects it.
202d7f9 to
d61ef49
Compare
l7aromeo
left a comment
There was a problem hiding this comment.
Rechecked d61ef49 against meocord 08757577, which is on main.
- localisation.md:
assertStartupClassesrefuses withmissingTranslatorError(cls)("Class: it injects Translator, but @meocord has no i18n. Pass @meocord({ i18n: t }), …") for every startup class. startup-roots.spec's PLACES include a pipe and the presenter. - testing.md:
compile()bindsClientto atoDynamicValuethat throws "A, Binject the Discord Client, which a testing module does not make: …" for every class that injects it, so it is refused where it is resolved.
Both lines match. No blockers.
Every claim on fifteen 4.1 pages checked against meocord 4.1.0 (main at b6113d30), and the examples at 4.1.0-beta.12. Thirteen pages change;
shardinganddatabaseare unchanged, having no claim that needed it.Three statements here describe behaviour from two meocord fixes, meocord/meocord#418 and meocord/meocord#419, both merged:
invokerefuses a command another handler takes by its subcommand path (invoke-and-dispatch);Translatorwithout@MeoCord({ i18n })stops the bot at startup (localisation);Clientit doesn't make, a guard, interceptor or filter included (testing).Pages
@Cooldownon autocomplete, reaction and event handlers is refused, and a controller's skips them; the early check runs when a message command must fetch; a stranger's press is counted under the stranger's id; a refused message command is told by DM withdmOnCooldownconsumeMany; admOnCooldownnotice is counted under:notice:@UseThemeinherits as far asinheritStageslets it; the app theme is given up when the start fails; a failed lookup isn't asked again for 10 seconds; the theme testing helpers live in Testing recipesTranslatorin a guard, interceptor or filterexpectCompleteCatalog, the keys at compile timeapppasses the whole message options;Clientin a stage classUserErrorafter a message is a reply in its channelgetChannelwithchannelTypesandgetFocusedthrow; which methods a deleted message refuses; options in the overridesemit'sAggregateErrorholds the errors@Inject; shared classes can't injectExecutionContext; the import-cycle rule needs the TypeScript resolver; a gotcha for the undecorated-class refusalExecutionContextmessages of shared classes; the app class's name inApp:; intents for DM and mention-only message commandsthemeForclass and shared guards, interceptors and filters get hooks; its place in the orderLoggerprints the token as[redacted]Two claims kept, with their sources
TIMEbefore they write, withoutredis.replicate_commands(). Redis's own documentation, Scripting with Lua: "In Redis 5.0, effects replication became the default mode", and with it "the restrictions on non-deterministic functions are removed. You can, for example, use the TIME … commands inside your scripts freely". The other commands the store sends (ZADD,ZRANGE … WITHSCORES,ZREMRANGEBYSCORE,ZCOUNT,ZCARD,ZREM,PEXPIRE,EVALandEVALSHA) date from Redis 2.node:sqlitewithout a flag from Node 22.13 (cooldown-stores). Node's v22.13.0 changelog, semver-minor commits: "doc,lib,src,test: unflag sqlite module" (nodejs/node#55890).Checks
bun run content:check,bun run examples:check(4.1 against meocord 4.1.0-beta.12, its specs included), prettier and eslint pass.