Saltearse al contenido
sern

Updating your sern app

Esta página aún no está disponible en tu idioma.

Arguments changed for all commands.

The second argument is the new SDT type

1
import { commandModule, CommandType } from '@sern/handler'
2
3
export 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 // Dependencies
9
sdt.type // module type
10
}
11
})

It used to look like this:

1
import { commandModule, CommandType } from '@sern/handler'
2
3
export 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 resolver
9
}
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";
3
import type { SernLogger } from "./utils/Logger";
4
import type { Octokit } from "@octokit/rest";
5
declare global {
6
interface Dependencies extends CoreDependencies {
7
"@sern/logger": SernLogger;
8
"@sern/logger": Singleton<SernLogger>;
9
octokit: Octokit;
10
octokit: Singleton<Octokit>;
11
}
12
}
13
export {};