fix api guides

This commit is contained in:
Domin-MND
2023-10-27 16:06:00 +03:00
parent 390da4cab6
commit c2e5dc04dd
3 changed files with 9 additions and 9 deletions

View File

@@ -11,8 +11,7 @@ You can send messages via Reacord to a channel like so.
```jsx
client.on("ready", () => {
const channel = await client.channels.fetch("abc123deadbeef")
const instance = reacord.createChannelMessage(channel)
instance.render("Hello, world!")
reacord.createChannelMessage(channel).render("Hello, world!")
})
```
@@ -36,7 +35,9 @@ function Uptime() {
}
client.on("ready", () => {
reacord.createChannelMessage(channel).render(<Uptime />)
const instance = reacord.createChannelMessage(channel)
instance.render(<Uptime />)
})
```
@@ -47,6 +48,7 @@ const Hello = ({ subject }) => <>Hello, {subject}!</>
client.on("ready", () => {
const instance = reacord.createChannelMessage(channel)
instance.render(<Hello subject="World" />)
instance.render(<Hello subject="Moon" />)
})

View File

@@ -24,11 +24,9 @@ function FancyMessage({ title, description }) {
```
```jsx
reacord.createChannelMessage(
channel,
{},
<FancyMessage title="Hello" description="World" />,
)
reacord
.createChannelMessage(channel)
.render(<FancyMessage title="Hello" description="World" />)
```
Reacord also comes with multiple embed components, for defining embeds on a piece-by-piece basis. This enables composition:

View File

@@ -22,5 +22,5 @@ function SelfDestruct() {
)
}
reacord.send(channelId, <SelfDestruct />)
reacord.createChannelMessage(channel).render(<SelfDestruct />)
```