mirror of
https://github.com/sern-handler/website
synced 2026-06-16 04:42:26 +00:00
making website look better
This commit is contained in:
@@ -95,6 +95,10 @@ export default defineConfig({
|
||||
label: "Snippets",
|
||||
autogenerate: { directory: "v4/snippets" },
|
||||
},
|
||||
{
|
||||
label: "Transition",
|
||||
autogenerate: { directory: "v4/transition" },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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' }
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
@@ -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) {
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
46
src/content/docs/v4/transition/from-v3.mdx
Normal file
46
src/content/docs/v4/transition/from-v3.mdx
Normal 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.
|
||||
|
||||
10
src/content/docs/v4/transition/whats-new.mdx
Normal file
10
src/content/docs/v4/transition/whats-new.mdx
Normal 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
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user