Updating your sern app
Bu içerik henüz dilinizde mevcut değil.
Arguments changed for all commands.
The second argument is the
new SDT
type
1import { commandModule, CommandType } from '@sern/handler'2
3export default commandModule({4 type: CommandType.Slash,5 description: "My ping command",6 execute: (ctx, sdt) => {7 sdt.params // only exists if current command is a component (dynamic custom ids)8 sdt.deps // Dependencies9 sdt.type // module type10 }11})
It used to look like this:
1import { commandModule, CommandType } from '@sern/handler'2
3export default commandModule({4 type: CommandType.Slash,5 description: "My ping command",6 execute: (ctx, [type, opts]) => {7 type // 'text' | 'slash'8 opts // string[] | discord.js command option resolver9 }10})
Killing Experimental Things
Sometimes your experiments need to be put behind the barn.
Sern.init('file')
has been removed.
Publishing Application Commands
sern commands publish
does not work with localizer plugin. It will work in version four, but it is recommended to use publishing as a service
Singleton, Transient, CoreModuleStore types removed
- All objects are by default a singleton now.
- By this assertion, we removed the type helpers for these. This may affect intellisense
Things marked internal are now removed from public api.
1 import type { SernEmitter, CoreDependencies, Singleton } from "@sern/handler";2 import type { SernEmitter, CoreDependencies } from "@sern/handler";3import type { SernLogger } from "./utils/Logger";4import type { Octokit } from "@octokit/rest";5declare global {6 interface Dependencies extends CoreDependencies {7 "@sern/logger": SernLogger;8 "@sern/logger": Singleton<SernLogger>;9 octokit: Octokit;10 octokit: Singleton<Octokit>;11 }12}13export {};