making website look better

This commit is contained in:
Jacob Nguyen
2024-06-03 00:02:18 -05:00
parent 2e769800dd
commit 85ecc72418
6 changed files with 65 additions and 2 deletions

View File

@@ -95,6 +95,10 @@ export default defineConfig({
label: "Snippets",
autogenerate: { directory: "v4/snippets" },
},
{
label: "Transition",
autogenerate: { directory: "v4/transition" },
},
],
},
],

View File

@@ -141,7 +141,7 @@ export default commandModule({
type: CommandType.Slash,
plugins: [plugin, plugin2],
execute: (ctx, sdt) => {
console.log(sdt.state) // { a: 'from plugin1', b: '182326315813306368 from plugin2' }
sdt.state // { a: 'from plugin1', b: '182326315813306368 from plugin2' }
}
})
```

View File

@@ -16,7 +16,7 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
export default eventModule({
type: EventType.Discord,
name: "guildMemberAdd",
async execute(member: GuildMember) {
async execute(member) {
},
});
```

View File

@@ -0,0 +1,46 @@
---
title: Updating your sern app
description: Moving from version three to four
sidebar:
order: 1
---
## Arguments changed for all commands.
> The second argument is the `new SDT` type
```ts {7-10}
import { commandModule, CommandType } from '@sern/handler'
export default commandModule({
type: CommandType.Slash,
description: "My ping command",
execute: (ctx, sdt) => {
sdt.params // only exists if current command is not a component
sdt.deps // Dependencies
sdt.type // module type
}
})
```
:::tip
To access arguments now, use `ctx.options`.
This getter will return `string[]` if `ctx` is a `Message`, else the discord.js interaction resolver
:::
It used to look like this:
```ts {7-8}
import { commandModule, CommandType } from '@sern/handler'
export default commandModule({
type: CommandType.Slash,
description: "My ping command",
execute: (ctx, [type, opts]) => {
type // 'text' | 'slash'
opts // string[] | discord.js command option resolver
}
})
```
## Killing Experimental Things
> *Sometimes your experiments need to be put behind the barn.*
`Sern.init('file')` has been removed.

View File

@@ -0,0 +1,10 @@
---
title: What's New
description: YEAHHHHHH NEW STUFF
sidebar:
order: 1
---
- [SDT](/v4/reference/plugins#passing-state-with-sdt)
- Cron Modules
- [Cross-component data](/v4/reference/modules/#dynamic-component-parameters)
- updating the module

View File

@@ -20,6 +20,9 @@ const plugins = pluginResponse.value;
---
<StarlightPage frontmatter={{ title: "Plugins", template: "splash" }}>
<h5>
First time here? View <a href="/v4/reference/plugins">plugins</a>
</h5>
<CardGrid>
{plugins.map((p) => <PluginCard {...p} />)}
</CardGrid>