-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: Message Components | ||
description: Discord message components | ||
--- | ||
|
||
The Message Components are a set of components that allow you to create rich Discord messages. | ||
Such as Buttons, Select Menus, Links, etc... | ||
|
||
```jsx | ||
import { Embed } from "reaccord" | ||
|
||
function MyBot() { | ||
const [selected, setSelected] = useState('cool') | ||
|
||
return ( | ||
<> | ||
<Button | ||
style={ButtonStyle.Secondary} | ||
onClick={() => setCurrentPage(1)} | ||
disabled={loading || page <= 1} | ||
> | ||
{"<<"} | ||
</Button> | ||
<SelectMenu onChange={([val]) => setSelected(val)}> | ||
<SelectMenu.Option | ||
value="cool" | ||
description="This is a cool option" | ||
selected={selected === "cool"} | ||
> | ||
Cool | ||
</SelectMenu.Option> | ||
<SelectMenu.Option | ||
value="awesome" | ||
description="This is an awesome option" | ||
selected={selected === "awesome"} | ||
> | ||
Awesome | ||
</SelectMenu.Option> | ||
</SelectMenu> | ||
{/* ... Add more components */} | ||
</> | ||
) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Custom Hooks | ||
description: Custom hooks for your bot | ||
--- | ||
|
||
Reaccord provides a set of custom hooks that allow you to hook into the lifecycle of your bot. | ||
|
||
```jsx | ||
import { Embed } from "reaccord" | ||
|
||
function MyBot() { | ||
useReceivedReply((message) => { | ||
console.log("Received message:", message.content) | ||
}) | ||
|
||
useReactionAdded((reaction) => { | ||
console.log("Reaction added:", reaction.emoji) | ||
}) | ||
|
||
return <>Hello World</> | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters