Skip to content

Commit

Permalink
a (#449)
Browse files Browse the repository at this point in the history
* chore(deps-dev): Bump @tsconfig/docusaurus from 1.0.7 to 2.0.0

Bumps [@tsconfig/docusaurus](https://github.com/tsconfig/bases/tree/HEAD/bases) from 1.0.7 to 2.0.0.
- [Commits](https://github.com/tsconfig/bases/commits/HEAD/bases)

---
updated-dependencies:
- dependency-name: "@tsconfig/docusaurus"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): Bump webpack from 5.88.1 to 5.88.2

Bumps [webpack](https://github.com/webpack/webpack) from 5.88.1 to 5.88.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.88.1...v5.88.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): Bump docusaurus-plugin-sass from 0.2.4 to 0.2.5

Bumps [docusaurus-plugin-sass](https://github.com/rlamana/docusaurus-plugin-sass) from 0.2.4 to 0.2.5.
- [Release notes](https://github.com/rlamana/docusaurus-plugin-sass/releases)
- [Commits](rlamana/docusaurus-plugin-sass@v0.2.4...v0.2.5)

---
updated-dependencies:
- dependency-name: docusaurus-plugin-sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): Bump clsx from 1.2.1 to 2.0.0

Bumps [clsx](https://github.com/lukeed/clsx) from 1.2.1 to 2.0.0.
- [Release notes](https://github.com/lukeed/clsx/releases)
- [Commits](lukeed/clsx@v1.2.1...v2.0.0)

---
updated-dependencies:
- dependency-name: clsx
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Create version-updates.yml

Signed-off-by: Lala Sabathil <[email protected]>

* Fix type

Signed-off-by: Chris Oelerich <[email protected]>

* chore(deps): Bump sass from 1.64.1 to 1.64.2 (#358)

Bumps [sass](https://github.com/sass/dart-sass) from 1.64.1 to 1.64.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.64.1...1.64.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump sass from 1.64.2 to 1.65.1 (#359)

Bumps [sass](https://github.com/sass/dart-sass) from 1.64.2 to 1.65.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.64.2...1.65.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump sass from 1.65.1 to 1.66.1 (#360)

Bumps [sass](https://github.com/sass/dart-sass) from 1.65.1 to 1.66.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.65.1...1.66.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump typescript from 5.1.6 to 5.2.2 (#361)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.1.6 to 5.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v5.1.6...v5.2.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump actions/checkout from 3 to 4 (#362)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump remark-frontmatter from 4.0.1 to 5.0.0 (#363)

Bumps [remark-frontmatter](https://github.com/remarkjs/remark-frontmatter) from 4.0.1 to 5.0.0.
- [Release notes](https://github.com/remarkjs/remark-frontmatter/releases)
- [Commits](remarkjs/remark-frontmatter@4.0.1...5.0.0)

---
updated-dependencies:
- dependency-name: remark-frontmatter
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): Bump sass from 1.66.1 to 1.67.0 (#365)

Bumps [sass](https://github.com/sass/dart-sass) from 1.66.1 to 1.67.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.66.1...1.67.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump @tsconfig/docusaurus from 2.0.0 to 2.0.1 (#366)

Bumps [@tsconfig/docusaurus](https://github.com/tsconfig/bases/tree/HEAD/bases) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/tsconfig/bases/commits/HEAD/bases)

---
updated-dependencies:
- dependency-name: "@tsconfig/docusaurus"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix guide

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Lala Sabathil <[email protected]>
Signed-off-by: Chris Oelerich <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chris Oelerich <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2024
1 parent 5077b2e commit 8006bfa
Show file tree
Hide file tree
Showing 15 changed files with 455 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
if: github.event.pull_request.user.type != 'Bot' && !contains(github.event.pull_request.labels.*.name, 'skip-ci')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: pip install codespell
- run: codespell --ignore-words-list="groupt,nd,ot,claus" --skip="./yarn.lock"
- run: codespell --ignore-words-list="groupt,nd,ot,claus,everytime" --skip="./yarn.lock"
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ on:
jobs:
lint:
name: DevSkim
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/njsscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: njsscan code scanning
steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@d58d8b2f26322cd35a9efb8003baac517f226d81
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:

strategy:
matrix:
node-version: [16.14]
node-version: [18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/version-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Version Update Auto Merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion docs/interactions/ui-components/buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ if you are trying to create a self-role system with buttons, for example. This i

Persistent views work forever. When the bot goes offline, the buttons will stop working. When the bot comes back online, however, the buttons will start working again.

In a Persistent View, the timeout must be set to `None` and all the children in the view much have a `custom_id` attribute set.
In a Persistent View, the timeout must be set to `None` and all the children in the view must have a `custom_id` attribute set.

```python
@bot.event
Expand Down
2 changes: 1 addition & 1 deletion docs/interactions/ui-components/dropdowns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MyView(discord.ui.View):

@bot.command()
async def flavor(ctx):
await ctx.send("Choose a flavor!", view=MyView())
await ctx.respond("Choose a flavor!", view=MyView())

bot.run("TOKEN")
```
Expand Down
1 change: 1 addition & 0 deletions docs/more/community-resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This page showcases the amazing things created by the Pycord community, includin

| Name | Type | Link |
| ------------------------ | ------------ | ----------------------------------------------------------------------------------- |
| CookieBot | Multipurpose | [website](https://cookie-bot.xyz) |
| Discord-Multipurpose-Bot | Multipurpose | [github](https://github.com/pogrammar/Discord-multipurpose-bot/tree/master/Python) |
| _GZ_ Global | Chatting | [website](https://www.gzglobal.eu/) |
| inconnu | Fun & QOL | [github](https://github.com/tiltowait/inconnu) |
Expand Down
64 changes: 41 additions & 23 deletions docs/voice/playing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ async def connect_nodes():
"""Connect to our Lavalink nodes."""
await bot.wait_until_ready() # wait until the bot is ready

await wavelink.NodePool.create_node(
bot=bot,
host='0.0.0.0',
port=2333,
password='youshallnotpass'
) # create a node
nodes = [
wavelink.Node(
identifier="Node1", # This identifier must be unique for all the nodes you are going to use
uri="http://0.0.0.0:443", # Protocol (http/s) is required, port must be 443 as it is the one lavalink uses
password="youshallnotpass"
)
]

await wavelink.Pool.connect(nodes=nodes, client=bot) # Connect our nodes
```

<br />
Expand All @@ -67,23 +70,35 @@ Now you are finished making your node! Next, you will want to:
To make a play command, you will need to make a function to connect and play audio in a voice channel.

```py title="Play Command Example"
import typing

@bot.slash_command(name="play")
async def play(ctx, search: str):
vc = ctx.voice_client # define our voice client

if not vc: # check if the bot is not in a voice channel
vc = await ctx.author.voice.channel.connect(cls=wavelink.Player) # connect to the voice channel

if ctx.author.voice.channel.id != vc.channel.id: # check if the bot is not in the voice channel
return await ctx.respond("You must be in the same voice channel as the bot.") # return an error message

song = await wavelink.YouTubeTrack.search(query=search, return_first=True) # search for the song

if not song: # check if the song is not found
return await ctx.respond("No song found.") # return an error message

await vc.play(song) # play the song
await ctx.respond(f"Now playing: `{vc.source.title}`") # return a message
# First we may define our voice client,
# for this, we are going to use typing.cast()
# function just for the type checker know that
# `ctx.voice_client` is going to be from type
# `wavelink.Player`
vc = typing.cast(wavelink.Player, ctx.voice_client)

if not vc: # We firstly check if there is a voice client
vc = await ctx.author.voice.channel.connect(cls=wavelink.Player) # If there isn't, we connect it to the channel

# Now we are going to check if the invoker of the command
# is in the same voice channel than the voice client, when defined.
# If not, we return an error message.
if ctx.author.voice.channel.id != vc.channel.id:
return await ctx.respond("You must be in the same voice channel as the bot.")

# Now we search for the song. You can optionally
# pass the "source" keyword, of type "wavelink.TrackSource"
song = await wavelink.Playable.search(search)

if not song: # In case the song is not found
return await ctx.respond("No song found.") # we return an error message

await vc.play(song) # Else, we play it
await ctx.respond(f"Now playing: `{song.title}`") # and return a success message
```

<DiscordComponent>
Expand Down Expand Up @@ -113,8 +128,11 @@ async def on_ready():
await connect_nodes() # connect to the server

@bot.event
async def on_wavelink_node_ready(node: wavelink.Node):
print(f"{node.identifier} is ready.") # print a message
async def on_wavelink_node_ready(payload: wavelink.NodeReadyEventPayload):
# Everytime a node is successfully connected, we
# will print a message letting it know.
print(f"Node with ID {payload.session_id} has connected")
print(f"Resumed session: {payload.resumed}")

bot.run("token")
```
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@
"@matteusan/sentro": "0.1.25",
"@mdx-js/react": "1.6.22",
"@types/react": "17.0.2",
"clsx": "1.2.1",
"discord-message-components": "https://gitpkg.now.sh/Pycord-Development/discord-message-components?aa468ada9b2b52986ae0aee4051660713c1e9095&scripts.postinstall=yarn%20install%20--ignore-scripts%20%26%26%20node%20node_modules%2Fesbuild%2Finstall.js%20%26%26yarn%20build%3Amarkdown%20%26%26%20yarn%20build%3Acore%20%26%26%20yarn%20build%3Areact",
"docusaurus-plugin-sass": "0.2.4",
"clsx": "2.0.0",
"discord-message-components": "https://gitpkg.now.sh/Pycord-Development/discord-message-components?aa468ada9b2b52986ae0aee4051660713c1e9095&scripts.postinstall=yarn%20install%20--ignore-scripts%20%26%26%20node%20node_modules%2Fesbuild%2Finstall.js%20%26%26yarn%20build%3Amarkdown%20%26%26%20yarn%20build%3Acore%20%26%26%20yarn%20build%3Areact%20%26%26",
"docusaurus-plugin-sass": "0.2.5",
"prism-react-renderer": "1.3.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-twemoji": "^0.5.0",
"sass": "1.64.1",
"webpack": "^5.88.1",
"sass": "1.67.0",
"webpack": "^5.88.2",
"yarn": "^1.22.19"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "1.0.7",
"@tsconfig/docusaurus": "2.0.1",
"micromark-extension-mdx-md": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-comment": "^1.0.0",
"remark-frontmatter": "^4.0.1",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^3.0.1",
"remark-mdx": "^2.3.0",
"remark-preset-lint-consistent": "^5.1.2",
"remark-preset-lint-recommended": "^6.1.3",
"typescript": "5.1.6"
"typescript": "5.2.2"
},
"resolutions": {
"@types/react": "17.0.2"
Expand Down
Loading

0 comments on commit 8006bfa

Please sign in to comment.