This repository has been archived by the owner on Mar 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAFF 1.11.0
- Loading branch information
Showing
81 changed files
with
2,061 additions
and
841 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,26 @@ | ||
name: docs-builder | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.fork == false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- uses: actions/cache@v2 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- run: pip install -e .[docs] | ||
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git | ||
- run: mkdocs gh-deploy | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DEPLOY: True |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ nav: | |
- events | ||
- models | ||
- ext | ||
- utils.md | ||
- monopage.md |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,23 @@ | ||
??? Hint "Example Usage:" | ||
```python | ||
from naff import slash_command, slash_option, OptionTypes, InteractionContext | ||
from naff.api.voice.audio import AudioVolume | ||
|
||
|
||
@slash_command("play") | ||
@slash_option("song", "The song to play", OptionTypes.STRING, required=True) | ||
async def test_cmd(ctx: InteractionContext, song: str): | ||
await ctx.defer() | ||
|
||
if not ctx.voice_state: | ||
await ctx.author.voice.channel.connect() # (1)! | ||
|
||
await ctx.send(f"Playing {song}") | ||
await ctx.voice_state.play(AudioVolume(song)) # (2)! | ||
``` | ||
{ .annotate } | ||
|
||
1. This connects the bot to the author's voice channel if we are not already connected | ||
2. Check out the [Voice Support Guide](/Guides/22 Voice.html) for more info on audio playback | ||
|
||
::: naff.models.naff.active_voice_state |
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 |
---|---|---|
@@ -1 +1,12 @@ | ||
??? Hint "Example Usage:" | ||
```python | ||
from naff import check, has_any_role, slash_command | ||
|
||
@slash_command(name='cmd') | ||
@check(has_any_role(174918559539920897, 970018521511768094)) | ||
async def some_command(ctx): | ||
... | ||
|
||
|
||
``` | ||
::: naff.models.naff.checks |
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 |
---|---|---|
@@ -1 +1,14 @@ | ||
::: naff.models.naff.command | ||
??? Hint "Example Usage:" | ||
```python | ||
from naff import slash_command, cooldown, Buckets | ||
|
||
@slash_command(name='cmd') | ||
@cooldown(Buckets.user, 1, 10) # (1)! | ||
async def some_command(ctx): | ||
... | ||
``` | ||
{ .annotate } | ||
|
||
1. This will create a cooldown for each user; allowing them to use the command once every 10 seconds | ||
|
||
::: naff.models.naff.cooldowns |
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,105 @@ | ||
--- | ||
search: | ||
exclude: true | ||
--- | ||
# Mono-Doc | ||
This file holds the entire API reference in a single page; should that be your preference. | ||
|
||
[//]: # (":::: naff" - while this would be an option, the order sucks) | ||
|
||
--- | ||
## Clients | ||
::: naff.client.client | ||
::: naff.client.auto_shard_client | ||
::: naff.models.naff.active_voice_state | ||
|
||
--- | ||
## User | ||
::: naff.models.discord.user | ||
::: naff.models.discord.voice_state | ||
|
||
--- | ||
## Guild | ||
::: naff.models.discord.guild | ||
::: naff.models.discord.scheduled_event | ||
::: naff.models.discord.sticker | ||
::: naff.models.discord.webhooks | ||
::: naff.models.discord.channel | ||
::: naff.models.discord.invite | ||
::: naff.models.discord.role | ||
::: naff.models.discord.emoji | ||
|
||
--- | ||
## Message | ||
::: naff.models.discord.message | ||
::: naff.models.discord.reaction | ||
|
||
--- | ||
## UX. | ||
::: naff.models.discord.embed | ||
::: naff.models.discord.asset | ||
::: naff.models.discord.color | ||
::: naff.models.discord.file | ||
|
||
--- | ||
## Commands | ||
::: naff.models.naff.command | ||
::: naff.models.naff.prefixed_command | ||
|
||
--- | ||
## Application Commands | ||
|
||
::: naff.models.discord.components | ||
::: naff.models.discord.modal | ||
::: naff.models.naff.application_commands | ||
|
||
--- | ||
## Context | ||
::: naff.models.naff.context | ||
|
||
--- | ||
## Presence | ||
::: naff.models.discord.activity | ||
|
||
--- | ||
## Data | ||
::: naff.models.discord.application | ||
::: naff.models.discord.team | ||
::: naff.models.discord.enums | ||
::: naff.models.discord.timestamp | ||
|
||
--- | ||
## naff Models | ||
::: naff.models.naff.extension | ||
::: naff.models.naff.cooldowns | ||
::: naff.models.naff.checks | ||
::: naff.models.naff.auto_defer | ||
::: naff.models.naff.annotations | ||
::: naff.models.naff.converters | ||
::: naff.models.naff.listener | ||
::: naff.models.naff.localisation | ||
::: naff.models.naff.tasks | ||
::: naff.models.naff.wait | ||
::: naff.models.misc.iterator | ||
|
||
--- | ||
## API | ||
::: naff.api.gateway.state | ||
::: naff.api.gateway.gateway | ||
::: naff.api.voice.voice_gateway | ||
::: naff.api.http.http_client | ||
|
||
--- | ||
## Voice | ||
::: naff.api.voice.audio | ||
::: naff.api.voice.player | ||
|
||
|
||
--- | ||
## Errors | ||
::: naff.client.errors | ||
|
||
--- | ||
## Events | ||
::: naff.api.events.discord | ||
::: naff.api.events.internal |
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,21 @@ | ||
These are a collection of utility methods that are used throughout the library. There are several more that are not included here, as they are reserved for internal use. | ||
|
||
!!! info | ||
All of these methods can be imported from the `naff.client.utils` namespace | ||
|
||
## Formatting | ||
These methods are to help you format strings for messages. | ||
|
||
::: naff.client.utils.formatting | ||
|
||
## Attrs Utilities | ||
These methods are intended to be used with attrs dataclasses | ||
|
||
::: naff.client.utils.attr_converters | ||
|
||
::: naff.client.utils.attr_utils | ||
|
||
## Misc Utilities | ||
Uncategorized utilities, might be useful, might not. | ||
|
||
::: naff.client.utils.misc_utils |
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 @@ | ||
naff.info |
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
--- | ||
hide: | ||
- navigation | ||
- toc | ||
--- | ||
!!! danger "Notice" | ||
This page is a placeholder, and will be populated at a later date. |
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
File renamed without changes.
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
Oops, something went wrong.