fix api guides
This commit is contained in:
@@ -11,8 +11,7 @@ You can send messages via Reacord to a channel like so.
|
|||||||
```jsx
|
```jsx
|
||||||
client.on("ready", () => {
|
client.on("ready", () => {
|
||||||
const channel = await client.channels.fetch("abc123deadbeef")
|
const channel = await client.channels.fetch("abc123deadbeef")
|
||||||
const instance = reacord.createChannelMessage(channel)
|
reacord.createChannelMessage(channel).render("Hello, world!")
|
||||||
instance.render("Hello, world!")
|
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,7 +35,9 @@ function Uptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.on("ready", () => {
|
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", () => {
|
client.on("ready", () => {
|
||||||
const instance = reacord.createChannelMessage(channel)
|
const instance = reacord.createChannelMessage(channel)
|
||||||
|
|
||||||
instance.render(<Hello subject="World" />)
|
instance.render(<Hello subject="World" />)
|
||||||
instance.render(<Hello subject="Moon" />)
|
instance.render(<Hello subject="Moon" />)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -24,11 +24,9 @@ function FancyMessage({ title, description }) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
reacord.createChannelMessage(
|
reacord
|
||||||
channel,
|
.createChannelMessage(channel)
|
||||||
{},
|
.render(<FancyMessage title="Hello" description="World" />)
|
||||||
<FancyMessage title="Hello" description="World" />,
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Reacord also comes with multiple embed components, for defining embeds on a piece-by-piece basis. This enables composition:
|
Reacord also comes with multiple embed components, for defining embeds on a piece-by-piece basis. This enables composition:
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ function SelfDestruct() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
reacord.send(channelId, <SelfDestruct />)
|
reacord.createChannelMessage(channel).render(<SelfDestruct />)
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user