diff --git a/blog/2022-09-28-mdx-blog-post.md b/blog/2022-09-28-mdx-blog-post.md index 17432f802..f5ebc5925 100644 --- a/blog/2022-09-28-mdx-blog-post.md +++ b/blog/2022-09-28-mdx-blog-post.md @@ -19,17 +19,15 @@ Quick List of changes! - [Dependencies update](#dependencies-update) - ### Class based modules Incorporate class based modules into your project instead of the traditional `commandModule` or `eventModule` Extend the new [CommandExecutable](docs/api/classes/CommandExecutable) or [EventExecutable](docs/api/classes/EventExecutable) ```ts title="commands/meaning-of-life.ts" -import { CommandType, CommandExecutable, type Args, type Context } from "@sern/handler"; -import { publish } from "../plugins/publish.js"; -import { serendipityOnly } from "../plugins/serendipityOnly.js"; +import { CommandType, CommandExecutable, type Args, type Context } from '@sern/handler'; +import { publish } from '../plugins/publish.js'; +import { serendipityOnly } from '../plugins/serendipityOnly.js'; export default class extends CommandExecutable { - type = CommandType.Both as const; description = 'What is the meaning of life?' override onEvent = [ @@ -50,11 +48,11 @@ execute must not be a method of the class. It should be as above, a property on ::: -```ts title="commands/guildMemberAdd.ts" -import { CommandType, EventExecutable, type EventType } from "@sern/handler"; +```ts title="events/guildMemberAdd.ts" +import { CommandType, EventExecutable, type EventType } from '@sern/handler'; import type { GuildMember } from 'discord.js' -export default class extends EventExecutable { +export default class extends EventExecutable { type = EventType.Discord as const; // highlight-next-line execute = (member: GuildMember) => { @@ -78,4 +76,4 @@ The next update will bring sern v2 with some important features. Here are some t ### Dependencies Update - TypeScript has been updated to 4.8.3 -- Discord.js has been upgraded to 14.5 \ No newline at end of file +- Discord.js has been upgraded to 14.5