Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
djobbo committed Apr 17, 2024
1 parent d333bba commit f2307c9
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 14 deletions.
44 changes: 44 additions & 0 deletions docs/src/content/docs/reference/Components/index.md
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 */}
</>
)
}
```
22 changes: 22 additions & 0 deletions docs/src/content/docs/reference/Hooks/index.md
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</>
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "turbo run dev --parallel",
"build": "turbo run build",
"build:w": "turbo run build:w",
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx,.json . --ignore-path .gitignore",
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx,.json,.cjs . --ignore-path .gitignore",
"test": "turbo run test",
"test:w": "turbo run test:w",
"check:lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.cjs . --ignore-path .gitignore",
Expand Down
17 changes: 4 additions & 13 deletions packages/create-reaccord-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"sourceMap": true,
"allowJs": true,
"target": "es6",
"lib": [
"esnext"
],
"lib": ["esnext"],
"moduleResolution": "node",
"outDir": "lib",
"declaration": true,
Expand All @@ -17,13 +15,6 @@
"skipLibCheck": true,
"noUnusedLocals": true
},
"include": [
"src"
],
"exclude": [
"node_modules",
"lib",
"src/**/*.test.ts",
"src/**/*.test.tsx"
]
}
"include": ["src"],
"exclude": ["node_modules", "lib", "src/**/*.test.ts", "src/**/*.test.tsx"]
}

0 comments on commit f2307c9

Please # to comment.