diff --git a/.github/workflows/book_deploy.yml b/.github/workflows/book_deploy.yml index 12b44787793..80c191d36da 100644 --- a/.github/workflows/book_deploy.yml +++ b/.github/workflows/book_deploy.yml @@ -1,153 +1,153 @@ -name: Wiki Deploy - -on: - push: - branches: - - dev - - prod - -jobs: - build: - name: Build wiki - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install dependencies - env: - GH_TOKEN: ${{ github.token }} - run: |- - gh release download -R rust-lang/mdBook -p mdbook-*-x86_64-unknown-linux-gnu.tar.gz - gh release download -R tommilligan/mdbook-admonish -p mdbook-admonish-*-x86_64-unknown-linux-gnu.tar.gz - gh release download -R NilPointer-Software/mdbook-discord-components -p mdbook-discord-components-*.tar.gz - - for file in *.tar.gz - do tar xzf "$file" -C /usr/local/bin - rm $file - done - - - name: Build book - env: - DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} - run: |- - mdbook-admonish install --css-dir src/theme - mdbook build - - - name: Upload book - uses: actions/upload-artifact@v4 - with: - name: book - path: book - - deploy-prod: - name: Deploy production wiki - needs: build - if: github.ref_name == 'prod' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: gh-pages - - - name: Prepare to fetch book - run: |- - mv nightly .. - rm -rf * - - - name: Fetch book artifact - uses: actions/download-artifact@v4 - with: - name: book - - - name: Deploy - run: |- - mv ../nightly . - git add -A - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git commit -m "Deploy $GITHUB_SHA to gh-pages" - git push --force --set-upstream origin gh-pages - - deploy-nightly: - name: Deploy nightly wiki - needs: build - if: github.ref_name == 'dev' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: gh-pages - - - name: Prepare to fetch book - run: rm -rf nightly/* - - - name: Fetch book artifact - uses: actions/download-artifact@v4 - with: - name: book - path: nightly - - - name: Deploy - run: |- - git add -A - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git commit -m "Deploy nightly $GITHUB_SHA to gh-pages" - git push --force --set-upstream origin gh-pages - - notify-discord: - name: Send notification - needs: [deploy-prod, deploy-nightly] - if: ${{ !failure() }} - runs-on: ubuntu-latest - env: - TYPE: Nightly - LINK: nightly - steps: - - name: Prepare notification - env: - RAW: ${{ github.event.head_commit.message }} - run: |- - echo "MESSAGE<> $GITHUB_ENV - RAW=$(echo "$RAW" | sed -r '/^\s*$/d') - echo "$RAW" | head -n 10 | sed ':a;N;$!ba;s/\n/\n /g' >> $GITHUB_ENV - if [ $(echo "$RAW" | wc -l) -gt 10 ]; then - echo " ..." >> $GITHUB_ENV - fi - echo "EOF" >> $GITHUB_ENV - - - name: Set notification type - if: github.ref_name == 'prod' - run: |- - echo "TYPE=Production" >> $GITHUB_ENV - echo "LINK=" >> $GITHUB_ENV - - - name: Send notification - uses: MineBartekSA/discord-webhook@v2.1 - with: - webhook: ${{ secrets.WEBHOOK }} - embed: |- - title: "${{ env.TYPE }} Wiki Update" - color: 10001644 - author: - name: ${{ github.event.head_commit.author.username }} - url: https://github.com/${{ github.event.head_commit.author.username }} - icon_url: https://github.com/${{ github.event.head_commit.author.username }}.png - thumbnail: - url: https://botdesignerdiscord.com/logo512.png - description: |- - **__Content__** - - ${{ env.MESSAGE }} - component: |- - - type: 2 - style: 5 - label: View commit - url: ${{ github.event.head_commit.url }} - - type: 2 - style: 5 - label: Preview site - url: https://nilpointer-software.github.io/bdfd-wiki/${{ env.LINK }} +name: Wiki Deploy + +on: + push: + branches: + - dev + - prod + +jobs: + build: + name: Build wiki + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + env: + GH_TOKEN: ${{ github.token }} + run: |- + gh release download -R rust-lang/mdBook -p mdbook-*-x86_64-unknown-linux-gnu.tar.gz + gh release download -R tommilligan/mdbook-admonish -p mdbook-admonish-*-x86_64-unknown-linux-gnu.tar.gz + gh release download -R NilPointer-Software/mdbook-discord-components -p mdbook-discord-components-*.tar.gz + + for file in *.tar.gz + do tar xzf "$file" -C /usr/local/bin + rm $file + done + + - name: Build book + env: + DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} + run: |- + mdbook-admonish install --css-dir src/theme + mdbook build + + - name: Upload book + uses: actions/upload-artifact@v4 + with: + name: book + path: book + + deploy-prod: + name: Deploy production wiki + needs: build + if: github.ref_name == 'prod' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Prepare to fetch book + run: |- + mv nightly .. + rm -rf * + + - name: Fetch book artifact + uses: actions/download-artifact@v4 + with: + name: book + + - name: Deploy + run: |- + mv ../nightly . + git add -A + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git commit -m "Deploy $GITHUB_SHA to gh-pages" + git push --force --set-upstream origin gh-pages + + deploy-nightly: + name: Deploy nightly wiki + needs: build + if: github.ref_name == 'dev' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Prepare to fetch book + run: rm -rf nightly/* + + - name: Fetch book artifact + uses: actions/download-artifact@v4 + with: + name: book + path: nightly + + - name: Deploy + run: |- + git add -A + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git commit -m "Deploy nightly $GITHUB_SHA to gh-pages" + git push --force --set-upstream origin gh-pages + + notify-discord: + name: Send notification + needs: [deploy-prod, deploy-nightly] + if: ${{ !failure() }} + runs-on: ubuntu-latest + env: + TYPE: Nightly + LINK: nightly + steps: + - name: Prepare notification + env: + RAW: ${{ github.event.head_commit.message }} + run: |- + echo "MESSAGE<> $GITHUB_ENV + RAW=$(echo "$RAW" | sed -r '/^\s*$/d') + echo "$RAW" | head -n 10 | sed ':a;N;$!ba;s/\n/\n /g' >> $GITHUB_ENV + if [ $(echo "$RAW" | wc -l) -gt 10 ]; then + echo " ..." >> $GITHUB_ENV + fi + echo "EOF" >> $GITHUB_ENV + + - name: Set notification type + if: github.ref_name == 'prod' + run: |- + echo "TYPE=Production" >> $GITHUB_ENV + echo "LINK=" >> $GITHUB_ENV + + - name: Send notification + uses: MineBartekSA/discord-webhook@v2.1 + with: + webhook: ${{ secrets.WEBHOOK }} + embed: |- + title: "${{ env.TYPE }} Wiki Update" + color: 6504371 + author: + name: ${{ github.event.head_commit.author.username }} + url: https://github.com/${{ github.event.head_commit.author.username }} + icon_url: https://github.com/${{ github.event.head_commit.author.username }}.png + thumbnail: + url: https://app.botdesignerdiscord.com/icons/Icon-512.png + description: |- + **__Content__** + + ${{ env.MESSAGE }} + component: |- + - type: 2 + style: 5 + label: View commit + url: ${{ github.event.head_commit.url }} + - type: 2 + style: 5 + label: Preview site + url: https://wiki.botdesignerdiscord.com/nightly/${{ env.LINK }} diff --git a/.gitignore b/.gitignore index c3eedcb51f7..63aea233ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -book -mdbook -mdbook.exe -mdbook-discord-components +book +mdbook +mdbook.exe +mdbook-discord-components +.idea \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e8ced407b28..d216ca6ce4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,233 +1,269 @@ -# Contributing -Hey! 👋 Thanks for checking out. If you would like to contribute to this repository, do not hesitate! Pull requests are always welcome at any hour. - -> **Note** : Contributions to this repository are generally made by submitting a pull request. -If you are comparatively new to GitHub or aren't familiar with how to submit a pull request, enlighten yourself a bit by checking [GitHub docs](https://docs.github.com/en/pull-requests) -or you can also ask anyone from the active [contributors](https://github.com/NilPointer-Software/bdfd-wiki/graphs/contributors) to submit your contributions on your behalf. - -## Guidelines -General guidelines to keep in mind when contributing : -- All file names must be in "[lowerCamelCase](https://wiki.c2.com/?LowerCamelCase)" format (i.e `fileName.md`). -- Avoid using spaces or any special characters (e.g `$`) in file names. -- Do not make duplicates or useless pull requests. -- Do not make troll or NSFW pull requests. -- Do not make huge pull requests. Keep them small. -- Fact-check/verify information included in the pull request. -- Make sure to follow [Proper Wiki Structure](#proper-wiki-structure). - -## FAQs -Some of the frequently asked questions from users - -1. My pull request has been merged but it isn't showing up on the wiki page. Why? - - Once a pull request is merged successfully, the changes can be seen in [Nightly Wiki](https://nilpointer-software.github.io/bdfd-wiki/nightly) after 2-3 minutes. In the case of [Main Wiki](https://nilpointer-software.github.io/bdfd-wiki), it will take some weeks since the contributed markdown files are deployed by a Developer only. - -2. Do I get any perks for contributing? - - You are credited for your contributions to the wiki here on GitHub, by being shown as a contributor. - However, if applicable the Developers reserve the right to give perks/accreditation to users for contributing. - -3. Any correct steps to submit contributions? - - Follow the steps described below : - - Fork the repository. - - Create a new branch from `dev` branch. - - Do the required changes in the new branch and then, submit a pull request. - - Once, the pull request has been merged successfully, fetch the upstream in `dev` branch *(Optionally, you can also delete the pull request branch if you want)*. - - That's it...Happy Contributing!! - -## Proper Wiki Structure - -### Grammar -- Don't use gendered pronouns *(i.e She/Her/Hers or He/Him/His)*, instead use neutral pronouns *(i.e They, Them, Their)*. -- Use *"We"* instead of *"I"* when referring to yourself. -- Use *"You/Your"* instead of *"We/Our"* when referring to the reader. -- Avoid using offensive phrases or words *(i.e dumb, useless, bad, trash, suck etc)*. - -### Shortening Headers -Always keep section headers short, consise, and in [Title Case](https://en.m.wikipedia.org/wiki/Title_case) format. For example, - -```diff -- How to create embeds -+ Creating Embeds -``` - -### Markdown -Markdown allows you to make headings, format text, make lists and tables. - ---- -#### Text Formatting -| Name | Sign | -| :---: | :---: | -| *Italics* | \*...\* or \_...\_ | -| **Bold** | \*\*...\*\* or \_\_...\_\_ | -| ~~Line-Through~~ | \~\~...\~\~ | -| `Code Snippet` | \`...\` | - ---- -#### Lists -\- Item 1\ -\- Item 2\ -\- Item 3 -##### Output -- Item 1 -- Item 2 -- Item 3 - ---- -#### Large Code Block -\`\`\`\ -Large Code Block\ -\`\`\` -##### Output -``` -Large Code Block -``` ---- -#### Quotes -\> This is a quote. -##### Output -> This is a quote. - ---- -#### Headers -| Name | Sign | -| :---: | :---: | -| Title | # | -| Section | ## | -| Sub-Section | ### | -| Small-Topic | #### | -| Sub-Small-Topic | ##### | -##### Output -# Title -## Section -### Sub-Section -#### Small-Topic - -##### Sub-Small-Topic - ---- -#### Tables - -1. Centered Text - ``` - | Name | Value | - | :---: | :---: | - | Name | Value | - | Name | The Longest Value | - | Name | Value | - | Name | Value | - | Name | Value | - ``` - ##### Output - | Name | Value | - | :---: | :---: | - | Name | Value | - | Name | The Longest Value | - | Name | Value | - | Name | Value | - | Name | Value | -2. Uncentered Text - ``` - | Name | Value | - | --- | --- | - | Name | Value | - | Name | The Longest Value | - | Name | Value | - | Name | Value | - | Name | Value | - ``` - ##### Output - | Name | Value | - | --- | --- | - | Name | Value | - | Name | The Longest Value | - | Name | Value | - | Name | Value | - | Name | Value | - -## Discord Code Blocks - -Our wiki uses custom markdown code blocks to generate Discord message previews. -In order to create them, wiki contributors write `discord` code blocks. - -Currently, only one variant is available, the `discord yaml` code block. -It utilizes the YAML language to write these Discord messages. - -Example: -``` yaml -- user_id: 154148273307910144 - username: MineBartekSA - color: "#E67E22" - content: | - Hi, this is an example of custom code blocks. -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - This is another message -- username: NilPointer Software - avatar: https://avatars.githubusercontent.com/u/63750675 - bot: true - verified: true - content: | - For more information about supported features, please see this GitHub repository -``` - -Like the last message in the example says, please check out the [NilPointer-Software/mdbook-discord-components](https://github.com/NilPointer-Software/mdbook-discord-components/) repository for more info about supported features. - -To test your custom code block, you can use the [official test site](https://nilpointer-software.github.io/mdbook-discord-components/) -> Please note, that the `user_id` field will not work on the test site. This feature is disabled on it. - -### Things To Note - -- In order to format messages or embed content like you can on Discord, you need to use HTML tags instead of markdown. - Please look at the example below on the [test site](https://nilpointer-software.github.io/mdbook-discord-components/) to see how they will actually look. -``` yaml -- user_id: 154148273307910144 - username: MineBartekSA - content: | - For *Italics* use the i HTML tag: Italics - For **Bold** use the b HTML tag: Bold - For ~~Line-Through~~ use the del HTML tag: Line-Through - For `Code Snippet` use the code HTML tag: Code Snippet - For __Underline__ use the u HTML tag: Underline - For > Quote use the discord-quote HTML tag: Quote -- user_id: 154148273307910144 - username: MineBartekSA - content: | - You can make spoilers by using the discord-spoiler HTML tag: Spoiler! -- user_id: 154148273307910144 - username: MineBartekSA - content: | - You can embed links by using the a HTML tag with the href attrubute: Test site -- user_id: 154148273307910144 - username: MineBartekSA - content: " " - embed: - title: Embed Text Formatting - color: "#00FFFF" - description: | - Italics, Bold, Line-Truough, Underline, Links, and Code Snippets use the same HTML tags. - - Embeds can contain multiline code blocks. - Add a multiline class to a code HTML tag: - This is a large code block. - It supports multiple lines. - - Quotes use the blockquote HTML tag:
Quote
- Spoiler use the span HTML tag with the spoiler class: - Spoiler -``` -> Please note, that the empty `content` filed in the message with embed is a bug that will be resolved. - -- On our wiki, messages can use the `user_id` yaml field for automatic and up-to-date avatar and username. - When using `user_id`, the `username` field is no longer required and will overwrite the username fetched from Discord. - The same thing applies to the `avatar` field. - -## Credits - -**Thanks to everyone who has already contributed!** - -[![Contributors](https://contrib.rocks/image?repo=NilPointer-Software/bdfd-wiki)](https://github.com/NilPointer-Software/bdfd-wiki/graphs/contributors) +# Contributing + +Hey! 👋 Thanks for checking out. If you would like to contribute to this repository, do not hesitate! Pull requests are always welcome at any hour. + +> **Note** : Contributions to this repository are generally made by submitting a pull request. +> If you are comparatively new to GitHub or aren't familiar with how to submit a pull request, enlighten yourself a bit by checking [GitHub docs](https://docs.github.com/en/pull-requests) +> or you can also ask anyone from the active [contributors](https://github.com/NilPointer-Software/bdfd-wiki/graphs/contributors) to submit your contributions on your behalf. + +## Guidelines + +General guidelines to keep in mind when contributing : + +- All file names must be in "[lowerCamelCase](https://wiki.c2.com/?LowerCamelCase)" format (i.e `fileName.md`). +- Avoid using spaces or any special characters (e.g `$`) in file names. +- Do not make duplicates or useless pull requests. +- Do not make troll or NSFW pull requests. +- Do not make huge pull requests. Keep them small. +- Fact-check/verify information included in the pull request. +- Make sure to follow [Proper Wiki Structure](#proper-wiki-structure). + +## FAQs + +Some of the frequently asked questions from users - + +1. My pull request has been merged but it isn't showing up on the wiki page. Why? + + Once a pull request is merged successfully, the changes can be seen in [Nightly Wiki](https://nilpointer-software.github.io/bdfd-wiki/nightly) after 2-3 minutes. In the case of [Main Wiki](https://nilpointer-software.github.io/bdfd-wiki), it will take some weeks since the contributed markdown files are deployed by a Developer only. + +2. Do I get any perks for contributing? + + You are credited for your contributions to the wiki here on GitHub, by being shown as a contributor. + However, if applicable the Developers reserve the right to give perks/accreditation to users for contributing. + +3. Any correct steps to submit contributions? + + Follow the steps described below : + + - Fork the repository. + - Create a new branch from `dev` branch. + - Do the required changes in the new branch and then, submit a pull request. + - Once, the pull request has been merged successfully, fetch the upstream in `dev` branch _(Optionally, you can also delete the pull request branch if you want)_. + - That's it...Happy Contributing!! + +## Proper Wiki Structure + +### Grammar + +- Don't use gendered pronouns _(i.e She/Her/Hers or He/Him/His)_, instead use neutral pronouns _(i.e They, Them, Their)_. +- Use _"We"_ instead of _"I"_ when referring to yourself. +- Use _"You/Your"_ instead of _"We/Our"_ when referring to the reader. +- Avoid using offensive phrases or words _(i.e dumb, useless, bad, trash, suck etc)_. + +### Shortening Headers + +Always keep section headers short, consise, and in [Title Case](https://en.m.wikipedia.org/wiki/Title_case) format. For example, + +```diff +- How to create embeds ++ Creating Embeds +``` + +### Markdown + +Markdown allows you to make headings, format text, make lists and tables. + +--- + +#### Text Formatting + +| Name | Sign | +| :--------------: | :------------------------: | +| _Italics_ | \*...\* or \_...\_ | +| **Bold** | \*\*...\*\* or \_\_...\_\_ | +| ~~Line-Through~~ | \~\~...\~\~ | +| `Code Snippet` | \`...\` | + +--- + +#### Lists + +\- Item 1\ +\- Item 2\ +\- Item 3 + +##### Output + +- Item 1 +- Item 2 +- Item 3 + +--- + +#### Large Code Block + +\`\`\`\ +Large Code Block\ +\`\`\` + +##### Output + +``` +Large Code Block +``` + +--- + +#### Quotes + +\> This is a quote. + +##### Output + +> This is a quote. + +--- + +#### Headers + +| Name | Sign | +| :-------------: | :---: | +| Title | # | +| Section | ## | +| Sub-Section | ### | +| Small-Topic | #### | +| Sub-Small-Topic | ##### | + +##### Output + +# Title + +## Section + +### Sub-Section + +#### Small-Topic + +##### Sub-Small-Topic + +--- + +#### Tables + +1. Centered Text + ``` + | Name | Value | + | :---: | :---: | + | Name | Value | + | Name | The Longest Value | + | Name | Value | + | Name | Value | + | Name | Value | + ``` + ##### Output + | Name | Value | + | :--: | :---------------: | + | Name | Value | + | Name | The Longest Value | + | Name | Value | + | Name | Value | + | Name | Value | +2. Uncentered Text + ``` + | Name | Value | + | --- | --- | + | Name | Value | + | Name | The Longest Value | + | Name | Value | + | Name | Value | + | Name | Value | + ``` + ##### Output + | Name | Value | + | ---- | ----------------- | + | Name | Value | + | Name | The Longest Value | + | Name | Value | + | Name | Value | + | Name | Value | + +## Discord Code Blocks + +Our wiki uses custom markdown code blocks to generate Discord message previews. +In order to create them, wiki contributors write `discord` code blocks. + +Currently, only one variant is available, the `discord yaml` code block. +It utilizes the YAML language to write these Discord messages. + +Example: + +```yaml +- user_id: 154148273307910144 + username: MineBartekSA + color: "#E67E22" + content: | + Hi, this is an example of custom code blocks. +- username: BDFD Support + avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 + color: "#378afa" + bot: true + verified: true + content: | + This is another message +- username: NilPointer Software + avatar: https://avatars.githubusercontent.com/u/63750675 + bot: true + verified: true + content: | + For more information about supported features, please see this GitHub repository +``` + +Like the last message in the example says, please check out the [NilPointer-Software/mdbook-discord-components](https://github.com/NilPointer-Software/mdbook-discord-components/) repository for more info about supported features. + +To test your custom code block, you can use the [official test site](https://nilpointer-software.github.io/mdbook-discord-components/) + +> Please note, that the `user_id` field will not work on the test site. This feature is disabled on it. + +### Things To Note + +- In order to format messages or embed content like you can on Discord, you need to use HTML tags instead of markdown. + Please look at the example below on the [test site](https://nilpointer-software.github.io/mdbook-discord-components/) to see how they will actually look. + +```yaml +- user_id: 154148273307910144 + username: MineBartekSA + content: | + For *Italics* use the i HTML tag: Italics + For **Bold** use the b HTML tag: Bold + For ~~Line-Through~~ use the del HTML tag: Line-Through + For `Code Snippet` use the code HTML tag: Code Snippet + For __Underline__ use the u HTML tag: Underline + For > Quote use the discord-quote HTML tag: Quote +- user_id: 154148273307910144 + username: MineBartekSA + content: | + You can make spoilers by using the discord-spoiler HTML tag: Spoiler! +- user_id: 154148273307910144 + username: MineBartekSA + content: | + You can embed links by using the a HTML tag with the href attrubute: Test site +- user_id: 154148273307910144 + username: MineBartekSA + content: " " + embed: + title: Embed Text Formatting + color: "#00FFFF" + description: | + Italics, Bold, Line-Truough, Underline, Links, and Code Snippets use the same HTML tags. + + Embeds can contain multiline code blocks. + Add a multiline class to a code HTML tag: + This is a large code block. + It supports multiple lines. + + Quotes use the blockquote HTML tag:
Quote
+ Spoiler use the span HTML tag with the spoiler class: + Spoiler +``` + +> Please note, that the empty `content` filed in the message with embed is a bug that will be resolved. + +- On our wiki, messages can use the `user_id` yaml field for automatic and up-to-date avatar and username. + When using `user_id`, the `username` field is no longer required and will overwrite the username fetched from Discord. + The same thing applies to the `avatar` field. + +## Credits + +**Thanks to everyone who has already contributed!** + +[![Contributors](https://contrib.rocks/image?repo=NilPointer-Software/bdfd-wiki)](https://github.com/NilPointer-Software/bdfd-wiki/graphs/contributors) diff --git a/Dockerfile b/Dockerfile index a7078879aa1..a439e2d4b07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,31 @@ -# Use an Ubuntu base image -FROM ubuntu - -# Install gh cli -RUN (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ -&& mkdir -p -m 755 /etc/apt/keyrings \ -&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ -&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ -&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ -&& apt update \ -&& apt install gh -y - -# Set config to ssh to bypass auth login -RUN gh config set git_protocol ssh -h github.com - -# Download required packages -RUN gh release download -R rust-lang/mdBook -p mdbook-*-x86_64-unknown-linux-gnu.tar.gz -RUN gh release download -R tommilligan/mdbook-admonish -p mdbook-admonish-*-x86_64-unknown-linux-gnu.tar.gz -RUN gh release download -R NilPointer-Software/mdbook-discord-components -p mdbook-discord-components-*.tar.gz - -# Set the working directory for your mdbook project -WORKDIR /app - -# Expose working port -EXPOSE 3000 - -# Copy dev run script -COPY dev.sh . - -# Run your start script -CMD ["sh", "dev.sh"] +# Use an Ubuntu base image +FROM ubuntu + +# Install gh cli +RUN (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \ +&& mkdir -p -m 755 /etc/apt/keyrings \ +&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ +&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ +&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ +&& apt update \ +&& apt install gh -y + +# Set config to ssh to bypass auth login +RUN gh config set git_protocol ssh -h github.com + +# Download required packages +RUN gh release download -R rust-lang/mdBook -p mdbook-*-x86_64-unknown-linux-gnu.tar.gz +RUN gh release download -R tommilligan/mdbook-admonish -p mdbook-admonish-*-x86_64-unknown-linux-gnu.tar.gz +RUN gh release download -R NilPointer-Software/mdbook-discord-components -p mdbook-discord-components-*.tar.gz + +# Set the working directory for your mdbook project +WORKDIR /app + +# Expose working port +EXPOSE 3000 + +# Copy dev run script +COPY dev.sh . + +# Run your start script +CMD ["sh", "dev.sh"] diff --git a/README.md b/README.md index 8c41769f47a..475be11f3d6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
-[![BDFD Logo](https://cdn.discordapp.com/emojis/983229875831832617.gif)](https://botdesignerdiscord.com) +[![BDFD Logo](https://github.com/user-attachments/assets/789fb2a2-aa5b-4fe3-a521-4c30b8438519)](https://app.botdesignerdiscord.com/) -## Bot Designer For Discord - Wiki +### Bot Designer For Discord - Wiki [![GitHub Forks](https://img.shields.io/github/forks/NilPointer-Software/bdfd-wiki?style=flat&logo=Github&label=Forks)](https://github.com/NilPointer-Software/bdfd-wiki/network/members) [![GitHub Repo Stars](https://img.shields.io/github/stars/NilPointer-Software/bdfd-wiki?style=flat&logo=Github&label=Stars)](https://github.com/NilPointer-Software/bdfd-wiki/stargazers) @@ -18,20 +18,11 @@
--- -## About +### ℹī¸ About **Bot Designer For Discord** is a free-to-use Discord Bot maker available for Android, iOS and Web. It's capable of developing nearly all types of bots from simple "echo" bots to advanced multi-purpose administration ones. This is the official GitHub repository of BDFD Wiki which explains BDFD functions, callbacks, and features. -### Links -- [Website](https://botdesignerdiscord.com) -- [Wiki](https://nilpointer-software.github.io/bdfd-wiki) -- [Wiki (Nightly)](https://nilpointer-software.github.io/bdfd-wiki/nightly) -- [Android App](https://play.google.com/store/apps/details?id=com.jakubtomana.discordbotdesinger) -- [iOS App](https://apps.apple.com/us/app/bot-designer-for-discord/id1495536477) -- [Web App](https://botdesignerdiscord.com/app) -- [Discord Server](https://discord.com/servers/bot-designer-for-discord-official-server-566363823137882154) - -### Contribution +#### 🛠ī¸ Contribution If you would like to contribute in this repository, do checkout [CONTRIBUTING.md](CONTRIBUTING.md) for further information. diff --git a/book.toml b/book.toml index 5801c8fb917..ee4500e0f66 100644 --- a/book.toml +++ b/book.toml @@ -13,6 +13,10 @@ preferred-dark-theme = "bdfd" smart-punctuation = true git-repository-url = "https://github.com/NilPointer-Software/bdfd-wiki" edit-url-template = "https://github.com/NilPointer-Software/bdfd-wiki/edit/dev/{path}" +no-section-label = true +input-404 = "404.md" +site-url = "/" +additional-css = ["./src/theme/mdbook-admonish.css"] [output.html.fold] enable = true @@ -30,19 +34,14 @@ embed-script = false [preprocessor.admonish] on_failure = "bail" +command = "mdbook-admonish" +assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install` # Redirects old wiki URL paths used by the app to new ones. # TODO: Remove URLs when old paths gets updated in the app. [output.html.redirect] "/guides/ifStatements.html" = "./general/ifStatements.html" "/guides/async.html" = "./general/bds2/asyncScopes.html" -"/guides/buttons.html" = "./general/interactions/buttons/aboutButtons.html" -"/selectmenu.html" = "./guides/general/interactions/selectMenus/aboutSelectMenu.html" -"/trycatch.html" = "./guides/general/bds2/errorHandling.html" - -"/bdscript/awaitReactions.html" = "../premium/awaitReactions.html" -"/bdscript/customImage.html" = "../premium/customImage.html" -"/bdscript/ignoreTriggerCase.html" = "../premium/ignoreTriggerCase.html" "/bdscript/httpAddHeader.html" = "../guides/general/httpRequests.html" "/bdscript/httpDelete.html" = "../guides/general/httpRequests.html" @@ -86,3 +85,19 @@ on_failure = "bail" "/bdscript/webhookSend.html" = "../guides/general/webhooks.html" "/bdscript/webhookTitle.html" = "../guides/general/webhooks.html" "/bdscript/webhookUsername.html" = "../guides/general/webhooks.html" + +"/bdscript/appendOptionSuggestion.html" = "../guides/general/interactions/slashCommands/autoComplete.html" +"/bdscript/autoCompleteOptionName.html" = "../guides/general/interactions/slashCommands/autoComplete.html" +"/bdscript/autoCompleteOptionValue.html" = "../guides/general/interactions/slashCommands/autoComplete.html" + +# Premium functions - Don't touch! +"/bdscript/ai.html" = "../premium/ai.html" +"/bdscript/aiQuota.html" = "../premium/aiQuota.html" +"/bdscript/awaitReactions.html" = "../premium/awaitReactions.html" +"/bdscript/customImage.html" = "../premium/customImage.html" +"/bdscript/ignoreTriggerCase.html" = "../premium/ignoreTriggerCase.html" +"/bdscript/log.html" = "../premium/log.html" +"/bdscript/logQuota.html" = "../premium/logQuota.html" +"/bdscript/sendNotification.html" = "../premium/sendNotification.html" +"/bdscript/suppressErrorLogging.html" = "../premium/suppressErrorLogging.html" +"/bdscript/usedEmoji.html" = "../premium/usedEmoji.html" diff --git a/docker-compose.yml b/docker-compose.yml index 15eec9a589f..26228a08c40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ -services: - mdbook-service: - build: . - volumes: - - ./:/app:rw - ports: - - "3000:3000" +services: + mdbook-service: + build: . + volumes: + - ./:/app:rw + ports: + - "3000:3000" diff --git a/external/CHANGELOG.json b/external/CHANGELOG.json index 3bafcc022fa..9739fa882d4 100644 --- a/external/CHANGELOG.json +++ b/external/CHANGELOG.json @@ -1,684 +1,705 @@ -{ - "2024": { - "august": [ - "Added `$log[]`", - "Added `$logQuota`", - "Added `$suppressErrorLogging`", - "Added `$ceil[]`", - "Added `$floor[]`", - "Added `$sqrt[]`", - "Added `$isInteger[]`" - ], - "july": [ - "Added `$isBooster[]`", - "Added `$setUserRoles[]`", - "Added `$getLeaderboardPosition[]`" - ], - "june": [ - "Added `$ai[]`", - "Added `$aiQuota`" - ], - "march": [ - "Fixed the bot sometimes duplicating its answer", - "Fixed `$onlyForIDs[]` not working correctly on big nodes" - ] - }, - "2023": { - "june": [ - "Fixed custom images not always being displayed", - "Allowed for empty string values in `$jsonSetString[]`", - "Added `$jsonArraySort[]`", - "Added `$jsonArrayReverse[]`", - "JSON Array function now can interact with JSON root", - "Emoji argument now allows for emoji aliases", - "Added `$nodeVersion[]`", - "Added `$removeEmoji[]`", - "Added `$addMessageReactions[]`", - "Fixed `$nickname[]` to work with the new Discord username system", - "Added `$displayName[]`", - "Added `$userBadges[]`", - "Added `$userBannerColor[]`" - ], - "may": [ - "Fixed `$min[]` and `$max[]` not working with floats" - ], - "april": [ - "Fixed caching timeout information" - ], - "march": [ - "Fixed callbacks not always getting detected", - "Fixed JSON functions inability to correctly return an object", - "Fixed `$jsonArrayPop[]` and `$jsonArrayShift[]` only working once on an array", - "Fixed a bug where `$jsonArrayPop[]` and `$jsonArrayShift[]` would stop execution when trying to operate on an empty array", - "Fixed `$round[]` adding trailing zeros", - "Added `$removeAllComponents`" - ], - "february": [ - "Fixed caching issues for leaderboards", - "Added `$jsonArrayShift[]`", - "Added `$jsonArrayUnshift[]`", - "Added `$jsonArrayPop[]`", - "Added `$jsonJoinArray[]`" - ], - "january": [ - "Added `$jsonParse[]`", - "Added `$jsonClear`", - "Added `$jsonStringify`", - "Added `$jsonPretty[]`", - "Added `$json[]`", - "Added `$jsonExists[]`", - "Added `$jsonSet[]`", - "Added `$jsonArray[]`", - "Added `$jsonArrayAppend[]`", - "Added `$jsonArrayCount[]`", - "Added `$jsonUnset[]`", - "Added `$disableInnerSpaceRemoval`", - "Fixed big numbers not working in leaderboard functions", - "Added Emoji argument type", - "Added `$isTicket[]`", - "Added `$userBanner[]`", - "Added `$randomGuildID`", - "Added `$randomRoleID[]`", - "Added `$randomCategoryID[]`", - "Added `$channelNames[]`", - "Added `$categoryChannels[]`", - "Fixed `$allowUserMentions[]` not working on slash commands", - "Fixed `$addTextInput[]` not working with empty values", - "Added `$jsonSetString[]`", - "Added `$jsonArrayIndex[]`" - ] - }, - "2022": { - "december": [ - "Added limit on input numbers to 2128 on the basic math functions", - "Fixed BDScript 2 having problems with handling unicode characters", - "Fixed `$stop` causing undefined behaviour", - "Added `$getBanReason[]`", - "Fixed caching issues for the text splitting functions", - "Fixed issues with custom images" - ], - "november": [ - "Deprecated `$userJoinedDiscord[]` in favor of `$creationDate[]`", - "Added `Format` argument to `$creationDate[]`", - "Added `$editSplitText[]`", - "Added `$serverEmojis[]`", - "Added `$setChannelVar[]`", - "Added `$getChannelVar[]`", - "Added `$resetChannelVar[]`", - "Added `channel` option to `$variablesCount[]`", - "Fixed BDScript 2's escaping not working in some cases" - ], - "october": [ - "Added `$publishMessage[]`", - "Made `$useChannel[]` work with message components", - "Added `$channelPosition[]`", - "Added `$categoryID`", - "Added `$varExists[]`", - "Added `$boostCount`", - "Added `$categoryCount`", - "Added `$isTimedOut[]`", - "Added `stage` and `forum` channel types to `$createChannel[]`", - "Added `stage`, `announcement`, and `forum` channel types to `$channelType[]`", - "`$enableDecimals[]` now works with `$calculate[]`", - "Added `$getCustomStatus[]`", - "Added `$httpStatus`", - "Added `$httpGetHeader[]`", - "Added `$botOwnerID`", - "Added `$repliedMessageID`", - "Fixed the guild list fetching issue", - "Added `$parentID`" - ], - "september": [ - "Added `channelID` field to `$awaitFunc[]`", - "Added `$trimContent`", - "Fixed fetching guilds not always working in the app", - "Added `$slashID`", - "Fixed slash command reordering", - "Added intent autodetection ", - "Added `globaluser` option to `$variablesCount[]`", - "Added support for big numbers in the math functions", - "Added new text tutorial", - "Fixed `$checkUserPerms[]` ignoring channel permissions", - "Fixed `$addReactions[]` not working on slash commands", - "Fixed `Ticket number` argument not working in `$newTicket[]`", - "Fixed `$httpAddHeader[]`", - "Fixed some callbacks not being detected as callbacks", - "Fixed attachments not working in slash commands" - ], - "august": [ - "Added `$scriptLanguage`", - "Fixed `$stop` breaking `$if[]`", - "Renamed `$customImage[]` argument to `Custom image tag`", - "Added `$hypesquad[]`", - "Added `$dmChannelID[]`", - "Fixed the app's max choices limit", - "Fixed `$registerGuildCommands[]` removing previously registered commands", - "Fixed `$reply` not working in DMs", - "Made it possible to return milliseconds and nanoseconds in `$getTimestamp[]`", - "Fixed `$addTextInput[]` not verifying max length", - "Fixed `$url[]` returning an error when no input was provided", - "Added `$userServerAvatar[]`", - "Fixed `$cropText[]` not supporting unicode", - "Not putting required slash command options on top no longer breaks the commands" - ], - "july": [ - "Added hex to the color picker", - "Fixed `$executionTime` not working inside embed fields", - "App now sends notification when bot hosting is expired", - "Added `$sendNotification[]` for premium bots", - "Made it possible to use only one option in a select menu", - "Fixed `$editChannelPerms[]`", - "Fixed verification of slash command names", - "Fixed `$sort` not working with `-1` as return amount" - ], - "june": [ - "Fixed `$onlyBotChannelPerms[]`", - "Fixed description verification in `$addSelectMenuOption[]` and `$editSelectMenuOption[]`", - "Updated limits of select menu options", - "Fixed updating components which are refering to `$messageID`" - ], - "may": [ - "Fixed token issues", - "Fixed disappearing slash command options", - "`AllowedMentions` field is now used in `$channelSendMessage[]`, `$sendEmbedMessage[]` and `$sendMessage[]`", - "Fixed black screen after bot creation", - "Fixed in-app tutorial", - "Fixed escaping response in interactions", - "Fixed cooldown error messages", - "Fixed empty values in variables not getting saved", - "Fixed userID being ignored when guildID is passed to `$getUserVar[]`" - ], - "april": [ - "Added `'return ID of the ticket message'` argument to `$newTicket[]`", - "Fixed disappearing slash commands from the app's state" - ], - "march": [ - "Added `$toTitleCase[]`", - "Fixed invite permission calculator", - "Fixed `$suppressErrors[]` and `$embedSuppressErrors[]` getting ignored by components errors", - "Fixed updating some components", - "Added `$registerGuildCommands[]`", - "Added `$unregisterGuildCommands[]`", - "Added `/callback_list`, `/callback_tag_list`, and `/callback/:callback_tag` endpoints to public BDFD API" - ], - "february": [ - "`$httpResult[]` can return JSON now", - "Fixed `$httpResult[]` not working with multiple requests", - "Saving a command in the webapp no longer restarts the bots", - "Optimized slash commands resynchronization", - "Fixed custom images not working after saving a command", - "Made it possible to escape backslash by using `\\`", - "Removed user permission check for `$ban[]`, `$banID[]`, `$unban[]` and `$unbanID[]`", - "Added `$newModal[]`", - "Added `$addTextInput[]`", - "Added `$input[]`", - "Deprecated `$channelIDFromName[]`, use `$channelID[]` instead", - "Added `$onlyForCategories[]`", - "Fixed `$modifyChannelPerms[]` ignoring last permission", - "Added `$onAutoComplete[]` callback", - "Added `$autoCompleteOptionName`", - "Added `$autoCompleteOptionValue`", - "Added `$appendOptionSuggestion[]`" - ], - "january": [ - "Added `$unescape[]`", - "Added a neutral permission (`/`) to `$modifyChannelPerms[]`", - "Added stop bot button in the app", - "Added restart bot button in the app", - "Added `$editChannelPerms[]` (replacement for the deprecated `$modifyChannelPerms[]`)", - "Added `$roleGrant[]` (replacement for the deprecated `$giveRole[]` and `$takeRole[]`)", - "Fixed component functions inside `$async[]` scope", - "Increased the limit of http functions in one command to `5`", - "Fixed `$userPerms[]`", - "Fixed some bugs regarding math commands", - "Added public BDFD API", - "Added `$serverDescription[]`" - ] - }, - "2021": { - "december": [ - "Saving a command no longer causes the bot to restart", - "Fixed `$noMentionMessage[]` in BDScript 2", - "Added `$timeout[]` and `$untimeout[]`", - "`$mute[]` and `$unmute[]` has been marked as deprecated", - "Added `guildID` argument to `$getUserVar[]` and `$setUserVar[]`", - "Fixed the issue with some bots not starting with invalid intents enabled", - "Fixed the role cache", - "Slash command's option description is now required", - "Added `$shardID[]`", - "Added sharding", - "Improved interaction handling", - "Added `$defer`", - "Fixed getting invites", - "Added debug information inside the app for translators", - "Fixed `$serverNames`", - "Added `%` *(modulo)* to `$calculate[]`", - "Fixed removing custom images", - "Added missing permissions", - "Fixed unintentional server restarts", - "The last argument in `$replaceText[]` is now optional" - ], - "november": [ - "Added `$reply[]`", - "Added `$trimSpace[]`", - "Added `$url[]`", - "Upgraded the database", - "Sped up the node starting time", - "Added `$botCommands[]`", - "Added `$unpinMessage[]`", - "Added `$pinMessage[]`", - "Fixed `$isUserDMEnabled[]` not returning false in some cases", - "`$addReactions[]` now works in slash commands", - "`$dm[]` now can dm to more than one mention and can be used multiple times", - "`$dm` now can be used with `$dm[]`", - "`$random[]` now can use decimals", - "Added `$'randomChannelID` (BDScript Unstable only)", - "Fixed `$textSplit[]` removing space" - ], - "october": [ - "Added `$deleteMessage[]`", - "Added `$hostingExpireTime[]`", - "Added timestamp option to `$premiumExpireTime`", - "Fixed `$isUserDMEnabled[]`", - "Fixed `image` parameter in `$sendEmbedMessage[]` and `$webhookSend[]`", - "Fixed caching issue for `$serverIcon`", - "Made it possible to use empty labels in the buttons", - "New UI", - "Added search bar in the variables section", - "Made it possible to use `https://youtu.be/` URL in the streaming statuses", - "Added `$getTextSplitIndex[]`", - "Added `$serverChannelExists[]`", - "Fixed `$changeUsername[]` and `$changeUsernameWithID[]` not working on the current bot", - "Made `$ephemeral` work with the buttons", - "Fixed global variables not getting saved", - "Fixed `$deletecommand` not getting catched by `$try` block", - "Made it possible to open function's wiki article from the functions list" - ], - "september": [ - "Updated ToS", - "Fixed `$executionTime` not working in embeds", - "Added `$botNode`", - "Added `$isBanned[]`", - "Fixed a problem with `$charCount[]` having problems with unicode", - "Added `$channelType[]`", - "Added `$async[]` block function and `$endasync`", - "Added `$await[]`", - "Added `$sort[]`", - "Added `$userPerms[]`", - "Added `$serverNames[]`", - "Improved variables lookup time" - ], - "august": [ - "Added `$webhookTitle[]`", - "Added `$webhookDescription[]`", - "Added `$webhookFooter[]`", - "Added `$webhookContent[]`", - "Added `$webhookUsername[]`", - "Added `$webhookAvatarURL[]`", - "Added `$webhookCreate[]`", - "Removed permission check from `$deleteChannelsByName[]`", - "Removed permission check from `$deleteChannels[]`", - "Removed permission check from `$createChannel[]`", - "Fixed the issue with bots not working in threads", - "Added `$startThread[]`", - "Added `$webhookColor[]`", - "Fixed optional field in `$getServerVar[]`", - "Fixed floating points in `$onlyIf[]` conditions", - "Added `$webhookDelete[]`", - "Added `$webhookSend[]`", - "Removed permission check from `$modifyChannelPerms[]`", - "Made it possible to use multiple `$onInteraction[]`s", - "Added `$onInteraction` callback (without `[]`)", - "Added `$customID`", - "Made it possible to use different scripting languages in callbacks", - "Added `$editThread[]`", - "Added `$threadAddMember[]`", - "Added `$threadRemoveMember[]`", - "Added `$getEmbedData[]`", - "Made it possible to use block functions (`$if[]`, `$try`, etc.) inside function arguments in BDScript 2", - "Fixed preprocessor failures in some corner cases in BDScript 2", - "Fixed a bug with block-functions adding extra new line in BDScript 2", - "Fixed and optimised `$setVar[]`", - "Added `$sendEmbedMessage[]`", - "Fixed condition parsing in `$if[]` for the normal BDScript and BDScript Unstable (BDScript 2 didn't have any issues)", - "Made command saving faster" - ], - "july": [ - "Added `$getTimestamp`", - "Added support for decimals in the math functions", - "Added `$newSelectMenu[]`", - "Added `$addSelectMenuOption[]`", - "Added `$editSelectMenu[]`", - "Added `$editSelectMenuOption[]`", - "Added `$removeComponent[]`", - "Added `$calculate[]`", - "Added `$round[]`", - "Added `$enableDecimals[]`", - "Added `$nickname`", - "Added row and column information in BDScript 2 errors", - "Fixed an issue with BDScript 2 not requiring `]`", - "Adjusted the optimizer in BDScript 2", - "Added `$onlyForRoleIDs[]`", - "Added `$getCooldown[]`", - "Fixed problems with `]` in some functions", - "Fixed component functions inside `$eval[]` function", - "Fixed minor bugs inside BDScript 2 parser", - "Fixed author ID not showing up in `$mentioned[..;yes]`", - "Fixed `$serverNames` which removed two last characters", - "Fixed `$addTimestamp[]` when used for multiple embeds", - "Added limits for the `$round[]` function *(max decimal place)*", - "Added `$and[]`", - "Added `$or[]`", - "Added `$allowRoleMentions[]`", - "Added `$allowUserMentions[]`", - "Added `$guildExists[]`", - "Fixed `$serverVerificationLvl`" - ], - "june": [ - "Fixed `$sendMessage[]` not working in normal BDScript", - "Fixed `$checkUserPerms[]`", - "Added BDScript 2 script language", - "Added to BDScript 2:", - "- `$try`, `$catch` and `$error`", - "- `$eval[]`", - "- `$optOff[]`", - "- `$stop[]`", - "- `$var[]`", - "Added customizable code highlighting", - "Fixed `$lowestRole` and `$highestRole`", - "Added `$isBoolean[]`", - "Made it possible to add 5 buttons per row", - "Added optional field `return type` to `$getLeaderboardValue[]`", - "Added `$deleteRole[]`", - "Added `$ephemeral`", - "Added `$elseif[]` to BDScript 2", - "Fixed URL in buttons", - "Fixed buttons in DMs", - "Fixed problems with custom prefixes", - "Added `$getUserStatus[]`", - "Added `$min[]`", - "Added `$max[]`", - "Fixed `$customEmoji[]`", - "Made it possible to edit embeds in `$editMessage[]`", - "Added support for multiple embeds", - "Added `$httpAddHeader[]`", - "Added `$httpRemoveHeader[]`" - ], - "may": [ - "Fixed a bug which allowed executing certain types of callbacks as normal commands", - "Fixed member caching issue", - "Fixed caching bots", - "Fixed changing tokens in the webapp", - "Fixed `$isUserDMEnabled[]`", - "Added `$addButton[]`", - "Added `$editButton[]`", - "Added `$removeButtons` and `$removeButtons[]`", - "Added `$onInteraction[]` callback", - "Fixed some issues with slash commands", - "Added `$c[]`" - ], - "april": [ - "Added `$httpGet[]`, `$httpPost[]`, `$httpPut[]`, `$httpDelete[]` and `$httpPatch[]`", - "Improved overall caching", - "Added `$httpResult[]`", - "Made command execution faster" - ], - "march": [ - "Added `$cropText[]`", - "Added `userID` field to `$awaitFunc[]`", - "Fixed removing normal commands and slash commands", - "Added `$removeLinks[]`", - "Made returning authorID optional in `$findUser[]`", - "Added `$slowmode[]`", - "Added `$checkUserPerms[]`", - "Added `$isNSFW[]`", - "Fixed setting NSFW in `$modifyChannel[]`", - "Fixed `$userJoined[]` and `$userJoinedDiscord[]`", - "Added `$editMessage[]`", - "Fixed caching for new members.", - "Added `$slashCommandsCount`", - "Added `$botID`", - "Added more permissions:", - "- `AttachFiles`", - "- `TTS`", - "- `ManageWebhooks`", - "- `EmbedLinks`", - "- `ExternalEmojis`", - "Added `$serverCooldown[]`", - "Fixed an issue with not expiring app bans", - "Fixed some issues with `[` and `]`", - "Fixed problems with slash commands and cooldowns" - ], - "february": [ - "Added `$sendMessage[]`", - "Added `$reply`", - "Added slash commands", - "Fixed mentions in `$findChannel[]`", - "Improved performance in the command interpreter", - "Optimized reaction handlers", - "Added `$isSlash`", - "Added new optional field to `$message[]`", - "Fixed semicolons in `$channelSendMessage[]`" - ], - "january": [ - "Fixed a problem with statuses not showing up", - "Fixed an issue with mentions not working", - "Fixed loading bots from database", - "Increased duration to 40 minutes for `$deleteIn[]`, `$editIn[]`, `$editEmbedIn[]`, `$replyIn[]`", - "Added if statements (`$if[]`, `$else`, `$endif`)", - "GuildID is now returned instead of `everyone` in `$lowestRole[]` and `$highestRole[]`", - "Space commands have been removed (you can still use `$alwaysReply`)", - "Added `$channelTopic[]`", - "Fixed issues with streaming status", - "Fixed the issue with tags/discriminators not working for `$userID[]` and `$findUser[]` ", - "Added `$findChannel[]` and `$channelExists[]`", - "Added `$userJoined[]` and `$userJoinedDiscord[]`" - ] - }, - "2020": { - "december": [ - "Timezones in `$time[]` has been fixed", - "Updated Discord API version", - "Added Competing presence", - "Added `$botLeave[]`", - "Fix for `$getLeaderboardValue[]`", - "Added `userID` option to `$resetUserVar`", - "Added `serverID` option to `$serverOwner`", - "Added `$premiumExpireTime`" - ], - "november": [ - "Fixed disappearing bot status", - "Fixed `$serverCount` in bot status", - "Improved caching", - "Functions that require privileged intents are now marked accordingly", - "Added `$getLeaderboardValue[]`", - "Added `$awaitReactions[]`", - "Awaited commands are now available for everyone", - "Added awaited reactions", - "Fixed problems with DMs" - ], - "october": [ - "Optimized memory usage", - "Added member and presence intents", - "Added `$editEmbedIn[]`", - "Added `serverID` field to server variables", - "Allowed using awaited functions in awaited commands", - "Fixed leaderboards", - "Fixed `$randomMention`, `$randomUser` and `$randomUserID`", - "Added `$awaitReactions[]` for premium bots", - "Added `$usedEmoji`", - "`$deletecommand` sends an error now", - "Fixed `$serverVerificationLvl` not working on very high verification servers", - "Fixed reconnecting bots to gateway" - ], - "september": [ - "Added `$ignoreTriggerCase` for premium bots", - "Fixed caching guilds", - "`$findUser[]` & `$findRole[]` are no longer case sensitive", - "`$findUser[]` returns authorID if no user found", - "Added awaited commands for premium bots", - "Fixed weird brackets in embeds", - "Added trigger list in the app" - ], - "august": [ - "Migrated to the new infrastructure (new database and API)", - "Premium released", - "Fixed `$isMentionable[]`", - "Fixed `$isHoisted[]`", - "Added `$removeSplitTextElement[]`", - "`$userAvatar[]` no longer stops code execution", - "Fixed `$argCount[]`", - "Added `$findUser[]`", - "Added `$findRole[]`", - "Added `$disableSpecialEscaping`" - ], - "july": [ - "Renamed `$splitText[]` to `$getSplitText[]` to avoid confusion _(`$splitText[]` still works)_", - "Added `$joinSplitText[]`", - "Added `$getInviteInfo[]`", - "Added `$guildID[]`", - "Fixed `$numberSeparator[]` in the bot's status", - "`$roleID[]` and `$channelID[]` no longer stop code execution", - "Enabled BDScript Unstable for callbacks", - "Added `$getTextSplitLength`" - ], - "june": [ - "Fixed `$getReactions[]` in BDScript Unstable", - "Fixed bracket escaping for some commands in BDScript Unstable", - "Fixed `$modifyChannel[]` (random slowmodes added on channels)" - ], - "may": [ - "Fixed `$onlyBotPerms[]`", - "Bot Designer List Open Beta", - "Added `$botListDescription[]` and `$botListHide`", - "Fixed brackets issue in `$serverNames`", - "Other bug fixing for Bot Designer and Bot Designer List" - ], - "april": [ - "Fixed `$serverIcon`", - "Added `$changeCooldownTime[]`", - "Disabled `$randomUserID`, `$'randomUserID`, `$deleteIn` and `$dm` in `$onMessageDelete`", - "Fixed `$addField[]`", - "Added error message in `$getServerVar[]` when provided variable does not exist", - "Fixed `$userID[]` to not stop code execution, if user is not found", - "Added `$botLeave`", - "Removed permission check from `$clear` command.", - "Fixed `$isAdmin[]`" - ], - "march": [ - "Added `$getReactions[]` and `$userReacted[]`", - "New command interpreter", - "Added to new parser:", - "- `$'random[]` and `$'random`", - "- `$'randomText[]`", - "- `$'randomUser`", - "- `$'randomMention`", - "- `$'randomUserID`", - "- `$'randomString[]`", - "Fixed brackets in `$getMessage[]`", - "Changed behaviour of `$onlyPerms[]` command", - "Added `$charCount[]`", - "Added `$clearReactions[]`", - "Added new options to `$getMessage[]`", - "Fixed adding slowmode when using `$modifyChannel[]`", - "Added `$checkContains[]`", - "Added `$addEmoji[]`", - "Fixed the bug with `$` command prefix and `$noMentionMessage`", - "Added `$unbanID[]`", - "Added `$hasRole[]`", - "Optimized the leaderboard commands", - "Fixed permissions in some commands", - "Fixed `$onlyPerms[]`", - "Fixed the bug with `$` command prefix and `$message`" - ], - "february": [ - "Fixed errors in `$addField`", - "Added `$serverRegion`", - "Added `$serverOwner`", - "Added `$emoteCount`", - "Added `$isMentionable[]`", - "Added `$isHoisted[]`", - "Added `$serverIcon[]`", - "Fixed suppressing errors in some variable commands", - "Fixed bug with `$replaceText[]` inside `$description`", - "Added `$isValidHex[]`", - "Added `$isAdmin[]`", - "`$userID[]` does not require discriminator now", - "Added `$serverVerificationLvl`", - "Fixed stopping command when `$changeUsernameWithID[]` or `$changeUsername[]` throws an exception", - "Added `$modifyRolePerms[]`", - "Added `$isUserDMEnabled[]`", - "Added new option to `$mentioned[]`", - "When `userID` is not provided in `$discriminator[]`, the author's ID will be used", - "Added `$argCount[]`", - "Added `$roleExists[]` and `$roleExists[]` ", - "Added `$varExistError[]`", - "Removed permissions check for `$kick[]` function", - "Fixed brackets issue in `$message` and `$noMentionMessage`", - "Fixed `$globalUserLeaderboard[]`", - "`$repeatMessage[]` won't send an error when there is `0` provided" - ], - "january": [ - "Final premium preparations", - "Space commands for premium bots", - "Added `sendChannelMessage()` to JS", - "Added `$isNumber[]`", - "Better description for` $replaceText[]`", - "Removed `#` from `$getRoleColor[]`", - "Added possibility of adding custom error message to `$suppressErrors[]`", - "Added `$embedSuppressErrors[]`", - "Added `$getServerVar[]` in command's name for premium bots", - "Added custom separators to `$numberSeparator[]`", - "Fixed issue with `+` and `-` in `$numberSeparator[]`", - "iOS release", - "Added `$isBot[]`", - "Added `userID` option to `$takeRole[]`", - "Fixed problems with timezones", - "`@everyone` role shows up now when it's a highest/lowest role in `$highestRole/$lowestRole`", - "`@everyone` role now works in `$rolePosition[]`", - "Added multi-line support for `$replaceText[]`", - "Fixed no errors in `$roleID[]`", - "Added `$toUppercase[]` and `$toLowercase[]`", - "Added `roleID` and `userID` to `$modifyChannelPerms[]`", - "Added `$authorOfMessage[]`", - "Added `$userID[]`", - "Improved servers response time by over 10x", - "Fixed issues with `$setServerVar[]` and `$setUserVar[]`", - "Added multi-line support for `$textSplit[]`", - "Fixed brackets in `$username`" - ] - }, - "2019": { - "december": [ - "Fixed high ping issues", - "Fixed whole bunch of other issues", - "Added to JS:", - "- authorId", - "- channelId", - "- userMentions", - "- roleMentions", - "- unban()", - "- takeRole()", - "- giveRole()", - "- channelTyping()", - "- createChannel()", - "- removeChannel()", - "- unpinMessage()", - "- banWithReason()", - "- kickWithReason()", - "- removeRole()", - "- createRole()", - "Created status website ", - "Web version of *Bot Designer for Discord* has been moved to new address ", - "Fixed some issues in web version", - "Fixed `$banID[]`", - "Preparations for premium points" - ], - "november": [ - "Added `$rolePosition[]`", - "Released translation strings to volunteers", - "Added `kick()` and `ban()` to JS", - "Released new stable version" - ] - } -} +{ + "2025": { + "january": [ + "Added `$afkChannelID`", + "Added `$afkTimeout[]`", + "Added `$boostLevel`", + "Added `$byteCount[]`", + "Added `$commandFolder`", + "Added `$commandName`", + "Added `$commandTrigger`", + "Added `$emojiExists[]`", + "Added `$emojiName[]`", + "Added `$getAttachments[]`", + "Added `$getSlowmode[]`", + "Added `$guildBanner[]`", + "Added `$isEmojiAnimated[]`", + "Added `$isMessageEdited[]`", + "Added `$lastMessageID`", + "Added `$lastPinTimestamp`", + "Added `$linesCount[]`", + "Added `$messageEditedTimestamp[]`", + "Added `$rolePerms[]`", + "Added `$rulesChannelID[]`", + "Added `$systemChannelID`", + "Added `$threadMessageCount`", + "Added `$threadUserCount`", + "Added `$voiceUserLimit[]`" + ] + }, + "2024": { + "august": [ + "Added `$log[]`", + "Added `$logQuota`", + "Added `$suppressErrorLogging`", + "Added `$ceil[]`", + "Added `$floor[]`", + "Added `$sqrt[]`", + "Added `$isInteger[]`" + ], + "july": [ + "Added `$isBooster[]`", + "Added `$setUserRoles[]`", + "Added `$getLeaderboardPosition[]`" + ], + "june": ["Added `$ai[]`", "Added `$aiQuota`"], + "march": [ + "Fixed the bot sometimes duplicating its answer", + "Fixed `$onlyForIDs[]` not working correctly on big nodes" + ] + }, + "2023": { + "june": [ + "Fixed custom images not always being displayed", + "Allowed for empty string values in `$jsonSetString[]`", + "Added `$jsonArraySort[]`", + "Added `$jsonArrayReverse[]`", + "JSON Array function now can interact with JSON root", + "Emoji argument now allows for emoji aliases", + "Added `$nodeVersion[]`", + "Added `$removeEmoji[]`", + "Added `$addMessageReactions[]`", + "Fixed `$nickname[]` to work with the new Discord username system", + "Added `$displayName[]`", + "Added `$userBadges[]`", + "Added `$userBannerColor[]`" + ], + "may": ["Fixed `$min[]` and `$max[]` not working with floats"], + "april": ["Fixed caching timeout information"], + "march": [ + "Fixed callbacks not always getting detected", + "Fixed JSON functions inability to correctly return an object", + "Fixed `$jsonArrayPop[]` and `$jsonArrayShift[]` only working once on an array", + "Fixed a bug where `$jsonArrayPop[]` and `$jsonArrayShift[]` would stop execution when trying to operate on an empty array", + "Fixed `$round[]` adding trailing zeros", + "Added `$removeAllComponents`" + ], + "february": [ + "Fixed caching issues for leaderboards", + "Added `$jsonArrayShift[]`", + "Added `$jsonArrayUnshift[]`", + "Added `$jsonArrayPop[]`", + "Added `$jsonJoinArray[]`" + ], + "january": [ + "Added `$jsonParse[]`", + "Added `$jsonClear`", + "Added `$jsonStringify`", + "Added `$jsonPretty[]`", + "Added `$json[]`", + "Added `$jsonExists[]`", + "Added `$jsonSet[]`", + "Added `$jsonArray[]`", + "Added `$jsonArrayAppend[]`", + "Added `$jsonArrayCount[]`", + "Added `$jsonUnset[]`", + "Added `$disableInnerSpaceRemoval`", + "Fixed big numbers not working in leaderboard functions", + "Added Emoji argument type", + "Added `$isTicket[]`", + "Added `$userBanner[]`", + "Added `$randomGuildID`", + "Added `$randomRoleID[]`", + "Added `$randomCategoryID[]`", + "Added `$channelNames[]`", + "Added `$categoryChannels[]`", + "Fixed `$allowUserMentions[]` not working on slash commands", + "Fixed `$addTextInput[]` not working with empty values", + "Added `$jsonSetString[]`", + "Added `$jsonArrayIndex[]`" + ] + }, + "2022": { + "december": [ + "Added limit on input numbers to 2128 on the basic math functions", + "Fixed BDScript 2 having problems with handling unicode characters", + "Fixed `$stop` causing undefined behaviour", + "Added `$getBanReason[]`", + "Fixed caching issues for the text splitting functions", + "Fixed issues with custom images" + ], + "november": [ + "Deprecated `$userJoinedDiscord[]` in favor of `$creationDate[]`", + "Added `Format` argument to `$creationDate[]`", + "Added `$editSplitText[]`", + "Added `$serverEmojis[]`", + "Added `$setChannelVar[]`", + "Added `$getChannelVar[]`", + "Added `$resetChannelVar[]`", + "Added `channel` option to `$variablesCount[]`", + "Fixed BDScript 2's escaping not working in some cases" + ], + "october": [ + "Added `$publishMessage[]`", + "Made `$useChannel[]` work with message components", + "Added `$channelPosition[]`", + "Added `$categoryID`", + "Added `$varExists[]`", + "Added `$boostCount`", + "Added `$categoryCount`", + "Added `$isTimedOut[]`", + "Added `stage` and `forum` channel types to `$createChannel[]`", + "Added `stage`, `announcement`, and `forum` channel types to `$channelType[]`", + "`$enableDecimals[]` now works with `$calculate[]`", + "Added `$getCustomStatus[]`", + "Added `$httpStatus`", + "Added `$httpGetHeader[]`", + "Added `$botOwnerID`", + "Added `$repliedMessageID`", + "Fixed the guild list fetching issue", + "Added `$parentID`" + ], + "september": [ + "Added `channelID` field to `$awaitFunc[]`", + "Added `$trimContent`", + "Fixed fetching guilds not always working in the app", + "Added `$slashID`", + "Fixed slash command reordering", + "Added intent autodetection ", + "Added `globaluser` option to `$variablesCount[]`", + "Added support for big numbers in the math functions", + "Added new text tutorial", + "Fixed `$checkUserPerms[]` ignoring channel permissions", + "Fixed `$addReactions[]` not working on slash commands", + "Fixed `Ticket number` argument not working in `$newTicket[]`", + "Fixed `$httpAddHeader[]`", + "Fixed some callbacks not being detected as callbacks", + "Fixed attachments not working in slash commands" + ], + "august": [ + "Added `$scriptLanguage`", + "Fixed `$stop` breaking `$if[]`", + "Renamed `$customImage[]` argument to `Custom image tag`", + "Added `$hypesquad[]`", + "Added `$dmChannelID[]`", + "Fixed the app's max choices limit", + "Fixed `$registerGuildCommands[]` removing previously registered commands", + "Fixed `$reply` not working in DMs", + "Made it possible to return milliseconds and nanoseconds in `$getTimestamp[]`", + "Fixed `$addTextInput[]` not verifying max length", + "Fixed `$url[]` returning an error when no input was provided", + "Added `$userServerAvatar[]`", + "Fixed `$cropText[]` not supporting unicode", + "Not putting required slash command options on top no longer breaks the commands" + ], + "july": [ + "Added hex to the color picker", + "Fixed `$executionTime` not working inside embed fields", + "App now sends notification when bot hosting is expired", + "Added `$sendNotification[]` for premium bots", + "Made it possible to use only one option in a select menu", + "Fixed `$editChannelPerms[]`", + "Fixed verification of slash command names", + "Fixed `$sort` not working with `-1` as return amount" + ], + "june": [ + "Fixed `$onlyBotChannelPerms[]`", + "Fixed description verification in `$addSelectMenuOption[]` and `$editSelectMenuOption[]`", + "Updated limits of select menu options", + "Fixed updating components which are refering to `$messageID`" + ], + "may": [ + "Fixed token issues", + "Fixed disappearing slash command options", + "`AllowedMentions` field is now used in `$channelSendMessage[]`, `$sendEmbedMessage[]` and `$sendMessage[]`", + "Fixed black screen after bot creation", + "Fixed in-app tutorial", + "Fixed escaping response in interactions", + "Fixed cooldown error messages", + "Fixed empty values in variables not getting saved", + "Fixed userID being ignored when guildID is passed to `$getUserVar[]`" + ], + "april": [ + "Added `'return ID of the ticket message'` argument to `$newTicket[]`", + "Fixed disappearing slash commands from the app's state" + ], + "march": [ + "Added `$toTitleCase[]`", + "Fixed invite permission calculator", + "Fixed `$suppressErrors[]` and `$embedSuppressErrors[]` getting ignored by components errors", + "Fixed updating some components", + "Added `$registerGuildCommands[]`", + "Added `$unregisterGuildCommands[]`", + "Added `/callback_list`, `/callback_tag_list`, and `/callback/:callback_tag` endpoints to public BDFD API" + ], + "february": [ + "`$httpResult[]` can return JSON now", + "Fixed `$httpResult[]` not working with multiple requests", + "Saving a command in the webapp no longer restarts the bots", + "Optimized slash commands resynchronization", + "Fixed custom images not working after saving a command", + "Made it possible to escape backslash by using `\\`", + "Removed user permission check for `$ban[]`, `$banID[]`, `$unban[]` and `$unbanID[]`", + "Added `$newModal[]`", + "Added `$addTextInput[]`", + "Added `$input[]`", + "Deprecated `$channelIDFromName[]`, use `$channelID[]` instead", + "Added `$onlyForCategories[]`", + "Fixed `$modifyChannelPerms[]` ignoring last permission", + "Added `$onAutoComplete[]` callback", + "Added `$autoCompleteOptionName`", + "Added `$autoCompleteOptionValue`", + "Added `$appendOptionSuggestion[]`" + ], + "january": [ + "Added `$unescape[]`", + "Added a neutral permission (`/`) to `$modifyChannelPerms[]`", + "Added stop bot button in the app", + "Added restart bot button in the app", + "Added `$editChannelPerms[]` (replacement for the deprecated `$modifyChannelPerms[]`)", + "Added `$roleGrant[]` (replacement for the deprecated `$giveRole[]` and `$takeRole[]`)", + "Fixed component functions inside `$async[]` scope", + "Increased the limit of http functions in one command to `5`", + "Fixed `$userPerms[]`", + "Fixed some bugs regarding math commands", + "Added public BDFD API", + "Added `$serverDescription[]`" + ] + }, + "2021": { + "december": [ + "Saving a command no longer causes the bot to restart", + "Fixed `$noMentionMessage[]` in BDScript 2", + "Added `$timeout[]` and `$untimeout[]`", + "`$mute[]` and `$unmute[]` has been marked as deprecated", + "Added `guildID` argument to `$getUserVar[]` and `$setUserVar[]`", + "Fixed the issue with some bots not starting with invalid intents enabled", + "Fixed the role cache", + "Slash command's option description is now required", + "Added `$shardID[]`", + "Added sharding", + "Improved interaction handling", + "Added `$defer`", + "Fixed getting invites", + "Added debug information inside the app for translators", + "Fixed `$serverNames`", + "Added `%` *(modulo)* to `$calculate[]`", + "Fixed removing custom images", + "Added missing permissions", + "Fixed unintentional server restarts", + "The last argument in `$replaceText[]` is now optional" + ], + "november": [ + "Added `$reply[]`", + "Added `$trimSpace[]`", + "Added `$url[]`", + "Upgraded the database", + "Sped up the node starting time", + "Added `$botCommands[]`", + "Added `$unpinMessage[]`", + "Added `$pinMessage[]`", + "Fixed `$isUserDMEnabled[]` not returning false in some cases", + "`$addReactions[]` now works in slash commands", + "`$dm[]` now can dm to more than one mention and can be used multiple times", + "`$dm` now can be used with `$dm[]`", + "`$random[]` now can use decimals", + "Added `$'randomChannelID` (BDScript Unstable only)", + "Fixed `$textSplit[]` removing space" + ], + "october": [ + "Added `$deleteMessage[]`", + "Added `$hostingExpireTime[]`", + "Added timestamp option to `$premiumExpireTime`", + "Fixed `$isUserDMEnabled[]`", + "Fixed `image` parameter in `$sendEmbedMessage[]` and `$webhookSend[]`", + "Fixed caching issue for `$serverIcon`", + "Made it possible to use empty labels in the buttons", + "New UI", + "Added search bar in the variables section", + "Made it possible to use `https://youtu.be/` URL in the streaming statuses", + "Added `$getTextSplitIndex[]`", + "Added `$serverChannelExists[]`", + "Fixed `$changeUsername[]` and `$changeUsernameWithID[]` not working on the current bot", + "Made `$ephemeral` work with the buttons", + "Fixed global variables not getting saved", + "Fixed `$deletecommand` not getting catched by `$try` block", + "Made it possible to open function's wiki article from the functions list" + ], + "september": [ + "Updated ToS", + "Fixed `$executionTime` not working in embeds", + "Added `$botNode`", + "Added `$isBanned[]`", + "Fixed a problem with `$charCount[]` having problems with unicode", + "Added `$channelType[]`", + "Added `$async[]` block function and `$endasync`", + "Added `$await[]`", + "Added `$sort[]`", + "Added `$userPerms[]`", + "Added `$serverNames[]`", + "Improved variables lookup time" + ], + "august": [ + "Added `$webhookTitle[]`", + "Added `$webhookDescription[]`", + "Added `$webhookFooter[]`", + "Added `$webhookContent[]`", + "Added `$webhookUsername[]`", + "Added `$webhookAvatarURL[]`", + "Added `$webhookCreate[]`", + "Removed permission check from `$deleteChannelsByName[]`", + "Removed permission check from `$deleteChannels[]`", + "Removed permission check from `$createChannel[]`", + "Fixed the issue with bots not working in threads", + "Added `$startThread[]`", + "Added `$webhookColor[]`", + "Fixed optional field in `$getServerVar[]`", + "Fixed floating points in `$onlyIf[]` conditions", + "Added `$webhookDelete[]`", + "Added `$webhookSend[]`", + "Removed permission check from `$modifyChannelPerms[]`", + "Made it possible to use multiple `$onInteraction[]`s", + "Added `$onInteraction` callback (without `[]`)", + "Added `$customID`", + "Made it possible to use different scripting languages in callbacks", + "Added `$editThread[]`", + "Added `$threadAddMember[]`", + "Added `$threadRemoveMember[]`", + "Added `$getEmbedData[]`", + "Made it possible to use block functions (`$if[]`, `$try`, etc.) inside function arguments in BDScript 2", + "Fixed preprocessor failures in some corner cases in BDScript 2", + "Fixed a bug with block-functions adding extra new line in BDScript 2", + "Fixed and optimised `$setVar[]`", + "Added `$sendEmbedMessage[]`", + "Fixed condition parsing in `$if[]` for the normal BDScript and BDScript Unstable (BDScript 2 didn't have any issues)", + "Made command saving faster" + ], + "july": [ + "Added `$getTimestamp`", + "Added support for decimals in the math functions", + "Added `$newSelectMenu[]`", + "Added `$addSelectMenuOption[]`", + "Added `$editSelectMenu[]`", + "Added `$editSelectMenuOption[]`", + "Added `$removeComponent[]`", + "Added `$calculate[]`", + "Added `$round[]`", + "Added `$enableDecimals[]`", + "Added `$nickname`", + "Added row and column information in BDScript 2 errors", + "Fixed an issue with BDScript 2 not requiring `]`", + "Adjusted the optimizer in BDScript 2", + "Added `$onlyForRoleIDs[]`", + "Added `$getCooldown[]`", + "Fixed problems with `]` in some functions", + "Fixed component functions inside `$eval[]` function", + "Fixed minor bugs inside BDScript 2 parser", + "Fixed author ID not showing up in `$mentioned[..;yes]`", + "Fixed `$serverNames` which removed two last characters", + "Fixed `$addTimestamp[]` when used for multiple embeds", + "Added limits for the `$round[]` function *(max decimal place)*", + "Added `$and[]`", + "Added `$or[]`", + "Added `$allowRoleMentions[]`", + "Added `$allowUserMentions[]`", + "Added `$guildExists[]`", + "Fixed `$serverVerificationLvl`" + ], + "june": [ + "Fixed `$sendMessage[]` not working in normal BDScript", + "Fixed `$checkUserPerms[]`", + "Added BDScript 2 script language", + "Added to BDScript 2:", + "- `$try`, `$catch` and `$error`", + "- `$eval[]`", + "- `$optOff[]`", + "- `$stop[]`", + "- `$var[]`", + "Added customizable code highlighting", + "Fixed `$lowestRole` and `$highestRole`", + "Added `$isBoolean[]`", + "Made it possible to add 5 buttons per row", + "Added optional field `return type` to `$getLeaderboardValue[]`", + "Added `$deleteRole[]`", + "Added `$ephemeral`", + "Added `$elseif[]` to BDScript 2", + "Fixed URL in buttons", + "Fixed buttons in DMs", + "Fixed problems with custom prefixes", + "Added `$getUserStatus[]`", + "Added `$min[]`", + "Added `$max[]`", + "Fixed `$customEmoji[]`", + "Made it possible to edit embeds in `$editMessage[]`", + "Added support for multiple embeds", + "Added `$httpAddHeader[]`", + "Added `$httpRemoveHeader[]`" + ], + "may": [ + "Fixed a bug which allowed executing certain types of callbacks as normal commands", + "Fixed member caching issue", + "Fixed caching bots", + "Fixed changing tokens in the webapp", + "Fixed `$isUserDMEnabled[]`", + "Added `$addButton[]`", + "Added `$editButton[]`", + "Added `$removeButtons` and `$removeButtons[]`", + "Added `$onInteraction[]` callback", + "Fixed some issues with slash commands", + "Added `$c[]`" + ], + "april": [ + "Added `$httpGet[]`, `$httpPost[]`, `$httpPut[]`, `$httpDelete[]` and `$httpPatch[]`", + "Improved overall caching", + "Added `$httpResult[]`", + "Made command execution faster" + ], + "march": [ + "Added `$cropText[]`", + "Added `userID` field to `$awaitFunc[]`", + "Fixed removing normal commands and slash commands", + "Added `$removeLinks[]`", + "Made returning authorID optional in `$findUser[]`", + "Added `$slowmode[]`", + "Added `$checkUserPerms[]`", + "Added `$isNSFW[]`", + "Fixed setting NSFW in `$modifyChannel[]`", + "Fixed `$userJoined[]` and `$userJoinedDiscord[]`", + "Added `$editMessage[]`", + "Fixed caching for new members.", + "Added `$slashCommandsCount`", + "Added `$botID`", + "Added more permissions:", + "- `AttachFiles`", + "- `TTS`", + "- `ManageWebhooks`", + "- `EmbedLinks`", + "- `ExternalEmojis`", + "Added `$serverCooldown[]`", + "Fixed an issue with not expiring app bans", + "Fixed some issues with `[` and `]`", + "Fixed problems with slash commands and cooldowns" + ], + "february": [ + "Added `$sendMessage[]`", + "Added `$reply`", + "Added slash commands", + "Fixed mentions in `$findChannel[]`", + "Improved performance in the command interpreter", + "Optimized reaction handlers", + "Added `$isSlash`", + "Added new optional field to `$message[]`", + "Fixed semicolons in `$channelSendMessage[]`" + ], + "january": [ + "Fixed a problem with statuses not showing up", + "Fixed an issue with mentions not working", + "Fixed loading bots from database", + "Increased duration to 40 minutes for `$deleteIn[]`, `$editIn[]`, `$editEmbedIn[]`, `$replyIn[]`", + "Added if statements (`$if[]`, `$else`, `$endif`)", + "GuildID is now returned instead of `everyone` in `$lowestRole[]` and `$highestRole[]`", + "Space commands have been removed (you can still use `$alwaysReply`)", + "Added `$channelTopic[]`", + "Fixed issues with streaming status", + "Fixed the issue with tags/discriminators not working for `$userID[]` and `$findUser[]` ", + "Added `$findChannel[]` and `$channelExists[]`", + "Added `$userJoined[]` and `$userJoinedDiscord[]`" + ] + }, + "2020": { + "december": [ + "Timezones in `$time[]` has been fixed", + "Updated Discord API version", + "Added Competing presence", + "Added `$botLeave[]`", + "Fix for `$getLeaderboardValue[]`", + "Added `userID` option to `$resetUserVar`", + "Added `serverID` option to `$serverOwner`", + "Added `$premiumExpireTime`" + ], + "november": [ + "Fixed disappearing bot status", + "Fixed `$serverCount` in bot status", + "Improved caching", + "Functions that require privileged intents are now marked accordingly", + "Added `$getLeaderboardValue[]`", + "Added `$awaitReactions[]`", + "Awaited commands are now available for everyone", + "Added awaited reactions", + "Fixed problems with DMs" + ], + "october": [ + "Optimized memory usage", + "Added member and presence intents", + "Added `$editEmbedIn[]`", + "Added `serverID` field to server variables", + "Allowed using awaited functions in awaited commands", + "Fixed leaderboards", + "Fixed `$randomMention`, `$randomUser` and `$randomUserID`", + "Added `$awaitReactions[]` for premium bots", + "Added `$usedEmoji`", + "`$deletecommand` sends an error now", + "Fixed `$serverVerificationLvl` not working on very high verification servers", + "Fixed reconnecting bots to gateway" + ], + "september": [ + "Added `$ignoreTriggerCase` for premium bots", + "Fixed caching guilds", + "`$findUser[]` & `$findRole[]` are no longer case sensitive", + "`$findUser[]` returns authorID if no user found", + "Added awaited commands for premium bots", + "Fixed weird brackets in embeds", + "Added trigger list in the app" + ], + "august": [ + "Migrated to the new infrastructure (new database and API)", + "Premium released", + "Fixed `$isMentionable[]`", + "Fixed `$isHoisted[]`", + "Added `$removeSplitTextElement[]`", + "`$userAvatar[]` no longer stops code execution", + "Fixed `$argCount[]`", + "Added `$findUser[]`", + "Added `$findRole[]`", + "Added `$disableSpecialEscaping`" + ], + "july": [ + "Renamed `$splitText[]` to `$getSplitText[]` to avoid confusion _(`$splitText[]` still works)_", + "Added `$joinSplitText[]`", + "Added `$getInviteInfo[]`", + "Added `$guildID[]`", + "Fixed `$numberSeparator[]` in the bot's status", + "`$roleID[]` and `$channelID[]` no longer stop code execution", + "Enabled BDScript Unstable for callbacks", + "Added `$getTextSplitLength`" + ], + "june": [ + "Fixed `$getReactions[]` in BDScript Unstable", + "Fixed bracket escaping for some commands in BDScript Unstable", + "Fixed `$modifyChannel[]` (random slowmodes added on channels)" + ], + "may": [ + "Fixed `$onlyBotPerms[]`", + "Bot Designer List Open Beta", + "Added `$botListDescription[]` and `$botListHide`", + "Fixed brackets issue in `$serverNames`", + "Other bug fixing for Bot Designer and Bot Designer List" + ], + "april": [ + "Fixed `$serverIcon`", + "Added `$changeCooldownTime[]`", + "Disabled `$randomUserID`, `$'randomUserID`, `$deleteIn` and `$dm` in `$onMessageDelete`", + "Fixed `$addField[]`", + "Added error message in `$getServerVar[]` when provided variable does not exist", + "Fixed `$userID[]` to not stop code execution, if user is not found", + "Added `$botLeave`", + "Removed permission check from `$clear` command.", + "Fixed `$isAdmin[]`" + ], + "march": [ + "Added `$getReactions[]` and `$userReacted[]`", + "New command interpreter", + "Added to new parser:", + "- `$'random[]` and `$'random`", + "- `$'randomText[]`", + "- `$'randomUser`", + "- `$'randomMention`", + "- `$'randomUserID`", + "- `$'randomString[]`", + "Fixed brackets in `$getMessage[]`", + "Changed behaviour of `$onlyPerms[]` command", + "Added `$charCount[]`", + "Added `$clearReactions[]`", + "Added new options to `$getMessage[]`", + "Fixed adding slowmode when using `$modifyChannel[]`", + "Added `$checkContains[]`", + "Added `$addEmoji[]`", + "Fixed the bug with `$` command prefix and `$noMentionMessage`", + "Added `$unbanID[]`", + "Added `$hasRole[]`", + "Optimized the leaderboard commands", + "Fixed permissions in some commands", + "Fixed `$onlyPerms[]`", + "Fixed the bug with `$` command prefix and `$message`" + ], + "february": [ + "Fixed errors in `$addField`", + "Added `$serverRegion`", + "Added `$serverOwner`", + "Added `$emoteCount`", + "Added `$isMentionable[]`", + "Added `$isHoisted[]`", + "Added `$serverIcon[]`", + "Fixed suppressing errors in some variable commands", + "Fixed bug with `$replaceText[]` inside `$description`", + "Added `$isValidHex[]`", + "Added `$isAdmin[]`", + "`$userID[]` does not require discriminator now", + "Added `$serverVerificationLvl`", + "Fixed stopping command when `$changeUsernameWithID[]` or `$changeUsername[]` throws an exception", + "Added `$modifyRolePerms[]`", + "Added `$isUserDMEnabled[]`", + "Added new option to `$mentioned[]`", + "When `userID` is not provided in `$discriminator[]`, the author's ID will be used", + "Added `$argCount[]`", + "Added `$roleExists[]` and `$roleExists[]` ", + "Added `$varExistError[]`", + "Removed permissions check for `$kick[]` function", + "Fixed brackets issue in `$message` and `$noMentionMessage`", + "Fixed `$globalUserLeaderboard[]`", + "`$repeatMessage[]` won't send an error when there is `0` provided" + ], + "january": [ + "Final premium preparations", + "Space commands for premium bots", + "Added `sendChannelMessage()` to JS", + "Added `$isNumber[]`", + "Better description for` $replaceText[]`", + "Removed `#` from `$getRoleColor[]`", + "Added possibility of adding custom error message to `$suppressErrors[]`", + "Added `$embedSuppressErrors[]`", + "Added `$getServerVar[]` in command's name for premium bots", + "Added custom separators to `$numberSeparator[]`", + "Fixed issue with `+` and `-` in `$numberSeparator[]`", + "iOS release", + "Added `$isBot[]`", + "Added `userID` option to `$takeRole[]`", + "Fixed problems with timezones", + "`@everyone` role shows up now when it's a highest/lowest role in `$highestRole/$lowestRole`", + "`@everyone` role now works in `$rolePosition[]`", + "Added multi-line support for `$replaceText[]`", + "Fixed no errors in `$roleID[]`", + "Added `$toUppercase[]` and `$toLowercase[]`", + "Added `roleID` and `userID` to `$modifyChannelPerms[]`", + "Added `$authorOfMessage[]`", + "Added `$userID[]`", + "Improved servers response time by over 10x", + "Fixed issues with `$setServerVar[]` and `$setUserVar[]`", + "Added multi-line support for `$textSplit[]`", + "Fixed brackets in `$username`" + ] + }, + "2019": { + "december": [ + "Fixed high ping issues", + "Fixed whole bunch of other issues", + "Added to JS:", + "- authorId", + "- channelId", + "- userMentions", + "- roleMentions", + "- unban()", + "- takeRole()", + "- giveRole()", + "- channelTyping()", + "- createChannel()", + "- removeChannel()", + "- unpinMessage()", + "- banWithReason()", + "- kickWithReason()", + "- removeRole()", + "- createRole()", + "Created status website ", + "Web version of *Bot Designer for Discord* has been moved to new address ", + "Fixed some issues in web version", + "Fixed `$banID[]`", + "Preparations for premium points" + ], + "november": [ + "Added `$rolePosition[]`", + "Released translation strings to volunteers", + "Added `kick()` and `ban()` to JS", + "Released new stable version" + ] + } +} diff --git a/src/404.md b/src/404.md index 9ae48f439ba..0c872930b45 100644 --- a/src/404.md +++ b/src/404.md @@ -1,9 +1,56 @@ -# Oops. Something Not Found! - -**The requested page was not found. -You may have navigated to the wrong address, or a separate page for the requested resource doesn't exist.\ -Try going to the [home page](./foreword.md) and using the ![search](https://user-images.githubusercontent.com/70456337/206868285-08701c5f-9449-409b-9472-2893f2505ea7.png) search function.** - -**If you think the resource requested by this address should exist, contact the Wiki Contributors on the [official BDFD server](https://discord.gg/botdesigner).** - -![cat](https://http.cat/404) \ No newline at end of file + + +
+ 404 +

Page not found:(

+
+ + +
+
diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 699438deb36..9c0765a43b0 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,704 +1,748 @@ -# Changelog - -# 2024 - -## August -- Added `$log[]` -- Added `$logQuota` -- Added `$suppressErrorLogging` -- Added `$ceil[]` -- Added `$floor[]` -- Added `$sqrt[]` -- Added `$isInteger[]` - -
Previous Updates - -## July -- Added `$setUserRoles[]` -- Added `$getLeaderboardPosition[]` -- Added `$isBooster[]` - -## June -- Added `$ai[]` -- Added `$aiQuota` - -## March -- Fixed the bot sometimes duplicating its answer -- Fixed `$onlyForIDs[]` not working correctly on big nodes - -
- -# 2023 - -## June -- Fixed custom images not always being displayed -- Allowed for empty string values in `$jsonSetString[]` -- Added `$jsonArraySort[]` -- Added `$jsonArrayReverse[]` -- JSON Array function now can interact with JSON root -- Emoji argument now allows for emoji aliases -- Added `$nodeVersion[]` -- Added `$removeEmoji[]` -- Added `$addMessageReactions[]` -- Fixed `$nickname[]` to work with the new Discord username system -- Added `$displayName[]` -- Added `$userBadges[]` -- Added `$userBannerColor[]` - -
Previous Updates - -## May -- Fixed `$min[]` and `$max[]` not working with floats - -## April -- Fixed caching timeout information - -## March -- Fixed callbacks not always getting detected -- Fixed JSON functions inability to correctly return an object -- Fixed `$jsonArrayPop[]` and `$jsonArrayShift[]` only working once on an array -- Fixed a bug where `$jsonArrayPop[]` and `$jsonArrayShift[]` would stop execution when trying to operate on an empty array -- Fixed `$round[]` adding trailing zeros -- Added `$removeAllComponents` - -## February -- Fixed caching issues for leaderboards -- Added `$jsonArrayShift[]` -- Added `$jsonArrayUnshift[]` -- Added `$jsonArrayPop[]` -- Added `$jsonJoinArray[]` - -## January -- Added `$jsonParse[]` -- Added `$jsonClear` -- Added `$jsonStringify` -- Added `$jsonPretty[]` -- Added `$json[]` -- Added `$jsonExists[]` -- Added `$jsonSet[]` -- Added `$jsonArray[]` -- Added `$jsonArrayAppend[]` -- Added `$jsonArrayCount[]` -- Added `$jsonUnset[]` -- Added `$disableInnerSpaceRemoval` -- Fixed big numbers not working in leaderboard functions -- Added Emoji argument type -- Added `$isTicket[]` -- Added `$userBanner[]` -- Added `$randomGuildID` -- Added `$randomRoleID[]` -- Added `$randomCategoryID[]` -- Added `$channelNames[]` -- Added `$categoryChannels[]` -- Fixed `$allowUserMentions[]` not working on slash commands -- Fixed `$addTextInput[]` not working with empty values -- Added `$jsonSetString[]` -- Added `$jsonArrayIndex[]` - -
- -# 2022 - -## December -- Added limit on input numbers to 2128 on the basic math functions -- Fixed BDScript 2 having problems with handling unicode characters -- Fixed `$stop` causing undefined behaviour -- Added `$getBanReason[]` -- Fixed caching issues for the text splitting functions -- Fixed issues with custom images - -
Previous Updates - -## November -- Deprecated `$userJoinedDiscord[]` in favor of `$creationDate[]` -- Added `Format` argument to `$creationDate[]` -- Added `$editSplitText[]` -- Added `$serverEmojis[]` -- Added `$setChannelVar[]` -- Added `$getChannelVar[]` -- Added `$resetChannelVar[]` -- Added `channel` option to `$variablesCount[]` -- Fixed BDScript 2's escaping not working in some cases - -## October -- Added `$publishMessage[]` -- Made `$useChannel[]` work with message components -- Added `$channelPosition[]` -- Added `$categoryID` -- Added `$varExists[]` -- Added `$boostCount` -- Added `$categoryCount` -- Added `$isTimedOut[]` -- Added `stage` and `forum` channel types to `$createChannel[]` -- Added `stage`, `announcement`, and `forum` channel types to `$channelType[]` -- `$enableDecimals[]` now works with `$calculate[]` -- Added `$getCustomStatus[]` -- Added `$httpStatus` -- Added `$httpGetHeader[]` -- Added `$botOwnerID` -- Added `$repliedMessageID` -- Fixed the guild list fetching issue -- Added `$parentID` - -## September -- Added `channelID` field to `$awaitFunc[]` -- Added `$trimContent` -- Fixed fetching guilds not always working in the app -- Added `$slashID` -- Fixed slash command reordering -- Added intent autodetection -- Added `globaluser` option to `$variablesCount[]` -- Added support for big numbers in the math functions -- Added new text tutorial -- Fixed `$checkUserPerms[]` ignoring channel permissions -- Fixed `$addReactions[]` not working on slash commands -- Fixed `Ticket number` argument not working in `$newTicket[]` -- Fixed `$httpAddHeader[]` -- Fixed some callbacks not being detected as callbacks -- Fixed attachments not working in slash commands - -## August -- Added `$scriptLanguage` -- Fixed `$stop` breaking `$if[]` -- Renamed `$customImage[]` argument to `Custom image tag` -- Added `$hypesquad[]` -- Added `$dmChannelID[]` -- Fixed the app's max choices limit -- Fixed `$registerGuildCommands[]` removing previously registered commands -- Fixed `$reply` not working in DMs -- Made it possible to return milliseconds and nanoseconds in `$getTimestamp[]` -- Fixed `$addTextInput[]` not verifying max length -- Fixed `$url[]` returning an error when no input was provided -- Added `$userServerAvatar[]` -- Fixed `$cropText[]` not supporting unicode -- Not putting required slash command options on top no longer breaks the commands - -## July -- Added hex to the color picker -- Fixed `$executionTime` not working inside embed fields -- App now sends notification when bot hosting is expired -- Added `$sendNotification[]` for premium bots -- Made it possible to use only one option in a select menu -- Fixed `$editChannelPerms[]` -- Fixed verification of slash command names -- Fixed `$sort` not working with `-1` as return amount - -## June -- Fixed `$onlyBotChannelPerms[]` -- Fixed description verification in `$addSelectMenuOption[]` and `$editSelectMenuOption[]` -- Updated limits of select menu options -- Fixed updating components which are refering to `$messageID` - -## May -- Fixed token issues -- Fixed disappearing slash command options -- `AllowedMentions` field is now used in `$channelSendMessage[]`, `$sendEmbedMessage[]` and `$sendMessage[]` -- Fixed black screen after bot creation -- Fixed in-app tutorial -- Fixed escaping response in interactions -- Fixed cooldown error messages -- Fixed empty values in variables not getting saved -- Fixed userID being ignored when guildID is passed to `$getUserVar[]` - -## April -- Added `"return ID of the ticket message"` argument to `$newTicket[]` -- Fixed disappearing slash commands from the app's state - -## March -- Added `$toTitleCase[]` -- Fixed invite permission calculator -- Fixed `$suppressErrors[]` and `$embedSuppressErrors[]` getting ignored by components errors -- Fixed updating some components -- Added `$registerGuildCommands[]` -- Added `$unregisterGuildCommands[]` -- Added `/callback_list`, `/callback_tag_list`, and `/callback/:callback_tag` endpoints to public BDFD API - -## February -- `$httpResult[]` can return JSON now -- Fixed `$httpResult[]` not working with multiple requests -- Saving a command in the webapp no longer restarts the bots -- Optimized slash commands resynchronization -- Fixed custom images not working after saving a command -- Made it possible to escape `\` by using `\\` -- Removed user permission check for `$ban[]`, `$banID[]`, `$unban[]` and `$unbanID[]` -- Added `$newModal[]` -- Added `$addTextInput[]` -- Added `$input[]` -- Deprecated `$channelIDFromName[]`, use `$channelID[]` instead -- Added `$onlyForCategories[]` -- Fixed `$modifyChannelPerms[]` ignoring last permission -- Added `$onAutoComplete[]` callback -- Added `$autoCompleteOptionName` -- Added `$autoCompleteOptionValue` -- Added `$appendOptionSuggestion[]` - -## January -- Added `$unescape[]` -- Added a neutral permission (`/`) to `$modifyChannelPerms[]` -- Added stop bot button in the app -- Added restart bot button in the app -- Added `$editChannelPerms[]` (replacement for the deprecated `$modifyChannelPerms[]`) -- Added `$roleGrant[]` (replacement for the deprecated `$giveRole[]` and `$takeRole[]`) -- Fixed component functions inside `$async[]` scope -- Increased the limit of http functions in one command to `5` -- Fixed `$userPerms[]` -- Fixed some bugs regarding math commands -- Added public BDFD API -- Added `$serverDescription[]` - -
- -# 2021 - -## December -- Saving a command no longer causes the bot to restart -- Fixed `$noMentionMessage[]` in BDScript 2 -- Added `$timeout[]` and `$untimeout[]` -- `$mute[]` and `$unmute[]` has been marked as deprecated -- Added `guildID` argument to `$getUserVar[]` and `$setUserVar[]` -- Fixed the issue with some bots not starting with invalid intents enabled -- Fixed the role cache -- Slash command's option description is now required -- Added `$shardID[]` -- Added sharding -- Improved interaction handling -- Added `$defer` -- Fixed getting invites -- Added debug information inside the app for translators -- Fixed `$serverNames` -- Added `%` *(modulo)* to `$calculate[]` -- Fixed removing custom images -- Added missing permissions -- Fixed unintentional server restarts -- The last argument in `$replaceText[]` is now optional - -
Previous Updates - -## November -- Added `$reply[]` -- Added `$trimSpace[]` -- Added `$url[]` -- Upgraded the database -- Sped up the node starting time -- Added `$botCommands[]` -- Added `$unpinMessage[]` -- Added `$pinMessage[]` -- Fixed `$isUserDMEnabled[]` not returning false in some cases -- `$addReactions[]` now works in slash commands -- `$dm[]` now can dm to more than one mention and can be used multiple times -- `$dm` now can be used with `$dm[]` -- `$random[]` now can use decimals -- Added `$'randomChannelID` (BDScript Unstable only) -- Fixed `$textSplit[]` removing space - -## October -- Added `$deleteMessage[]` -- Added `$hostingExpireTime[]` -- Added timestamp option to `$premiumExpireTime` -- Fixed `$isUserDMEnabled[]` -- Fixed `image` parameter in `$sendEmbedMessage[]` and `$webhookSend[]` -- Fixed caching issue for `$serverIcon` -- Made it possible to use empty labels in the buttons -- New UI -- Added search bar in the variables section -- Made it possible to use `https://youtu.be/` URL in the streaming statuses -- Added `$getTextSplitIndex[]` -- Added `$serverChannelExists[]` -- Fixed `$changeUsername[]` and `$changeUsernameWithID[]` not working on the current bot -- Made `$ephemeral` work with the buttons -- Fixed global variables not getting saved -- Fixed `$deletecommand` not getting catched by `$try` block -- Made it possible to open function's wiki article from the functions list - -## September -- Updated ToS -- Fixed `$executionTime` not working in embeds -- Added `$botNode` -- Added `$isBanned[]` -- Fixed a problem with `$charCount[]` having problems with unicode -- Added `$channelType[]` -- Added `$async[]` block function and `$endasync` -- Added `$await[]` -- Added `$sort[]` -- Added `$userPerms[]` -- Added `$serverNames[]` -- Improved variables lookup time - -## August -- Added `$webhookTitle[]` -- Added `$webhookDescription[]` -- Added `$webhookFooter[]` -- Added `$webhookContent[]` -- Added `$webhookUsername[]` -- Added `$webhookAvatarURL[]` -- Added `$webhookCreate[]` -- Removed permission check from `$deleteChannelsByName[]` -- Removed permission check from `$deleteChannels[]` -- Removed permission check from `$createChannel[]` -- Fixed the issue with bots not working in threads -- Added `$startThread[]` -- Added `$webhookColor[]` -- Fixed optional field in `$getServerVar[]` -- Fixed floating points in `$onlyIf[]` conditions -- Added `$webhookDelete[]` -- Added `$webhookSend[]` -- Removed permission check from `$modifyChannelPerms[]` -- Made it possible to use multiple `$onInteraction[]`s -- Added `$onInteraction` callback (without `[]`) -- Added `$customID` -- Made it possible to use different scripting languages in callbacks -- Added `$editThread[]` -- Added `$threadAddMember[]` -- Added `$threadRemoveMember[]` -- Added `$getEmbedData[]` -- Made it possible to use block functions (`$if[]`, `$try`, etc.) inside function arguments in BDScript 2 -- Fixed preprocessor failures in some corner cases in BDScript 2 -- Fixed a bug with block-functions adding extra new line in BDScript 2 -- Fixed and optimised `$setVar[]` -- Added `$sendEmbedMessage[]` -- Fixed condition parsing in `$if[]` for the normal BDScript and BDScript Unstable (BDScript 2 didn't have any issues) -- Made command saving faster - -## July -- Added `$getTimestamp` -- Added support for decimals in the math functions -- Added `$newSelectMenu[]` -- Added `$addSelectMenuOption[]` -- Added `$editSelectMenu[]` -- Added `$editSelectMenuOption[]` -- Added `$removeComponent[]` -- Added `$calculate[]` -- Added `$round[]` -- Added `$enableDecimals[]` -- Added `$nickname` -- Added row and column information in BDScript 2 errors -- Fixed an issue with BDScript 2 not requiring `]` -- Adjusted the optimizer in BDScript 2 -- Added `$onlyForRoleIDs[]` -- Added `$getCooldown[]` -- Fixed problems with `]` in some functions -- Fixed component functions inside `$eval[]` function -- Fixed minor bugs inside BDScript 2 parser -- Fixed author ID not showing up in `$mentioned[..;yes]` -- Fixed `$serverNames` which removed two last characters -- Fixed `$addTimestamp[]` when used for multiple embeds -- Added limits for the `$round[]` function *(max decimal place)* -- Added `$and[]` -- Added `$or[]` -- Added `$allowRoleMentions[]` -- Added `$allowUserMentions[]` -- Added `$guildExists[]` -- Fixed `$serverVerificationLvl` - -## June -- Fixed `$sendMessage[]` not working in normal BDScript -- Fixed `$checkUserPerms[]` -- Added BDScript 2 script language -- Added to BDScript 2: - - `$try`, `$catch` and `$error` - - `$eval[]` - - `$optOff[]` - - `$stop[]` - - `$var[]` -- Added customizable code highlighting -- Fixed `$lowestRole` and `$highestRole` -- Added `$isBoolean[]` -- Made it possible to add 5 buttons per row -- Added optional field `return type` to `$getLeaderboardValue[]` -- Added `$deleteRole[]` -- Added `$ephemeral` -- Added `$elseif[]` to BDScript 2 -- Fixed URL in buttons -- Fixed buttons in DMs -- Fixed problems with custom prefixes -- Added `$getUserStatus[]` -- Added `$min[]` -- Added `$max[]` -- Fixed `$customEmoji[]` -- Made it possible to edit embeds in `$editMessage[]` -- Added support for multiple embeds -- Added `$httpAddHeader[]` -- Added `$httpRemoveHeader[]` - -## May -- Fixed a bug which allowed executing certain types of callbacks as normal commands -- Fixed member caching issue -- Fixed caching bots -- Fixed changing tokens in the webapp -- Fixed `$isUserDMEnabled[]` -- Added `$addButton[]` -- Added `$editButton[]` -- Added `$removeButtons` and `$removeButtons[]` -- Added `$onInteraction[]` callback -- Fixed some issues with slash commands -- Added `$c[]` - -## April -- Added `$httpGet[]`, `$httpPost[]`, `$httpPut[]`, `$httpDelete[]` and `$httpPatch[]` -- Improved overall caching -- Added `$httpResult[]` -- Made command execution faster - -## March -- Added `$cropText[]` -- Added `userID` field to `$awaitFunc[]` -- Fixed removing normal commands and slash commands -- Added `$removeLinks[]` -- Made returning authorID optional in `$findUser[]` -- Added `$slowmode[]` -- Added `$checkUserPerms[]` -- Added `$isNSFW[]` -- Fixed setting NSFW in `$modifyChannel[]` -- Fixed `$userJoined[]` and `$userJoinedDiscord[]` -- Added `$editMessage[]` -- Fixed caching for new members. -- Added `$slashCommandsCount` -- Added `$botID` -- Added more permissions: - - `AttachFiles` - - `TTS` - - `ManageWebhooks` - - `EmbedLinks` - - `ExternalEmojis` -- Added `$serverCooldown[]` -- Fixed an issue with not expiring app bans -- Fixed some issues with `[` and `]` -- Fixed problems with slash commands and cooldowns - -## February -- Added `$sendMessage[]` -- Added `$reply` -- Added slash commands -- Fixed mentions in `$findChannel[]` -- Improved performance in the command interpreter -- Optimized reaction handlers -- Added `$isSlash` -- Added new optional field to `$message[]` -- Fixed semicolons in `$channelSendMessage[]` - -## January -- Fixed a problem with statuses not showing up -- Fixed an issue with mentions not working -- Fixed loading bots from database -- Increased duration to 40 minutes for `$deleteIn[]`, `$editIn[]`, `$editEmbedIn[]`, `$replyIn[]` -- Added if statements (`$if[]`, `$else`, `$endif`) -- GuildID is now returned instead of `everyone` in `$lowestRole[]` and `$highestRole[]` -- Space commands have been removed (you can still use `$alwaysReply`) -- Added `$channelTopic[]` -- Fixed issues with streaming status -- Fixed the issue with tags/discriminators not working for `$userID[]` and `$findUser[]` -- Added `$findChannel[]` and `$channelExists[]` -- Added `$userJoined[]` and `$userJoinedDiscord[]` - -# 2020 - -## December -- Timezones in `$time[]` has been fixed -- Updated Discord API version -- Added Competing presence -- Added `$botLeave[]` -- Fix for `$getLeaderboardValue[]` -- Added `userID` option to `$resetUserVar` -- Added `serverID` option to `$serverOwner` -- Added `$premiumExpireTime` - -## November -- Fixed disappearing bot status -- Fixed `$serverCount` in bot status -- Improved caching -- Functions that require privileged intents are now marked accordingly -- Added `$getLeaderboardValue[]` -- Added `$awaitReactions[]` -- Awaited commands are now available for everyone -- Added awaited reactions -- Fixed problems with DMs - -## October -- Optimized memory usage -- Added member and presence intents -- Added `$editEmbedIn[]` -- Added `serverID` field to server variables -- Allowed using awaited functions in awaited commands -- Fixed leaderboards -- Fixed `$randomMention`, `$randomUser` and `$randomUserID` -- Added `$awaitReactions[]` for premium bots -- Added `$usedEmoji` -- `$deletecommand` sends an error now -- Fixed `$serverVerificationLvl` not working on very high verification servers -- Fixed reconnecting bots to gateway - -## September -- Added `$ignoreTriggerCase` for premium bots -- Fixed caching guilds -- `$findUser[]` & `$findRole[]` are no longer case sensitive -- `$findUser[]` returns authorID if no user found -- Added awaited commands for premium bots -- Fixed weird brackets in embeds -- Added trigger list in the app - -## August -- Migrated to the new infrastructure (new database and API) -- Premium released -- Fixed `$isMentionable[]` -- Fixed `$isHoisted[]` -- Added `$removeSplitTextElement[]` -- `$userAvatar[]` no longer stops code execution -- Fixed `$argCount[]` -- Added `$findUser[]` -- Added `$findRole[]` -- Added `$disableSpecialEscaping` - -## July -- Renamed `$splitText[]` to `$getSplitText[]` to avoid confusion _(`$splitText[]` still works)_ -- Added `$joinSplitText[]` -- Added `$getInviteInfo[]` -- Added `$guildID[]` -- Fixed `$numberSeparator[]` in the bot's status -- `$roleID[]` and `$channelID[]` no longer stop code execution -- Enabled BDScript Unstable for callbacks -- Added `$getTextSplitLength` - -## June -- Fixed `$getReactions[]` in BDScript Unstable -- Fixed bracket escaping for some commands in BDScript Unstable -- Fixed `$modifyChannel[]` (random slowmodes added on channels) - -## May -- Fixed `$onlyBotPerms[]` -- Bot Designer List Open Beta -- Added `$botListDescription[]` and `$botListHide` -- Fixed brackets issue in `$serverNames` -- Other bug fixing for Bot Designer and Bot Designer List - -## April -- Fixed `$serverIcon` -- Added `$changeCooldownTime[]` -- Disabled `$randomUserID`, `$'randomUserID`, `$deleteIn` and `$dm` in `$onMessageDelete` -- Fixed `$addField[]` -- Added error message in `$getServerVar[]` when provided variable does not exist -- Fixed `$userID[]` to not stop code execution, if user is not found -- Added `$botLeave` -- Removed permission check from `$clear` command. -- Fixed `$isAdmin[]` - -## March -- Added `$getReactions[]` and `$userReacted[]` -- New command interpreter -- Added to new parser: - - `$'random[]` and `$'random` - - `$'randomText[]` - - `$'randomUser` - - `$'randomMention` - - `$'randomUserID` - - `$'randomString[]` -- Fixed brackets in `$getMessage[]` -- Changed behaviour of `$onlyPerms[]` command -- Added `$charCount[]` -- Added `$clearReactions[]` -- Added new options to `$getMessage[]` -- Fixed adding slowmode when using `$modifyChannel[]` -- Added `$checkContains[]` -- Added `$addEmoji[]` -- Fixed the bug with `$` command prefix and `$noMentionMessage` -- Added `$unbanID[]` -- Added `$hasRole[]` -- Optimized the leaderboard commands -- Fixed permissions in some commands -- Fixed `$onlyPerms[]` -- Fixed the bug with `$` command prefix and `$message` - -## February -- Fixed errors in `$addField` -- Added `$serverRegion` -- Added `$serverOwner` -- Added `$emoteCount` -- Added `$isMentionable[]` -- Added `$isHoisted[]` -- Added `$serverIcon[]` -- Fixed suppressing errors in some variable commands -- Fixed bug with `$replaceText[]` inside `$description` -- Added `$isValidHex[]` -- Added `$isAdmin[]` -- `$userID[]` does not require discriminator now -- Added `$serverVerificationLvl` -- Fixed stopping command when `$changeUsernameWithID[]` or `$changeUsername[]` throws an exception -- Added `$modifyRolePerms[]` -- Added `$isUserDMEnabled[]` -- Added new option to `$mentioned[]` -- When `userID` is not provided in `$discriminator[]`, the author's ID will be used -- Added `$argCount[]` -- Added `$roleExists[]` and `$roleExists[]` -- Added `$varExistError[]` -- Removed permissions check for `$kick[]` function -- Fixed brackets issue in `$message` and `$noMentionMessage` -- Fixed `$globalUserLeaderboard[]` -- `$repeatMessage[]` won't send an error when there is `0` provided - -## January -- Final premium preparations -- Space commands for premium bots -- Added `sendChannelMessage()` to JS -- Added `$isNumber[]` -- Better description for` $replaceText[]` -- Removed `#` from `$getRoleColor[]` -- Added possibility of adding custom error message to `$suppressErrors[]` -- Added `$embedSuppressErrors[]` -- Added `$getServerVar[]` in command's name for premium bots -- Added custom separators to `$numberSeparator[]` -- Fixed issue with `+` and `-` in `$numberSeparator[]` -- iOS release -- Added `$isBot[]` -- Added `userID` option to `$takeRole[]` -- Fixed problems with timezones -- `@everyone` role shows up now when it's a highest/lowest role in `$highestRole/$lowestRole` -- `@everyone` role now works in `$rolePosition[]` -- Added multi-line support for `$replaceText[]` -- Fixed no errors in `$roleID[]` -- Added `$toUppercase[]` and `$toLowercase[]` -- Added `roleID` and `userID` to `$modifyChannelPerms[]` -- Added `$authorOfMessage[]` -- Added `$userID[]` -- Improved servers response time by over 10x -- Fixed issues with `$setServerVar[]` and `$setUserVar[]` -- Added multi-line support for `$textSplit[]` -- Fixed brackets in `$username` - -
- -# 2019 - -## December -- Fixed high ping issues -- Fixed whole bunch of other issues -- Added to JS: - - authorId, - - channelId, - - userMentions, - - roleMentions, - - unban(), - - takeRole(), - - giveRole(), - - channelTyping(), - - createChannel(), - - removeChannel(), - - unpinMessage(), - - banWithReason(), - - kickWithReason(), - - removeRole(), - - createRole() -- Created status website -- Web version of *Bot Designer for Discord* has been moved to new address -- Fixed some issues in web version -- Fixed `$banID[]` -- Preparations for premium points - -
Previous Updates - -## November -- Added `$rolePosition[]` -- Released translation strings to volunteers -- Added `kick()` and `ban()` to JS -- Released new stable version -
- -> If you want to access this changelog externally, we have a [JSON version](https://raw.githubusercontent.com/NilPointer-Software/bdfd-wiki/dev/external/CHANGELOG.json) of the changelog to which you can send a GET request and work with a JSON document further. +# Changelog + + + +# 2025 + +## January +- Added `$afkChannelID` +- Added `$afkTimeout[]` +- Added `$boostLevel` +- Added `$byteCount[]` +- Added `$commandFolder` +- Added `$commandName` +- Added `$commandTrigger` +- Added `$emojiExists[]` +- Added `$emojiName[]` +- Added `$getAttachments[]` +- Added `$getSlowmode[]` +- Added `$guildBanner[]` +- Added `$isEmojiAnimated[]` +- Added `$isMessageEdited[]` +- Added `$lastMessageID` +- Added `$lastPinTimestamp` +- Added `$linesCount[]` +- Added `$messageEditedTimestamp[]` +- Added `$rolePerms[]` +- Added `$rulesChannelID[]` +- Added `$systemChannelID` +- Added `$threadMessageCount` +- Added `$threadUserCount` +- Added `$voiceUserLimit[]` + +# 2024 + +## August +- Added `$log[]` +- Added `$logQuota` +- Added `$suppressErrorLogging` +- Added `$ceil[]` +- Added `$floor[]` +- Added `$sqrt[]` +- Added `$isInteger[]` + +
Previous Updates + +## July +- Added `$setUserRoles[]` +- Added `$getLeaderboardPosition[]` +- Added `$isBooster[]` + +## June +- Added `$ai[]` +- Added `$aiQuota` + +## March +- Fixed the bot sometimes duplicating its answer +- Fixed `$onlyForIDs[]` not working correctly on big nodes + +
+ +# 2023 + +## June +- Fixed custom images not always being displayed +- Allowed for empty string values in `$jsonSetString[]` +- Added `$jsonArraySort[]` +- Added `$jsonArrayReverse[]` +- JSON Array function now can interact with JSON root +- Emoji argument now allows for emoji aliases +- Added `$nodeVersion[]` +- Added `$removeEmoji[]` +- Added `$addMessageReactions[]` +- Fixed `$nickname[]` to work with the new Discord username system +- Added `$displayName[]` +- Added `$userBadges[]` +- Added `$userBannerColor[]` + +
Previous Updates + +## May +- Fixed `$min[]` and `$max[]` not working with floats + +## April +- Fixed caching timeout information + +## March +- Fixed callbacks not always getting detected +- Fixed JSON functions inability to correctly return an object +- Fixed `$jsonArrayPop[]` and `$jsonArrayShift[]` only working once on an array +- Fixed a bug where `$jsonArrayPop[]` and `$jsonArrayShift[]` would stop execution when trying to operate on an empty array +- Fixed `$round[]` adding trailing zeros +- Added `$removeAllComponents` + +## February +- Fixed caching issues for leaderboards +- Added `$jsonArrayShift[]` +- Added `$jsonArrayUnshift[]` +- Added `$jsonArrayPop[]` +- Added `$jsonJoinArray[]` + +## January +- Added `$jsonParse[]` +- Added `$jsonClear` +- Added `$jsonStringify` +- Added `$jsonPretty[]` +- Added `$json[]` +- Added `$jsonExists[]` +- Added `$jsonSet[]` +- Added `$jsonArray[]` +- Added `$jsonArrayAppend[]` +- Added `$jsonArrayCount[]` +- Added `$jsonUnset[]` +- Added `$disableInnerSpaceRemoval` +- Fixed big numbers not working in leaderboard functions +- Added Emoji argument type +- Added `$isTicket[]` +- Added `$userBanner[]` +- Added `$randomGuildID` +- Added `$randomRoleID[]` +- Added `$randomCategoryID[]` +- Added `$channelNames[]` +- Added `$categoryChannels[]` +- Fixed `$allowUserMentions[]` not working on slash commands +- Fixed `$addTextInput[]` not working with empty values +- Added `$jsonSetString[]` +- Added `$jsonArrayIndex[]` + +
+ +# 2022 + +## December +- Added limit on input numbers to 2128 on the basic math functions +- Fixed BDScript 2 having problems with handling unicode characters +- Fixed `$stop` causing undefined behaviour +- Added `$getBanReason[]` +- Fixed caching issues for the text splitting functions +- Fixed issues with custom images + +
Previous Updates + +## November +- Deprecated `$userJoinedDiscord[]` in favor of `$creationDate[]` +- Added `Format` argument to `$creationDate[]` +- Added `$editSplitText[]` +- Added `$serverEmojis[]` +- Added `$setChannelVar[]` +- Added `$getChannelVar[]` +- Added `$resetChannelVar[]` +- Added `channel` option to `$variablesCount[]` +- Fixed BDScript 2's escaping not working in some cases + +## October +- Added `$publishMessage[]` +- Made `$useChannel[]` work with message components +- Added `$channelPosition[]` +- Added `$categoryID` +- Added `$varExists[]` +- Added `$boostCount` +- Added `$categoryCount` +- Added `$isTimedOut[]` +- Added `stage` and `forum` channel types to `$createChannel[]` +- Added `stage`, `announcement`, and `forum` channel types to `$channelType[]` +- `$enableDecimals[]` now works with `$calculate[]` +- Added `$getCustomStatus[]` +- Added `$httpStatus` +- Added `$httpGetHeader[]` +- Added `$botOwnerID` +- Added `$repliedMessageID` +- Fixed the guild list fetching issue +- Added `$parentID` + +## September +- Added `channelID` field to `$awaitFunc[]` +- Added `$trimContent` +- Fixed fetching guilds not always working in the app +- Added `$slashID` +- Fixed slash command reordering +- Added intent autodetection +- Added `globaluser` option to `$variablesCount[]` +- Added support for big numbers in the math functions +- Added new text tutorial +- Fixed `$checkUserPerms[]` ignoring channel permissions +- Fixed `$addReactions[]` not working on slash commands +- Fixed `Ticket number` argument not working in `$newTicket[]` +- Fixed `$httpAddHeader[]` +- Fixed some callbacks not being detected as callbacks +- Fixed attachments not working in slash commands + +## August +- Added `$scriptLanguage` +- Fixed `$stop` breaking `$if[]` +- Renamed `$customImage[]` argument to `Custom image tag` +- Added `$hypesquad[]` +- Added `$dmChannelID[]` +- Fixed the app's max choices limit +- Fixed `$registerGuildCommands[]` removing previously registered commands +- Fixed `$reply` not working in DMs +- Made it possible to return milliseconds and nanoseconds in `$getTimestamp[]` +- Fixed `$addTextInput[]` not verifying max length +- Fixed `$url[]` returning an error when no input was provided +- Added `$userServerAvatar[]` +- Fixed `$cropText[]` not supporting unicode +- Not putting required slash command options on top no longer breaks the commands + +## July +- Added hex to the color picker +- Fixed `$executionTime` not working inside embed fields +- App now sends notification when bot hosting is expired +- Added `$sendNotification[]` for premium bots +- Made it possible to use only one option in a select menu +- Fixed `$editChannelPerms[]` +- Fixed verification of slash command names +- Fixed `$sort` not working with `-1` as return amount + +## June +- Fixed `$onlyBotChannelPerms[]` +- Fixed description verification in `$addSelectMenuOption[]` and `$editSelectMenuOption[]` +- Updated limits of select menu options +- Fixed updating components which are refering to `$messageID` + +## May +- Fixed token issues +- Fixed disappearing slash command options +- `AllowedMentions` field is now used in `$channelSendMessage[]`, `$sendEmbedMessage[]` and `$sendMessage[]` +- Fixed black screen after bot creation +- Fixed in-app tutorial +- Fixed escaping response in interactions +- Fixed cooldown error messages +- Fixed empty values in variables not getting saved +- Fixed userID being ignored when guildID is passed to `$getUserVar[]` + +## April +- Added `"return ID of the ticket message"` argument to `$newTicket[]` +- Fixed disappearing slash commands from the app's state + +## March +- Added `$toTitleCase[]` +- Fixed invite permission calculator +- Fixed `$suppressErrors[]` and `$embedSuppressErrors[]` getting ignored by components errors +- Fixed updating some components +- Added `$registerGuildCommands[]` +- Added `$unregisterGuildCommands[]` +- Added `/callback_list`, `/callback_tag_list`, and `/callback/:callback_tag` endpoints to public BDFD API + +## February +- `$httpResult[]` can return JSON now +- Fixed `$httpResult[]` not working with multiple requests +- Saving a command in the webapp no longer restarts the bots +- Optimized slash commands resynchronization +- Fixed custom images not working after saving a command +- Made it possible to escape `\` by using `\\` +- Removed user permission check for `$ban[]`, `$banID[]`, `$unban[]` and `$unbanID[]` +- Added `$newModal[]` +- Added `$addTextInput[]` +- Added `$input[]` +- Deprecated `$channelIDFromName[]`, use `$channelID[]` instead +- Added `$onlyForCategories[]` +- Fixed `$modifyChannelPerms[]` ignoring last permission +- Added `$onAutoComplete[]` callback +- Added `$autoCompleteOptionName` +- Added `$autoCompleteOptionValue` +- Added `$appendOptionSuggestion[]` + +## January +- Added `$unescape[]` +- Added a neutral permission (`/`) to `$modifyChannelPerms[]` +- Added stop bot button in the app +- Added restart bot button in the app +- Added `$editChannelPerms[]` (replacement for the deprecated `$modifyChannelPerms[]`) +- Added `$roleGrant[]` (replacement for the deprecated `$giveRole[]` and `$takeRole[]`) +- Fixed component functions inside `$async[]` scope +- Increased the limit of http functions in one command to `5` +- Fixed `$userPerms[]` +- Fixed some bugs regarding math commands +- Added public BDFD API +- Added `$serverDescription[]` + +
+ +# 2021 + +## December +- Saving a command no longer causes the bot to restart +- Fixed `$noMentionMessage[]` in BDScript 2 +- Added `$timeout[]` and `$untimeout[]` +- `$mute[]` and `$unmute[]` has been marked as deprecated +- Added `guildID` argument to `$getUserVar[]` and `$setUserVar[]` +- Fixed the issue with some bots not starting with invalid intents enabled +- Fixed the role cache +- Slash command's option description is now required +- Added `$shardID[]` +- Added sharding +- Improved interaction handling +- Added `$defer` +- Fixed getting invites +- Added debug information inside the app for translators +- Fixed `$serverNames` +- Added `%` *(modulo)* to `$calculate[]` +- Fixed removing custom images +- Added missing permissions +- Fixed unintentional server restarts +- The last argument in `$replaceText[]` is now optional + +
Previous Updates + +## November +- Added `$reply[]` +- Added `$trimSpace[]` +- Added `$url[]` +- Upgraded the database +- Sped up the node starting time +- Added `$botCommands[]` +- Added `$unpinMessage[]` +- Added `$pinMessage[]` +- Fixed `$isUserDMEnabled[]` not returning false in some cases +- `$addReactions[]` now works in slash commands +- `$dm[]` now can dm to more than one mention and can be used multiple times +- `$dm` now can be used with `$dm[]` +- `$random[]` now can use decimals +- Added `$'randomChannelID` (BDScript Unstable only) +- Fixed `$textSplit[]` removing space + +## October +- Added `$deleteMessage[]` +- Added `$hostingExpireTime[]` +- Added timestamp option to `$premiumExpireTime` +- Fixed `$isUserDMEnabled[]` +- Fixed `image` parameter in `$sendEmbedMessage[]` and `$webhookSend[]` +- Fixed caching issue for `$serverIcon` +- Made it possible to use empty labels in the buttons +- New UI +- Added search bar in the variables section +- Made it possible to use `https://youtu.be/` URL in the streaming statuses +- Added `$getTextSplitIndex[]` +- Added `$serverChannelExists[]` +- Fixed `$changeUsername[]` and `$changeUsernameWithID[]` not working on the current bot +- Made `$ephemeral` work with the buttons +- Fixed global variables not getting saved +- Fixed `$deletecommand` not getting catched by `$try` block +- Made it possible to open function's wiki article from the functions list + +## September +- Updated ToS +- Fixed `$executionTime` not working in embeds +- Added `$botNode` +- Added `$isBanned[]` +- Fixed a problem with `$charCount[]` having problems with unicode +- Added `$channelType[]` +- Added `$async[]` block function and `$endasync` +- Added `$await[]` +- Added `$sort[]` +- Added `$userPerms[]` +- Added `$serverNames[]` +- Improved variables lookup time + +## August +- Added `$webhookTitle[]` +- Added `$webhookDescription[]` +- Added `$webhookFooter[]` +- Added `$webhookContent[]` +- Added `$webhookUsername[]` +- Added `$webhookAvatarURL[]` +- Added `$webhookCreate[]` +- Removed permission check from `$deleteChannelsByName[]` +- Removed permission check from `$deleteChannels[]` +- Removed permission check from `$createChannel[]` +- Fixed the issue with bots not working in threads +- Added `$startThread[]` +- Added `$webhookColor[]` +- Fixed optional field in `$getServerVar[]` +- Fixed floating points in `$onlyIf[]` conditions +- Added `$webhookDelete[]` +- Added `$webhookSend[]` +- Removed permission check from `$modifyChannelPerms[]` +- Made it possible to use multiple `$onInteraction[]`s +- Added `$onInteraction` callback (without `[]`) +- Added `$customID` +- Made it possible to use different scripting languages in callbacks +- Added `$editThread[]` +- Added `$threadAddMember[]` +- Added `$threadRemoveMember[]` +- Added `$getEmbedData[]` +- Made it possible to use block functions (`$if[]`, `$try`, etc.) inside function arguments in BDScript 2 +- Fixed preprocessor failures in some corner cases in BDScript 2 +- Fixed a bug with block-functions adding extra new line in BDScript 2 +- Fixed and optimised `$setVar[]` +- Added `$sendEmbedMessage[]` +- Fixed condition parsing in `$if[]` for the normal BDScript and BDScript Unstable (BDScript 2 didn't have any issues) +- Made command saving faster + +## July +- Added `$getTimestamp` +- Added support for decimals in the math functions +- Added `$newSelectMenu[]` +- Added `$addSelectMenuOption[]` +- Added `$editSelectMenu[]` +- Added `$editSelectMenuOption[]` +- Added `$removeComponent[]` +- Added `$calculate[]` +- Added `$round[]` +- Added `$enableDecimals[]` +- Added `$nickname` +- Added row and column information in BDScript 2 errors +- Fixed an issue with BDScript 2 not requiring `]` +- Adjusted the optimizer in BDScript 2 +- Added `$onlyForRoleIDs[]` +- Added `$getCooldown[]` +- Fixed problems with `]` in some functions +- Fixed component functions inside `$eval[]` function +- Fixed minor bugs inside BDScript 2 parser +- Fixed author ID not showing up in `$mentioned[..;yes]` +- Fixed `$serverNames` which removed two last characters +- Fixed `$addTimestamp[]` when used for multiple embeds +- Added limits for the `$round[]` function *(max decimal place)* +- Added `$and[]` +- Added `$or[]` +- Added `$allowRoleMentions[]` +- Added `$allowUserMentions[]` +- Added `$guildExists[]` +- Fixed `$serverVerificationLvl` + +## June +- Fixed `$sendMessage[]` not working in normal BDScript +- Fixed `$checkUserPerms[]` +- Added BDScript 2 script language +- Added to BDScript 2: + - `$try`, `$catch` and `$error` + - `$eval[]` + - `$optOff[]` + - `$stop[]` + - `$var[]` +- Added customizable code highlighting +- Fixed `$lowestRole` and `$highestRole` +- Added `$isBoolean[]` +- Made it possible to add 5 buttons per row +- Added optional field `return type` to `$getLeaderboardValue[]` +- Added `$deleteRole[]` +- Added `$ephemeral` +- Added `$elseif[]` to BDScript 2 +- Fixed URL in buttons +- Fixed buttons in DMs +- Fixed problems with custom prefixes +- Added `$getUserStatus[]` +- Added `$min[]` +- Added `$max[]` +- Fixed `$customEmoji[]` +- Made it possible to edit embeds in `$editMessage[]` +- Added support for multiple embeds +- Added `$httpAddHeader[]` +- Added `$httpRemoveHeader[]` + +## May +- Fixed a bug which allowed executing certain types of callbacks as normal commands +- Fixed member caching issue +- Fixed caching bots +- Fixed changing tokens in the webapp +- Fixed `$isUserDMEnabled[]` +- Added `$addButton[]` +- Added `$editButton[]` +- Added `$removeButtons` and `$removeButtons[]` +- Added `$onInteraction[]` callback +- Fixed some issues with slash commands +- Added `$c[]` + +## April +- Added `$httpGet[]`, `$httpPost[]`, `$httpPut[]`, `$httpDelete[]` and `$httpPatch[]` +- Improved overall caching +- Added `$httpResult[]` +- Made command execution faster + +## March +- Added `$cropText[]` +- Added `userID` field to `$awaitFunc[]` +- Fixed removing normal commands and slash commands +- Added `$removeLinks[]` +- Made returning authorID optional in `$findUser[]` +- Added `$slowmode[]` +- Added `$checkUserPerms[]` +- Added `$isNSFW[]` +- Fixed setting NSFW in `$modifyChannel[]` +- Fixed `$userJoined[]` and `$userJoinedDiscord[]` +- Added `$editMessage[]` +- Fixed caching for new members. +- Added `$slashCommandsCount` +- Added `$botID` +- Added more permissions: + - `AttachFiles` + - `TTS` + - `ManageWebhooks` + - `EmbedLinks` + - `ExternalEmojis` +- Added `$serverCooldown[]` +- Fixed an issue with not expiring app bans +- Fixed some issues with `[` and `]` +- Fixed problems with slash commands and cooldowns + +## February +- Added `$sendMessage[]` +- Added `$reply` +- Added slash commands +- Fixed mentions in `$findChannel[]` +- Improved performance in the command interpreter +- Optimized reaction handlers +- Added `$isSlash` +- Added new optional field to `$message[]` +- Fixed semicolons in `$channelSendMessage[]` + +## January +- Fixed a problem with statuses not showing up +- Fixed an issue with mentions not working +- Fixed loading bots from database +- Increased duration to 40 minutes for `$deleteIn[]`, `$editIn[]`, `$editEmbedIn[]`, `$replyIn[]` +- Added if statements (`$if[]`, `$else`, `$endif`) +- GuildID is now returned instead of `everyone` in `$lowestRole[]` and `$highestRole[]` +- Space commands have been removed (you can still use `$alwaysReply`) +- Added `$channelTopic[]` +- Fixed issues with streaming status +- Fixed the issue with tags/discriminators not working for `$userID[]` and `$findUser[]` +- Added `$findChannel[]` and `$channelExists[]` +- Added `$userJoined[]` and `$userJoinedDiscord[]` + +
+ +# 2020 + +## December +- Timezones in `$time[]` has been fixed +- Updated Discord API version +- Added Competing presence +- Added `$botLeave[]` +- Fix for `$getLeaderboardValue[]` +- Added `userID` option to `$resetUserVar` +- Added `serverID` option to `$serverOwner` +- Added `$premiumExpireTime` + +
Previous Updates + +## November +- Fixed disappearing bot status +- Fixed `$serverCount` in bot status +- Improved caching +- Functions that require privileged intents are now marked accordingly +- Added `$getLeaderboardValue[]` +- Added `$awaitReactions[]` +- Awaited commands are now available for everyone +- Added awaited reactions +- Fixed problems with DMs + +## October +- Optimized memory usage +- Added member and presence intents +- Added `$editEmbedIn[]` +- Added `serverID` field to server variables +- Allowed using awaited functions in awaited commands +- Fixed leaderboards +- Fixed `$randomMention`, `$randomUser` and `$randomUserID` +- Added `$awaitReactions[]` for premium bots +- Added `$usedEmoji` +- `$deletecommand` sends an error now +- Fixed `$serverVerificationLvl` not working on very high verification servers +- Fixed reconnecting bots to gateway + +## September +- Added `$ignoreTriggerCase` for premium bots +- Fixed caching guilds +- `$findUser[]` & `$findRole[]` are no longer case sensitive +- `$findUser[]` returns authorID if no user found +- Added awaited commands for premium bots +- Fixed weird brackets in embeds +- Added trigger list in the app + +## August +- Migrated to the new infrastructure (new database and API) +- Premium released +- Fixed `$isMentionable[]` +- Fixed `$isHoisted[]` +- Added `$removeSplitTextElement[]` +- `$userAvatar[]` no longer stops code execution +- Fixed `$argCount[]` +- Added `$findUser[]` +- Added `$findRole[]` +- Added `$disableSpecialEscaping` + +## July +- Renamed `$splitText[]` to `$getSplitText[]` to avoid confusion _(`$splitText[]` still works)_ +- Added `$joinSplitText[]` +- Added `$getInviteInfo[]` +- Added `$guildID[]` +- Fixed `$numberSeparator[]` in the bot's status +- `$roleID[]` and `$channelID[]` no longer stop code execution +- Enabled BDScript Unstable for callbacks +- Added `$getTextSplitLength` + +## June +- Fixed `$getReactions[]` in BDScript Unstable +- Fixed bracket escaping for some commands in BDScript Unstable +- Fixed `$modifyChannel[]` (random slowmodes added on channels) + +## May +- Fixed `$onlyBotPerms[]` +- Bot Designer List Open Beta +- Added `$botListDescription[]` and `$botListHide` +- Fixed brackets issue in `$serverNames` +- Other bug fixing for Bot Designer and Bot Designer List + +## April +- Fixed `$serverIcon` +- Added `$changeCooldownTime[]` +- Disabled `$randomUserID`, `$'randomUserID`, `$deleteIn` and `$dm` in `$onMessageDelete` +- Fixed `$addField[]` +- Added error message in `$getServerVar[]` when provided variable does not exist +- Fixed `$userID[]` to not stop code execution, if user is not found +- Added `$botLeave` +- Removed permission check from `$clear` command. +- Fixed `$isAdmin[]` + +## March +- Added `$getReactions[]` and `$userReacted[]` +- New command interpreter +- Added to new parser: + - `$'random[]` and `$'random` + - `$'randomText[]` + - `$'randomUser` + - `$'randomMention` + - `$'randomUserID` + - `$'randomString[]` +- Fixed brackets in `$getMessage[]` +- Changed behaviour of `$onlyPerms[]` command +- Added `$charCount[]` +- Added `$clearReactions[]` +- Added new options to `$getMessage[]` +- Fixed adding slowmode when using `$modifyChannel[]` +- Added `$checkContains[]` +- Added `$addEmoji[]` +- Fixed the bug with `$` command prefix and `$noMentionMessage` +- Added `$unbanID[]` +- Added `$hasRole[]` +- Optimized the leaderboard commands +- Fixed permissions in some commands +- Fixed `$onlyPerms[]` +- Fixed the bug with `$` command prefix and `$message` + +## February +- Fixed errors in `$addField` +- Added `$serverRegion` +- Added `$serverOwner` +- Added `$emoteCount` +- Added `$isMentionable[]` +- Added `$isHoisted[]` +- Added `$serverIcon[]` +- Fixed suppressing errors in some variable commands +- Fixed bug with `$replaceText[]` inside `$description` +- Added `$isValidHex[]` +- Added `$isAdmin[]` +- `$userID[]` does not require discriminator now +- Added `$serverVerificationLvl` +- Fixed stopping command when `$changeUsernameWithID[]` or `$changeUsername[]` throws an exception +- Added `$modifyRolePerms[]` +- Added `$isUserDMEnabled[]` +- Added new option to `$mentioned[]` +- When `userID` is not provided in `$discriminator[]`, the author's ID will be used +- Added `$argCount[]` +- Added `$roleExists[]` and `$roleExists[]` +- Added `$varExistError[]` +- Removed permissions check for `$kick[]` function +- Fixed brackets issue in `$message` and `$noMentionMessage` +- Fixed `$globalUserLeaderboard[]` +- `$repeatMessage[]` won't send an error when there is `0` provided + +## January +- Final premium preparations +- Space commands for premium bots +- Added `sendChannelMessage()` to JS +- Added `$isNumber[]` +- Better description for` $replaceText[]` +- Removed `#` from `$getRoleColor[]` +- Added possibility of adding custom error message to `$suppressErrors[]` +- Added `$embedSuppressErrors[]` +- Added `$getServerVar[]` in command's name for premium bots +- Added custom separators to `$numberSeparator[]` +- Fixed issue with `+` and `-` in `$numberSeparator[]` +- iOS release +- Added `$isBot[]` +- Added `userID` option to `$takeRole[]` +- Fixed problems with timezones +- `@everyone` role shows up now when it's a highest/lowest role in `$highestRole/$lowestRole` +- `@everyone` role now works in `$rolePosition[]` +- Added multi-line support for `$replaceText[]` +- Fixed no errors in `$roleID[]` +- Added `$toUppercase[]` and `$toLowercase[]` +- Added `roleID` and `userID` to `$modifyChannelPerms[]` +- Added `$authorOfMessage[]` +- Added `$userID[]` +- Improved servers response time by over 10x +- Fixed issues with `$setServerVar[]` and `$setUserVar[]` +- Added multi-line support for `$textSplit[]` +- Fixed brackets in `$username` + +
+ +# 2019 + +## December +- Fixed high ping issues +- Fixed whole bunch of other issues +- Added to JS: + - authorId, + - channelId, + - userMentions, + - roleMentions, + - unban(), + - takeRole(), + - giveRole(), + - channelTyping(), + - createChannel(), + - removeChannel(), + - unpinMessage(), + - banWithReason(), + - kickWithReason(), + - removeRole(), + - createRole() +- Created status website +- Web version of *Bot Designer for Discord* has been moved to new address +- Fixed some issues in web version +- Fixed `$banID[]` +- Preparations for premium points + +
Previous Updates + +## November +- Added `$rolePosition[]` +- Released translation strings to volunteers +- Added `kick()` and `ban()` to JS +- Released new stable version +
+ +```admonish tip +If you want to access this changelog externally, we have a [JSON version](https://raw.githubusercontent.com/NilPointer-Software/bdfd-wiki/dev/external/CHANGELOG.json) of the changelog to which you can send a GET request and work with a JSON document further. +``` + +```admonish abstract title="Flowchart Changelog" +If you want to see the BDScript changelog, [click here](./FLOWCHART_CHANGELOG.md). +``` diff --git a/src/FLOWCHART_CHANGELOG.md b/src/FLOWCHART_CHANGELOG.md index ec7f5530ef3..4b974dce4cc 100644 --- a/src/FLOWCHART_CHANGELOG.md +++ b/src/FLOWCHART_CHANGELOG.md @@ -1,58 +1,73 @@ -# Changelog - -# 2024 - -## August -- Flowchart bot type was added to Bot Designer For Discord. -- Added `Entry point` -- Added `Add numbers` -- Added `Add response embed` -- Added `Add` -- Added `Ban` -- Added `Ceil number` -- Added `Create Boolean` -- Added `Create number` -- Added `Create snowflake` -- Added `Create text` -- Added `Current Date` -- Added `Delete global storage` -- Added `Divide numbers` -- Added `Equals` -- Added `Floor number` -- Added `Format date` -- Added `Format text` -- Added `Format text with multiple arguments` -- Added `Generate random Boolean` -- Added `Generate random number` -- Added `Generate random text` -- Added `Get command arg` -- Added `Get author` -- Added `Get channel ID` -- Added `Get gloval value` -- Added `Get guild ID` -- Added `Global storage contains key` -- Added `Greater` -- Added `Greater or equal` -- Added `If` -- Added `Is number` -- Added `Less` -- Added `Less or equal` -- Added `Multiply numbers` -- Added `Not` -- Added `Open direct message channel` -- Added `Or` -- Added `Parse number` -- Added `Parse timestamp` -- Added `Replace in text` -- Added `Round number` -- Added `Send message` -- Added `Set global data` -- Added `Set response message` -- Added `Subtract numbers` -- Added `To lowercase` -- Added `To text` -- Added `To uppercase` - -```admonish abstract title="BDScript Changelog" -If you want to see the BDScript changelog, [click here](./CHANGELOG.md). -``` +# Flowchart Changelog + + + +
+
+

2024

+

What new has been added?

+
+
+ +
+
+

August

+

Let's start from scratch now

+ NEW +
+
    +
  • Flowchart bot type was added to Bot Designer For Discord.
  • +
  • Added Entry point
  • +
  • Added Add numbers
  • +
  • Added Add response embed
  • +
  • Added Add
  • +
  • Added Ban
  • +
  • Added Ceil number
  • +
  • Added Create Boolean
  • +
  • Added Create number
  • +
  • Added Create snowflake
  • +
  • Added Create text
  • +
  • Added Current Date
  • +
  • Added Delete global storage
  • +
  • Added Divide numbers
  • +
  • Added Equals
  • +
  • Added Floor number
  • +
  • Added Format date
  • +
  • Added Format text
  • +
  • Added Format text with multiple arguments
  • +
  • Added Generate random Boolean
  • +
  • Added Generate random number
  • +
  • Added Generate random text
  • +
  • Added Get command arg
  • +
  • Added Get author
  • +
  • Added Get channel ID
  • +
  • Added Get gloval value
  • +
  • Added Get guild ID
  • +
  • Added Global storage contains key
  • +
  • Added Greater
  • +
  • Added Greater or equal
  • +
  • Added If
  • +
  • Added Is number
  • +
  • Added Less
  • +
  • Added Less or equal
  • +
  • Added Multiply numbers
  • +
  • Added Not
  • +
  • Added Open direct message channel
  • +
  • Added Or
  • +
  • Added Parse number
  • +
  • Added Parse timestamp
  • +
  • Added Replace in text
  • +
  • Added Round number
  • +
  • Added Send message
  • +
  • Added Set global data
  • +
  • Added Set response message
  • +
  • Added Subtract numbers
  • +
  • Added To lowercase
  • +
  • Added To text
  • +
  • Added To uppercase
  • +
+
+ +```admonish abstract title="BDScript Changelog" +If you want to see the BDScript changelog, [click here](./CHANGELOG.md). +``` diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 41a2f51e222..2c29524e058 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -1,6 +1,7 @@ # Summary -[Foreword](./foreword.md) +[Home](./foreword.md) +[Settings](./settings.md) [Changelog](./CHANGELOG.md) [Flowchart Changelog](./FLOWCHART_CHANGELOG.md) [Terms of Service](./terms.md) @@ -9,24 +10,21 @@ --- - [Guides]() - - [Introduction](./guides/introduction/aboutSection.md) + - [Introduction](./guides/introduction.md) - [Beginning](./guides/introduction/beginning.md) - - [Bot Status](./guides/introduction/botStatus.md) - [Commands Anatomy](./guides/introduction/commandsAnatomy.md) - - [Gateway Intents](./guides/introduction/gatewayIntents.md) + - [Bot Status](./guides/introduction/botStatus.md) - [Variables](./guides/introduction/variables.md) + - [Gateway Intents](./guides/introduction/gatewayIntents.md) - [General]() - [BDScript 2]() - [About BDScript 2](./guides/general/bds2/aboutBDScript2.md) - [Async Scopes](./guides/general/bds2/asyncScopes.md) - [Error Handling](./guides/general/bds2/errorHandling.md) - [Interactions]() - - [Buttons]() - - [About Buttons](./guides/general/interactions/buttons/aboutButtons.md) - - [Modals]() - - [About Modals](./guides/general/interactions/modals/aboutModals.md) - - [Select Menus]() - - [About Select Menu](./guides/general/interactions/selectMenus/aboutSelectMenu.md) + - [Buttons](./guides/general/interactions/buttons/aboutButtons.md) + - [Modals](./guides/general/interactions/modals/aboutModals.md) + - [Select Menus](./guides/general/interactions/selectMenus/aboutSelectMenu.md) - [Slash Commands]() - [About Slash Commands](./guides/general/interactions/slashCommands/aboutSlashCommands.md) - [Auto Complete](./guides/general/interactions/slashCommands/autoComplete.md) @@ -70,6 +68,8 @@ - [$addTextInput](./bdscript/addTextInput.md) - [$addTimestamp](./bdscript/addTimestamp.md) - [$addTimestamp[]](./bdscript/addTimestampComplex.md) + - [$afkChannelID](./bdscript/afkChannelID.md) + - [$afkTimeout](./bdscript/afkTimeout.md) - [$allMembersCount](./bdscript/allMembersCount.md) - [$allowMention](./bdscript/allowMention.md) - [$allowRoleMentions](./bdscript/allowRoleMentions.md) @@ -96,6 +96,7 @@ - [$blackListUsers](./bdscript/blackListUsers.md) - [$boostCount](./bdscript/boostCount.md) - [$boostCount[]](./bdscript/boostCountComplex.md) + - [$boostLevel](./bdscript/boostLevel.md) - [$botCommands](./bdscript/botCommands.md) - [$botID](./bdscript/botID.md) - [$botLeave](./bdscript/botLeave.md) @@ -105,6 +106,7 @@ - [$botNode](./bdscript/botNode.md) - [$botOwnerID](./bdscript/botOwnerID.md) - [$botTyping](./bdscript/botTyping.md) + - [$byteCount](./bdscript/byteCount.md) - [$c](./bdscript/c.md) - [$calculate](./bdscript/calculate.md) - [$catch](./bdscript/catch.md) @@ -139,6 +141,9 @@ - [$closeTicket](./bdscript/closeTicket.md) - [$color](./bdscript/color.md) - [$colorRole](./bdscript/colorRole.md) + - [$commandFolder](./bdscript/commandFolder.md) + - [$commandName](./bdscript/commandName.md) + - [$commandTrigger](./bdscript/commandTrigger.md) - [$commandsCount](./bdscript/commandsCount.md) - [$cooldown](./bdscript/cooldown.md) - [$createChannel](./bdscript/createChannel.md) @@ -179,6 +184,8 @@ - [$elseif](./bdscript/elseif.md) - [$embeddedURL](./bdscript/embeddedURL.md) - [$embedSuppressErrors](./bdscript/embedSuppressErrors.md) + - [$emojiExists](./bdscript/emojiExists.md) + - [$emojiName](./bdscript/emojiName.md) - [$emoteCount](./bdscript/emoteCount.md) - [$enabled](./bdscript/enabled.md) - [$enableDecimals](./bdscript/enableDecimals.md) @@ -209,6 +216,7 @@ - [$getServerInvite](./bdscript/getServerInvite.md) - [$getServerInvite[]](./bdscript/getServerInviteComplex.md) - [$getServerVar](./bdscript/getServerVar.md) + - [$getSlowmode](./bdscript/getSlowmode.md) - [$getTextSplitIndex](./bdscript/getTextSplitIndex.md) - [$getTextSplitLength](./bdscript/getTextSplitLength.md) - [$getTimestamp](./bdscript/getTimestamp.md) @@ -240,6 +248,7 @@ - [$isBoolean](./bdscript/isBoolean.md) - [$isBooster](./bdscript/isBooster.md) - [$isBot](./bdscript/isBot.md) + - [$isEmojiAnimated](./bdscript/isEmojiAnimated.md) - [$isHoisted](./bdscript/isHoisted.md) - [$isInteger](./bdscript/isInteger.md) - [$isMentionable](./bdscript/isMentionable.md) @@ -254,6 +263,8 @@ - [$kick](./bdscript/kick.md) - [$kick[]](./bdscript/kickComplex.md) - [$kickMention](./bdscript/kickMention.md) + - [$lastMessageID](./bdscript/lastMessageID.md) + - [$lastPinTimestamp](./bdscript/lastPinTimestamp.md) - [$lowestRole](./bdscript/lowestRole.md) - [$lowestRole[]](./bdscript/lowestRoleComplex.md) - [$lowestRoleWithPerms](./bdscript/lowestRoleWithPerms.md) @@ -352,6 +363,7 @@ - [$roleNames](./bdscript/roleNames.md) - [$rolePosition](./bdscript/rolePosition.md) - [$round](./bdscript/round.md) + - [$rulesChannelID](./bdscript/rulesChannelID.md) - [$scriptLanguage](./bdscript/scriptLanguage.md) - [$second](./bdscript/second.md) - [$sendEmbedMessage](./bdscript/sendEmbedMessage.md) @@ -386,16 +398,20 @@ - [$slowmode](./bdscript/slowmode.md) - [$sort](./bdscript/sort.md) - [$splitText](./bdscript/splitText.md) + - [$sqrt](./bdscript/sqrt.md) - [$startThread](./bdscript/startThread.md) - [$stop](./bdscript/stop.md) - [$sub](./bdscript/sub.md) - [$sum](./bdscript/sum.md) - [$suppressErrors](./bdscript/suppressErrors.md) - [$suppressErrors[]](./bdscript/suppressErrorsComplex.md) + - [$systemChannelID](./bdscript/systemChannelID.md) - [$takeRole](./bdscript/takeRole.md) - [$textSplit](./bdscript/textSplit.md) - [$threadAddMember](./bdscript/threadAddMember.md) + - [$threadMessageCount](./bdscript/threadMessageCount.md) - [$threadRemoveMember](./bdscript/threadRemoveMember.md) + - [$threadUserCount](./bdscript/threadUserCount.md) - [$thumbnail](./bdscript/thumbnail.md) - [$time](./bdscript/time.md) - [$timeout](./bdscript/timeout.md) @@ -439,6 +455,7 @@ - [$varExistError](./bdscript/varExistError.md) - [$varExists](./bdscript/varExists.md) - [$variablesCount](./bdscript/variablesCount.md) + - [$voiceUserLimit](./bdscript/voiceUserLimit.md) - [$year](./bdscript/year.md) - [Callbacks]() @@ -453,11 +470,12 @@ - [$onInteraction](./callbacks/onInteraction.md) - [$onInteraction[]](./callbacks/onInteractionComplex.md) -- [Flowchart]() +- [Flowcharts]() + - [Introduction](./flowchart/introduction.md) - [Add Response Embed](./flowchart/addResponseEmbed.md) - [Set Response Message](./flowchart/setResponseMessage.md) + - [To lowercase](./flowchart/toLowercase.md) - - [Premium]() - [Introduction](./premium/introduction.md) - [Callbacks]() @@ -469,9 +487,12 @@ - [$aiQuota](./premium/aiQuota.md) - [$awaitReactions](./premium/awaitReactions.md) - [$customImage](./premium/customImage.md) - - [$usedEmoji](./premium/usedEmoji.md) - [$ignoreTriggerCase](./premium/ignoreTriggerCase.md) + - [$log](./premium/log.md) + - [$logQuota](./premium/logQuota.md) - [$sendNotification](./premium/sendNotification.md) + - [$suppressErrorLogging](./premium/suppressErrorLogging.md) + - [$usedEmoji](./premium/usedEmoji.md) - [Features]() - [Awaited Reactions](./premium/awaitedReactions.md) - [Custom Images](./premium/customImages.md) diff --git a/src/bdscript/addButton.md b/src/bdscript/addButton.md index da5f9ec2cbc..10dcc106d76 100644 --- a/src/bdscript/addButton.md +++ b/src/bdscript/addButton.md @@ -8,18 +8,25 @@ $addButton[New row?;Interaction ID/URL;Label;Style;(Disable?;Emoji;Message ID)] ### Parameters - `New row?` `(Type: Bool || Flag: Required)`: If set to `yes`, the button will appear in a new row. If set to `no`, the button will appear in the same row as the previous button. - > A message can have a maximum of 25 buttons (5 rows of 5 buttons). + +```admonish warning title="Limit" +A message can have a maximum of 25 buttons (5 rows of 5 buttons). +``` + - `Interaction ID/URL` `(Type: String, URL || Flag: Required)`: Depending on the button type, you either set it to `Interaction ID` which is then used in `$onInteraction[ID]` callback or `URL` if it's a link button. + +```admonish warning +**1.** Interactive buttons can't have duplicated `ID`'s in the same message. So for example, you can't have two buttons with the ID set to `test`. + +**2.** If `URL` is used in the `Interaction ID/URL` argument, it **has to** start with `http://` or `https://`. +``` + - `Label` `(Type: String || Flag: Emptiable)`: The text value visible on the button. - `Style` `(Type: Enum || Flag: Required)`: It's used to specify the button's background color. If the button has a link/URL, you **have to** set the value to `link`. Check [this section](#button-style) for more details. - `Disable?` `(Type: Bool || Flag: Vacantable)`: If set to `yes`, the button can't be pressed. Defaults to `no`. - `Emoji` `(Type: Emoji || Flag: Vacantable)`: Adds an emoji inside the button. Emojis have to be either pasted as *unicode*, *alias* or be in the following format `<:emoji name:emoji ID>`. - `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Adds the button to the provided message ID. It's important to note that the provided message ID author **has to** be the bot. -> Interactive buttons can't have duplicated `ID`'s in the same message. So for example, you can't have two buttons with the ID set to `test`. - -> If `URL` is used in the `Interaction ID/URL` argument, it **has to** start with `http://` or `https://`. - ## Button Style Buttons can have different styles _(background colors)_. Here, are all possible values for the `style` function argument. @@ -84,7 +91,9 @@ Here, are all possible values for the `style` function argument. emoji: https://em-content.zobj.net/thumbs/120/mozilla/36/heavy-black-heart_2764.png ``` -> If `link` style is used, the button **won't send** any interactions! +```admonish failure +If `link` style is used, the button **won't send** any interactions! +``` ## Example ``` @@ -112,4 +121,6 @@ $addButton[no;test;Say hello!;primary;no;] label: Say hello! ``` -> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +```admonish info title="Read more" +For more information, read the the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +``` diff --git a/src/bdscript/addCmdReactions.md b/src/bdscript/addCmdReactions.md index ff09b6de14b..1b5d15b5caa 100644 --- a/src/bdscript/addCmdReactions.md +++ b/src/bdscript/addCmdReactions.md @@ -1,47 +1,50 @@ -# $addCmdReactions -Adds reactions to the message that triggered the command. - -## Syntax -``` -$addCmdReactions[Emojis;...] -``` - -### Parameters -- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) the bot reacts with. Use semicolons `;` as a separator to separate multiple emojis. - -> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. -> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ -> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. -> -> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ -> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) - -## Example -``` -$nomention -$addCmdReactions[$message] -``` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example ❤ī¸ - reactions: - - emoji: https://upload.wikimedia.org/wikipedia/commons/7/70/Symbolic_Love_Heart.png - count: 1 - reacted: false -``` -\ -### How to get emoji ID? - -> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! - -1. Type `\:TheEmojiName:` -2. Send the message. -3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:ID>`. If the emoji is animated, it should look like this: ``) -4. Input the emoji ID into `$addCmdReactions[]`. (e.g. `$addCmdReactions[<:hollyDab:828628880629825546>]`) - -![example](https://media.discordapp.net/attachments/609162277312266280/745309789491298415/My_Movie_0.gif) - -> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. +# $addCmdReactions +Adds reactions to the message that triggered the command. + +## Syntax +``` +$addCmdReactions[Emojis;...] +``` + +### Parameters +- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) the bot reacts with. Use semicolons `;` as a separator to separate multiple emojis. + +> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. +> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ +> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. +> +> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ +> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) + +## Example +``` +$nomention +$addCmdReactions[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example ❤ī¸ + reactions: + - emoji: https://upload.wikimedia.org/wikipedia/commons/7/70/Symbolic_Love_Heart.png + count: 1 + reacted: false +``` + +### How to get emoji ID? + +> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! + +1. Type `\:TheEmojiName:` +2. Send the message. +3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:emojiID>`. If the emoji is animated, it should look like this: ``) +4. Input the emoji ID into `$addCmdReactions[]`. Example: + +``` +$addCmdReactions[<:hollyDab:828628880629825546>] +``` + +> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. diff --git a/src/bdscript/addEmoji.md b/src/bdscript/addEmoji.md index cab67190044..7df47a9eaec 100644 --- a/src/bdscript/addEmoji.md +++ b/src/bdscript/addEmoji.md @@ -1,20 +1,43 @@ -# $addEmoji -Adds an emoji to the server. - -## Syntax -``` -$addEmoji[Name;Image URL;Return emoji?] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the new emoji. -- `Image URL` `(Type: URL || Flag: Required)`: The image of the new emoji. The link needs to be a valid image URL. -- `Return emoji?` `(Type: Bool || Flag: Required)`: Whether to show the emoji in the bot's message or not. (`yes`/`no`) - -## Example -``` -$nomention -$argsCheck[>2;Provide all needed arguments! Usage: `!add-emoji (imageURL) (emojiName)`] -Added new emoji: $addEmoji[$replaceText[$message;$message[1];;1];$message[1];yes] -``` -![example](https://user-images.githubusercontent.com/113303649/209926846-f957e945-64f8-4e05-b950-9dc20c683850.png) +# $addEmoji +Adds an emoji to the server. + +## Syntax +``` +$addEmoji[Name;Image URL;Return emoji?] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name of the new emoji. +- `Image URL` `(Type: URL || Flag: Required)`: The image of the new emoji. The link needs to be a valid image URL. +- `Return emoji?` `(Type: Bool || Flag: Required)`: Whether to show the emoji in the bot's message or not. + +## Example +``` +$nomention +Added new emoji: $addEmoji[$message[2];$message[1];yes] with `$message[2]` name. +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example https://media.discordapp.net/attachments/566370477967147018/1329787837733928981/emoji.png BDFDCompany + attachments: + - url: https://avatars.githubusercontent.com/u/63750675?s=100 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Added new emoji: with "BDFDCompany" name. +``` + +```admonish question title="What is this?" +How [`$message[]`](./messageComplex.md) works? +``` + +```admonish example +In this example we used fake image link. Remember: The link needs to be a valid image URL! +``` diff --git a/src/bdscript/addField.md b/src/bdscript/addField.md index 19bbeb16e00..62e4b8091f9 100644 --- a/src/bdscript/addField.md +++ b/src/bdscript/addField.md @@ -1,85 +1,91 @@ -# $addField -Adds a field to an embed. - -## Syntax -``` -$addField[Name;Value;(Inline?;Index)] -``` - -> 📌 You can add up to 25 fields per embed. - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the field. It cannot exceed more than 256 characters. -- `Value` `(Type: String || Flag: Required)`: The value of the field. It cannot exceed more than 1024 characters. -- `Inline?` `(Type: Bool || Flag: Optional)`: If `yes`, fields will appear in the same line. However, if you have more than 3 fields (or the fields are just too long) with inline enabled, the bot will return rows with 3 fields (2 if there is a thumbnail) in each row. It is set to `no` by default. -- `Index` `(Type: Integer || Flag: Optional)`: Adds the field to a specified embed index number. [(learn more)](../resources/embedIndexes.md) - -> 💡 Inline fields may not appear inline on some mobile devices. - -## Examples - -### Without inline fields -``` -$nomention -$addField[The field name 1!;The field value 1!] -$addField[The field name 2!;The field value 2!] -$addField[The field name 3!;The field value 3!] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - fields: - - name: The field name 1! - value: The field value 1! - - name: The field name 2! - value: The field value 2! - - name: The field name 3! - value: The field value 3! -``` -\ -### With inline fields -``` -$nomention -$addField[The field name 1!;The field value 1!;yes] -$addField[The field name 2!;The field value 2!;yes] -$addField[The field name 3!;The field value 3!;yes] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - fields: - - name: The field name 1! - value: The field value 1! - inline: true - inline_index: 1 - - name: The field name 2! - value: The field value 2! - inline: true - inline_index: 2 - - name: The field name 3! - value: The field value 3! - inline: true - inline_index: 3 -``` +# $addField +Adds a field to an embed. + +## Syntax +``` +$addField[Name;Value;(Inline?;Index)] +``` + +```admonish warning title="Limit" +You can add up to 25 fields per embed. +``` + + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name of the field. It cannot exceed more than 256 characters. +- `Value` `(Type: String || Flag: Required)`: The value of the field. It cannot exceed more than 1024 characters. +- `Inline?` `(Type: Bool || Flag: Optional)`: If `yes`, fields will appear in the same line. However, if you have more than 3 fields (or the fields are just too long) with inline enabled, the bot will return rows with 3 fields (2 if there is a thumbnail) in each row. It is set to `no` by default. +- `Index` `(Type: Integer || Flag: Optional)`: Adds the field to a specified embed index number. [(learn more)](../resources/embedIndexes.md) + +```admonish failure +Inline fields may not appear inline on some **mobile devices**. +``` + +## Example +``` +$nomention +$addField[The field name 1!;The field value 1!] +$addField[The field name 2!;The field value 2!] +$addField[The field name 3!;The field value 3!] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + fields: + - name: The field name 1! + value: The field value 1! + - name: The field name 2! + value: The field value 2! + - name: The field name 3! + value: The field value 3! +``` + +- With inline fields: + +``` +$nomention +$addField[The field name 1!;The field value 1!;yes] +$addField[The field name 2!;The field value 2!;yes] +$addField[The field name 3!;The field value 3!;yes] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + fields: + - name: The field name 1! + value: The field value 1! + inline: true + inline_index: 1 + - name: The field name 2! + value: The field value 2! + inline: true + inline_index: 2 + - name: The field name 3! + value: The field value 3! + inline: true + inline_index: 3 +``` diff --git a/src/bdscript/addMessageReactions.md b/src/bdscript/addMessageReactions.md index 26551d39663..6c186108435 100644 --- a/src/bdscript/addMessageReactions.md +++ b/src/bdscript/addMessageReactions.md @@ -1,42 +1,45 @@ -# $addMessageReactions -Adds reactions to the specified message. - -## Syntax -``` -$addMessageReactions[Channel ID;Message ID;Emojis;...] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to which the reactions will be added. -- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) to add as reaction to the message. Use semicolons `;` as a separator to separate multiple emojis. - -> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. -> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ -> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. -> -> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ -> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) - -## Example -``` -$nomention -$trimContent -$addMessageReactions[$channelID;$message[1];👍;✨;<:coolemoji:991742553340792882>] - -Successfully added the reactions to the message. -``` -![example1](https://user-images.githubusercontent.com/111157596/249183563-89753bae-aa63-4f42-8172-30975f468189.gif) - -## How to get emoji ID? - -> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! - -1. Type `\:TheEmojiName:` -2. Send the message. -3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:ID>`. If the emoji is animated, it should look like this: ``) -4. Input the emoji ID into `$addMessageReactions[]`. (e.g. `$addMessageReactions[$channelID;1123254137547653222;<:hollyDab:828628880629825546>]`) - -![example2](https://media.discordapp.net/attachments/609162277312266280/745309789491298415/My_Movie_0.gif) - -> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. +# $addMessageReactions +Adds reactions to the specified message. + +## Syntax +``` +$addMessageReactions[Channel ID;Message ID;Emojis;...] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to which the reactions will be added. +- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) to add as reaction to the message. Use semicolons `;` as a separator to separate multiple emojis. + +> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. +> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ +> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. +> +> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ +> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) + +## Example +``` +$nomention +$trimContent +$addMessageReactions[$channelID;$message[1];👍;✨;<:coolemoji:991742553340792882>] + +Successfully added the reactions to the message. +``` +![example1](https://user-images.githubusercontent.com/111157596/249183563-89753bae-aa63-4f42-8172-30975f468189.gif) + +## How to get emoji ID? + +> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! + +1. Type `\:TheEmojiName:` +2. Send the message. +3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:emojiID>`. If the emoji is animated, it should look like this: ``) +4. Input the emoji ID into `$addMessageReactions[]`. Example: + +``` +$addMessageReactions[$channelID;1123254137547653222;<:hollyDab:828628880629825546>] +``` + + +> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. diff --git a/src/bdscript/addReactions.md b/src/bdscript/addReactions.md index 761fd94a9be..0576d24687f 100644 --- a/src/bdscript/addReactions.md +++ b/src/bdscript/addReactions.md @@ -1,59 +1,61 @@ -# $addReactions -Adds reactions to the bot's response. - -## Syntax -``` -$addReactions[Emojis;...] -``` - -### Parameters -- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) the bot reacts with. Use semicolons `;` as a separator to separate multiple emojis. - -> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. -> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ -> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. -> -> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ -> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) - -## Example -``` -$nomention -Yes or No? -$addReactions[✅;:x:] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !reactions - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Yes or No? - reactions: - - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Twemoji12_2705.svg/640px-Twemoji12_2705.svg.png - name: ":white_check_mark:" - count: 1 - - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Twemoji2_274c.svg/640px-Twemoji2_274c.svg.png - name: ":x:" - count: 1 -``` -\ -### How to get emoji ID? - -> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! - -1. Type `\:TheEmojiName:` -2. Send the message. -3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:ID>`. If the emoji is animated, it should look like this: ``) -4. Input the emoji ID into `$addReactions[]`. (e.g. `$addReactions[<:hollyDab:828628880629825546>]`) - -![example](https://media.discordapp.net/attachments/609162277312266280/745309789491298415/My_Movie_0.gif) - -> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. +# $addReactions +Adds reactions to the bot's response. + +## Syntax +``` +$addReactions[Emojis;...] +``` + +### Parameters +- `Emojis` `(Type: Emoji || Flag: Required)`: The emoji(s) the bot reacts with. Use semicolons `;` as a separator to separate multiple emojis. + +> You can use **unicode emojis**, **emoji IDs**, and **emoji aliases**. +> > For **emoji aliases**, make sure to put `:` in front and at the end of the alias. \ +> > For **emoji IDs**, the bot must be present in the server that the emoji originates from. +> +> List of unicode emojis: [😋 Get Emoji](https://getemoji.com) \ +> List of supported emoji aliases: [Emoji Aliases](https://botdesignerdiscord.com/public/emoji_alias_list) + +## Example +``` +$nomention +Yes or No? +$addReactions[✅;:x:] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !reactions + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Yes or No? + reactions: + - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Twemoji12_2705.svg/640px-Twemoji12_2705.svg.png + name: ":white_check_mark:" + count: 1 + - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Twemoji2_274c.svg/640px-Twemoji2_274c.svg.png + name: ":x:" + count: 1 +``` +\ +### How to get emoji ID? + +> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! + +1. Type `\:TheEmojiName:` +2. Send the message. +3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:emojiID>`. If the emoji is animated, it should look like this: ``) +4. Input the emoji ID into `$addReactions[]`. Example: + +``` +$addReactions[<:hollyDab:828628880629825546>] +``` + +> If you're still having issues, check the [Troubleshooting](../resources/troubleshooting.md#the-bot-fails-to-add-reactions) page. diff --git a/src/bdscript/addTimestamp.md b/src/bdscript/addTimestamp.md index ad7c373de43..a751ee3f35e 100644 --- a/src/bdscript/addTimestamp.md +++ b/src/bdscript/addTimestamp.md @@ -1,16 +1,38 @@ -# $addTimestamp -Adds a timestamp to an embed. - -## Syntax -``` -$addTimestamp -``` - -## Example -``` -$nomention -$description[Hi!] -$footer[That is the timestamp =>] -$addTimestamp -``` -![example](https://user-images.githubusercontent.com/113303649/209937294-5cf68498-dcb9-4dcc-88b9-4da824f86e3e.png) \ No newline at end of file +# $addTimestamp +Adds a timestamp to an embed. + +## Syntax +``` +$addTimestamp +``` + +## Example +``` +$nomention +$footer[That is the timestamp =>] +$addTimestamp +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + footer: + text: It's a timestamp => Today at 00:00 +``` + +```admonish question title="What is this?" +How [`$footer[]`](./footer.md) works? +``` + +```admonish note +[`$footer[]`](./footer.md) is not required to use with `$addTimestamp`. +``` diff --git a/src/bdscript/addTimestampComplex.md b/src/bdscript/addTimestampComplex.md index c0fcb41b9cc..403c712d08d 100644 --- a/src/bdscript/addTimestampComplex.md +++ b/src/bdscript/addTimestampComplex.md @@ -1,20 +1,46 @@ -# $addTimestamp[] -Adds a timestamp to a specific embed. - -## Syntax -``` -$addTimestamp[Index] -``` - -### Parameters -- `Index` `(Type: Integer || Flag: Optional)`: To which embed the timestamp should be added to. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$description[Hi!] -$description[Timestamp!;2] -$footer[That is the timestamp =>;2] -$addTimestamp[2] -``` -![example](https://user-images.githubusercontent.com/113303649/211189667-92fc90ff-0cca-4963-a649-8b39508d0968.png) +# $addTimestamp[] +Adds a timestamp to a specific embed. + +## Syntax +``` +$addTimestamp[Index] +``` + +### Parameters +- `Index` `(Type: Integer || Flag: Optional)`: To which embed the timestamp should be added to. [(Learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$description[Hello world!] +$description[Embed with timestamp.;2] +$footer[It's a timestamp =>;2] +$addTimestamp[2] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + description: Hello world! + embeds: + - description: Embed with timestamp. + footer: + text: It's a timestamp => Today at 00:00 +``` + +```admonish question title="What is this?" +How [`$description[]`](./description.md) and [`$footer[]`](./footer.md) works? +``` + +```admonish note +[`$footer[]`](./footer.md) and [`$description[]`](./description.md) are not required to use with `$addTimestamp[]`. +``` diff --git a/src/bdscript/afkChannelID.md b/src/bdscript/afkChannelID.md new file mode 100644 index 00000000000..9425dd4bbc9 --- /dev/null +++ b/src/bdscript/afkChannelID.md @@ -0,0 +1,79 @@ +# $afkChannelID +Returns the servers AFK channel ID (**returns an error if there isn't such a channel**). + +```admonish info title="What is this?" +An AFK channel on Discord is a voice channel where inactive users are automatically moved after being idle for a set time (Can be returned via [`$afkTimeout`](./afkTimeout.md)). It keeps active channels clear of idle users. +``` + +## Syntax +``` +$afkChannelID +``` + +## Example +``` +$nomention +AFK channel ID: $afkChannelID +``` + +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + AFK channel ID: 567428769766440962 +``` + +~~~admonish tip title="How to stop the error message?" +The `$afkChannelID` function as said in above returns an error if there isn't any AFK channel set on the server and there is a way to stop that. +``` +$nomention +$try + AFK channel ID: $afkChannelID +$catch + No AFK channel found! +$endtry +``` + +- Without try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Function $afkChannelID at 3:31 returned an error: No AFK channel set in this server! +``` + +- With try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + No AFK channel found! +``` + +> For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). + +~~~ diff --git a/src/bdscript/afkTimeout.md b/src/bdscript/afkTimeout.md new file mode 100644 index 00000000000..ff34d9fb645 --- /dev/null +++ b/src/bdscript/afkTimeout.md @@ -0,0 +1,39 @@ +# $afkTimeout +Returns the AFK time-out (In Seconds) for a provided guild. + +```admonish info title="Time-out" +Discord automatically moves member to the specified (in the Server Settings / Can be returned via [`$afkChannelID`](./afkChannelID)) voice channel and mute them when they have been idle for longer then the inactive time-out ("inactive time-out" can be returned via `$afkTimeout[]` function). +``` + +## Syntax +``` +$afkTimeout[(Guild ID)] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to get the AFK time-out. + +## Example +``` +$nomention +AFK Time-out: $afkTimeout[$guildID] seconds +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + AFK Time-out: 300 seconds +``` + +```admonish question title="What is this?" +How [`$guildID`](./guildID.md) works? +``` diff --git a/src/bdscript/allMembersCount.md b/src/bdscript/allMembersCount.md index f31183384b0..55669f0e4e1 100644 --- a/src/bdscript/allMembersCount.md +++ b/src/bdscript/allMembersCount.md @@ -1,28 +1,32 @@ -# $allMembersCount -Returns the total number of users from every server the bot is in. - -## Syntax -``` -$allMembersCount -``` - -## Example -``` -$nomention -I'm serving $allMembersCount users! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - I'm serving 8560 users! -``` +# $allMembersCount +Returns the total number of users from every server the bot is in. + +```admonish failure +You can’t display the member count in the bot’s status with `$allMembersCount`. Use the [`$membersCount`](./membersCount.md) function instead! +``` + +## Syntax +``` +$allMembersCount +``` + +## Example +``` +$nomention +I'm serving $allMembersCount users! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I'm serving 20560 users! +``` diff --git a/src/bdscript/allowMention.md b/src/bdscript/allowMention.md index 3dea6879129..ceb451eabf9 100644 --- a/src/bdscript/allowMention.md +++ b/src/bdscript/allowMention.md @@ -1,46 +1,50 @@ -# $allowMention -Disables replacing mentions in `$message` with text. - -## Syntax -``` -$allowMention -``` - -## Example -``` -$nomention -$allowMention -$message -``` - -### With `$allowMention`: -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@RainbowKey> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - <@RainbowKey> -``` -\ -### Without `$allowMention` -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@RainbowKey> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - @RainbowKey -``` +# $allowMention +Disables replacing mentions in `$message` with text. + +## Syntax +``` +$allowMention +``` + +## Example +``` +$nomention +$allowMention +$message +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@RainbowKey> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@RainbowKey> +``` + +- Without `$allowMention`: + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@RainbowKey> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + @RainbowKey +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/allowRoleMentions.md b/src/bdscript/allowRoleMentions.md index 6bae01f3ba9..b7055f1a3c6 100644 --- a/src/bdscript/allowRoleMentions.md +++ b/src/bdscript/allowRoleMentions.md @@ -1,34 +1,34 @@ -# $allowRoleMentions -Enables role pings only for the provided role IDs, while the roles not provided will be "fake pinged" *(the role will be pinged, but users will not be notified)*. - -## Syntax -``` -$allowRoleMentions[Role IDs;...] -``` - -### Parameters -- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role(s) that can be pinged, leave empty to disable pings for every role. Separate role IDs using `;`. - -## Example -``` -$nomention -$allowRoleMentions[] -I'm pinging <@&858376972303204362>, but no one got notified; wow! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - roles: - Extremely Cool Role: "#FFD700" - content: | - I'm pinging <@Extremely Cool Role>, but no one got notified; wow! -``` +# $allowRoleMentions +Enables role pings only for the provided role IDs, while the roles not provided will be "fake pinged" *(the role will be pinged, but users will not be notified)*. + +## Syntax +``` +$allowRoleMentions[Role IDs;...] +``` + +### Parameters +- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role(s) that can be pinged, leave empty to disable pings for every role. Separate role IDs using `;`. + +## Example +``` +$nomention +$allowRoleMentions[] +I'm pinging <@&858376972303204362>, but no one got notified; wow! +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + roles: + Extremely Cool Role: "#FFD700" + content: | + I'm pinging <@Extremely Cool Role>, but no one got notified; wow! +``` diff --git a/src/bdscript/allowUserMentions.md b/src/bdscript/allowUserMentions.md index 75a8e16ae1a..870c48a7c97 100644 --- a/src/bdscript/allowUserMentions.md +++ b/src/bdscript/allowUserMentions.md @@ -1,32 +1,32 @@ -# $allowUserMentions -Enables user pings only for the provided user IDs, while the user not provided will be "fake pinged" *(the user will be pinged, but user will not be notified)*. - -## Syntax -``` -$allowUserMentions[User IDs;...] -``` - -### Parameters -- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The user(s) that can be pinged, leave empty to disable pings for every user. Separate user IDs using `;`. - -## Example -``` -$nomention -$allowUserMentions[] -Hi <@696368083517964288>! I mentioned you, but you didn't get pinged. -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi <@Spen>! I mentioned you, but you didn't get pinged. -``` +# $allowUserMentions +Enables user pings only for the provided user IDs, while the user not provided will be "fake pinged" *(the user will be pinged, but user will not be notified)*. + +## Syntax +``` +$allowUserMentions[User IDs;...] +``` + +### Parameters +- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The user(s) that can be pinged, leave empty to disable pings for every user. Separate user IDs using `;`. + +## Example +``` +$nomention +$allowUserMentions[] +Hi <@696368083517964288>! I mentioned you, but you didn't get pinged. +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi <@Spen>! I mentioned you, but you didn't get pinged. +``` diff --git a/src/bdscript/alternativeParsing.md b/src/bdscript/alternativeParsing.md index 790181df258..c99e82a0274 100644 --- a/src/bdscript/alternativeParsing.md +++ b/src/bdscript/alternativeParsing.md @@ -1,91 +1,103 @@ -# $alternativeParsing -Changes the way how triggers are read. - -## Syntax -``` -$alternativeParsing -``` -> This function was added at the end of 2019 as an experiment, and it can be unstable and break your commands. You should not use `$alternativeParsing` when making your bot. - -## Example -1. Create two commands and set the trigger `hello` for one command and `helloworld` for the other. -2. Add the `$alternativeParsing` function to the command code with the `hello` trigger. - - Code with trigger `hello`: - ``` - $nomention - $alternativeParsing - $description["hello"] - ``` - Code with trigger `helloworld`: - ``` - $nomention - $description["helloworld"] - ``` -3. Execute commands. - ### With `$alternativeParsing` - ``` discord yaml - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - hello - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - description: "\"hello\"" - - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - helloworld - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - description: "\"helloworld\"" - ``` - \ - ### Without `$alternativeParsing` - ``` discord yaml - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - hello - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - description: "\"hello\"" - - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - helloworld - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embeds: - - description: "\"helloworld\"" - - description: "\"hello\"" - ``` +# $alternativeParsing +
+ Dangerous + Experiment +
+ + + +Changes the way how triggers are read. + +## Syntax +``` +$alternativeParsing +``` +> This function was added at the end of 2019 as an experiment, and it can be unstable and break your commands. You should not use `$alternativeParsing` when making your bot. + +## Example +1. Create two commands and set the trigger `hello` for one command and `helloworld` for the other. +2. Add the `$alternativeParsing` function to the command code with the `hello` trigger. + + Code with trigger `hello`: + ``` + $nomention + $alternativeParsing + $description["hello"] + ``` + Code with trigger `helloworld`: + ``` + $nomention + $description["helloworld"] + ``` +3. Execute commands. + ``` discord yaml + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + hello + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + description: "\"hello\"" + + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + helloworld + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + description: "\"helloworld\"" + ``` + + - Without `$alternativeParsing`: + + ``` discord yaml + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + hello + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + description: "\"hello\"" + + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + helloworld + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embeds: + - description: "\"helloworld\"" + - description: "\"hello\"" + ``` diff --git a/src/bdscript/and.md b/src/bdscript/and.md index 863e7350800..5ea94343314 100644 --- a/src/bdscript/and.md +++ b/src/bdscript/and.md @@ -1,84 +1,90 @@ -# $and -Returns `true` if every provided condition is true, otherwise `false` is returned. - -## Syntax -``` -$and[Conditions;...] -``` - -### Parameters -- `Conditions` `(Type: String || Flag: Required)`: Checks that will be carried out. All conditions must be true for this function to return `true`. Separate conditions using `;`. - -### Signs -`==` - Equal - -`!=` - Not Equal - -`<` - Less Than - -`>` - Greater Than - -`>=` - Greater Than Or Equal To - -`<=` - Less Than Or Equal To -- These signs could vary in meaning based on the order or intent of the if statement. -- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. - -## Example -``` -$nomention -$and[$nickname==MineBartekSA;$message==Update] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - true - ``` - -> For more info, see the [If Guide](../guides/ifStatements.md). +# $and +Returns `true` if every provided condition is true, otherwise `false` is returned. + +## Syntax +``` +$and[Conditions;...] +``` + +### Parameters +- `Conditions` `(Type: String || Flag: Required)`: Checks that will be carried out. All conditions must be true for this function to return `true`. Separate conditions using `;`. + +### Signs +`==` - Equal + +`!=` - Not Equal + +`<` - Less Than + +`>` - Greater Than + +`>=` - Greater Than Or Equal To + +`<=` - Less Than Or Equal To +- These signs could vary in meaning based on the order or intent of the if statement. +- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. + +## Example +``` +$nomention +$and[$nickname==MineBartekSA;$message==Update] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) and [`$nickname`](./nickname.md) works? +``` + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/argCount.md b/src/bdscript/argCount.md index ab03977fd99..e1bd7563230 100644 --- a/src/bdscript/argCount.md +++ b/src/bdscript/argCount.md @@ -1,30 +1,47 @@ -# $argCount -Returns how many words (aka arguments/args) are in the provided text. - -## Syntax -``` -$argCount[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to get the word count for. - -## Example -``` -$nomention -Word count: $argCount[$message] -``` -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hello noit! -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Word count: 2 -``` +# $argCount +Returns how many words (aka arguments/args) are in the provided text. + +## Syntax +``` +$argCount[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to get the word count for. + +## Example +``` +$nomention +Word count: $argCount[$message] +``` +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello noit! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Word count: 2 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $argCount[] +
+
+

Output:

+ Word count: 1 +
+
diff --git a/src/bdscript/argsCheck.md b/src/bdscript/argsCheck.md index 9089bf8d248..038bb8644f2 100644 --- a/src/bdscript/argsCheck.md +++ b/src/bdscript/argsCheck.md @@ -1,47 +1,47 @@ -# $argsCheck -When this function is used, the command can only be executed if the user’s message contains a certain amount of arguments (words). - -## Syntax -``` -$argsCheck[How many?;Error message] -``` - -### Parameters -- `How many?` `(Type: HowMany || Flag: Required)`: How many arguments there should be in the user’s message. - > If you want users to have **3 or more arguments** in their message, you can use `>3`. If you want users to have **less than 3 arguments** in their message, you can use `<3`. If you want the users to have **exactly 3 arguments** in their message, put `3`. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that the bot will send if the user has too many/few arguments. - -## Example -``` -$nomention -$argsCheck[>1;❌ Please provide something for me to say!] -$message -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ Please provide something for me to say! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hello World! -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello World! -``` - +# $argsCheck +When this function is used, the command can only be executed if the user’s message contains a certain amount of arguments (words). + +## Syntax +``` +$argsCheck[How many?;Error message] +``` + +### Parameters +- `How many?` `(Type: HowMany || Flag: Required)`: How many arguments there should be in the user’s message. + > If you want users to have **3 or more arguments** in their message, you can use `>3`. If you want users to have **less than 3 arguments** in their message, you can use `<3`. If you want the users to have **exactly 3 arguments** in their message, put `3`. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that the bot will send if the user has too many/few arguments. + +## Example +``` +$nomention +$argsCheck[>1;❌ Please provide something for me to say!] +$message +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Please provide something for me to say! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello World! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello World! +``` + diff --git a/src/bdscript/author.md b/src/bdscript/author.md index d5650a0e3db..a955ea81779 100644 --- a/src/bdscript/author.md +++ b/src/bdscript/author.md @@ -1,33 +1,33 @@ -# $author -Adds author text to an embed. - -## Syntax -``` -$author[Text;(Index)] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text that appears in the author text. It cannot exceed more than 256 characters. -- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author text will be added. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$author[This is the author text!] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !author - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - embed: - author: - text: This is the author text! -``` +# $author +Adds author text to an embed. + +## Syntax +``` +$author[Text;(Index)] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text that appears in the author text. It cannot exceed more than 256 characters. +- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author text will be added. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$author[This is the author text!] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !author + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + embed: + author: + text: This is the author text! +``` diff --git a/src/bdscript/authorAvatar.md b/src/bdscript/authorAvatar.md index b22819e4483..c478dd50971 100644 --- a/src/bdscript/authorAvatar.md +++ b/src/bdscript/authorAvatar.md @@ -1,34 +1,33 @@ -# $authorAvatar -Returns the author's avatar URL. - -## Syntax -``` -$authorAvatar -``` - -## Example -``` -$nomention -$image[$authorAvatar] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !authorAvatar - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - image: https://user-images.githubusercontent.com/111157596/257052136-4b8d5715-b381-4d5f-8c46-8ae0be53c8d8.png -``` - - -> You can use `?size=size` at the end of the avatar URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. -> -> (e.g. `$image[$authorAvatar?size=4096]`) +# $authorAvatar +Returns the author's avatar URL. + +## Syntax +``` +$authorAvatar +``` + +## Example +``` +$nomention +$image[$authorAvatar] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + image: https://user-images.githubusercontent.com/111157596/257052136-4b8d5715-b381-4d5f-8c46-8ae0be53c8d8.png +``` + +```admonish tip title="Image size" +You can use `?size=size` at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. +(e.g. `$image[$authorAvatar?size=4096]`) +``` diff --git a/src/bdscript/authorID.md b/src/bdscript/authorID.md index c6995e74e00..b03dd99518f 100644 --- a/src/bdscript/authorID.md +++ b/src/bdscript/authorID.md @@ -11,13 +11,13 @@ $authorID $nomention This command was executed by <@$authorID>! ``` + ``` discord yaml - user_id: 729343563401265193 username: Nicky color: "#EE7908" content: | !example - - user_id: 566613317972394004 username: Wiki Bot color: "#748BD4" @@ -27,3 +27,7 @@ This command was executed by <@$authorID>! content: | This command was executed by <@Nicky>! ``` + +```admonish note +You can disable mention with the [`$allowUserMentions[]`](./allowUserMentions.md) function. +``` diff --git a/src/bdscript/authorIcon.md b/src/bdscript/authorIcon.md index c339ad73365..ef761125175 100644 --- a/src/bdscript/authorIcon.md +++ b/src/bdscript/authorIcon.md @@ -1,38 +1,44 @@ -# $authorIcon -Adds an icon to the author section in the embed. - -## Syntax -``` -$authorIcon[Image URL;(Index)] -``` - -> `$authorIcon[]` will not work if there is no text provided in [`$author[]`](./author.md). - -### Parameters -- `Image URL` `(Type: URL || Flag: Emptiable)`: The image for the author icon. This must be a valid image URL. -- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author icon will be added. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$authorIcon[$authorAvatar] -$author[âŦ…ī¸ That is the author icon. This is the author text.] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - author: - text: âŦ…ī¸ That is the author icon. This is the author text. - image: https://user-images.githubusercontent.com/111157596/257052136-4b8d5715-b381-4d5f-8c46-8ae0be53c8d8.png -``` +# $authorIcon +Adds an icon to the author section in the embed. + +## Syntax +``` +$authorIcon[Image URL;(Index)] +``` + +```admonish failure +`$authorIcon[]` will not work if there is no text provided in [`$author[]`](./author.md). +``` + +### Parameters +- `Image URL` `(Type: URL || Flag: Emptiable)`: The image for the author icon. This must be a valid image URL. +- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author icon will be added. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$authorIcon[$authorAvatar] +$author[âŦ…ī¸ That is the author icon. This is the author text.] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + author: + text: âŦ…ī¸ That is the author icon. This is the author text. + image: https://user-images.githubusercontent.com/111157596/257052136-4b8d5715-b381-4d5f-8c46-8ae0be53c8d8.png +``` + +```admonish question title="What is this?" +How [`$authorAvatar`](./authorAvatar.md) works? +``` diff --git a/src/bdscript/authorOfMessage.md b/src/bdscript/authorOfMessage.md index 9d6ac92036f..d329659be3f 100644 --- a/src/bdscript/authorOfMessage.md +++ b/src/bdscript/authorOfMessage.md @@ -1,40 +1,43 @@ -# $authorOfMessage -Returns the ID of the provided message's author. - -## Syntax -``` -$authorOfMessage[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message for which the author ID will be returned. - -> [How to get the Message/Channel ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) - -## Example -``` -$nomention -Author of message: $username[$authorOfMessage[$message[1];$message[2]]] -``` - -``` discord yaml -- user_id: 863865579483037726 - username: Kemi - color: "#000000" - content: | - Message ID: 1135158746369245314 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 566370477967147018 1135158746369245314 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Author of message: Kemi -``` - +# $authorOfMessage +Returns the ID of the provided message's author. + +## Syntax +``` +$authorOfMessage[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message for which the author ID will be returned. + +> [How to get the Message/Channel ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) + +## Example +``` +$nomention +Author of message: $username[$authorOfMessage[$message[1];$message[2]]] +``` + +``` discord yaml +- user_id: 863865579483037726 + username: Kemi + color: "#000000" + content: | + Message ID: 1135158746369245314 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566370477967147018 1135158746369245314 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Author of message: Kemi +``` + +```admonish question title="What is this?" +How [`$username`](./username.md) and [`$message[]`](./messageComplex.md) works? +``` diff --git a/src/bdscript/authorURL.md b/src/bdscript/authorURL.md index 091f33ae0c4..ebaa3b8f371 100644 --- a/src/bdscript/authorURL.md +++ b/src/bdscript/authorURL.md @@ -1,37 +1,40 @@ -# $authorURL -Adds a hyperlink to the author text. - -## Syntax -``` -$authorURL[URL;(Index)] -``` -> `$authorURL[]` will not work if there is no text provided in [`$author[]`](./author.md). - -### Parameters -- `URL` `(Type: URL || Flag: Emptiable)`: The link to set as the author hyperlink. -- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author URL will be added. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$author[Click me to visit the BDFD website!] -$authorURL[https://botdesignerdiscord.com] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - author: - text: Click me to visit the BDFD website! - url: https://botdesignerdiscord.com -``` +# $authorURL +Adds a hyperlink to the author text. + +## Syntax +``` +$authorURL[URL;(Index)] +``` + +```admonish failure +`$authorURL[]` will not work if there is no text provided in [`$author[]`](./author.md). +``` + +### Parameters +- `URL` `(Type: URL || Flag: Emptiable)`: The link to set as the author hyperlink. +- `Index` `(Type: Integer || Flag: Optional)`: To which embed the author URL will be added. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$author[Click me to visit the BDFD web app] +$authorURL[https://app.botdesignerdiscord.com/] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + author: + text: Click me to visit the BDFD web app + url: https://app.botdesignerdiscord.com/ +``` diff --git a/src/bdscript/awaitFunc.md b/src/bdscript/awaitFunc.md index d84a84bc39f..acc2762861d 100644 --- a/src/bdscript/awaitFunc.md +++ b/src/bdscript/awaitFunc.md @@ -1,51 +1,50 @@ -# $awaitFunc -Used to initiate an awaited command. - -## Syntax -``` -$awaitFunc[Name;(User ID;Channel ID)] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name used inside the [`$awaitedCommand[]`](../callbacks/awaitedCommand.md) and [`$awaitedCommandError[]`](../callbacks/awaitedCommandError.md) callbacks. -- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user the awaited command will trigger for. Uses command author, if `User ID` is not present. -- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel where the command will be awaited. Uses current channel, if `Channel ID` is not present. - -## Example -``` -$nomention -What do you want me to say? -$awaitFunc[say] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !say - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - What do you want me to say? - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - I love BDFD! - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - I love BDFD! -``` - - -> For more info, see the [Awaited Commands Guide](../guides/general/awaitedCommands.md). +# $awaitFunc +Used to initiate an awaited command. + +## Syntax +``` +$awaitFunc[Name;(User ID;Channel ID)] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name used inside the [`$awaitedCommand[]`](../callbacks/awaitedCommand.md) and [`$awaitedCommandError[]`](../callbacks/awaitedCommandError.md) callbacks. +- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user the awaited command will trigger for. Uses command author, if `User ID` is not present. +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel where the command will be awaited. Uses current channel, if `Channel ID` is not present. + +## Example +``` +$nomention +What do you want me to say? +$awaitFunc[say] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + What do you want me to say? +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + I love BDFD! +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + I love BDFD! +``` + +```admonish info title="Read more" +For more information, read the the [Awaited Commands Guide](../guides/general/awaitedCommands.md). +``` diff --git a/src/bdscript/ban.md b/src/bdscript/ban.md index 17de0a6875a..242b0a2a1fa 100644 --- a/src/bdscript/ban.md +++ b/src/bdscript/ban.md @@ -1,32 +1,36 @@ -# $ban -Bans the mentioned user. - -## Syntax -``` -$ban -``` - -## Example -``` -$nomention -$ban -<@$mentioned[1]> was banned! -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@Spen> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - <@Spen> was banned! -- content: | - Spen left without pizza. - type: leave -``` +# $ban +Bans the mentioned user without reason. + +## Syntax +``` +$ban +``` + +## Example +``` +$nomention +$ban +<@$mentioned[1]> was banned! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@Spen> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@Spen> was banned! +- content: | + Spen left without pizza. + type: leave +``` + +```admonish question title="What is this?" +How [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/banComplex.md b/src/bdscript/banComplex.md index d57df7f8155..d3068333e56 100644 --- a/src/bdscript/banComplex.md +++ b/src/bdscript/banComplex.md @@ -1,35 +1,43 @@ -# $ban[] -Bans the mentioned user with a reason. - -## Syntax -``` -$ban[Reason] -``` - -### Parameters -- `Reason` `(Type: String || Flag: Emptiable)`: The reason for the ban, which will be saved in the audit-log. - -## Example -``` -$nomention -$ban[$noMentionMessage] -<@$mentioned[1]> was banned! -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@Spen> Too cute -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - <@Spen> was banned! -- content: | - Spen left without pizza. - type: leave -``` +# $ban[] +Bans the mentioned user with a reason. + +## Syntax +``` +$ban[Reason] +``` + +### Parameters +- `Reason` `(Type: String || Flag: Emptiable)`: The reason for the ban, which will be saved in the audit-log. Reason must not exceed more than 512 characters. + +```admonish tip +Use [`$getBanReason[]`](./getBanReason.md) to get the ban reason. +``` + +## Example +``` +$nomention +$ban[$noMentionMessage] +<@$mentioned[1]> was banned! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@Spen> Too cute +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@Spen> was banned! +- content: | + Spen left without pizza. + type: leave +``` + +```admonish question title="What is this?" +How [`$noMentionMessage`](./noMentionMessage.md) and [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/banID.md b/src/bdscript/banID.md index e0aae5588f1..796a957f999 100644 --- a/src/bdscript/banID.md +++ b/src/bdscript/banID.md @@ -1,36 +1,37 @@ -# $banID -Bans a user using their ID without reason. -The user ID will be taken from the last part of the author's message. - -## Syntax -``` -$banID -``` - -## Example -``` -$nomention -$onlyPerms[ban;You need the `ban` permission to use that command!] -<@$findUser[$message;no]> was banned! -$banID -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 854665455527526421 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - <@Chilli> was banned! -- content: | - Chilli left without pizza. - type: leave -``` - -> [How `$findUser[]` works?](./findUser.md) +# $banID +Bans a user using their ID without reason. +The user ID will be taken from the last part of the author's message. + +## Syntax +``` +$banID +``` + +## Example +``` +$nomention +<@$findUser[$message;no]> was banned! +$banID +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 854665455527526421 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@Chilli> was banned! +- content: | + Chilli left without pizza. + type: leave +``` + +```admonish question title="What is this?" +How [`$findUser[]`](./findUser.md) and [`$message`](./message.md) works? +``` diff --git a/src/bdscript/banIDComplex.md b/src/bdscript/banIDComplex.md index ea37a204988..cb7291804b1 100644 --- a/src/bdscript/banIDComplex.md +++ b/src/bdscript/banIDComplex.md @@ -1,42 +1,45 @@ -# $banID[] -Bans a user using their ID. - -## Syntax -``` -$banID[Reason;(User ID)] -``` - -### Parameters -- `Reason` `(Type: String || Flag: Emptiable)`: The reason for the ban, which will be saved in the audit-log. - > Use [`$getBanReason[]`](./getBanReason.md) to get the ban reason. -- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user to ban. If empty, the ID will be taken from the last part of the author's message. - -## Example -``` -$nomention -$onlyAdmin[You need the `admim` permission to use that command!] -$argsCheck[>1;Please provide a `user`. Syntax: `!ban (user) `] -$onlyIf[$findUser[$message[1];no]!=;Failed to find user!] -<@$findUser[$message;no]> was banned! -$banID[$replaceText[$message;$message[1];;1];$findUser[$message[1];no]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 854665455527526421 Hello! -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - <@Chilli> was banned! -- content: | - Chilli left without pizza. - type: leave -``` - -> [How `$findUser[]` works?](./findUser.md) +# $banID[] +Bans a user using their ID. + +## Syntax +``` +$banID[Reason;(User ID)] +``` + +### Parameters +- `Reason` `(Type: String || Flag: Emptiable)`: The reason for the ban, which will be saved in the audit-log. Reason must not exceed more than 512 characters. + +```admonish tip +Use [`$getBanReason[]`](./getBanReason.md) to get the ban reason. +``` + +- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user to ban. If empty, the ID will be taken from the last part of the author's message. + +## Example +``` +$nomention +<@$mentioned[1]> was banned! +$banID[$noMentionMessage;$mentioned[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 854665455527526421 Hello! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@Chilli> was banned! +- content: | + Chilli left without pizza. + type: leave +``` + +```admonish question title="What is this?" +How [`$mentioned[]`](./mentioned.md) and [`$noMentionMessage`](./noMentionMessage.md) works? +``` diff --git a/src/bdscript/blackListIDs.md b/src/bdscript/blackListIDs.md index 424174043ce..45c1cab1063 100644 --- a/src/bdscript/blackListIDs.md +++ b/src/bdscript/blackListIDs.md @@ -1,46 +1,50 @@ -# $blackListIDs -Blocks certain users from using the command. - -## Syntax -``` -$blackListIDs[User IDs;...;Error message] -``` - -### Parameters -- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The user(s) to blacklist from using the command. Use semicolons `;` as a separator to separate multiple user IDs. - > [How to get user ID?](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) -- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent when the user running the command is blacklisted. - -## Example -``` -$nomention -$blackListIDs[566613317972394004;437154602626973697;❌ You can't use this command!] -Pong! $ping ms -``` - -```discord yaml -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ You can't use this command! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 1 ms -``` +# $blackListIDs +Blocks certain users from using the command. + +## Syntax +``` +$blackListIDs[User IDs;...;Error message] +``` + +### Parameters +- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The user(s) to blacklist from using the command. Use semicolons `;` as a separator to separate multiple user IDs. + > [How to get user ID?](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) +- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent when the user running the command is blacklisted. + +## Example +``` +$nomention +$blackListIDs[566613317972394004;437154602626973697;❌ You can't use this command!] +Pong! $ping ms +``` + +```discord yaml +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ You can't use this command! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 1 ms +``` + +```admonish question title="What is this?" +How [`$ping`](./ping.md) works? +``` diff --git a/src/bdscript/blackListRoles.md b/src/bdscript/blackListRoles.md index 5d43660b684..943240a7c6f 100644 --- a/src/bdscript/blackListRoles.md +++ b/src/bdscript/blackListRoles.md @@ -1,50 +1,54 @@ -# $blackListRoles -Blocks users with certain role(s) from using the command. If the user has any role in the blacklist, they will not be able to run the command. Uses role names instead of role IDs. - -## Syntax -``` -$blackListRoles[Role names;...;Error message] -``` - -### Parameters -- `Role names` `(Type: String || Flag: Emptiable)`: The name(s) of the role(s) to blacklist. Use semicolons `;` as a separator to separate multiple role names. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the user has a role from the blacklist. - -## Example -``` -$nomention -$blackListRoles[Owner;Bot;❌ You can't use this command!] -Pong! $ping ms -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ You can't use this command! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - Because I have a role with name "Owner". -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 2 ms -``` +# $blackListRoles +Blocks users with certain role(s) from using the command. If the user has any role in the blacklist, they will not be able to run the command. Uses role names instead of role IDs. + +## Syntax +``` +$blackListRoles[Role names;...;Error message] +``` + +### Parameters +- `Role names` `(Type: String || Flag: Emptiable)`: The name(s) of the role(s) to blacklist. Use semicolons `;` as a separator to separate multiple role names. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the user has a role from the blacklist. + +## Example +``` +$nomention +$blackListRoles[Owner;Bot;❌ You can't use this command!] +Pong! $ping ms +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ You can't use this command! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Because I have a role with name "Owner". +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 2 ms +``` + +```admonish question title="What is this?" +How [`$ping`](./ping.md) works? +``` diff --git a/src/bdscript/blackListRolesIDs.md b/src/bdscript/blackListRolesIDs.md index 59e5ab55904..65d8beb833d 100644 --- a/src/bdscript/blackListRolesIDs.md +++ b/src/bdscript/blackListRolesIDs.md @@ -1,46 +1,50 @@ -# $blackListRolesIDs -Blocks users with certain roles from using the command. If the user has any role in the blacklist, they will not be able to run the command. - -## Syntax -``` -$blackListRolesIDs[Role IDs;...;Error message] -``` - -### Parameters -- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role(s) that will be blacklisted. Use semicolons `;` as a separator to separate multiple role IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the user has a role from the blacklist. - -## Example -``` -$nomention -$blackListRolesIDs[1009019299987476540;1014547313957539901;❌ You can't use this command!] -Pong! $ping ms -``` - - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ You can't use this command! -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 4 ms -``` +# $blackListRolesIDs +Blocks users with certain roles from using the command. If the user has any role in the blacklist, they will not be able to run the command. + +## Syntax +``` +$blackListRolesIDs[Role IDs;...;Error message] +``` + +### Parameters +- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role(s) that will be blacklisted. Use semicolons `;` as a separator to separate multiple role IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the user has a role from the blacklist. + +## Example +``` +$nomention +$blackListRolesIDs[1009019299987476540;1014547313957539901;❌ You can't use this command!] +Pong! $ping ms +``` + + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ You can't use this command! +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 4 ms +``` + +```admonish question title="What is this?" +How [`$ping`](./ping.md) works? +``` diff --git a/src/bdscript/blackListServers.md b/src/bdscript/blackListServers.md index 1efbaf57d24..4262f5e62f5 100644 --- a/src/bdscript/blackListServers.md +++ b/src/bdscript/blackListServers.md @@ -1,52 +1,90 @@ -# $blackListServers -Blocks certain servers from using the command. - -## Syntax -``` -$blackListServers[Guild IDs;...;Error message] -``` - -### Parameters -- `Guild IDs` `(Type: Snowflake || Flag: Emptiable)`: The server(s) to blacklist from using a command. Use semicolons `;` as a separator to separate multiple server IDs. - > [Where do I find server IDs? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) -- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the command is run in a blacklisted server. - - -## Example -``` -$nomention -$blackListServers[1009018669982031912;❌ You can't use this command!] -Pong! $ping ms -*Guild ID: $guildID* -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ You can't use this command! -``` -\ - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 1 ms - Guild ID: 1009018669982031912 -``` +# $blackListServers +Blocks certain servers from using the command. + + + +## Syntax +``` +$blackListServers[Guild IDs;...;Error message] +``` + +### Parameters +- `Guild IDs` `(Type: Snowflake || Flag: Emptiable)`: The server(s) to blacklist from using a command. Use semicolons `;` as a separator to separate multiple server IDs. + > [Where do I find server IDs? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) +- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent if the command is run in a blacklisted server. + + +## Example +``` +$nomention +$blackListServers[1009018669982031912;❌ You can't use this command!] +Pong! $ping ms +*Guild ID: $guildID* +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ You can't use this command! +``` +\ + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 1 ms + Guild ID: 1009018669982031912 +``` + +```admonish question title="What is this?" +How [`$ping`](./ping.md) works? +``` diff --git a/src/bdscript/blackListUsers.md b/src/bdscript/blackListUsers.md index da8911bc3ad..2e885bd5088 100644 --- a/src/bdscript/blackListUsers.md +++ b/src/bdscript/blackListUsers.md @@ -1,50 +1,54 @@ -# $blackListUsers -Blocks certain users from using the command. Uses usernames instead of user IDs. - -## Syntax -``` -$blackListUsers[Usernames;...;Error message] -``` - -### Parameters -- `Usernames` `(Type: String || Flag: Emptiable)`: The username(s) to blacklist. Use semicolons `;` as a separator to separate multiple usernames. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent when the username of the user running the command is blacklisted. - -## Example -``` -$nomention -$blackListUsers[RainbowKey;❌ You can't use this command!] -Pong! $ping ms -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ You can't use this command! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - Because my username is "RainbowKey". -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 3 ms -``` +# $blackListUsers +Blocks certain users from using the command. Uses usernames instead of user IDs. + +## Syntax +``` +$blackListUsers[Usernames;...;Error message] +``` + +### Parameters +- `Usernames` `(Type: String || Flag: Emptiable)`: The username(s) to blacklist. Use semicolons `;` as a separator to separate multiple usernames. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that will be sent when the username of the user running the command is blacklisted. + +## Example +``` +$nomention +$blackListUsers[RainbowKey;❌ You can't use this command!] +Pong! $ping ms +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ You can't use this command! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Because my username is "RainbowKey". +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 3 ms +``` + +```admonish question title="What is this?" +How [`$ping`](./ping.md) works? +``` diff --git a/src/bdscript/boostCount.md b/src/bdscript/boostCount.md index f54c37ab556..69ac345847a 100644 --- a/src/bdscript/boostCount.md +++ b/src/bdscript/boostCount.md @@ -1,31 +1,31 @@ -# $boostCount -Returns the current guild's number of nitro boosts. - -## Syntax -``` -$boostCount -``` - -## Example -``` -$nomention -This server currently has $boostCount boost(s). -``` - -```discord yaml -- type: boost - content: | - RainbowKey just boosted the server! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - This server currently has 12 boost(s). -``` +# $boostCount +Returns the current guild's number of nitro boosts. + +## Syntax +``` +$boostCount +``` + +## Example +``` +$nomention +This server currently has $boostCount boost(s). +``` + +```discord yaml +- type: boost + content: | + RainbowKey just boosted the server! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This server currently has 12 boost(s). +``` diff --git a/src/bdscript/boostCountComplex.md b/src/bdscript/boostCountComplex.md index 2b823422cec..1c2fb5fa848 100644 --- a/src/bdscript/boostCountComplex.md +++ b/src/bdscript/boostCountComplex.md @@ -1,34 +1,34 @@ -# $boostCount[] -Returns a guild's number of nitro boosts. - -## Syntax -``` -$boostCount[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get the number of boosts for. - -## Example -``` -$nomention -This server currently has $boostCount[$message[1]] boost(s). -``` - -```discord yaml -- type: boost - content: | - RainbowKey just boosted the server! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 566363823137882154 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - This server currently has 38 boost(s). -``` +# $boostCount[] +Returns a guild's number of nitro boosts. + +## Syntax +``` +$boostCount[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get the number of boosts for. + +## Example +``` +$nomention +This server currently has $boostCount[$message] boost(s). +``` + +```discord yaml +- type: boost + content: | + RainbowKey just boosted the server! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This server currently has 38 boost(s). +``` diff --git a/src/bdscript/boostLevel.md b/src/bdscript/boostLevel.md new file mode 100644 index 00000000000..fd8372219cc --- /dev/null +++ b/src/bdscript/boostLevel.md @@ -0,0 +1,36 @@ +# $boostLevel +Returns the current guild's boost level. + +## Syntax +``` +$boostLevel +``` + +### Possible Outputs +Output (Boost Level) | Required Boosts | +---------------------|-----------------| +0 | 0 | +1 | 2 | +2 | 7 | +3 | 14 | + +## Example +``` +$nomention +Current Boost level: $boostLevel +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Current Boost level: 0 +``` diff --git a/src/bdscript/botCommands.md b/src/bdscript/botCommands.md index 4b1b2bccf2a..3c3cda6fc9e 100644 --- a/src/bdscript/botCommands.md +++ b/src/bdscript/botCommands.md @@ -1,31 +1,31 @@ -# $botCommands -Returns a list of the bot's commands. - -## Syntax -``` -$botCommands[Separator] -``` - -### Parameters -- `Separator` `(Type: String || Flag: Required)`: Will be used to separate each command. - -## Example -``` -$nomention -$botCommands[🔹] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - !help🔹!server🔹!bdfd -``` +# $botCommands +Returns a list of the bot's commands. + +## Syntax +``` +$botCommands[Separator] +``` + +### Parameters +- `Separator` `(Type: String || Flag: Required)`: Will be used to separate each command. + +## Example +``` +$nomention +$botCommands[🔹] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + !help🔹!server🔹!bdfd +``` diff --git a/src/bdscript/botID.md b/src/bdscript/botID.md index b9b9091e5e7..5a8055edde3 100644 --- a/src/bdscript/botID.md +++ b/src/bdscript/botID.md @@ -1,28 +1,28 @@ -# $botID -Returns the bot's ID. - -## Syntax -``` -$botID -``` - -## Example -``` -$nomention -My ID is: $botID -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - My ID: 1009018156494368798 -``` +# $botID +Returns the bot's ID. + +## Syntax +``` +$botID +``` + +## Example +``` +$nomention +My ID is: $botID +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + My ID: 1009018156494368798 +``` diff --git a/src/bdscript/botLeave.md b/src/bdscript/botLeave.md index 5077fecf74b..e015b9752f1 100644 --- a/src/bdscript/botLeave.md +++ b/src/bdscript/botLeave.md @@ -1,31 +1,35 @@ -# $botLeave -Forces the bot to leave the current server. - -## Syntax -``` -$botLeave -``` - -## Example -``` -$nomention -$sendMessage[I left this server!] -$botLeave -``` -![example](https://user-images.githubusercontent.com/113303649/210329580-8237da8e-762c-422f-9408-f0e734a21657.png) - -> If you are using **BDScript 2**, put `$botLeave` at the very bottom of the code so that the code works correctly i.e: -> -> ❌ Not correct: -> ``` -> $botLeave -> $nomention -> $sendMessage[I left this server!] -> ``` -> -> ✅ Correct: -> ``` -> $nomention -> $sendMessage[I left this server!] -> $botLeave -> ``` +# $botLeave +Forces the bot to leave the current server. + +## Syntax +``` +$botLeave +``` + +## Example +``` +$nomention +$sendMessage[I left this server!] +$botLeave +``` +![example](https://user-images.githubusercontent.com/113303649/210329580-8237da8e-762c-422f-9408-f0e734a21657.png) + +```admonish question title="What is this?" +How [`$sendMessage[]`](./sendMessage.md) works? +``` + +> If you are using **BDScript 2**, put `$botLeave` at the very bottom of the code so that the code works correctly i.e: +> +> ❌ Not correct: +> ``` +> $botLeave +> $nomention +> $sendMessage[I left this server!] +> ``` +> +> ✅ Correct: +> ``` +> $nomention +> $sendMessage[I left this server!] +> $botLeave +> ``` diff --git a/src/bdscript/botLeaveComplex.md b/src/bdscript/botLeaveComplex.md index 713f4d6a785..a943cbbe2d2 100644 --- a/src/bdscript/botLeaveComplex.md +++ b/src/bdscript/botLeaveComplex.md @@ -1,50 +1,54 @@ -# $botLeave[] -Forces the bot to leave the server matching the provided [server ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID). - -## Syntax -``` -$botLeave[Guild ID] -```` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The ID of the guild to leave. - -## Example -``` -$nomention -$sendMessage[I left out `$serverName[$message]` server.] -$botLeave[$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 1009018156494368798 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - I left out BDFD Support server. -``` -\ -![example](https://user-images.githubusercontent.com/113303649/210337078-dbdb0539-6f4a-4271-8574-afc43551d0e8.png) - -> If you are using **BDScript 2**, put `$botLeave[]` at the very bottom of the code so that the code works correctly i.e: -> -> ❌ Not correct: -> ``` -> $botLeave[$message] -> $nomention -> $sendMessage[I left this server!] -> ``` -> -> ✅ Correct: -> ``` -> $nomention -> $sendMessage[I left this server!] -> $botLeave[$message] -> ``` +# $botLeave[] +Forces the bot to leave the server matching the provided [server ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID). + +## Syntax +``` +$botLeave[Guild ID] +```` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The ID of the guild to leave. + +## Example +``` +$nomention +$sendMessage[I left out `$serverName[$message]` server.] +$botLeave[$message] +``` + +```admonish question title="What is this?" +How [`$sendMessage[]`](./sendMessage.md), [`$serverName[]`](./serverName.md) and [`$message`](./message.md) works? +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1009018156494368798 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I left out BDFD Support server. +``` +\ +![example](https://user-images.githubusercontent.com/113303649/210337078-dbdb0539-6f4a-4271-8574-afc43551d0e8.png) + +> If you are using **BDScript 2**, put `$botLeave[]` at the very bottom of the code so that the code works correctly i.e: +> +> ❌ Not correct: +> ``` +> $botLeave[$message] +> $nomention +> $sendMessage[I left this server!] +> ``` +> +> ✅ Correct: +> ``` +> $nomention +> $sendMessage[I left this server!] +> $botLeave[$message] +> ``` diff --git a/src/bdscript/botListDescription.md b/src/bdscript/botListDescription.md index 3552a9bc271..6eeef7ef28c 100644 --- a/src/bdscript/botListDescription.md +++ b/src/bdscript/botListDescription.md @@ -1,34 +1,34 @@ -# $botListDescription -Sets the description of this command, for the BDL command list (if the bot is on [**Bot Designer List**](https://botdesignerlist.com)). - -## Syntax -``` -$botListDescription[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Required)`: The text that the description will be set to. - -## Example -``` -$nomention -Pong! -$botListDescription[Ping? Pong!] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! -``` -\ -![example](https://user-images.githubusercontent.com/113303649/210341495-bbda340a-3f30-4c6d-af7c-4445233ede37.png) +# $botListDescription +Sets the description of this command, for the BDL command list (if the bot is on [**Bot Designer List**](https://botdesignerlist.com)). + +## Syntax +``` +$botListDescription[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Required)`: The text that the description will be set to. + +## Example +``` +$nomention +Pong! +$botListDescription[Ping? Pong!] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! +``` +\ +![example](https://user-images.githubusercontent.com/113303649/210341495-bbda340a-3f30-4c6d-af7c-4445233ede37.png) diff --git a/src/bdscript/botListHide.md b/src/bdscript/botListHide.md index 19f46c03489..384503328c4 100644 --- a/src/bdscript/botListHide.md +++ b/src/bdscript/botListHide.md @@ -1,35 +1,35 @@ -# $botListHide -Hides this command from being shown on the BDL command list (if the bot is on [**Bot Designer List**](https://botdesignerlist.com)). - -## Syntax -``` -$botListHide -``` -> This function does not hide the command for [`$botCommands[]`](./botCommands.md). - -## Example -1. Create two commands and set the trigger `!ping` for one command and `!secret` for the other. -2. Add the `$botListHide` function to the command code with the `!secret` trigger. - - Code with trigger `!secret`: - ``` - $nomention - This is a secret command! đŸ¤Ģ - $botListHide - ``` - - Code with trigger `!ping`: - ``` - $nomention - Pong! - $botListDescription[Ping? Pong!] - ``` -3. Execute commands - - ![example](https://user-images.githubusercontent.com/113303649/210347402-7b36f8f4-fc8f-4804-9310-1ed2de0392dc.png) - -### With `$botListHide` - ![example](https://user-images.githubusercontent.com/113303649/210349185-677b00f3-df10-4443-a9b5-25ec9c2c2e29.png) - -### Without `$botListHide` -![example](https://user-images.githubusercontent.com/113303649/210350126-b99c73bd-e684-4f5e-a01c-f32c40c54c20.png) +# $botListHide +Hides this command from being shown on the BDL command list (if the bot is on [**Bot Designer List**](https://botdesignerlist.com)). + +## Syntax +``` +$botListHide +``` +> This function does not hide the command for [`$botCommands[]`](./botCommands.md). + +## Example +1. Create two commands and set the trigger `!ping` for one command and `!secret` for the other. +2. Add the `$botListHide` function to the command code with the `!secret` trigger. + + Code with trigger `!secret`: + ``` + $nomention + This is a secret command! đŸ¤Ģ + $botListHide + ``` + + Code with trigger `!ping`: + ``` + $nomention + Pong! + $botListDescription[Ping? Pong!] + ``` +3. Execute commands + + ![example](https://user-images.githubusercontent.com/113303649/210347402-7b36f8f4-fc8f-4804-9310-1ed2de0392dc.png) + +### With `$botListHide` + ![example](https://user-images.githubusercontent.com/113303649/210349185-677b00f3-df10-4443-a9b5-25ec9c2c2e29.png) + +### Without `$botListHide` +![example](https://user-images.githubusercontent.com/113303649/210350126-b99c73bd-e684-4f5e-a01c-f32c40c54c20.png) diff --git a/src/bdscript/botNode.md b/src/bdscript/botNode.md index 0ea5629cba8..5d07baa2887 100644 --- a/src/bdscript/botNode.md +++ b/src/bdscript/botNode.md @@ -1,29 +1,29 @@ -# $botNode -Returns the bot's node ID. - -## Syntax -``` -$botNode -``` -> See list of Nodes and Status, [Click here](https://botdesignerdiscord.com/status). - -## Example -``` -$nomention -The bot's node ID: $botNode -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - The bot's node ID: 21 -``` +# $botNode +Returns the bot's node ID. + +## Syntax +``` +$botNode +``` +> See list of Nodes and Status, [Click here](https://botdesignerdiscord.com/status). + +## Example +``` +$nomention +The bot's node ID: $botNode +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + The bot's node ID: 21 +``` diff --git a/src/bdscript/botOwnerID.md b/src/bdscript/botOwnerID.md index 860c8eef388..9b06de8a77c 100644 --- a/src/bdscript/botOwnerID.md +++ b/src/bdscript/botOwnerID.md @@ -1,29 +1,28 @@ -# $botOwnerID -Returns the bot owner's ID. - -## Syntax -``` -$botOwnerID -``` - -## Example -``` -$nomention -My owner's ID: $botOwnerID -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !botOwnerID - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - My owner's ID: 729343563401265193 -``` +# $botOwnerID +Returns the bot owner's ID. + +## Syntax +``` +$botOwnerID +``` + +## Example +``` +$nomention +My owner's ID: $botOwnerID +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + My owner's ID: 729343563401265193 +``` diff --git a/src/bdscript/botTyping.md b/src/bdscript/botTyping.md index bd89be4bc14..2a194361bfd 100644 --- a/src/bdscript/botTyping.md +++ b/src/bdscript/botTyping.md @@ -1,35 +1,53 @@ -# $botTyping -This function tells Discord that the bot is typing. - -## Syntax -``` -$botTyping -``` - -## Example -``` -$nomention -$botTyping -Hello $username! -``` - -- Command started: - -![example](https://user-images.githubusercontent.com/113303649/210356430-f642b91c-f742-457d-a5ce-b446f18b03ca.png) - -- Command completed: - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello RainbowKey! -``` +# $botTyping +This function tells Discord that the bot is typing. + + + +## Syntax +``` +$botTyping +``` + +```admonish info +Using `$botTyping` will add a 2-3 second delay before your bot’s response, simulating the typing process. +``` + +## Example +``` +$nomention +$botTyping +Hello $username! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +``` + +- Command completed: + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello RainbowKey! +``` diff --git a/src/bdscript/byteCount.md b/src/bdscript/byteCount.md new file mode 100644 index 00000000000..800811643cc --- /dev/null +++ b/src/bdscript/byteCount.md @@ -0,0 +1,85 @@ +# $byteCount +Returns the amount of bytes in the provided "`Text`". + +## Syntax +``` +$byteCount[Text] +``` + +~~~admonish tip title="Recommendation" +We recommend using this function to add limits to variables instead of [`$charCount[]`](./charCount.md), since variables use bit limits, not characters! + +``` +$nomention +$onlyIf[$byteCount[$message]<500;Character limit has reached!] +New value for variable set! +$setUserVar[Text;$message] +``` + +> How [`$onlyIf[]`](./onlyIf.md), [`$message`](./message.md) and [`$setUserVar[]`](./setUserVar.md) works? +~~~ + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to return the byte count for. + +## Example +``` +$nomention +Your message has $byteCount[$message] bytes. +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello World! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your message has 12 bytes. +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example ПŅ€Đ¸Đ˛ĐĩŅ‚ МиŅ€! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your message has 20 bytes. +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example äŊ åĨŊ世į•Œīŧ +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your message has 15 bytes. +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $byteCount[] +
+
+

Output:

+ Your message has 4 bytes +
+
diff --git a/src/bdscript/c.md b/src/bdscript/c.md index fd06ab1cd56..7dc60872006 100644 --- a/src/bdscript/c.md +++ b/src/bdscript/c.md @@ -1,32 +1,36 @@ -# $c -Adds a comment to the code. Comments do not appear in the bot's response. - -## Syntax -``` -$c[Comment] -``` - -### Parameters -- `Comment` `(Type: String || Flag: Emptiable)`: Any text. This text will not be taken into account during processing. Commonly used to add notes to the code. - -## Example -``` -$nomention -$noMentionMessage -$c[This is a say command. You are reading a comment!] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !say As you can see, the comment doesn't appear! Pretty cool; right? - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - As you can see, the comment doesn't appear! Pretty cool; right? -``` +# $c +Adds a comment to the code. Comments do not appear in the bot's response. + +## Syntax +``` +$c[Comment] +``` + +### Parameters +- `Comment` `(Type: String || Flag: Emptiable)`: Any text. This text will not be taken into account during processing. Commonly used to add notes to the code. + +## Example +``` +$nomention +$message +$c[This is a say command. You are reading a comment!] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !say As you can see, the comment doesn't appear! Pretty cool; right? +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + As you can see, the comment doesn't appear! Pretty cool; right? +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/calculate.md b/src/bdscript/calculate.md index bd9b278fcdc..616cbeb4b99 100644 --- a/src/bdscript/calculate.md +++ b/src/bdscript/calculate.md @@ -1,43 +1,45 @@ -# $calculate -Calculates a math expression. - -## Syntax -``` -$calculate[Expression] -``` - -### Parameters -- `Expression` `(Type: String || Flag: Required)`: The math expression to solve. - -### Signs -- `+` - Addition. -- `-` - Subtraction. -- `/` - Division. -- `*` - Multiplication. -- `%` - Modulo. -- `**` - Power. -- `()` - Parentheses you can put equations in. - -## Example -``` -$nomention -$enableDecimals[yes] -$calculate[$message] 🧠 -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 10+5.9-9 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 6.9 🧠 -``` - -> [How does `$enableDecimals[]` work?](./enableDecimals.md) +# $calculate +Calculates a math expression. + +## Syntax +``` +$calculate[Expression] +``` + +### Parameters +- `Expression` `(Type: String || Flag: Required)`: The math expression to solve. + +### Signs +- `+` - Addition. +- `-` - Subtraction. +- `/` - Division. +- `*` - Multiplication. +- `%` - Modulo. +- `**` - Power. +- `()` - Parentheses you can put equations in. + +## Example +``` +$nomention +$enableDecimals[yes] +$calculate[$message] 🧠 +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 10+5.9-9 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 6.9 🧠 +``` + +```admonish question title="What is this?" +How [`$enableDecimals[]`](./enableDecimals.md) and [`$message`](./message.md) works? +``` diff --git a/src/bdscript/catch.md b/src/bdscript/catch.md index b14745b8880..14679465c6e 100644 --- a/src/bdscript/catch.md +++ b/src/bdscript/catch.md @@ -1,56 +1,56 @@ -# $catch -Used to create a sub-block between `$try` and `$endtry` that will contain the code that will be executed when an error occurs. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$catch -``` - -## Example -``` -$nomention -$try - $calculate[$message] -$catch - ❌ Invalid expression! -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example abc -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ Invalid expression! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 60+9 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 69 -``` - -```admonish question title="What is this?" -How [`$calculate[]`](./calculate.md), [`$message`](./message.md), [`$try`](./try.md) and [`$endtry`](./endtry.md) works? -``` - -```admonish info title="Read more" -For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). -``` +# $catch +Used to create a sub-block between `$try` and `$endtry` that will contain the code that will be executed when an error occurs. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$catch +``` + +## Example +``` +$nomention +$try + $calculate[$message] +$catch + ❌ Invalid expression! +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example abc +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Invalid expression! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 60+9 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 69 +``` + +```admonish question title="What is this?" +How [`$calculate[]`](./calculate.md), [`$message`](./message.md), [`$try`](./try.md) and [`$endtry`](./endtry.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). +``` diff --git a/src/bdscript/categoryChannels.md b/src/bdscript/categoryChannels.md index 2281c8cd5d8..819321d861a 100644 --- a/src/bdscript/categoryChannels.md +++ b/src/bdscript/categoryChannels.md @@ -1,48 +1,53 @@ -# $categoryChannels -Lists all channels of the given category. - -## Syntax -``` -$categoryChannels[Category ID;Separator;(Option)] -``` - -### Parameters -- `Category ID` `(Type: Snowflake || Flag: Required)`: The category from which to list the channels. -- `Seperator` `(Type: String || Flag: Emptiable)`: The separator to use when separating channel properties. -- `Option` `(Type: Enum || Flag: Optional)`: Which property to get from category channels. Default is `name`. See [below](#options) for more information. - -### Options -- `name` - The names of the channels. -- `id` - The IDs of the channels. -- `mention` - The mentions of the channels. -- `count` - The amount of channels in the category. - -> The `count` option does not list anything, instead it will return the number of channels under the given category. - -## Example -``` -$nomention -<#$categoryChannels[$categoryID[BDFD];> -<#;id]> -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - <#rules> - <#news> - <#update-logs> - <#bots> - <#bdfd-forums> -``` - -> [How `$categoryID[]` works?](./categoryID.md) +# $categoryChannels +Lists all channels of the given category. + +## Syntax +``` +$categoryChannels[Category ID;Separator;(Option)] +``` + +### Parameters +- `Category ID` `(Type: Snowflake || Flag: Required)`: The category from which to list the channels. +- `Seperator` `(Type: String || Flag: Emptiable)`: The separator to use when separating channel properties. +- `Option` `(Type: Enum || Flag: Optional)`: Which property to get from category channels. Default is `name`. See [below](#options) for more information. + +### Options +- `name` - The names of the channels. +- `id` - The IDs of the channels. +- `mention` - The mentions of the channels. +- `count` - The amount of channels in the category. + +> The `count` option does not list anything, instead it will return the number of channels under the given category. + +## Example +``` +$nomention +Total $categoryChannels[$categoryID[BDFD];;count] channels! +$categoryChannels[$categoryID[BDFD]; +;mention] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Total 5 channels! + <#rules> + <#news> + <#update-logs> + <#main-chat> + <#secret-channel> +``` + +```admonish question title="What is this?" +How [`$categoryID[]`](./categoryID.md) works? +``` diff --git a/src/bdscript/categoryCount.md b/src/bdscript/categoryCount.md index 82a0e2f5983..8f503572a10 100644 --- a/src/bdscript/categoryCount.md +++ b/src/bdscript/categoryCount.md @@ -1,27 +1,27 @@ -# $categoryCount -Returns the category count of the current guild. - -## Syntax -``` -$categoryCount -``` -## Example -``` -$nomention -There are $categoryCount categories in this server! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !categories - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - There are 3 categories in this server! -``` +# $categoryCount +Returns the category count of the current guild. + +## Syntax +``` +$categoryCount +``` +## Example +``` +$nomention +There are $categoryCount categories in this server! +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !categories + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + There are 3 categories in this server! +``` diff --git a/src/bdscript/categoryCountComplex.md b/src/bdscript/categoryCountComplex.md index 3b4d7c02a61..5a70157e341 100644 --- a/src/bdscript/categoryCountComplex.md +++ b/src/bdscript/categoryCountComplex.md @@ -1,31 +1,35 @@ -# $categoryCount[] -Returns the category count of the provided guild. - -## Syntax -``` -$categoryCount[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get its category count. - -## Example -``` -$nomention -There are $categoryCount[$message[1]] categories in the server! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !categories 790676954247725106 - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - There are 5 categories in the server! -``` +# $categoryCount[] +Returns the category count of the provided guild. + +## Syntax +``` +$categoryCount[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get its category count. + +## Example +``` +$nomention +There are $categoryCount[$message] categories in the server! +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !categories 790676954247725106 +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + There are 5 categories in the server! +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/categoryID.md b/src/bdscript/categoryID.md index 2ea86089969..b6456210c01 100644 --- a/src/bdscript/categoryID.md +++ b/src/bdscript/categoryID.md @@ -1,33 +1,39 @@ -# $categoryID -Returns the category ID of the given category name. - -## Syntax -``` -$categoryID[Category name] -``` - -### Parameters -- `Category name` `(Type: String || Flag: Required)`: The name of the category from which to return the ID. - -## Example -``` -$nomention -Category ID: $categoryID[$message] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !categoryID Information - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Category ID: 790620501927526462 -``` - -> To get the category ID from a *channel ID* use [`$parentID`](./parentID.md). +# $categoryID +Returns the category ID of the given category name. + +```admonish note +To get the category ID from a *channel ID* use [`$parentID`](./parentID.md). +``` + +## Syntax +``` +$categoryID[Category name] +``` + +### Parameters +- `Category name` `(Type: String || Flag: Required)`: The name of the category from which to return the ID. + +## Example +``` +$nomention +Category ID: $categoryID[$message] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !categoryID Information +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Category ID: 790620501927526462 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/ceil.md b/src/bdscript/ceil.md index 538d619f6fa..1fd6457e094 100644 --- a/src/bdscript/ceil.md +++ b/src/bdscript/ceil.md @@ -1,55 +1,72 @@ -# $ceil -Rounds the number **up** and returns the smallest integer greater than or equal to a specified number. - -## Syntax -``` -$ceil[Number] -``` - -### Parameters -- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded. - -## Example -``` -$nomention -Result: $ceil[$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 6.3 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: 7 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -6.4 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: -6 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 8 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: 8 -``` +# $ceil +Rounds the number **up** and returns the smallest integer greater than or equal to a specified number. + +## Syntax +``` +$ceil[Number] +``` + +### Parameters +- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded. + +## Example +``` +$nomention +Result: $ceil[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 6.3 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 7 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example -6.4 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: -6 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 8 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 8 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $ceil[] +
+
+

Output:

+ Result: 1 +
+
diff --git a/src/bdscript/changeCooldownTime.md b/src/bdscript/changeCooldownTime.md index ca905354d83..f2ee4fce007 100644 --- a/src/bdscript/changeCooldownTime.md +++ b/src/bdscript/changeCooldownTime.md @@ -1,59 +1,61 @@ -# $changeCooldownTime -Changes the cooldown metrics. These can be used in cooldown error messages. It can be useful for translations. - -## Syntax -``` -$changeCooldownTime[Days;Hours;Minutes;Seconds] -``` - -### Parameters -- `Days` `(Type: String || Flag: Required)`: The text to replace 'Days' with. -- `Hours` `(Type: String || Flag: Required)`: The text to replace 'Hours' with. -- `Minutes` `(Type: String || Flag: Required)`: The text to replace 'Minutes' with. -- `Seconds` `(Type: String || Flag: Required)`: The text to replace 'Seconds' with. - - ### Sub-functions - - Name | Type -------------|--------- -`%time-d%` | Day -`%time-h%` | Hour -`%time-m%` | Minute -`%time-s%` | Second - -## Example -``` -$nomention -Hello $displayName! -$changeCooldownTime[Days⏰;Hours⏰;Mins🕧;Secs🕧] -$cooldown[10m;Please wait %time-m%!] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !hello - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello Nicky! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !hello - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Please wait 9.9 Mins🕧! -``` +# $changeCooldownTime +Changes the cooldown metrics. These can be used in cooldown error messages. It can be useful for translations. + +## Syntax +``` +$changeCooldownTime[Days;Hours;Minutes;Seconds] +``` + +### Parameters +- `Days` `(Type: String || Flag: Required)`: The text to replace 'Days' with. +- `Hours` `(Type: String || Flag: Required)`: The text to replace 'Hours' with. +- `Minutes` `(Type: String || Flag: Required)`: The text to replace 'Minutes' with. +- `Seconds` `(Type: String || Flag: Required)`: The text to replace 'Seconds' with. + + ### Sub-functions + + Name | Type +------------|--------- +`%time-d%` | Day +`%time-h%` | Hour +`%time-m%` | Minute +`%time-s%` | Second + +## Example +``` +$nomention +Hello world! +$changeCooldownTime[Days⏰;Hours⏰;Mins🕧;Secs🕧] +$cooldown[10m;Please wait %time-m%!] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello world! +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Please wait 9.9 Mins🕧! +``` + +```admonish question title="What is this?" +How [`$cooldown[]`](./cooldown.md) works? +``` diff --git a/src/bdscript/changeUsername.md b/src/bdscript/changeUsername.md index 9307d996688..2f70614aeb6 100644 --- a/src/bdscript/changeUsername.md +++ b/src/bdscript/changeUsername.md @@ -1,34 +1,36 @@ -# $changeUsername -Changes the mentioned user's nickname. - -## Syntax -``` -$changeUsername[New nickname] -``` - -### Parameters -- `New nickname` `(Type: String || Flag: Required)`: The text to change the user's nickname to. It cannot exceed more than 32 characters. Using `%username%` will be replaced by the real user's username. - -## Example -``` -$nomention -$onlyPerms[managenicknames;Missing permission 'manage nicknames'!] -$argsCheck[>2;Wrong usage! Correct Usage: `!nickname (user) (text)`] -$changeUsername[$noMentionMessage] -Changed <@$mentioned[1]>'s nickname to **$noMentionMessage**. -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !nickname <@Cool Bot> Cool Bot - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Changed <@Cool Bot>'s nickname to Cool Bot. -``` +# $changeUsername +Changes the mentioned user's nickname. + +## Syntax +``` +$changeUsername[New nickname] +``` + +### Parameters +- `New nickname` `(Type: String || Flag: Required)`: The text to change the user's nickname to. It cannot exceed more than 32 characters. Using `%username%` will be replaced by the real user's username. + +## Example +``` +$nomention +$changeUsername[$noMentionMessage] +Changed <@$mentioned[1]>'s nickname to **$noMentionMessage**. +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example <@Cool Bot> Cool Bot +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Changed <@Cool Bot>'s nickname to Cool Bot. +``` + +```admonish question title="What is this?" +How [`$noMentionMessage`](./noMentionMessage.md) and [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/changeUsernameWithID.md b/src/bdscript/changeUsernameWithID.md index bbb68a8d4bd..1c9765dfd0b 100644 --- a/src/bdscript/changeUsernameWithID.md +++ b/src/bdscript/changeUsernameWithID.md @@ -1,32 +1,34 @@ -# $changeUsernameWithID -Changes a user's nickname using their ID. - -## Syntax -``` -$changeUsernameWithID[User ID;New nickname] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user whose nickname will be changed. -- `New nickname` `(Type: String || Flag: Required)`: The text to change the user's nickname to. It cannot exceed more than 32 characters, using `%username%` will be replaced by real user's username. - -## Example -``` -$nomention -$argsCheck[>1;Please provide text!] -$addCmdReactions[❤ī¸] -$changeUsernameWithID[$message[1];$message[2]] -``` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 154148273307910144 Owner - reactions: - - emoji: https://upload.wikimedia.org/wikipedia/commons/7/70/Symbolic_Love_Heart.png - count: 1 - reacted: false -``` - -> [How `$addCmdReactions[]` works?](./addCmdReactions.md) +# $changeUsernameWithID +Changes a user's nickname using their ID. + +## Syntax +``` +$changeUsernameWithID[User ID;New nickname] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user whose nickname will be changed. +- `New nickname` `(Type: String || Flag: Required)`: The text to change the user's nickname to. It cannot exceed more than 32 characters, using `%username%` will be replaced by real user's username. + +## Example +``` +$nomention +$addCmdReactions[❤ī¸] +$changeUsernameWithID[$message[1];$message[2]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 154148273307910144 Owner + reactions: + - emoji: https://upload.wikimedia.org/wikipedia/commons/7/70/Symbolic_Love_Heart.png + count: 1 + reacted: false +``` + +```admonish question title="What is this?" +How [`$addCmdReactions[]`](./addCmdReactions.md) and [`$message[]`](./messageComplex.md) works? +``` diff --git a/src/bdscript/channelCount.md b/src/bdscript/channelCount.md index ab99e4e342e..e852fecb94a 100644 --- a/src/bdscript/channelCount.md +++ b/src/bdscript/channelCount.md @@ -1,28 +1,28 @@ -# $channelCount -Returns the amount of channels in the current server. - - -## Syntax -``` -$channelCount -``` -## Example -``` -$nomention -There are $channelCount channels in this server! -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - There are 19 channels in this server! -``` +# $channelCount +Returns the amount of channels in the current server. + + +## Syntax +``` +$channelCount +``` +## Example +``` +$nomention +There are $channelCount channels in this server! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + There are 19 channels in this server! +``` diff --git a/src/bdscript/channelExists.md b/src/bdscript/channelExists.md index 5034667e50e..ba33cc02d61 100644 --- a/src/bdscript/channelExists.md +++ b/src/bdscript/channelExists.md @@ -1,31 +1,64 @@ -# $channelExists -Checks if the provided channel exists in any server the bot is in. - -## Syntax -``` -$channelExists[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: String, Snowflake || Flag: Emptiable)`: The channel which the bot will check for. - -## Example -``` -$nomention -$channelExists[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 566370477967147018 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $channelExists +Checks if the provided channel exists in any server the bot is in. + +## Syntax +``` +$channelExists[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: String, Snowflake || Flag: Emptiable)`: The channel which the bot will check for. + +## Example +``` +$nomention +$channelExists[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566370477967147018 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example dthhdgettthttd +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#main-chat> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Use $findChannel[] function to support channel mentions! +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/channelID.md b/src/bdscript/channelID.md index 89c4212d2d7..ddf06a43b4c 100644 --- a/src/bdscript/channelID.md +++ b/src/bdscript/channelID.md @@ -1,42 +1,45 @@ -# $channelID -Returns the ID of the current channel. - -## Syntax -``` -$channelID -``` -## Example -``` -$nomention -Channel ID: $channelID -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel ID: 566370477967147018 -``` - -> It will return `none` if you use it in a DM. -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - bot: true - verified: true - content: | - Channel ID: none -``` - +# $channelID +Returns the ID of the current channel. + +## Syntax +``` +$channelID +``` +## Example +``` +$nomention +Channel ID: $channelID +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel ID: 566370477967147018 +``` + +```admonish note +It will return `none` if you use it in a DM: +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + bot: true + verified: true + content: | + Channel ID: none +``` + diff --git a/src/bdscript/channelIDComplex.md b/src/bdscript/channelIDComplex.md index ef6fc62f081..b36c17d246d 100644 --- a/src/bdscript/channelIDComplex.md +++ b/src/bdscript/channelIDComplex.md @@ -1,49 +1,54 @@ -# $channelID[] -Returns the channel ID for the given channel name. - -## Syntax -``` -$channelID[Channel name] -``` - -### Parameters -- `Channel name` `(Type: String || Flag: Required)`: The name of the channel. - -## Example -``` -$nomention -Channel ID: $channelID[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example main-chat -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel ID: 566370477967147018 -``` - -> It supports category names. - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example BDFD -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel ID: 1009019011545178132 -``` +# $channelID[] +Returns the channel ID for the given channel name. + +## Syntax +``` +$channelID[Channel name] +``` + +### Parameters +- `Channel name` `(Type: String || Flag: Required)`: The name of the channel. + +## Example +``` +$nomention +Channel ID: $channelID[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example main-chat +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel ID: 566370477967147018 +``` + +```admonish note +It supports category names: +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel ID: 1009019011545178132 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/channelIDFromName.md b/src/bdscript/channelIDFromName.md index 366ce162624..c2c75a1fbb4 100644 --- a/src/bdscript/channelIDFromName.md +++ b/src/bdscript/channelIDFromName.md @@ -1,35 +1,41 @@ -# $channelDFromName -*(deprecated)* - -> 🧙‍♂ī¸ This function is deprecated, instead better use [`$channelID[]`](./channelIDComplex.md). - -Returns a channel's ID from its name. - -## Syntax -``` -$channelIDFromName[Channel name] -``` - -### Parameters -- `Channel name` `(Type: String || Flag: Required)`: The channel name that the bot will return the channel ID for. - -## Example -``` -$nomention -Channel ID: $channelIDFromName[$mesaage] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example main-chat -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel ID: 1014546423032860754 -``` +# $channelDFromName +
+ Deprecated +
+ +> This function is deprecated, instead better use [`$channelID[]`](./channelIDComplex.md). + +Returns a channel's ID from its name. + +## Syntax +``` +$channelIDFromName[Channel name] +``` + +### Parameters +- `Channel name` `(Type: String || Flag: Required)`: The channel name that the bot will return the channel ID for. + +## Example +``` +$nomention +Channel ID: $channelIDFromName[$mesaage] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example main-chat +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel ID: 1014546423032860754 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/channelName.md b/src/bdscript/channelName.md index 5bb2e4baeb7..4c66f796327 100644 --- a/src/bdscript/channelName.md +++ b/src/bdscript/channelName.md @@ -1,34 +1,38 @@ -# $channelName -Returns the name for the provided channel ID. -## Syntax -``` -$channelName[Channel ID] -``` - - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel which name will be returned. - -> 🧙‍♂ī¸ [How do I find channel IDs? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) - - -## Example -``` -$nomention -Channel Name: `#$channelName[$channelID]` -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel Name: #main-chat -``` +# $channelName +Returns the name for the provided channel ID. +## Syntax +``` +$channelName[Channel ID] +``` + + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel which name will be returned. + +> [How do I find channel IDs? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) + + +## Example +``` +$nomention +Channel Name: `#$channelName[$channelID]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel Name: #main-chat +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) works? +``` diff --git a/src/bdscript/channelNames.md b/src/bdscript/channelNames.md index a93b5974821..475ad5968cc 100644 --- a/src/bdscript/channelNames.md +++ b/src/bdscript/channelNames.md @@ -1,36 +1,36 @@ -# $channelNames -List all channel names separated by a given separator. - -## Syntax -``` -$channelNames[Separator;(Guild ID)] -``` -### Parameters -- `Seperator` `(Type: String || Flag: Emptiable)`: The separator used to separate the channel names. -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild for which to return the channel names. _(Defaults to the current guild)_ -## Example -``` -$nomention -#$channelNames[ -#] -``` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example main-chat -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - #main-chat - #media - #suggestions - #Category -``` - -> It can return names of the `category`, `channel`, `forum`. - +# $channelNames +List all channel names separated by a given separator. + +## Syntax +``` +$channelNames[Separator;(Guild ID)] +``` +### Parameters +- `Seperator` `(Type: String || Flag: Emptiable)`: The separator used to separate the channel names. +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild for which to return the channel names. _(Defaults to the current guild)_ +## Example +``` +$nomention +#$channelNames[ +#] +``` +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example main-chat +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + #main-chat + #media + #suggestions + #Category +``` + +> It can return names of the `category`, `channel`, `forum`. + diff --git a/src/bdscript/channelPosition.md b/src/bdscript/channelPosition.md index 55dc190aa9a..70d004d433e 100644 --- a/src/bdscript/channelPosition.md +++ b/src/bdscript/channelPosition.md @@ -1,29 +1,29 @@ -# $channelPosition -Returns the position of the current channel. - -## Syntax -``` -$channelPosition -``` -## Example -``` -$nomention -Channel Position: $channelPosition -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel Position: 1 -``` - - +# $channelPosition +Returns the position of the current channel. + +## Syntax +``` +$channelPosition +``` +## Example +``` +$nomention +Channel Position: $channelPosition +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel Position: 1 +``` + + diff --git a/src/bdscript/channelPositionComplex.md b/src/bdscript/channelPositionComplex.md index 21c917cf6f3..73fc22ad80f 100644 --- a/src/bdscript/channelPositionComplex.md +++ b/src/bdscript/channelPositionComplex.md @@ -1,34 +1,35 @@ -# $channelPosition[] -Returns the position of a given channel using its ID. - -## Syntax -``` -$channelPosition[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of a channel whose position will be returned. -> [How to get a channel ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) -## Example -``` -$nomention -Channel Position: $channelPosition[$mentionedChannels[1;yes]] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <#main-chat> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel Position: 2 -``` - -> How [`$mentionedChannels[]`](./mentionedChannels.md) works? - +# $channelPosition[] +Returns the position of a given channel using its ID. + +## Syntax +``` +$channelPosition[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of a channel whose position will be returned. +> [How to get a channel ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) +## Example +``` +$nomention +Channel Position: $channelPosition[$mentionedChannels[1]] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#main-chat> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel Position: 2 +``` + +```admonish question title="What is this?" +How [`$mentionedChannels[]`](./mentionedChannels.md) works? +``` diff --git a/src/bdscript/channelSendMessage.md b/src/bdscript/channelSendMessage.md index 85621cb8171..9e2b3efabb6 100644 --- a/src/bdscript/channelSendMessage.md +++ b/src/bdscript/channelSendMessage.md @@ -1,47 +1,72 @@ -# $channelSendMessage -Sends a message in the provided channel. - -## Syntax -``` -$channelSendMessage[Channel ID;Message] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to send the message in. -- `Message` `(Type: String || Flag: Required)`: The message that gets sent to the channel. - -## Example -``` -$nomention -The message was sent to the channel: <#835108724846493726> -$channelSendMessage[835108724846493726;Hello!] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - The message was sent to the channel: <#fun> -``` -\ - -### in **#fun** channel: -``` discord yaml -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Hello! -``` - +# $channelSendMessage +Sends a message in the provided channel. + + + +## Syntax +``` +$channelSendMessage[Channel ID;Message] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to send the message in. +- `Message` `(Type: String || Flag: Required)`: The message that gets sent to the channel. + +## Example +``` +$nomention +$channelSendMessage[$mentionedChannels[1];Hello!] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#secret-channel> +``` + +``` discord yaml +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello! +``` + +```admonish question title="What is this?" +How [`$mentionedChannels[]`](./mentionedChannels.md) works? +``` diff --git a/src/bdscript/channelTopic.md b/src/bdscript/channelTopic.md index 83c1868ec58..1149897ad19 100644 --- a/src/bdscript/channelTopic.md +++ b/src/bdscript/channelTopic.md @@ -1,28 +1,31 @@ -# $channelTopic -Returns the topic of the channel that the command is being used in. - -## Syntax -``` -$channelTopic -``` - -## Example -``` -$nomention -<#$channelID>'s channel topic is: $channelTopic -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - <#testing>'s channel topic is: A testing channel! -``` +# $channelTopic +Returns the topic of the channel that the command is being used in. + +## Syntax +``` +$channelTopic +``` + +## Example +``` +$nomention +<#$channelID>'s channel topic is: $channelTopic +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + <#testing>'s channel topic is: A testing channel! +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) works? +``` diff --git a/src/bdscript/channelTopicComplex.md b/src/bdscript/channelTopicComplex.md index 40ac8c1d3c6..a92371dcde5 100644 --- a/src/bdscript/channelTopicComplex.md +++ b/src/bdscript/channelTopicComplex.md @@ -1,31 +1,34 @@ -# $channelTopic[] -Returns the topic of a channel by its ID. - -## Syntax -``` -$channelTopic[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to return its topic. - -## Example -``` -$nomention -<#$noMentionMessage>'s channel topic is: $channelTopic[$noMentionMessage] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example 860870690323300359 - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - <#demo>'s channel topic is: Demos, examples and more! -``` +# $channelTopic[] +Returns the topic of a channel by its ID. + +## Syntax +``` +$channelTopic[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to return its topic. + +## Example +``` +$nomention +<#$noMentionMessage>'s channel topic is: $channelTopic[$noMentionMessage] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example 860870690323300359 +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + <#demo>'s channel topic is: Demos, examples and more! +``` + +```admonish question title="What is this?" +How [`$noMentionMessage`](./noMentionMessage.md) works? +``` diff --git a/src/bdscript/channelType.md b/src/bdscript/channelType.md index afdd661c236..32910e5c4bd 100644 --- a/src/bdscript/channelType.md +++ b/src/bdscript/channelType.md @@ -1,54 +1,38 @@ -# $channelType -Returns the type of a channel. - -## Syntax -``` -$channelType[Channel ID] -``` - -> The different channel types that the bot will return are: `text`, `voice`, `category`, `thread`, `dm`, `stage`, `announcement` and `forum`. - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel which type will be returned. - - -## Example -``` -$nomention -$channelType[$channelID] -``` - -**Text Channel** - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !channelType - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - text -``` - -\ -**DM Channel** - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - content: | - !channelType - -- user_id: 566613317972394004 - username: Wiki Bot - bot: true - verified: true - content: | - dm -``` +# $channelType +Returns the type of a channel. + +## Syntax +``` +$channelType[Channel ID] +``` + +> The different channel types that the bot will return are: `text`, `voice`, `category`, `thread`, `dm`, `stage`, `announcement` and `forum`. + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel which type will be returned. + + +## Example +``` +$nomention +$channelType[$channelID] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + text +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) works? +``` diff --git a/src/bdscript/charCount.md b/src/bdscript/charCount.md index 3074242ea83..4846045e0ae 100644 --- a/src/bdscript/charCount.md +++ b/src/bdscript/charCount.md @@ -1,31 +1,48 @@ -# $charCount -Returns the amount of characters in the provided "Text". - -## Syntax -``` -$charCount[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to return the character count for. - -## Example -``` -$nomention -Your message has $charCount[$message] characters. -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hello World! -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Your message has 12 characters. -``` +# $charCount +Returns the amount of characters in the provided "Text". + +## Syntax +``` +$charCount[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to return the character count for. + +## Example +``` +$nomention +Your message has $charCount[$message] characters. +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello World! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your message has 12 characters. +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $charCount[] +
+
+

Output:

+ Your message has 4 characters. +
+
diff --git a/src/bdscript/checkCondition.md b/src/bdscript/checkCondition.md index 06344257c29..9be23442c0a 100644 --- a/src/bdscript/checkCondition.md +++ b/src/bdscript/checkCondition.md @@ -1,64 +1,63 @@ -# $checkCondition -Checks if a condition is `true` or `false`. - -## Syntax -``` -$checkCondition[Condition] -``` - -### Parameters -- `Condition` `(Type: String || Flag: Required)`: The condition to check. - -### Signs -`==` - Equal - -`!=` - Not Equal - -`<` - Less Than - -`>` - Greater Than - -`>=` - Greater Than Or Equal To - -`<=` - Less Than Or Equal To - -## Example -``` -$nomention -$checkCondition[$message==hello] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example BDFD -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example hello -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - Because hello==hello. -``` +# $checkCondition +Checks if a condition is `true` or `false`. + +## Syntax +``` +$checkCondition[Condition] +``` + +### Parameters +- `Condition` `(Type: String || Flag: Required)`: The condition to check. + +### Signs +`==` - Equal + +`!=` - Not Equal + +`<` - Less Than + +`>` - Greater Than + +`>=` - Greater Than Or Equal To + +`<=` - Less Than Or Equal To + +## Example +``` +$nomention +$checkCondition[$message==hello] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hello +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Because hello==hello. +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/checkContains.md b/src/bdscript/checkContains.md index 42f7ad59ebd..9138f6b1911 100644 --- a/src/bdscript/checkContains.md +++ b/src/bdscript/checkContains.md @@ -1,56 +1,57 @@ -# $checkContains -Checks if the 'text' contains at least one of the provided 'phrases'. - -## Syntax -``` -$checkContains[Text;Phrases;...] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text that will be checked. -- `Phrases` `(Type: String || Flag: Emptiable)`: The phrases/words the bot will check for in `Text`. Separate phrases using `;`. - -## Example -``` -$nomention -$checkContains[$message;hi;hello] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example bye -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example hello -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example hi bye -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $checkContains +Checks if the 'text' contains at least one of the provided 'phrases'. + +## Syntax +``` +$checkContains[Text;Phrases;...] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text that will be checked. +- `Phrases` `(Type: String || Flag: Emptiable)`: The phrases/words the bot will check for in `Text`. Separate phrases using `;`. + +## Example +``` +$nomention +$checkContains[$message;hi;hello] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example bye +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hello +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hi bye +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/checkUserPerms.md b/src/bdscript/checkUserPerms.md index b3f2bd2586b..d38aaab3370 100644 --- a/src/bdscript/checkUserPerms.md +++ b/src/bdscript/checkUserPerms.md @@ -1,33 +1,37 @@ -# $checkUserPerms -Returns "true" if a user has all of the provided permissions, otherwise "false" is returned. - -## Syntax -``` -$checkUserPerms[User ID;Permissions] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user that the bot checks the permissions for. -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the bot checks for. Separate permissions using `;`. - -## Example -``` -$nomention -$onlyIf[$checkUserPerms[$authorID;admin]==false;You can't use this command, because you are an administrator.] -You aren't an admin! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - You can't use this command, because you are an administrator. -``` +# $checkUserPerms +Returns "true" if a user has all of the provided permissions, otherwise "false" is returned. + +## Syntax +``` +$checkUserPerms[User ID;Permissions] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user that the bot checks the permissions for. +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the bot checks for. Separate permissions using `;`. + +## Example +``` +$nomention +$onlyIf[$checkUserPerms[$authorID;admin]==false;You can't use this command, because you are an administrator.] +You aren't an admin! +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + You can't use this command, because you are an administrator. +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/clear.md b/src/bdscript/clear.md index 19ad7c06ff5..686ec4b23cc 100644 --- a/src/bdscript/clear.md +++ b/src/bdscript/clear.md @@ -1,84 +1,79 @@ -# $clear -Deletes a certain amount of messages. - -> When using just `$clear`, the author's message must include a number. - -## Syntax -``` -$clear -``` - -> Discord doesn't allow deleting messages in bulk which are over 2 weeks old. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managemessages` - -## Example -``` -$nomention -$deletecommand -$clear -``` - -### Before -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - 5 -- user_id: 729343563401265193 - username: Nicky - color: "#509070" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/34462b51-de96-4a43-b085-3babc085f70b - content: | - 4 -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - content: | - 3 -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - avatar: https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/5d649ade-b7d9-471f-84d0-8cc36b4fa76e - content: | - 2 -- user_id: 325663449680052227 - username: Emperor Toaster - color: "#939394" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/06e0dcd9-3668-4d51-ad7b-3e7d68e5021a - content: | - 1 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - !example 3 -``` -\ -### After -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - 5 -- user_id: 729343563401265193 - username: Nicky - color: "#509070" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/34462b51-de96-4a43-b085-3babc085f70b - content: | - 4 -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - content: | - 3 -``` +# $clear +Deletes a certain amount of messages. + +> When using just `$clear`, the author's message must include a number. + +## Syntax +``` +$clear +``` + +> Discord doesn't allow deleting messages in bulk which are over 2 weeks old. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managemessages` + +## Example +``` +$nomention +$deletecommand +$clear +``` + +### Before +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 5 +- user_id: 729343563401265193 + username: Nicky + color: "#509070" + content: | + 4 +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + 3 +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + 2 +- user_id: 325663449680052227 + username: Emperor Toaster + color: "#939394" + content: | + 1 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 3 +``` +\ +### After +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 5 +- user_id: 729343563401265193 + username: Nicky + color: "#509070" + content: | + 4 +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + 3 +``` + +```admonish question title="What is this?" +How [`$deletecommand`](./deletecommand.md) works? +``` diff --git a/src/bdscript/clearComplex.md b/src/bdscript/clearComplex.md index fe56786fb73..2c04ac07437 100644 --- a/src/bdscript/clearComplex.md +++ b/src/bdscript/clearComplex.md @@ -1,86 +1,81 @@ -# $clear[] -Deletes the provided amount of messages. - -## Syntax -``` -$clear[Amount;(User ID;Remove pinned messages?)] -``` - -### Parameters -- `Amount` `(Type: Integer || Flag: Required)`: The amount of messages to delete. (maximal 100) -- `User ID` `(Type: Snowflake || Flag: Vacantable)`: If a user ID is provided, the bot will only delete messages from that user. -- `Remove pinned messages?` `(Type: Bool || Flag: Optional)`: Decides whether to delete pinned messages or not. The default is `yes`. - -> 📌 Discord doesn't allow deleting messages in bulk which are over 2 weeks old. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managemessages` - -## Example -``` -$nomention -$clear[$message] -``` - -### Before -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - 5 -- user_id: 729343563401265193 - username: Nicky - color: "#509070" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/34462b51-de96-4a43-b085-3babc085f70b - content: | - 4 -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - content: | - 3 -- user_id: 437154602626973697 - username: Kito - color: "#4365ab" - avatar: https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/5d649ade-b7d9-471f-84d0-8cc36b4fa76e - content: | - 2 -- user_id: 325663449680052227 - username: Emperor Toaster - color: "#939394" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/06e0dcd9-3668-4d51-ad7b-3e7d68e5021a - content: | - 1 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - !example 3 -``` -\ -### After -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - content: | - 5 -- user_id: 729343563401265193 - username: Nicky - color: "#509070" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/34462b51-de96-4a43-b085-3babc085f70b - content: | - 4 -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - content: | - 3 -``` +# $clear[] +Deletes the provided amount of messages. + +## Syntax +``` +$clear[Amount;(User ID;Remove pinned messages?)] +``` + +### Parameters +- `Amount` `(Type: Integer || Flag: Required)`: The amount of messages to delete. (maximal 100) +- `User ID` `(Type: Snowflake || Flag: Vacantable)`: If a user ID is provided, the bot will only delete messages from that user. +- `Remove pinned messages?` `(Type: Bool || Flag: Optional)`: Decides whether to delete pinned messages or not. The default is `yes`. + +> Discord doesn't allow deleting messages in bulk which are over 2 weeks old. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managemessages` + +## Example +``` +$nomention +$clear[$message] +``` + +### Before +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 5 +- user_id: 729343563401265193 + username: Nicky + color: "#509070" + content: | + 4 +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + 3 +- user_id: 437154602626973697 + username: Kito + color: "#4365ab" + content: | + 2 +- user_id: 325663449680052227 + username: Emperor Toaster + color: "#939394" + content: | + 1 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 3 +``` +\ +### After +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 5 +- user_id: 729343563401265193 + username: Nicky + color: "#509070" + content: | + 4 +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + 3 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/clearReactions.md b/src/bdscript/clearReactions.md index 3cd46810b10..c144367b89a 100644 --- a/src/bdscript/clearReactions.md +++ b/src/bdscript/clearReactions.md @@ -1,49 +1,49 @@ -# $clearReactions -Removes reactions from the provided message. - -## Syntax -``` -$clearReactions[Channel ID;Message ID;Emoji] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that the message belongs to. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to remove the reaction from. -- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji to remove from the message. Use `!all` to clear all reactions. - -## Example -``` -$nomention -$clearReactions[$channelID;$message;✅] -``` -### Before -``` discord yaml -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Message ID: 1216863258708021248 - reactions: - - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Twemoji12_2705.svg/640px-Twemoji12_2705.svg.png - name: ":white_check_mark:" - count: 179 - reacted: true -``` -\ -### After -``` discord yaml -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Message ID: 1216863258708021248 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 1216863258708021248 -``` +# $clearReactions +Removes reactions from the provided message. + +## Syntax +``` +$clearReactions[Channel ID;Message ID;Emoji] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that the message belongs to. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to remove the reaction from. +- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji to remove from the message. Use `!all` to clear all reactions. + +## Example +``` +$nomention +$clearReactions[$channelID;$message;✅] +``` +### Before +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Message ID: 1216863258708021248 + reactions: + - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Twemoji12_2705.svg/640px-Twemoji12_2705.svg.png + name: ":white_check_mark:" + count: 52 + reacted: true +``` +\ +### After +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Message ID: 1216863258708021248 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1216863258708021248 +``` diff --git a/src/bdscript/closeTicket.md b/src/bdscript/closeTicket.md index 8f0507e2d8f..81d9f381317 100644 --- a/src/bdscript/closeTicket.md +++ b/src/bdscript/closeTicket.md @@ -1,16 +1,16 @@ -# $closeTicket -Deletes the ticket channel (has to be created with `$newTicket`). - -## Syntax -``` -$closeTicket[Error message] -``` - -### Parameters -- `Error message` `(Type: String || Flag: Emptiable)`: The error to return if the channel isn't a ticket. - -## Example -``` -$nomention -$closeTicket[That channel isn't a ticket!] -``` +# $closeTicket +Deletes the ticket channel (has to be created with `$newTicket`). + +## Syntax +``` +$closeTicket[Error message] +``` + +### Parameters +- `Error message` `(Type: String || Flag: Emptiable)`: The error to return if the channel isn't a ticket. + +## Example +``` +$nomention +$closeTicket[That channel isn't a ticket!] +``` diff --git a/src/bdscript/color.md b/src/bdscript/color.md index a105bcb6fb2..31cf38cd1ef 100644 --- a/src/bdscript/color.md +++ b/src/bdscript/color.md @@ -1,35 +1,35 @@ -# $color -Sets the embed border color. - -## Syntax -``` -$color[Color hex;(Index)] -``` - -### Parameters -- `Color hex` `(Type: Color || Flag: Emptiable)`: The [color hex](https://htmlcolorcodes.com/color-picker) to set the embed border color as. You can also use color integer number. -- `Index` `(Type: Integer || Flag: Optional)`: What embed the color border should belong to (Optional). The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$description[âŦ…ī¸ That is the embed color border!] -$color[#673ab7] -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: - embed: - description: âŦ…ī¸ That is the embed color border! - color: "#673ab7" -``` +# $color +Sets the embed border color. + +## Syntax +``` +$color[Color hex;(Index)] +``` + +### Parameters +- `Color hex` `(Type: Color || Flag: Emptiable)`: The [color hex](https://htmlcolorcodes.com/color-picker) to set the embed border color as. You can also use color integer number. +- `Index` `(Type: Integer || Flag: Optional)`: What embed the color border should belong to (Optional). The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$description[âŦ…ī¸ That is the embed color border!] +$color[#673ab7] +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + description: âŦ…ī¸ That is the embed color border! + color: "#673ab7" +``` diff --git a/src/bdscript/colorRole.md b/src/bdscript/colorRole.md index 16bbf124ef6..5636dcea8b7 100644 --- a/src/bdscript/colorRole.md +++ b/src/bdscript/colorRole.md @@ -1,38 +1,36 @@ -# $colorRole -Changes the color of the mentioned role. - -## Syntax -``` -$colorRole[Color hex] -``` - -### Parameters -- `Color hex` `(Type: Color || Flag: Required)`: The [color hex](https://htmlcolorcodes.com/color-picker) to change the mentioned role color to. - -## Example -``` -$nomention -$onlyPerms[manageroles;❌ You need the `MANAGE_ROLES` permission to use that!] -$argsCheck[>2;Please provide the needed arguments! The `colorHex` and `role` arguments are needed.] -$colorRole[$noMentionMessage] -✅ Changed the role color of <@&$mentionedRoles[1]> to `$noMentionMessage`! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - roles: - cool role: "#E11F0E" - content: | - !example <@cool role> #E11F0E - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - ✅ Changed the role color of <@cool role> to #E11F0E! -``` -\ -![example](https://user-images.githubusercontent.com/111157596/257056832-3040aa89-91ea-428e-b362-3ed075cf620e.png) +# $colorRole +Changes the color of the mentioned role. + +## Syntax +``` +$colorRole[Color hex] +``` + +### Parameters +- `Color hex` `(Type: Color || Flag: Required)`: The [color hex](https://htmlcolorcodes.com/color-picker) to change the mentioned role color to. + +## Example +``` +$nomention +$colorRole[$noMentionMessage] +✅ Changed the role color of <@&$mentionedRoles[1]> to `$noMentionMessage`! +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + roles: + cool role: "#E11F0E" + content: | + !example <@cool role> #E11F0E +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + ✅ Changed the role color of <@cool role> to #E11F0E! +``` +\ +![example](https://user-images.githubusercontent.com/111157596/257056832-3040aa89-91ea-428e-b362-3ed075cf620e.png) diff --git a/src/bdscript/commandFolder.md b/src/bdscript/commandFolder.md new file mode 100644 index 00000000000..bbf14f36a8e --- /dev/null +++ b/src/bdscript/commandFolder.md @@ -0,0 +1,28 @@ +# $commandFolder +Returns the current command folder. + +## Syntax +``` +$commandFolder +``` + +## Example +``` +$nomention +Commmand folder: $commandFolder +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello world! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Commmand folder: Moderation +``` diff --git a/src/bdscript/commandName.md b/src/bdscript/commandName.md new file mode 100644 index 00000000000..32fb75d2dfe --- /dev/null +++ b/src/bdscript/commandName.md @@ -0,0 +1,28 @@ +# $commandName +Returns the current command name. + +## Syntax +``` +$commandName +``` + +## Example +``` +$nomention +Commmand name: $commandName +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello world! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Commmand name: example +``` diff --git a/src/bdscript/commandTrigger.md b/src/bdscript/commandTrigger.md new file mode 100644 index 00000000000..8e9628c1e8a --- /dev/null +++ b/src/bdscript/commandTrigger.md @@ -0,0 +1,32 @@ +# $commandTrigger +Returns the current command trigger. + +```admonish info +Returns empty value in the callbacks! +``` + +## Syntax +``` +$commandTrigger +``` + +## Example +``` +$nomention +Commmand trigger: $commandTrigger +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello world! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Commmand trigger: !example +``` diff --git a/src/bdscript/commandsCount.md b/src/bdscript/commandsCount.md index 6601a19a8fa..fcf0926b710 100644 --- a/src/bdscript/commandsCount.md +++ b/src/bdscript/commandsCount.md @@ -1,28 +1,28 @@ -# $commandsCount -Returns how many commands the bot has total. - -## Syntax -``` -$commandsCount -``` - -## Example -``` -$nomention -I have $commandsCount commands! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - I have 174 commands! -``` +# $commandsCount +Returns how many commands the bot has total. + +## Syntax +``` +$commandsCount +``` + +## Example +``` +$nomention +I have $commandsCount commands! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello world! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + I have 85 commands! +``` diff --git a/src/bdscript/cooldown.md b/src/bdscript/cooldown.md index 3b030891e45..3dec94239a4 100644 --- a/src/bdscript/cooldown.md +++ b/src/bdscript/cooldown.md @@ -1,83 +1,83 @@ -# $cooldown -Sets a cooldown. The user can not run the command again, until the 'duration' is up. - -## Syntax -``` -$cooldown[Duration;Error message] -``` - -### Parameters -- `Duration` `(Type: Duration || Flag: Required)`: The duration of this cooldown. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the cooldown duration is still ongoing. `%time%` and other related functions can be used here. - -| Time | In Usage | Limit -| ---------------- | --------------------- | ------------- -Year | y | 191568 -Week | w | 9988936 -Day | d | 69922554 -Hour | h | 1678141301 -Minute | m | 100688478068 -Second | s | 6041308684139 - -> `%time%` returns how much time is left on the cooldown. - -## Example -``` -$nomention -$cooldown[30s;Please wait %time%, then use that command again!] -Hi! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Please wait 27 Seconds, then use that command again! -``` -\ - -> If you are using **BDScript 2**, then all functions above `$cooldown[]` will always work. -> -> ❌ Not correct: -> ``` -> $nomention -> $setUserVar[Money;$sum[$getUserVar[Money];5]] -> $sendMessage[You worked successfully and earned 5 đŸĒ™] -> $cooldown[30s;Please wait %time%, then use !work command again!] -> ``` -> Your bot will always add 5đŸĒ™ to "Money" variable. -> -> ✅ Correct: -> ``` -> $nomention -> $cooldown[30s;Please wait %time%, then use !work command again!] -> $setUserVar[Money;$sum[$getUserVar[Money];5]] -> $sendMessage[You worked successfully and earned 5 đŸĒ™] -> ``` -> How [`$setUserVar[]`](./findUser.md) and [`$sendMessage[]`](./sendMessage.md) works? - -### Recommendation -You can also use these functions: -- [`$getCooldown[]`](./getCooldown.md) -- [`$serverCooldown[]`](./serverCooldown.md) -- [`$globalCooldown[]`](./globalCooldown.md) +# $cooldown +Sets a cooldown. The user can not run the command again, until the 'duration' is up. + +## Syntax +``` +$cooldown[Duration;Error message] +``` + +### Parameters +- `Duration` `(Type: Duration || Flag: Required)`: The duration of this cooldown. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the cooldown duration is still ongoing. `%time%` and other related functions can be used here. + +| Time | In Usage | Limit +| ---------------- | --------------------- | ------------- +Year | y | 191568 +Week | w | 9988936 +Day | d | 69922554 +Hour | h | 1678141301 +Minute | m | 100688478068 +Second | s | 6041308684139 + +> `%time%` returns how much time is left on the cooldown. + +## Example +``` +$nomention +$cooldown[30s;Please wait %time%, then use that command again!] +Hi! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Please wait 27 Seconds, then use that command again! +``` +\ + +> If you are using **BDScript 2**, then all functions above `$cooldown[]` will always work. +> +> ❌ Not correct: +> ``` +> $nomention +> $setUserVar[Money;$sum[$getUserVar[Money];5]] +> $sendMessage[You worked successfully and earned 5 đŸĒ™] +> $cooldown[30s;Please wait %time%, then use !work command again!] +> ``` +> Your bot will always add 5đŸĒ™ to "Money" variable. +> +> ✅ Correct: +> ``` +> $nomention +> $cooldown[30s;Please wait %time%, then use !work command again!] +> $setUserVar[Money;$sum[$getUserVar[Money];5]] +> $sendMessage[You worked successfully and earned 5 đŸĒ™] +> ``` +> How [`$setUserVar[]`](./findUser.md) and [`$sendMessage[]`](./sendMessage.md) works? + +### Recommendation +You can also use these functions: +- [`$getCooldown[]`](./getCooldown.md) +- [`$serverCooldown[]`](./serverCooldown.md) +- [`$globalCooldown[]`](./globalCooldown.md) diff --git a/src/bdscript/createChannel.md b/src/bdscript/createChannel.md index e28a4a60d0d..2f8befdd0b2 100644 --- a/src/bdscript/createChannel.md +++ b/src/bdscript/createChannel.md @@ -1,47 +1,47 @@ -# $createChannel -Creates a new channel. - -## Syntax -``` -$createChannel[Name;Type;(Category ID)] -``` -> Discord allows users to create up to 500 channels per server. This includes all channel types. - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the new channel. - > Channel names can have a maximum of 100 characters. -- `Type` `(Type: Enum || Flag: Required)`: The channel type. Channel types: - - `category` - - `text` - - `voice` - - `stage` - - `forum` -- `Category ID` `(Type: Snowflake || Flag: Optional)`: The category to put the channel in (if applicable). -> [How to get the Category ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) - -## Example -``` -$nomention -$createChannel[cool-channel;text] -New channel created! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - New channel created! -``` -\ - -![example](https://user-images.githubusercontent.com/69215413/125972524-95307b17-bfcc-4525-a4fa-1d58a30a1fa9.png) - -> [You can use `$channelID[]` to return the channel ID.](./authorIDComplex.md) +# $createChannel +Creates a new channel. + +## Syntax +``` +$createChannel[Name;Type;(Category ID)] +``` +> Discord allows users to create up to 500 channels per server. This includes all channel types. + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name of the new channel. + > Channel names can have a maximum of 100 characters. +- `Type` `(Type: Enum || Flag: Required)`: The channel type. Channel types: + - `category` + - `text` + - `voice` + - `stage` + - `forum` +- `Category ID` `(Type: Snowflake || Flag: Optional)`: The category to put the channel in (if applicable). +> [How to get the Category ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) + +## Example +``` +$nomention +$createChannel[cool-channel;text] +New channel created! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + New channel created! +``` +\ + +![example](https://user-images.githubusercontent.com/69215413/125972524-95307b17-bfcc-4525-a4fa-1d58a30a1fa9.png) + +> [You can use `$channelID[]` to return the channel ID.](./authorIDComplex.md) diff --git a/src/bdscript/createRole.md b/src/bdscript/createRole.md index e9c3206695b..5cc2df5edc5 100644 --- a/src/bdscript/createRole.md +++ b/src/bdscript/createRole.md @@ -1,43 +1,43 @@ -# $createRole -Creates a new role. - -## Syntax -``` -$createRole[Role name;Color hex;Hoist?;Mentionable?] -``` -> Discord allows users to create up to 250 roles per server. - -### Parameters -- `Role name` `(Type: String || Flag: Required)`: The name to give the new role. -> Role names can have a maximum of 100 characters. -- `Color hex` `(Type: Color || Flag: Required)`: The [color hex](https://htmlcolorcodes.com/color-picker) of the new role. -- `Hoist?` `(Type: Bool || Flag: Vacantable)`: Whether the role should be displayed separately (hoisted) or not. `no` means the role won't be hoisted, `yes` means it will.\ - ![example](https://user-images.githubusercontent.com/69215413/122795705-965e9480-d28b-11eb-8e4e-98338f143ecb.png) -- `Mentionable?` `(Type: Bool || Flag: Vacantable)`: Whether the role should be mentionable by everyone. `no` means the role won't be mentionable, `yes` means it will.\ - ![example](https://user-images.githubusercontent.com/69215413/122795765-a37b8380-d28b-11eb-8f06-c23e01bafc11.png) - -## Example -``` -$nomention -$createRole[Cool Role;#FFFF00;yes;no] -New role created! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - New role created! -``` -\ -![example](https://user-images.githubusercontent.com/69215413/125973030-7c9b980c-cffb-4f8e-aacc-a644a6fa23c3.png) - -> [You can use `$roleID[]` to return the role ID.](./roleID.md) +# $createRole +Creates a new role. + +## Syntax +``` +$createRole[Role name;Color hex;Hoist?;Mentionable?] +``` +> Discord allows users to create up to 250 roles per server. + +### Parameters +- `Role name` `(Type: String || Flag: Required)`: The name to give the new role. +> Role names can have a maximum of 100 characters. +- `Color hex` `(Type: Color || Flag: Required)`: The [color hex](https://htmlcolorcodes.com/color-picker) of the new role. +- `Hoist?` `(Type: Bool || Flag: Vacantable)`: Whether the role should be displayed separately (hoisted) or not. `no` means the role won't be hoisted, `yes` means it will.\ + ![example](https://user-images.githubusercontent.com/69215413/122795705-965e9480-d28b-11eb-8e4e-98338f143ecb.png) +- `Mentionable?` `(Type: Bool || Flag: Vacantable)`: Whether the role should be mentionable by everyone. `no` means the role won't be mentionable, `yes` means it will.\ + ![example](https://user-images.githubusercontent.com/69215413/122795765-a37b8380-d28b-11eb-8f06-c23e01bafc11.png) + +## Example +``` +$nomention +$createRole[Cool Role;#FFFF00;yes;no] +New role created! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + New role created! +``` +\ +![example](https://user-images.githubusercontent.com/69215413/125973030-7c9b980c-cffb-4f8e-aacc-a644a6fa23c3.png) + +> [You can use `$roleID[]` to return the role ID.](./roleID.md) diff --git a/src/bdscript/creationDate.md b/src/bdscript/creationDate.md index ec809ca4a2a..43094e85e43 100644 --- a/src/bdscript/creationDate.md +++ b/src/bdscript/creationDate.md @@ -1,59 +1,63 @@ -# $creationDate -Returns the creation date of any valid Discord Snowflake ID. - -## Syntax -``` -$creationDate[ID;(Format)] -``` - -> Uses GoLang date format - -### Parameters -- `ID` `(Type: Snowflake || Flag: Required)`: The ID from which to get the creation date. The ID can be a `User ID`, a `Role ID`, a `Message ID`, a `Emoji ID`, or a `Guild ID`. -> [How to get the ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) -- `Format` `(Type: String || Flag: Optional)`: Customize the default time format output. -> Click [me](../resources/timeFormat.md) to check all supported time format values. - -## Example -- Default format - ``` - $nomention - $creationDate[$authorID] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 2021-01-26 -``` -\ - -- Custom format - ``` - $nomention - $creationDate[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - January 26, 2021 at 10:18 AM (UTC +00:00) -``` +# $creationDate +Returns the creation date of any valid Discord Snowflake ID. + +## Syntax +``` +$creationDate[ID;(Format)] +``` + +> Uses GoLang date format + +### Parameters +- `ID` `(Type: Snowflake || Flag: Required)`: The ID from which to get the creation date. The ID can be a `User ID`, a `Role ID`, a `Message ID`, a `Emoji ID`, or a `Guild ID`. +> [How to get the ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) +- `Format` `(Type: String || Flag: Optional)`: Customize the default time format output. +> Click [me](../resources/timeFormat.md) to check all supported time format values. + +## Example +- Default format + ``` + $nomention + $creationDate[$authorID] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 2021-01-26 +``` +\ + +- Custom format + ``` + $nomention + $creationDate[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + January 26, 2021 at 10:18 AM (UTC +00:00) +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/cropText.md b/src/bdscript/cropText.md index f80fcfb35cf..9a55bcbabf4 100644 --- a/src/bdscript/cropText.md +++ b/src/bdscript/cropText.md @@ -1,33 +1,37 @@ -# $cropText -Crops the provided text. If text is cropped then the `ending` is added at the end of the text. - -## Syntax -``` -$cropText[Text;Max characters;Ending] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to crop. -- `Max characters` `(Type: Integer || Flag: Required)`: The maximum amount of characters. Subsequent characters are removed. -- `Ending` `(Type: String || Flag: Emptiable)`: The text to end the cropped text with (if the text was cropped). - -## Example -``` -$nomention -$cropText[$message;50;...] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hello everyone! This message is very cool. 😎 We hope you enjoy coding in BDFD, bye! -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello everyone! This message is very cool. 😎 We ho... -``` +# $cropText +Crops the provided text. If text is cropped then the `ending` is added at the end of the text. + +## Syntax +``` +$cropText[Text;Max characters;Ending] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to crop. +- `Max characters` `(Type: Integer || Flag: Required)`: The maximum amount of characters. Subsequent characters are removed. +- `Ending` `(Type: String || Flag: Emptiable)`: The text to end the cropped text with (if the text was cropped). + +## Example +``` +$nomention +$cropText[$message;50;...] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello everyone! This message is very cool. 😎 We hope you enjoy coding in BDFD, bye! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello everyone! This message is very cool. 😎 We ho... +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/customEmoji.md b/src/bdscript/customEmoji.md index 32644f0c9a4..49c31c241dc 100644 --- a/src/bdscript/customEmoji.md +++ b/src/bdscript/customEmoji.md @@ -1,19 +1,22 @@ -# $customEmoji -Returns a custom emoji. -> 🧙‍♂ī¸ **Note:** We recommend emoji IDs instead of `$customEmoji` for public bots. - -## Syntax -``` -$customEmoji[emoji name] -``` - -### Parameters -- `emoji name` `(Type: String || Flag: Required)`: The name of the emoji to return. - -## Example -``` -$nomention -Hello there! $customEmoji[Wave] -``` - -![Example](https://user-images.githubusercontent.com/69215413/122825469-fa934f80-d2af-11eb-9563-67552204beb5.png) +# $customEmoji +Returns a custom emoji. + +```admonish danger title="Important" +We recommend emoji IDs instead of `$customEmoji[]` **for public** bots. +``` + +## Syntax +``` +$customEmoji[Emoji name] +``` + +### Parameters +- `Emoji name` `(Type: String || Flag: Required)`: The name of the emoji to return. + +## Example +``` +$nomention +Hello there! $customEmoji[Wave] +``` + +![Example](https://user-images.githubusercontent.com/69215413/122825469-fa934f80-d2af-11eb-9563-67552204beb5.png) diff --git a/src/bdscript/customID.md b/src/bdscript/customID.md index 31e998b8291..c86085a1a00 100644 --- a/src/bdscript/customID.md +++ b/src/bdscript/customID.md @@ -1,41 +1,41 @@ -# $customID -Can only be used with the [`$onInteraction`](../callbacks/onInteractionComplex.md) callback. Returns the custom ID of this interaction. - -## Syntax -``` -$customID -``` - -## Example -`!buttons` code: -``` -$nomention -Pick a button! -$addButton[no;button1-$authorID;Button #1;primary;no;] -$addButton[no;button2-$authorID;Button #2;primary;no;] -``` -> You may remove `-$authorID` from `$addButton[]` to allow all users to use the interaction, rather than just the author. - -`$onInteraction` code: -``` -$nomention -$if[$customID==button1-$authorID] -You picked button #1! -$editButton[$customID;Button #1;success;yes;] -$editButton[button2-$authorID;Button #2;danger;yes;] -$endif - -$if[$customID==button2-$authorID] -You picked button #2! -$editButton[button1-$authorID;Button #1;danger;yes;] -$editButton[$customID;Button #2;success;yes;] -$endif -``` -> You may remove `-$authorID` from the `$if[]` statement to allow all users to use the interaction, rather than just the author. - -#### Result -Before pressing a button:\ -![](https://user-images.githubusercontent.com/69215413/131228448-75afbbbd-3ac6-4348-8ebd-9e7661bf82df.png) - -After pressing a button:\ -![](https://user-images.githubusercontent.com/69215413/131228494-33298b23-b5e0-47af-b5f5-77e5ea864815.png) +# $customID +Can only be used with the [`$onInteraction`](../callbacks/onInteractionComplex.md) callback. Returns the custom ID of this interaction. + +## Syntax +``` +$customID +``` + +## Example +`!buttons` code: +``` +$nomention +Pick a button! +$addButton[no;button1-$authorID;Button #1;primary;no;] +$addButton[no;button2-$authorID;Button #2;primary;no;] +``` +> You may remove `-$authorID` from `$addButton[]` to allow all users to use the interaction, rather than just the author. + +`$onInteraction` code: +``` +$nomention +$if[$customID==button1-$authorID] +You picked button #1! +$editButton[$customID;Button #1;success;yes;] +$editButton[button2-$authorID;Button #2;danger;yes;] +$endif + +$if[$customID==button2-$authorID] +You picked button #2! +$editButton[button1-$authorID;Button #1;danger;yes;] +$editButton[$customID;Button #2;success;yes;] +$endif +``` +> You may remove `-$authorID` from the `$if[]` statement to allow all users to use the interaction, rather than just the author. + +#### Result +Before pressing a button:\ +![](https://user-images.githubusercontent.com/69215413/131228448-75afbbbd-3ac6-4348-8ebd-9e7661bf82df.png) + +After pressing a button:\ +![](https://user-images.githubusercontent.com/69215413/131228494-33298b23-b5e0-47af-b5f5-77e5ea864815.png) diff --git a/src/bdscript/date.md b/src/bdscript/date.md index 5809391b4a8..c35f93fb965 100644 --- a/src/bdscript/date.md +++ b/src/bdscript/date.md @@ -1,29 +1,34 @@ -# $date -Returns the current date. - -> You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$date -``` - -## Example -``` -$nomention -Today's Date: $date -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - content: | - Today's Date: 2024-06-22 -``` +# $date +Returns the current date. + +## Syntax +``` +$date +``` + +## Example +``` +$nomention +Current Date: $date +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/day.md b/src/bdscript/day.md index 712c6f6d421..e43e1f13a80 100644 --- a/src/bdscript/day.md +++ b/src/bdscript/day.md @@ -1,31 +1,33 @@ -# $day -Returns the current day of the month. - -> You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$day -``` - -## Example -``` -$nomention -Current Day: $day -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - content: | -
-``` - - +# $day +Returns the current day of the month. + +## Syntax +``` +$day +``` + +## Example +``` +$nomention +Current Day: $day +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/defer.md b/src/bdscript/defer.md index d0802ffc036..69b22ec5492 100644 --- a/src/bdscript/defer.md +++ b/src/bdscript/defer.md @@ -1,52 +1,52 @@ -# $defer -Defers response to an interaction from components and slash commands. - -## Syntax -``` -$defer -``` - -## Example -Sometimes the code we write needs more time to execute fully. -In normal commands, this isn't a problem, but interactions are different. -Interactions have a 3-second long timeout in which our code needs to respond in. -The `$defer` function solves this by telling Discord to wait a bit longer for our response. -With `$defer` we have 15 minutes to finish executing our code. - -This is an example of a code that will take more than 3 seconds to execute. -``` -$nomention - -$title[$getEmbedData[$channelID;$message[message-id];1;title];1] -$description[$getEmbedData[$channelID;$message[message-id];1;description];1] -$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1] -$color[$getEmbedData[$channelID;$message[message-id];1;color];1] - -$title[$getEmbedData[$channelID;$message[message-id];2;title];2] -$description[$getEmbedData[$channelID;$message[message-id];2;description];2] -$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2] -$color[$getEmbedData[$channelID;$message[message-id];2;color];2] -``` -Let's execute it. - -### Without `$defer` - -![Without](https://user-images.githubusercontent.com/70456337/189966580-203e3626-02e5-47a6-a649-07ff55079414.gif) - -### With `$defer` -``` -$nomention -$defer - -$title[$getEmbedData[$channelID;$message[message-id];1;title];1] -$description[$getEmbedData[$channelID;$message[message-id];1;description];1] -$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1] -$color[$getEmbedData[$channelID;$message[message-id];1;color];1] - -$title[$getEmbedData[$channelID;$message[message-id];2;title];2] -$description[$getEmbedData[$channelID;$message[message-id];2;description];2] -$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2] -$color[$getEmbedData[$channelID;$message[message-id];2;color];2] -``` - -![With](https://user-images.githubusercontent.com/70456337/189966702-1dafdaf5-f706-419a-a150-c7eead0c0e17.gif) +# $defer +Defers response to an interaction from components and slash commands. + +## Syntax +``` +$defer +``` + +## Example +Sometimes the code we write needs more time to execute fully. +In normal commands, this isn't a problem, but interactions are different. +Interactions have a 3-second long timeout in which our code needs to respond in. +The `$defer` function solves this by telling Discord to wait a bit longer for our response. +With `$defer` we have 15 minutes to finish executing our code. + +This is an example of a code that will take more than 3 seconds to execute. +``` +$nomention + +$title[$getEmbedData[$channelID;$message[message-id];1;title];1] +$description[$getEmbedData[$channelID;$message[message-id];1;description];1] +$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1] +$color[$getEmbedData[$channelID;$message[message-id];1;color];1] + +$title[$getEmbedData[$channelID;$message[message-id];2;title];2] +$description[$getEmbedData[$channelID;$message[message-id];2;description];2] +$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2] +$color[$getEmbedData[$channelID;$message[message-id];2;color];2] +``` +Let's execute it. + +### Without `$defer` + +![Without](https://user-images.githubusercontent.com/70456337/189966580-203e3626-02e5-47a6-a649-07ff55079414.gif) + +### With `$defer` +``` +$nomention +$defer + +$title[$getEmbedData[$channelID;$message[message-id];1;title];1] +$description[$getEmbedData[$channelID;$message[message-id];1;description];1] +$footer[$getEmbedData[$channelID;$message[message-id];1;footer];1] +$color[$getEmbedData[$channelID;$message[message-id];1;color];1] + +$title[$getEmbedData[$channelID;$message[message-id];2;title];2] +$description[$getEmbedData[$channelID;$message[message-id];2;description];2] +$footer[$getEmbedData[$channelID;$message[message-id];2;footer];2] +$color[$getEmbedData[$channelID;$message[message-id];2;color];2] +``` + +![With](https://user-images.githubusercontent.com/70456337/189966702-1dafdaf5-f706-419a-a150-c7eead0c0e17.gif) diff --git a/src/bdscript/deleteChannels.md b/src/bdscript/deleteChannels.md index 3b4bbf74369..bfb1c9dad3a 100644 --- a/src/bdscript/deleteChannels.md +++ b/src/bdscript/deleteChannels.md @@ -1,40 +1,42 @@ -# $deleteChannels -Deletes the provided channel(s). - -## Syntax -``` -$deleteChannels[Channel IDs;...] -``` - -### Parameters -- `Channel IDs` `(Type: Snowflake || Flag: Required)`: The channels to delete. Use semicolons `;` as a separator to separate multiple channel IDs. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managechannels` - -## Example -``` -$nomention -Successfully deleted #$channelName[$mentionedChannels[1]] -$deleteChannels[$mentionedChannels[1]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <#main-chat> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Successfully deleted #main-chat - ``` -\ -![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/6479e1dd-da03-431a-85e8-1f8ff18bf84c) - -> How [`$channelName[]`](./channelName.md) and [`$mentionedChannels[]`](./mentionedChannels.md) works? +# $deleteChannels +Deletes the provided channel(s). + +## Syntax +``` +$deleteChannels[Channel IDs;...] +``` + +### Parameters +- `Channel IDs` `(Type: Snowflake || Flag: Required)`: The channels to delete. Use semicolons `;` as a separator to separate multiple channel IDs. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managechannels` + +## Example +``` +$nomention +Successfully deleted #$channelName[$mentionedChannels[1]] +$deleteChannels[$mentionedChannels[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#main-chat> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Successfully deleted #main-chat + ``` +\ +![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/6479e1dd-da03-431a-85e8-1f8ff18bf84c) + +```admonish question title="What is this?" +How [`$channelName[]`](./channelName.md) and [`$mentionedChannels[]`](./mentionedChannels.md) works? +``` diff --git a/src/bdscript/deleteChannelsByName.md b/src/bdscript/deleteChannelsByName.md index 929d9ff8594..98b3f75d868 100644 --- a/src/bdscript/deleteChannelsByName.md +++ b/src/bdscript/deleteChannelsByName.md @@ -1,40 +1,40 @@ -# $deleteChannelsByName -Deletes all channels matching the names provided. - -## Syntax -``` -$deleteChannelsByName[Channel name;...] -``` - -### Parameters -- `Channel name` `(Type: String || Flag: Required)`: The name(s) of the channel(s) to delete. Use semicolons `;` as a separator to separate multiple channel names. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managechannels` - -## Example -``` -$nomention -Successfully deleted #$channelName[$channelID[$message]]! -$deleteChannelsByName[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example main-chat -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Successfully deleted #main-chat - ``` -\ -![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/6479e1dd-da03-431a-85e8-1f8ff18bf84c) - -> How [`$channelName[]`](./channelName.md) and [`$channelID[]`](./channelIDComplex.md) works? +# $deleteChannelsByName +Deletes all channels matching the names provided. + +## Syntax +``` +$deleteChannelsByName[Channel name;...] +``` + +### Parameters +- `Channel name` `(Type: String || Flag: Required)`: The name(s) of the channel(s) to delete. Use semicolons `;` as a separator to separate multiple channel names. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managechannels` + +## Example +``` +$nomention +Successfully deleted #$channelName[$channelID[$message]]! +$deleteChannelsByName[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example main-chat +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Successfully deleted #main-chat + ``` +\ +![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/6479e1dd-da03-431a-85e8-1f8ff18bf84c) + +> How [`$channelName[]`](./channelName.md) and [`$channelID[]`](./channelIDComplex.md) works? diff --git a/src/bdscript/deleteIn.md b/src/bdscript/deleteIn.md index 2550df67115..e7ba5dec45e 100644 --- a/src/bdscript/deleteIn.md +++ b/src/bdscript/deleteIn.md @@ -1,21 +1,21 @@ -# $deleteIn -Deletes the bot's response after the provided duration. - -## Syntax -``` -$deleteIn[Duration] -``` - -### Parameters -- `Duration` `(Type: Duration || Flag: Required)`: The time to wait before deleting the message (e.g `3s`, `30s`, `1m`, etc). Max duration is `40m` (`120m` for [premium bots](../premium/introduction.md)). - - -## Example -``` -$nomention -Hello World! -$deleteIn[3s] -``` -*The message deletes itself after 3 seconds.* - -![example](https://user-images.githubusercontent.com/111157596/232803197-f11780dd-754b-4203-8556-54629a677a65.gif) +# $deleteIn +Deletes the bot's response after the provided duration. + +## Syntax +``` +$deleteIn[Duration] +``` + +### Parameters +- `Duration` `(Type: Duration || Flag: Required)`: The time to wait before deleting the message (e.g `3s`, `30s`, `1m`, etc). Max duration is `40m` (`120m` for [premium bots](../premium/introduction.md)). + + +## Example +``` +$nomention +Hello World! +$deleteIn[3s] +``` +*The message deletes itself after 3 seconds.* + +![example](https://user-images.githubusercontent.com/111157596/232803197-f11780dd-754b-4203-8556-54629a677a65.gif) diff --git a/src/bdscript/deleteMessage.md b/src/bdscript/deleteMessage.md index fd9630f99d3..b0019d6dd9d 100644 --- a/src/bdscript/deleteMessage.md +++ b/src/bdscript/deleteMessage.md @@ -1,24 +1,24 @@ -# $deleteMessage -Deletes a message. - -## Syntax -``` -$deleteMessage[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel ID where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message which will be deleted. - -> [How to get the Channel ID and Message ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) -> -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managemessages` - -## Example -``` -$nomention -$deleteMessage[$channelID;$messageID] -Hello $username! -``` +# $deleteMessage +Deletes a message. + +## Syntax +``` +$deleteMessage[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel ID where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message which will be deleted. + +> [How to get the Channel ID and Message ID guide.](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) +> +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managemessages` + +## Example +``` +$nomention +$deleteMessage[$channelID;$messageID] +Hello $username! +``` diff --git a/src/bdscript/deleteRole.md b/src/bdscript/deleteRole.md index be2965e20cc..e455560587a 100644 --- a/src/bdscript/deleteRole.md +++ b/src/bdscript/deleteRole.md @@ -1,40 +1,40 @@ -# $deleteRole -Deletes a role. - -## Syntax -``` -$deleteRole[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to delete. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `manageroles` - -## Example -``` -$nomention -$deleteRole[$findRole[$message]] -Successfully deleted $roleName[$findRole[$message]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Cool Role -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Successfully deleted Cool Role - ``` -\ -![example](https://user-images.githubusercontent.com/111157596/239688761-3bd88f60-8a5c-48e9-9b23-677b2e4ecd17.png) - -> How [`$findRole[]`](./findRole.md), [`$roleName[]`](./roleName.md) and [`$message`](./message.md) works? +# $deleteRole +Deletes a role. + +## Syntax +``` +$deleteRole[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to delete. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `manageroles` + +## Example +``` +$nomention +$deleteRole[$findRole[$message]] +Successfully deleted $roleName[$findRole[$message]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Cool Role +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Successfully deleted Cool Role + ``` +\ +![example](https://user-images.githubusercontent.com/111157596/239688761-3bd88f60-8a5c-48e9-9b23-677b2e4ecd17.png) + +> How [`$findRole[]`](./findRole.md), [`$roleName[]`](./roleName.md) and [`$message`](./message.md) works? diff --git a/src/bdscript/deletecommand.md b/src/bdscript/deletecommand.md index afb7022ab33..8eb1f6cae02 100644 --- a/src/bdscript/deletecommand.md +++ b/src/bdscript/deletecommand.md @@ -1,28 +1,28 @@ -# $deletecommand -Deletes the author's command message. - -> The bot must have the `manage_messages` permission. - -## Syntax -``` -$deletecommand -``` - -> Sometimes a message may be deleted, but you will still see it. This is a discord bug. - -## Example -``` -$nomention -$deletecommand -Hello world! -``` - -``` discord yaml -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello world! -``` +# $deletecommand +Deletes the author's command message. + +> The bot must have the `manage_messages` permission. + +## Syntax +``` +$deletecommand +``` + +> Sometimes a message may be deleted, but you will still see it. This is a discord bug. + +## Example +``` +$nomention +$deletecommand +Hello world! +``` + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello world! +``` diff --git a/src/bdscript/description.md b/src/bdscript/description.md index 20f17bdb5ac..6c2e4046ff3 100644 --- a/src/bdscript/description.md +++ b/src/bdscript/description.md @@ -1,19 +1,32 @@ -# $description -Adds a description to an embed. - -## Syntax -``` -$description[message;(index)] -``` - -### Parameters -- `message` `(Type: String || Flag: Emptiable)`: The text to set the description as. It cannot exceed more than 4096 characters. -- `index` `(Type: Integer || Flag: Optional)`: What embed the description should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$description[This is a description! 😎] -``` - -![example](https://user-images.githubusercontent.com/69215413/125975247-34376dd7-faa1-4426-a774-59294a3962c0.png) +# $description +Adds a description to an embed. + +## Syntax +``` +$description[message;(index)] +``` + +### Parameters +- `message` `(Type: String || Flag: Emptiable)`: The text to set the description as. It cannot exceed more than 4096 characters. +- `index` `(Type: Integer || Flag: Optional)`: What embed the description should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$description[This is a description!] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + description: This is a description! +``` diff --git a/src/bdscript/disableInnerSpaceRemoval.md b/src/bdscript/disableInnerSpaceRemoval.md index 27830f0e568..72be1b44d2a 100644 --- a/src/bdscript/disableInnerSpaceRemoval.md +++ b/src/bdscript/disableInnerSpaceRemoval.md @@ -1,23 +1,50 @@ -# $disableInnerSpaceRemoval -Disables the removal of multiple spaces from within the message. - -## Syntax -``` -$disableInnerSpaceRemoval -``` - -## Example -``` -$nomention -$disableInnerSpaceRemoval - -Hello $displayName! -``` - -### Output Without - -![](https://user-images.githubusercontent.com/70456337/214134396-560937db-efe6-40e9-b50d-2bd26faab03b.png) - -### Output With - -![](https://user-images.githubusercontent.com/70456337/214134431-5ac11979-20a4-45ef-b390-918cc4b01370.png) +# $disableInnerSpaceRemoval +Disables the removal of multiple spaces from within the message. + +## Syntax +``` +$disableInnerSpaceRemoval +``` + +## Example +``` +$nomention +$disableInnerSpaceRemoval +Hello $displayName! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello RainbowKey! +``` + +- Without `$disableInnerSpaceRemoval`: + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + HelloㅤㅤㅤㅤRainbowKey! + ``` + +```admonish question title="What is this?" +How [`$displayName`](./displayName.md) works? +``` diff --git a/src/bdscript/disableSpecialEscaping.md b/src/bdscript/disableSpecialEscaping.md index ae01c9aed1e..4eed3e98a01 100644 --- a/src/bdscript/disableSpecialEscaping.md +++ b/src/bdscript/disableSpecialEscaping.md @@ -1,31 +1,31 @@ -# $disableSpecialEscaping -*(for advanced users)* - -Disables escaping for `;` and `$` (e.g. `%{-SEMICOL-}%` gets interpeted as a regular `;`). - -## Syntax -``` -$disableSpecialEscaping -``` - -## Example -``` -$nomention -$disableSpecialEscaping -%{DOL}%replaceText[Hello World!%{-SEMICOL-}%World%{-SEMICOL-}%Planet%{-SEMICOL-}%1] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello Planet! - ``` +# $disableSpecialEscaping +*(for advanced users)* + +Disables escaping for `;` and `$` (e.g. `%{-SEMICOL-}%` gets interpeted as a regular `;`). + +## Syntax +``` +$disableSpecialEscaping +``` + +## Example +``` +$nomention +$disableSpecialEscaping +%{DOL}%replaceText[Hello World!%{-SEMICOL-}%World%{-SEMICOL-}%Planet%{-SEMICOL-}%1] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello Planet! + ``` diff --git a/src/bdscript/discriminator.md b/src/bdscript/discriminator.md index b8589ab6ab0..8c8ede991f8 100644 --- a/src/bdscript/discriminator.md +++ b/src/bdscript/discriminator.md @@ -1,36 +1,43 @@ -# $discriminator -Returns a user's discriminator (the 4 digit number at the end of their username). - -## Syntax -``` -$discriminator[User ID] -``` - -> Discord has updated the username system, removing discriminators for users. Discriminators will only work for bots. For user it will return `0000`. - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to get the discriminator from. - -## Example -``` -$nomention -Discriminator: $discriminator[$mentioned[1]] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@BDFD Support> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Discriminator: #7678 -``` - -> You can use `$discriminator[]` get the discriminator of the author.\ -> [How `$mentioned[]` works?](./mentioned.md)) +# $discriminator +Returns a user's discriminator (the 4 digit number at the end of their username). + +```admonish fail +Discord has updated the username system, removing discriminators for users. Discriminators will only work for bots. For user it will return `0000`. +``` + +## Syntax +``` +$discriminator[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to get the discriminator from. + +## Example +``` +$nomention +Discriminator: #$discriminator[$mentioned[1]] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@BDFD Support> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Discriminator: #7678 +``` + +```admonish note +You can use `$discriminator[]` get the discriminator of the author. +``` + +```admonish question title="What is this?" +How [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/displayName.md b/src/bdscript/displayName.md index 9433682e83b..a7e4c41d4f8 100644 --- a/src/bdscript/displayName.md +++ b/src/bdscript/displayName.md @@ -1,28 +1,28 @@ -# $displayName -Returns the author's display name. - -## Syntax -``` -$displayName -``` - -## Example -``` -$nomention -Your display name is $displayName -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Your display name is Nicky -``` +# $displayName +Returns the author's display name. + +## Syntax +``` +$displayName +``` + +## Example +``` +$nomention +Your display name is $displayName +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Your display name is Nicky +``` diff --git a/src/bdscript/displayNameComplex.md b/src/bdscript/displayNameComplex.md index 8010f14d03d..28b2e2382af 100644 --- a/src/bdscript/displayNameComplex.md +++ b/src/bdscript/displayNameComplex.md @@ -1,31 +1,35 @@ -# $displayName[] -Returns the display name of the given user. - -## Syntax -``` -$displayName[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the display name for. - -## Example -``` -$nomention -Display name: $displayName[$mentioned[1]] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@MineBartekSA> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Display name: MineBartekSA -``` +# $displayName[] +Returns the display name of the given user. + +## Syntax +``` +$displayName[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the display name for. + +## Example +``` +$nomention +Display name: $displayName[$mentioned[1]] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@MineBartekSA> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Display name: MineBartekSA +``` + +```admonish question title="What is this?" +How [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/divide.md b/src/bdscript/divide.md index 61d879a0802..3b468a335b6 100644 --- a/src/bdscript/divide.md +++ b/src/bdscript/divide.md @@ -1,31 +1,35 @@ -# $divide -Divides the provided numbers. - -## Syntax -``` -$divide[Numbers] -``` - -### Parameters -- `Numbers` `(Type: Integer, Float || Flag: Required)`: The numbers to divide. Separate numbers using `;`. - -## Example -``` -$nomention -Answer: $divide[10;$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 5 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Answer: 2 -``` +# $divide +Divides the provided numbers. + +## Syntax +``` +$divide[Numbers] +``` + +### Parameters +- `Numbers` `(Type: Integer, Float || Flag: Required)`: The numbers to divide. Separate numbers using `;`. + +## Example +``` +$nomention +Result: $divide[10;$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 2 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/dm.md b/src/bdscript/dm.md index d7d7c7de0cd..9cd8b7ac420 100644 --- a/src/bdscript/dm.md +++ b/src/bdscript/dm.md @@ -1,6 +1,40 @@ # $dm Direct messages the user who runs the command. + + ## Syntax ``` $dm @@ -12,8 +46,24 @@ $nomention $dm Hello! ``` -![example](https://user-images.githubusercontent.com/111157596/250920927-01f8c481-ab76-4810-a940-e060f7396003.png)\ -![example](https://user-images.githubusercontent.com/111157596/250920959-d1d8ecda-5a3a-4b65-9135-0502d13c6520.png) -## Note +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +``` + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + bot: true + verified: true + content: | + Hello! +``` + +```admonish failure If the command fails to send the message, make sure you allow direct messages from everyone. +``` diff --git a/src/bdscript/dmChannelID.md b/src/bdscript/dmChannelID.md index ddee4752b3e..61c1ba42f87 100644 --- a/src/bdscript/dmChannelID.md +++ b/src/bdscript/dmChannelID.md @@ -1,31 +1,33 @@ -# $dmChannelID -Retrieves the DM channel ID for the provided user id. - -## Syntax -``` -$dmChannelID[User ID] -``` -### Parameters -- `user ID` `(Type: Snowflake || Flag: Required)`: The user for whom to fetch the DM channel ID - -## Example -``` -$nomention -ID: $dmChannelID[$authorID] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - ID: 1011919618610311189 -``` +# $dmChannelID +Retrieves the DM channel ID for the provided user id. + +## Syntax +``` +$dmChannelID[User ID] +``` +### Parameters +- `user ID` `(Type: Snowflake || Flag: Required)`: The user for whom to fetch the DM channel ID + +## Example +``` +$nomention +ID: $dmChannelID[$authorID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ID: 1011919618610311189 +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/dmComplex.md b/src/bdscript/dmComplex.md index d8bcd341695..7561cbce78c 100644 --- a/src/bdscript/dmComplex.md +++ b/src/bdscript/dmComplex.md @@ -1,34 +1,34 @@ -# $dm[] -Direct messages one or multiple users. - -## Syntax -``` -$dm[User ID;...] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to whom to send the direct message. Use semicolons `;` as a separator to separate multiple user IDs. - -> 🧙‍♂ī¸ You can leave the `User ID` argument empty to direct message the mentioned user. See [Example #1](#example-1) below. - -## Examples -### Example #1 -*This will direct message the mentioned user.* -``` -$nomention -$dm[] -$displayName says hello 👋 -``` -![example1](https://user-images.githubusercontent.com/111157596/250921279-a0f6cf34-8a24-49aa-a678-d1b015542b0a.png)\ -![example1](https://user-images.githubusercontent.com/111157596/250921319-335229ed-6002-424c-8634-d6c33815d792.png) - -### Example #2 -*This will direct message all the specified users.* -``` -$nomention -$dm[871078018041409608;729343563401265193] -$displayName says hello 👋 -``` - -## Note -If the command fails to send the message, make sure the user allows direct messages from everyone. +# $dm[] +Direct messages one or multiple users. + +## Syntax +``` +$dm[User ID;...] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to whom to send the direct message. Use semicolons `;` as a separator to separate multiple user IDs. + +> You can leave the `User ID` argument empty to direct message the mentioned user. See [Example #1](#example-1) below. + +## Examples +### Example #1 +*This will direct message the mentioned user.* +``` +$nomention +$dm[] +$displayName says hello 👋 +``` +![example1](https://user-images.githubusercontent.com/111157596/250921279-a0f6cf34-8a24-49aa-a678-d1b015542b0a.png)\ +![example1](https://user-images.githubusercontent.com/111157596/250921319-335229ed-6002-424c-8634-d6c33815d792.png) + +### Example #2 +*This will direct message all the specified users.* +``` +$nomention +$dm[871078018041409608;729343563401265193] +$displayName says hello 👋 +``` + +## Note +If the command fails to send the message, make sure the user allows direct messages from everyone. diff --git a/src/bdscript/editButton.md b/src/bdscript/editButton.md index 71ea624367a..a9ffb9ea67b 100644 --- a/src/bdscript/editButton.md +++ b/src/bdscript/editButton.md @@ -3,14 +3,14 @@ Edits an already existing button. ## Syntax ``` -$editButton[Button ID/URL;Label;Style;(Disabled;Emoji;Message ID)] +$editButton[Button ID/URL;Label;Style;(Disabled?;Emoji;Message ID)] ``` ### Parameters - `Button ID/URL` `(Type: String, URL || Flag: Required)`: The required button ID or URL, you want to be edited. - `Label` `(Type: String || Flag: Emptiable)`: The new label displayed on the button. - `Style` `(Type: Enum || Flag: Required)`: The style of the button. All styles are listed [below](#button-style). -- `Disabled` `(Type: Bool || Flag: Vacantable)`: If set to `yes`, the button can't be pressed. Default is `no`. +- `Disabled?` `(Type: Bool || Flag: Vacantable)`: If set to `yes`, the button can't be pressed. Default is `no`. - `Emoji` `(Type: Emoji || Flag: Vacantable)`: Edits / Adds an emoji inside the button. Emojis have to be either pasted as *Unicode* or be in the following format `<:emoji name:emoji ID>`. - `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Adds a button to the provided message ID. It's important to note that provided message ID author **has to** be the bot. @@ -89,4 +89,6 @@ $addButton[no;http://botdesignerdiscord.com;Check our website;link;no;👀] ``` ![](https://user-images.githubusercontent.com/16838075/120207246-7d366b00-c22c-11eb-8d04-9cf569ced8ae.png) -> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +```admonish info title="Read more" +For more information, read the the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +``` diff --git a/src/bdscript/editChannelPerms.md b/src/bdscript/editChannelPerms.md index fba59301c90..03c36518754 100644 --- a/src/bdscript/editChannelPerms.md +++ b/src/bdscript/editChannelPerms.md @@ -1,24 +1,26 @@ -# $editChannelPerms -Changes permissions for the mentioned user/role in the provided channel. - -## Syntax -``` -$editChannelPerms[Channel ID;User/Role ID;Permission;...] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the role/user is being modified. -- `User/Role ID` `(Type: Snowflake || Flag: Emptiable)`: The ID of the role/user whose permissions will be modified. -- `Permission` `(Type: Permission || Flag: Required)`: The [permission(s)](../resources/permissions.md) to be modified. (e.g. `-sendmessages`) - - `+` - set "+" to add the permission. - - `-` - set "-" to remove the permission. - -## Example -``` -$nomention -$onlyPerms[managechannels;❌ You need the `MANAGE_CHANNELS` permission to use that!] - -$editChannelPerms[$channelID;$mentionedRoles[1];-sendmessages] -✅ Now the role cannot send messages -``` -![image](https://user-images.githubusercontent.com/42785890/153126133-42a80968-589a-4ff2-a871-19c614eceed9.png) +# $editChannelPerms +Changes permissions for the mentioned user/role in the provided channel. + +## Syntax +``` +$editChannelPerms[Channel ID;User/Role ID;Permission;...] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the role/user is being modified. +- `User/Role ID` `(Type: Snowflake || Flag: Emptiable)`: The ID of the role/user whose permissions will be modified. +- `Permission` `(Type: Permission || Flag: Required)`: The [permission(s)](../resources/permissions.md) to be modified. (e.g. `-sendmessages`) + - `+` - set "+" to add the permission. + - `-` - set "-" to remove the permission. + +## Example +``` +$nomention +$editChannelPerms[$channelID;$mentionedRoles[1];-sendmessages] +✅ Now the role cannot send messages +``` +![image](https://user-images.githubusercontent.com/42785890/153126133-42a80968-589a-4ff2-a871-19c614eceed9.png) + +```admonish question title="What is this?" +How [`$channelID`](./chanelID.md) and [`$menntionedRoles[]`](./mentionedRoles.md) works? +``` diff --git a/src/bdscript/editEmbedIn.md b/src/bdscript/editEmbedIn.md index eb44fc5c11c..1969ef73f2f 100644 --- a/src/bdscript/editEmbedIn.md +++ b/src/bdscript/editEmbedIn.md @@ -1,34 +1,34 @@ -# $editEmbedIn -Edits the bot's message after the given time, as an embed. - -## Syntax -``` -$editEmbedIn[Time;(Title;Description;Footer;Color)] -``` - -> 📝 Optional fields can be left empty. At least one embed field (`Title`, `Description`, or `Footer`) needs to be inputted. - -### Parameters -- `Time` `(Type: Duration || Flag: Required)`: The time to wait before editing the message (e.g `3s`, `30s`, `10m`). Max time is 40 minutes (for premium users, it's 120 minutes). Required. -- `Title` `(Type: String || Flag: Vacantable)`: The new embed title. Optional. -- `Description` `(Type: String || Flag: Vacantable)`: The new embed description. Optional. -- `Footer` `(Type: String || Flag: Vacantable)`: The new embed footer. Optional. -- `Color` `(Type: Color || Flag: Vacantable)`: The embed border color, must be a valid [color hex](https://htmlcolorcodes.com/color-picker) or color integer number. Use `0` for the default color. Optional. - -## Example -``` -$nomention -$title[Cool Title] -$description[This is a cool embed to edit!] -$color[#6A96FC] -$editEmbedIn[5s;Epic Title;This is the edited description!;;#E46AFC] -``` - -### Output -**Before** - -![example1](https://user-images.githubusercontent.com/69215413/123012695-bdeb5500-d390-11eb-82a0-5e4fdb4b337e.png) - -**After** - -![example2](https://user-images.githubusercontent.com/69215413/123012680-b7f57400-d390-11eb-866c-6f0aa0fdf9f7.png) +# $editEmbedIn +Edits the bot's message after the given time, as an embed. + +## Syntax +``` +$editEmbedIn[Time;(Title;Description;Footer;Color)] +``` + +> 📝 Optional fields can be left empty. At least one embed field (`Title`, `Description`, or `Footer`) needs to be inputted. + +### Parameters +- `Time` `(Type: Duration || Flag: Required)`: The time to wait before editing the message (e.g `3s`, `30s`, `10m`). Max time is 40 minutes (for premium users, it's 120 minutes). Required. +- `Title` `(Type: String || Flag: Vacantable)`: The new embed title. Optional. +- `Description` `(Type: String || Flag: Vacantable)`: The new embed description. Optional. +- `Footer` `(Type: String || Flag: Vacantable)`: The new embed footer. Optional. +- `Color` `(Type: Color || Flag: Vacantable)`: The embed border color, must be a valid [color hex](https://htmlcolorcodes.com/color-picker) or color integer number. Use `0` for the default color. Optional. + +## Example +``` +$nomention +$title[Cool Title] +$description[This is a cool embed to edit!] +$color[#6A96FC] +$editEmbedIn[5s;Epic Title;This is the edited description!;;#E46AFC] +``` + +### Output +**Before** + +![example1](https://user-images.githubusercontent.com/69215413/123012695-bdeb5500-d390-11eb-82a0-5e4fdb4b337e.png) + +**After** + +![example2](https://user-images.githubusercontent.com/69215413/123012680-b7f57400-d390-11eb-866c-6f0aa0fdf9f7.png) diff --git a/src/bdscript/editIn.md b/src/bdscript/editIn.md index 14463408d3c..251f9f433f6 100644 --- a/src/bdscript/editIn.md +++ b/src/bdscript/editIn.md @@ -1,27 +1,27 @@ -# $editIn -Edits the bot's response after the given time. - -## Syntax -``` -$editIn[Time;New message] -``` - -### Parameters -- `Time` `(Type: Duration || Flag: Required)`: The time to wait before editing the message (e.g `3s`, `30s`, `10m`). Max is `40m` (for premium users `120m`). -- `New message` `(Type: String || Flag: Required)`: The text that appears when this message is edited. - -## Example -``` -$nomention -This is a nice message to edit! -$editIn[5s;This is the edited message!] -``` - -### Output -**Before** - -![example1](https://user-images.githubusercontent.com/69215413/123013307-fccdda80-d391-11eb-91c2-9406b8fe48da.png) - -**After** - -![example2](https://user-images.githubusercontent.com/69215413/123013297-f7709000-d391-11eb-9b00-55cf1387b498.png) +# $editIn +Edits the bot's response after the given time. + +## Syntax +``` +$editIn[Time;New message] +``` + +### Parameters +- `Time` `(Type: Duration || Flag: Required)`: The time to wait before editing the message (e.g `3s`, `30s`, `10m`). Max is `40m` (for premium users `120m`). +- `New message` `(Type: String || Flag: Required)`: The text that appears when this message is edited. + +## Example +``` +$nomention +This is a nice message to edit! +$editIn[5s;This is the edited message!] +``` + +### Output +**Before** + +![example1](https://user-images.githubusercontent.com/69215413/123013307-fccdda80-d391-11eb-91c2-9406b8fe48da.png) + +**After** + +![example2](https://user-images.githubusercontent.com/69215413/123013297-f7709000-d391-11eb-9b00-55cf1387b498.png) diff --git a/src/bdscript/editMessage.md b/src/bdscript/editMessage.md index c938cd46fbc..112a5eac8a7 100644 --- a/src/bdscript/editMessage.md +++ b/src/bdscript/editMessage.md @@ -1,32 +1,32 @@ -# $editMessage -Edits one of the bot's messages. - -## Syntax -``` -$editMessage[Channel ID;Message ID;Content;(Title;Description;Color;Footer)] -``` -> 🧙‍♂ī¸ [How Do I Get The Channel / Message ID? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID) - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that this message belongs to. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to edit (must be a message that the bot sent). -- `Content` `(Type: String || Flag: Emptiable)`: The new message contents. -- `Title` `(Type: String || Flag: Vacantable)`: The new embed title. -- `Description` `(Type: String || Flag: Vacantable)`: The new embed description. -- `Color` `(Type: Color || Flag: Vacantable)`: The new embed color border hex. -- `Footer` `(Type: String || Flag: Vacantable)`: The new embed footer text. - -## Example -``` -$nomention -$editMessage[853070225398693898;857040509549281292;This message has been edited!] -``` - -### Output -**Before** - -![example1](https://user-images.githubusercontent.com/69215413/125876425-57ea4bf7-a357-48be-a6f6-ffb84df4be23.png) - -**After** - -![example2](https://user-images.githubusercontent.com/69215413/125876457-cf834ed3-f57c-41f3-b862-20433ec21b83.png) +# $editMessage +Edits one of the bot's messages. + +## Syntax +``` +$editMessage[Channel ID;Message ID;Content;(Title;Description;Color;Footer)] +``` +> [How Do I Get The Channel / Message ID? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID) + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that this message belongs to. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to edit (must be a message that the bot sent). +- `Content` `(Type: String || Flag: Emptiable)`: The new message contents. +- `Title` `(Type: String || Flag: Vacantable)`: The new embed title. +- `Description` `(Type: String || Flag: Vacantable)`: The new embed description. +- `Color` `(Type: Color || Flag: Vacantable)`: The new embed color border hex. +- `Footer` `(Type: String || Flag: Vacantable)`: The new embed footer text. + +## Example +``` +$nomention +$editMessage[853070225398693898;857040509549281292;This message has been edited!] +``` + +### Output +**Before** + +![example1](https://user-images.githubusercontent.com/69215413/125876425-57ea4bf7-a357-48be-a6f6-ffb84df4be23.png) + +**After** + +![example2](https://user-images.githubusercontent.com/69215413/125876457-cf834ed3-f57c-41f3-b862-20433ec21b83.png) diff --git a/src/bdscript/editSplitText.md b/src/bdscript/editSplitText.md index 9677f5cf29c..c9d0a9fd39c 100644 --- a/src/bdscript/editSplitText.md +++ b/src/bdscript/editSplitText.md @@ -1,35 +1,35 @@ -# $editSplitText -Edits a splitted text element using its index. - -## Syntax -``` -$editSplitText[Index;Value] -``` - -### Parameters -- `Index` `(Type: Integer || Flag: Required)`: The index of the element to edit. -- `Value` `(Type: String || Flag: Required)`: The new value to assign to the provided index. - -## Example -``` -$nomention - -$textSplit[$message; ] - -$var[Index;$splitText[$sub[$getTextSplitLength;1]]] -$var[Value;$splitText[$getTextSplitLength]] - -$removeSplitTextElement[$getTextSplitLength] -$removeSplitTextElement[$getTextSplitLength] - -$var[Text;$joinSplitText[ ]] - -$textSplit[$var[Text];] -$editSplitText[$var[Index];$var[Value]] - -Original Text: $var[Text] -New Text: $joinSplitText[] -``` -![example](https://user-images.githubusercontent.com/95774950/202880969-9ce5041a-cc6c-4bd2-a275-76e9d80be5b5.png) - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $editSplitText +Edits a splitted text element using its index. + +## Syntax +``` +$editSplitText[Index;Value] +``` + +### Parameters +- `Index` `(Type: Integer || Flag: Required)`: The index of the element to edit. +- `Value` `(Type: String || Flag: Required)`: The new value to assign to the provided index. + +## Example +``` +$nomention + +$textSplit[$message; ] + +$var[Index;$splitText[$sub[$getTextSplitLength;1]]] +$var[Value;$splitText[$getTextSplitLength]] + +$removeSplitTextElement[$getTextSplitLength] +$removeSplitTextElement[$getTextSplitLength] + +$var[Text;$joinSplitText[ ]] + +$textSplit[$var[Text];] +$editSplitText[$var[Index];$var[Value]] + +Original Text: $var[Text] +New Text: $joinSplitText[] +``` +![example](https://user-images.githubusercontent.com/95774950/202880969-9ce5041a-cc6c-4bd2-a275-76e9d80be5b5.png) + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/editThread.md b/src/bdscript/editThread.md index 29f5e2c8cf0..bf55d40dcfa 100644 --- a/src/bdscript/editThread.md +++ b/src/bdscript/editThread.md @@ -1,23 +1,23 @@ -# $editThread -Modifies an existing thread. - -> 🧙‍♂ī¸ You can use `!unchanged` as an argument for the option to remain in its current state. - -## Syntax -``` -$editThread[Thread ID;(Name;Archived;Archive duration;Locked;Slowmode)] -``` - -### Parameters -- `Thread ID` `(Type: Snowflake || Flag: Required)`: The thread channel to edit. -- `Name` `(Type: String || Flag: Optional)`: The new name of the thread. -- `Archived` `(Type: Bool || Flag: Optional)`: Whether to archive this thread or not. -- `Archive duration` `(Type: Integer || Flag: Optional)`: The archive duration of this thread in minutes. Only 60, 1440,4320, 10080 can be used. Note that for the 4320 archive duration option, the server needs to be level 1 boosted, and for 10080 the server needs level 2. -- `Locked` `(Type: Bool || Flag: Optional)`: Whether to lock this thread or not. Note that archived threads can't be locked. -- `Slowmode` `(Type: Integer || Flag: Optional)`: The slowmode of this channel, expressed in seconds. - -## Example -``` -$nomention -$editThread[1098166444111433819;Cool Thread 😎;no;!unchanged;!unchanged;5] -``` +# $editThread +Modifies an existing thread. + +## Syntax +``` +$editThread[Thread ID;(Name;Archived;Archive duration;Locked;Slowmode)] +``` + +### Parameters +- `Thread ID` `(Type: Snowflake || Flag: Required)`: The thread channel to edit. +- `Name` `(Type: String || Flag: Optional)`: The new name of the thread. +- `Archived` `(Type: Bool || Flag: Optional)`: Whether to archive this thread or not. +- `Archive duration` `(Type: Integer || Flag: Optional)`: The archive duration of this thread in minutes. Only 60, 1440,4320, 10080 can be used. Note that for the 4320 archive duration option, the server needs to be level 1 boosted, and for 10080 the server needs level 2. +- `Locked` `(Type: Bool || Flag: Optional)`: Whether to lock this thread or not. Note that archived threads can't be locked. +- `Slowmode` `(Type: Integer || Flag: Optional)`: The slowmode of this channel, expressed in seconds. + +> You can use `!unchanged` as an parameter for the option to remain in its current state. + +## Example +``` +$nomention +$editThread[1098166444111433819;Cool Thread 😎;no;!unchanged;!unchanged;5] +``` diff --git a/src/bdscript/else.md b/src/bdscript/else.md index ec736870272..c3a9b1899ac 100644 --- a/src/bdscript/else.md +++ b/src/bdscript/else.md @@ -1,49 +1,46 @@ -# $else -A block of code to be executed, if the `$if[]` condition is `false`. - -## Syntax -``` -$else -``` - -## Example -``` -$nomention -$if[$authorID==$botOwnerID] - $sendMessage[You are the developer of this bot!] -$else - $sendMessage[You are not the developer of this bot!] -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - You are the developer of this bot! -- user_id: 154148273307910144 - username: MineBartekSA - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - color: "#f1bdee" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - You are not the developer of this bot! -``` -\ - -> For more info, see the [If Guide](../guides/ifStatements.md). +# $else +A block of code to be executed, if the `$if[]` condition is `false`. + +## Syntax +``` +$else +``` + +## Example +``` +$nomention +$if[$authorID==$botOwnerID] + $sendMessage[You are the developer of this bot!] +$else + $sendMessage[You are not the developer of this bot!] +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + You are the developer of this bot! +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + You are not the developer of this bot! +``` + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/elseif.md b/src/bdscript/elseif.md index 0eb15fae6b5..5d57fd047c1 100644 --- a/src/bdscript/elseif.md +++ b/src/bdscript/elseif.md @@ -1,69 +1,66 @@ -# $elseif -Checks provided condition only if previous `$if[]` or `$elseif[]` conditions returned false. If the provided condition is true, the following block of code will be executed. - -> Only for **BDScript 2**! - -## Syntax -``` -$elseif[Condition] -``` - -### Parameters -- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. - -### Signs -`==` - Equal - -`!=` - Not Equal - -`<` - Less Than - -`>` - Greater Than - -`>=` - Greater Than Or Equal To - -`<=` - Less Than Or Equal To -- These signs could vary in meaning based on the order or intent of the if statement. -- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. - -## Example -``` -$nomention -$if[$authorID==$botOwnerID] - $sendMessage[Developer] -$elseif[$authorID==$serverOwner] - $sendMessage[Server Owner] -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Developer -- user_id: 154148273307910144 - username: MineBartekSA - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - color: "#f1bdee" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Server Owner - ``` - \ - -> For more info, see the [If Guide](../guides/ifStatements.md). +# $elseif +Checks provided condition only if previous `$if[]` or `$elseif[]` conditions returned false. If the provided condition is true, the following block of code will be executed. + +> Only for **BDScript 2**! + +## Syntax +``` +$elseif[Condition] +``` + +### Parameters +- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. + +### Signs +`==` - Equal + +`!=` - Not Equal + +`<` - Less Than + +`>` - Greater Than + +`>=` - Greater Than Or Equal To + +`<=` - Less Than Or Equal To +- These signs could vary in meaning based on the order or intent of the if statement. +- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. + +## Example +``` +$nomention +$if[$authorID==$botOwnerID] + $sendMessage[Developer] +$elseif[$authorID==$serverOwner] + $sendMessage[Server Owner] +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Developer +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Server Owner +``` + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/embedSuppressErrors.md b/src/bdscript/embedSuppressErrors.md index 409df6f71b8..9eae3ce12b6 100644 --- a/src/bdscript/embedSuppressErrors.md +++ b/src/bdscript/embedSuppressErrors.md @@ -1,38 +1,38 @@ -# $embedSuppressErrors -Suppresses the error messages, responds with the embed if there is an error. - -## Syntax -``` -$embedSuppressErrors[Title;Description;(Color;Author;Footer;Footer icon)] -``` - -> All fields are optional, leave the field empty to not include it. At least one field needs to be inputted, however. - -### Parameters -- `Title` `(Type: String || Flag: Emptiable)`: The title of the embed. -- `Description` `(Type: String || Flag: Emptiable)`: The embed description. -- `Color` `(Type: Color || Flag: Vacantable)`: The embed border color, must be a valid [color hex](https://htmlcolorcodes.com/color-picker). -- `Author` `(Type: String || Flag: Vacantable)`: The embed author text. -- `Footer` `(Type: String || Flag: Vacantable)`: The embed footer text. -- `Footer icon` `(Type: URL || Flag: Vacantable)`: The embed footer icon, must be a valid image URL. - -## Examples -### Example #1 -``` -$nomention -$embedSuppressErrors[Error!;❌ Invalid math expression!;#ff0000;;Calculator] - -Result: **$calculate[$message]** -``` -![example](https://github.com/caramellya-mei/bdfd-wiki/assets/115384748/739e2996-62b2-43ad-8c93-783bf4adccce) - -### Example #2 -You can pass error from limiter functions into the embed by leaving the `Description` argument to be empty. -``` -$nomention -$embedSuppressErrors[Error!;;#ff0000] -$argsCheck[>1;You must type at least one word] - -You typed "$message" -``` -![example_2](https://github.com/caramellya-mei/bdfd-wiki/assets/115384748/f8bb4e3b-e87e-4d9e-83ce-f480363ea924) +# $embedSuppressErrors +Suppresses the error messages, responds with the embed if there is an error. + +## Syntax +``` +$embedSuppressErrors[Title;Description;(Color;Author;Footer;Footer icon)] +``` + +> All fields are optional, leave the field empty to not include it. At least one field needs to be inputted, however. + +### Parameters +- `Title` `(Type: String || Flag: Emptiable)`: The title of the embed. +- `Description` `(Type: String || Flag: Emptiable)`: The embed description. +- `Color` `(Type: Color || Flag: Vacantable)`: The embed border color, must be a valid [color hex](https://htmlcolorcodes.com/color-picker). +- `Author` `(Type: String || Flag: Vacantable)`: The embed author text. +- `Footer` `(Type: String || Flag: Vacantable)`: The embed footer text. +- `Footer icon` `(Type: URL || Flag: Vacantable)`: The embed footer icon, must be a valid image URL. + +## Examples +### Example #1 +``` +$nomention +$embedSuppressErrors[Error!;❌ Invalid math expression!;#ff0000;;Calculator] + +Result: **$calculate[$message]** +``` +![example](https://github.com/caramellya-mei/bdfd-wiki/assets/115384748/739e2996-62b2-43ad-8c93-783bf4adccce) + +### Example #2 +You can pass error from limiter functions into the embed by leaving the `Description` argument to be empty. +``` +$nomention +$embedSuppressErrors[Error!;;#ff0000] +$argsCheck[>1;You must type at least one word] + +You typed "$message" +``` +![example_2](https://github.com/caramellya-mei/bdfd-wiki/assets/115384748/f8bb4e3b-e87e-4d9e-83ce-f480363ea924) diff --git a/src/bdscript/embeddedURL.md b/src/bdscript/embeddedURL.md index 949ddaefddc..ea78e227926 100644 --- a/src/bdscript/embeddedURL.md +++ b/src/bdscript/embeddedURL.md @@ -1,24 +1,41 @@ -# $embeddedURL -Sets the title to be a hyperlink. - -> 📝 Only works if `$title` is also used. - -## Syntax -``` -$embeddedURL[Link;(Index)] -``` - -### Parameters -- `Link` `(Type: URL || Flag: Emptiable)`: The link to set the title hyperlink to. -- `Index` `(Type: Integer || Flag: Optional)`: What embed the title hyperlink should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$title[Bot Designer For Discord] -$embeddedURL[https://botdesignerdiscord.com] -$description[Hello World!] -$color[#683cb4] -``` - -![example](https://user-images.githubusercontent.com/69215413/125976626-45a94f29-cd9b-445f-a0ae-5dba6f49d2a6.png) +# $embeddedURL +Sets the title to be a hyperlink. + +```admonish failure +`$embeddedURL[]` will not work if there is no text provided in [`$title[]`](./title.md). +``` + +## Syntax +``` +$embeddedURL[Link;(Index)] +``` + +### Parameters +- `Link` `(Type: URL || Flag: Emptiable)`: The link to set the title hyperlink to. +- `Index` `(Type: Integer || Flag: Optional)`: What embed the title hyperlink should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$title[Google] +$embeddedURL[https://google.com] +$footer[âŦ†ī¸ Title hyperlink] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + embed: + title: Google + url: https://google.com + footer: + text: âŦ†ī¸ Title hyperlink +``` diff --git a/src/bdscript/emojiExists.md b/src/bdscript/emojiExists.md new file mode 100644 index 00000000000..1e0143b8080 --- /dev/null +++ b/src/bdscript/emojiExists.md @@ -0,0 +1,63 @@ +# $emojiExists[] +Checks if provided emoji's id exists. + +```admonish tip +`true` means the emoji exists, `false` means they don’t. +``` + +## Syntax +``` +$emojiExists[Emoji ID] +``` + +### Parameters +- `Emoji ID` `(Type: Snowflake || Flag: Required)`: The id to check for. + +## Example +``` +$nomention +Emoji exists?: `$emojiExists[$message]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 760463263879135242 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Emoji exists?: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example idhoshkxbidho +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Emoji exists?: false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example doge +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Emoji exists?: false +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/emojiName.md b/src/bdscript/emojiName.md new file mode 100644 index 00000000000..2d0066b1b60 --- /dev/null +++ b/src/bdscript/emojiName.md @@ -0,0 +1,35 @@ +# $emojiName[] +Returns the name of the custom emoji. + +## Syntax +``` +$emojiName[Emoji ID] +``` + +### Parameters +- `Emoji ID` `(Type: Snowflake || Flag: Required)`: The emoji's id to get the name for. + +## Example +``` +$nomention +Emoji Name: $emojiName[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 760463263879135242 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Emoji Name: doge +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/emoteCount.md b/src/bdscript/emoteCount.md index 51d3963339f..9eed3a67304 100644 --- a/src/bdscript/emoteCount.md +++ b/src/bdscript/emoteCount.md @@ -1,28 +1,28 @@ -# $emoteCount -Returns the number of emojis in the current server. - -## Syntax -``` -$emoteCount -``` - -## Example -``` -$nomention -There are $emoteCount emojis in $serverName[$guildID]! -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - There are 26 emojis in Bot Designer for Discord Official Server! -``` +# $emoteCount +Returns the number of emojis in the current server. + +## Syntax +``` +$emoteCount +``` + +## Example +``` +$nomention +There are $emoteCount emojis in $serverName[$guildID]! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + There are 26 emojis in Bot Designer for Discord Official Server! +``` diff --git a/src/bdscript/enableDecimals.md b/src/bdscript/enableDecimals.md index 927538ce88b..d49268fc0c8 100644 --- a/src/bdscript/enableDecimals.md +++ b/src/bdscript/enableDecimals.md @@ -1,38 +1,60 @@ -# $enableDecimals -Enables/disables decimals in math functions. - -## Syntax -``` -$enableDecimals[Enable?] -``` - -### Parameters -- `Enable?` `(Type: Bool || Flag: Required)`: Whether to enable decimals in math functions or not, `yes` means it's enabled and `no` means it's disabled. - -### Explaination -By default, decimals in math functions (e.g `$sum`, `$sub`, `$multi`, etc) are disabled. The only use for this function is to enable decimals, if you want decimals enabled for math functions in that command. - -## Example -``` -$nomention -$enableDecimals[yes] -Result: $random[1;5] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Result: 3.381 -``` - -> [How `$random[]` works?](./randomComplex.md) +# $enableDecimals +Enables/disables decimals in math functions. + +## Syntax +``` +$enableDecimals[Enable?] +``` + +```admonish note +You can use [`$round[]`](./round.md), [`$ceil[]`](./ceil.md), [`$floor[]`](./floor.md) for work with decimal numbers. +``` + +### Parameters +- `Enable?` `(Type: Bool || Flag: Required)`: Whether to enable decimals in math functions or not, `yes` means it's enabled and `no` means it's disabled. + +### Explaination +By default, decimals in math functions (e.g `$sum`, `$sub`, `$multi`, etc) are disabled. The only use for this function is to enable decimals, if you want decimals enabled for math functions in that command. + +## Example +``` +$nomention +$enableDecimals[yes] +Result: $random[1;5] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 3.381 +``` + +- Without `$enableDecimals[]` (or result with `$enableDecimals[no]`): + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 3 +``` + +```admonish question title="What is this?" +How [`$random[]`](./randomComplex.md) works? +``` diff --git a/src/bdscript/enabled.md b/src/bdscript/enabled.md index 92107c66245..025648a7cc0 100644 --- a/src/bdscript/enabled.md +++ b/src/bdscript/enabled.md @@ -1,41 +1,41 @@ -# $enabled -Allows you to enable/disable commands. - -## Syntax -``` -$enabled[Enabled;Error message] -``` - -### Parameters -- `Enabled` `(Type: Bool || Flag: Required)`: If the command should be enabled or disabled. Use `yes` to enable the command, `no` to disable it. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned if the command is disabled. - -## Example -This section will explain how to disable/enable certain commands using server variables. - -1. Create a variable named `enabled` and set the value to `yes` or `no` (whatever you want the default option to be. `no` - disabled, `yes` - enabled.) - - ![example](https://user-images.githubusercontent.com/69215413/123017732-31925f80-d39b-11eb-8e23-ca01b0dc5ed4.png) - -2. Create a command for the enable code. Put this in the reply text/code section: - ``` - $onlyAdmin[❌ Only admins can enable commands!] - $setServerVar[enabled;yes] - I successfully enabled the command! - ``` - -3. Create a command for the disable code. Put this in the reply text/code section: - ``` - $onlyAdmin[❌ Only admins can disable commands!] - $setServerVar[enabled;no] - I successfully disabled the command! - ``` - -4. In the command(s) you want the enable/disable to affect, put: - ``` - $enabled[$getServerVar[enabled];❌ This command is disabled!] - ``` - -5. Now your bot has a system where servers can disable/enable command(s). - -> 📝 In order to make this changeable for multiple commands, you'll need to do it multiple times (using different variable names). As this only affects the commands you put the "affect" code in. +# $enabled +Allows you to enable/disable commands. + +## Syntax +``` +$enabled[Enabled;Error message] +``` + +### Parameters +- `Enabled` `(Type: Bool || Flag: Required)`: If the command should be enabled or disabled. Use `yes` to enable the command, `no` to disable it. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned if the command is disabled. + +## Example +This section will explain how to disable/enable certain commands using server variables. + +1. Create a variable named `enabled` and set the value to `yes` or `no` (whatever you want the default option to be. `no` - disabled, `yes` - enabled.) + + ![example](https://user-images.githubusercontent.com/69215413/123017732-31925f80-d39b-11eb-8e23-ca01b0dc5ed4.png) + +2. Create a command for the enable code. Put this in the reply text/code section: + ``` + $onlyAdmin[❌ Only admins can enable commands!] + $setServerVar[enabled;yes] + I successfully enabled the command! + ``` + +3. Create a command for the disable code. Put this in the reply text/code section: + ``` + $onlyAdmin[❌ Only admins can disable commands!] + $setServerVar[enabled;no] + I successfully disabled the command! + ``` + +4. In the command(s) you want the enable/disable to affect, put: + ``` + $enabled[$getServerVar[enabled];❌ This command is disabled!] + ``` + +5. Now your bot has a system where servers can disable/enable command(s). + +> 📝 In order to make this changeable for multiple commands, you'll need to do it multiple times (using different variable names). As this only affects the commands you put the "affect" code in. diff --git a/src/bdscript/endif.md b/src/bdscript/endif.md index 9d7f5b27625..2d7290399be 100644 --- a/src/bdscript/endif.md +++ b/src/bdscript/endif.md @@ -1,51 +1,50 @@ -# $endif -Ends an if statement. - -## Syntax -``` -$endif -``` - -## Example -``` -$nomention -$if[$message==BDFD] - I love BDFD! -$endif -``` -### With `$endif` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example BDFD -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - I love BDFD! -``` -\ -### Without `$endif` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example BDFD -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - $if not closed with $endif -``` -\ - -> For more info, see the [If Guide](../guides/ifStatements.md). +# $endif +Ends an if statement. + +## Syntax +``` +$endif +``` + +## Example +``` +$nomention +$if[$message==BDFD] + I love BDFD! +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I love BDFD! +``` + +- Without `$endif`: + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + $if not closed with $endif +``` + + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/endtry.md b/src/bdscript/endtry.md index f84fe288e41..e6ae4c85ed4 100644 --- a/src/bdscript/endtry.md +++ b/src/bdscript/endtry.md @@ -1,59 +1,59 @@ -# $endtry -Closes the Error Handling block. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$endtry -``` - -## Example -``` -$nomention -$try - $calculate[$message] -$endtry -``` - -- With `$endtry`: -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 5+2 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 7 -``` - -- Without `$endtry`: -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 5+2 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - $try not closed with $endtry or invalid use of $sum -``` - -```admonish question title="What is this?" -How [`$calculate[]`](./calculate.md), [`$message`](./message.md) and [`$try`](./try.md) works? -``` - -```admonish info title="Read more" -For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). -``` +# $endtry +Closes the Error Handling block. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$endtry +``` + +## Example +``` +$nomention +$try + $calculate[$message] +$endtry +``` + +- With `$endtry`: +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5+2 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 7 +``` + +- Without `$endtry`: +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5+2 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + $try not closed with $endtry or invalid use of $sum +``` + +```admonish question title="What is this?" +How [`$calculate[]`](./calculate.md), [`$message`](./message.md) and [`$try`](./try.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). +``` diff --git a/src/bdscript/ephemeral.md b/src/bdscript/ephemeral.md index f37e02aa6bc..a75f12370e3 100644 --- a/src/bdscript/ephemeral.md +++ b/src/bdscript/ephemeral.md @@ -1,19 +1,51 @@ -# $ephemeral -Makes the bot's response ephemeral. - -> 🧙‍♂ī¸ [What are ephemeral responses? (click-me)](https://support.discord.com/hc/en-us/articles/1500000580222-Ephemeral-Messages-FAQ) - -## Syntax -``` -$ephemeral -``` -> ⚠ī¸ You can get an ephemeral response only through an interaction (slash commands, buttons, select menus, etc.) - -## Example -``` -$nomention -$ephemeral -hello! -``` -![example1](https://user-images.githubusercontent.com/69215413/122575265-91e17400-d01e-11eb-9789-de224722f3ab.png)\ -![example2](https://user-images.githubusercontent.com/69215413/122575261-90b04700-d01e-11eb-942c-1cd5096998d0.png) +# $ephemeral +Makes the bot's response ephemeral. + +```admonish warning +Can only be used in [Slash Commands](../guides/general/interactions/slashCommands/aboutSlashCommands.md), [`$onInteraction`](../callbacks/onInteraction.md) and [`$onInteraction[]`](../callbacks/onInteractionComplex.md). +``` + +## Syntax +``` +$ephemeral +``` + +## Example +``` +$nomention +$ephemeral +Hello! +``` + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + ephemeral: true + command: + user_id: 803569638084313098 + author: RainbowKey + color: "#E67E22" + command: /example + content: | + Hello! +``` + +- Without `$ephemeral`: + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + command: + user_id: 803569638084313098 + author: RainbowKey + color: "#E67E22" + command: /example + content: | + Hello! +``` diff --git a/src/bdscript/error.md b/src/bdscript/error.md index 451e7d6547d..b4e3a92dcd2 100644 --- a/src/bdscript/error.md +++ b/src/bdscript/error.md @@ -1,72 +1,72 @@ -# $error -Used in the `$catch` block to return the BDScript 2 error information. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$error[Type] -``` - -## Parameters -- `Type` `(Type: Enum || Flag: Required)`: What type of error data to return. - -### Error Type -| Name | Description | Example -| --------- | ---------------------------------------------------------------------- | ---------------------------------------- -| `command` | Returns the name of the function that returned the error. | $sum -| `message` | Returns the error message that was received. | expected integer in position 2, got 'a' -| `source` | Returns the content of the line where the error occurred. | $sum[2;a] -| `row` | Returns the number of the row in the code where the error occurred. | 2 -| `column` | Returns the number of the column in the code where the error occurred. | 10 - -~~~admonish warning title="Syntax sensitivity" -The type input must only be written in lowercase letters.\ -❌ Not correct: -``` -$error[MEsSage] -``` -✅ Correct: -``` -$error[message] -``` -~~~ - -## Example -``` -$nomention -$try - $description[Hello developer!;] -$catch -❌ An error has occurred! -Function: $error[command] -Error: $error[message] -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ An error has occurred! - Function: $description - Error: expected valid value in position 2, got empty value -``` - -```admonish question title="What is this?" -How [`$description[]`](./description.md), [`$try`](./try.md), [`$endtry`](./endtry.md) and [`$catch`](./catch.md) works? -``` - -```admonish info title="Read more" -For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). -``` +# $error +Used in the `$catch` block to return the BDScript 2 error information. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$error[Type] +``` + +## Parameters +- `Type` `(Type: Enum || Flag: Required)`: What type of error data to return. + +### Error Type +| Name | Description | Example +| --------- | ---------------------------------------------------------------------- | ---------------------------------------- +| `command` | Returns the name of the function that returned the error. | $sum +| `message` | Returns the error message that was received. | expected integer in position 2, got 'a' +| `source` | Returns the content of the line where the error occurred. | $sum[2;a] +| `row` | Returns the number of the row in the code where the error occurred. | 2 +| `column` | Returns the number of the column in the code where the error occurred. | 10 + +~~~admonish warning title="Syntax sensitivity" +The type input must only be written in lowercase letters.\ +❌ Not correct: +``` +$error[MEsSage] +``` +✅ Correct: +``` +$error[message] +``` +~~~ + +## Example +``` +$nomention +$try + $description[Hello developer!;] +$catch +❌ An error has occurred! +Function: $error[command] +Error: $error[message] +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ An error has occurred! + Function: $description + Error: expected valid value in position 2, got empty value +``` + +```admonish question title="What is this?" +How [`$description[]`](./description.md), [`$try`](./try.md), [`$endtry`](./endtry.md) and [`$catch`](./catch.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). +``` diff --git a/src/bdscript/eval.md b/src/bdscript/eval.md index 97762ac0496..e58e49183bd 100644 --- a/src/bdscript/eval.md +++ b/src/bdscript/eval.md @@ -1,47 +1,55 @@ -# $eval -Evaluates the provided BDScript code. **Can only be used in BDScript 2.** - -> ⚠ī¸ **Should be used with caution!** ⚠ī¸ - - -## Syntax -``` -$eval[Source code] -``` - -### Parameters -- `Source code` `(Type: String || Flag: Emptiable)`: The code to be evaluated. - -## Example -``` -$nomention -$eval[$message] -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example $sendMessage[Hello! My username is $username] -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello! My username is Nicky -``` - -> How [`$message`](./message.md) works? - -> ⚠ī¸ **Should be used with caution!** ⚠ī¸ -> -> It is recommended to restrict the command to be only used by the bot developers, this can be done with: -``` -$nomention -$onlyForIDs[$botOwnerID;❌ You are not my owner!] -$eval[$message] -``` - -> How [`$onlyForIDs[]`](./onlyForIDs.md) and [`$botOwnerID`](./botOwnerID.md) works? +# $eval +
+ Dangerous +
+ +Evaluates the provided BDScript code. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +> ⚠ī¸ **Should be used with caution!** ⚠ī¸ + + +## Syntax +``` +$eval[Source code] +``` + +### Parameters +- `Source code` `(Type: String || Flag: Emptiable)`: The code to be evaluated. + +## Example +``` +$nomention +$eval[$message] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example $sendMessage[Hello! My username is $username] +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello! My username is Nicky +``` + +> How [`$message`](./message.md) works? + +> ⚠ī¸ **Should be used with caution!** ⚠ī¸ +> +> It is recommended to restrict the command to be only used by the bot developers, this can be done with: +``` +$nomention +$onlyForIDs[$botOwnerID;❌ You are not my owner!] +$eval[$message] +``` + +> How [`$onlyForIDs[]`](./onlyForIDs.md) and [`$botOwnerID`](./botOwnerID.md) works? diff --git a/src/bdscript/executionTime.md b/src/bdscript/executionTime.md index aba6a1cfab6..0c98735972d 100644 --- a/src/bdscript/executionTime.md +++ b/src/bdscript/executionTime.md @@ -1,30 +1,32 @@ -# $executionTime -Returns how long the command took to execute, in milliseconds. - -## Syntax -``` -$executionTime -``` - -> You cannot use this function in [`$sendMessage[]`](./sendMessage.md), [`$channelSendMessage[]`](./findUser.md), [`$sendEmbedMessage[]`](./sendEmbedMessage.md), [`$sum[]`](./sum.md), [`$sub[]`](./sub.md), [`$divide[]`](./divide.md), [`$multi[]`](./multi.md), [`$calculate[]`](./calculate.md), [`$random[]`](./randomComplex.md), [`$textSplit[]`](./textSplit.md), [`$splitText[]`](./splitText.md), etc... - -## Example -``` -$nomention -Pong! $executionTime ms -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Pong! 12 ms -``` +# $executionTime +Returns how long the command took to execute, in milliseconds. + +## Syntax +``` +$executionTime +``` + +```admonish warning +You cannot use this function in [`$sendMessage[]`](./sendMessage.md), [`$channelSendMessage[]`](./findUser.md), [`$sendEmbedMessage[]`](./sendEmbedMessage.md), [`$sum[]`](./sum.md), [`$sub[]`](./sub.md), [`$divide[]`](./divide.md), [`$multi[]`](./multi.md), [`$calculate[]`](./calculate.md), [`$random[]`](./randomComplex.md), [`$textSplit[]`](./textSplit.md), [`$splitText[]`](./splitText.md), etc... +``` + +## Example +``` +$nomention +Pong! $executionTime ms +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Pong! 12 ms +``` diff --git a/src/bdscript/findChannel.md b/src/bdscript/findChannel.md index f006442b817..cd11044a088 100644 --- a/src/bdscript/findChannel.md +++ b/src/bdscript/findChannel.md @@ -1,35 +1,37 @@ -# $findChannel -Finds a channel's ID from the given channel name, ID, or mention. - -> This function can only find channels of **the current** server. - -## Syntax -``` -$findChannel[Channel] -``` - -### Parameters -- `Channel` `(Type: String || Flag: Emptiable)`: The channel name/ID/mention to find. - -## Example -``` -$nomention -Channel ID: $findChannel[$mentionedChannels[1]] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <#main-chat> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Channel ID: 566370477967147018 -``` - -> [How `$mentionedChannels[]` works?](./mentionedChannels.md) +# $findChannel +Finds a channel's ID from the given channel name, ID, or mention. + +> This function can only find channels of **the current** server. + +## Syntax +``` +$findChannel[Channel] +``` + +### Parameters +- `Channel` `(Type: String || Flag: Emptiable)`: The channel name/ID/mention to find. + +## Example +``` +$nomention +Channel ID: $findChannel[$mentionedChannels[1]] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#main-chat> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Channel ID: 566370477967147018 +``` + +```admonish question title="What is this?" +How [`$mentionedChannels[]`](./mentionedChannels.md) works? +``` diff --git a/src/bdscript/findRole.md b/src/bdscript/findRole.md index 24c6ef23724..7e4a7e2c6d8 100644 --- a/src/bdscript/findRole.md +++ b/src/bdscript/findRole.md @@ -1,35 +1,37 @@ -# $findRole -Finds a role's ID using the given role name, ID, or mention. - -> This function can only find roles of **the current** server. - -## Syntax -``` -$findRole[Role] -``` - -### Parameters -- `Role` `(Type: String || Flag: Emptiable)`: The role name, ID, or mention to find. - -## Example -``` -$nomention -Role ID: $findRole[$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Support -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Role ID: 568155071997542410 -``` - -> [How `$message` works?](./message.md) +# $findRole +Finds a role's ID using the given role name, ID, or mention. + +> This function can only find roles of **the current** server. + +## Syntax +``` +$findRole[Role] +``` + +### Parameters +- `Role` `(Type: String || Flag: Emptiable)`: The role name, ID, or mention to find. + +## Example +``` +$nomention +Role ID: $findRole[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Support +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Role ID: 568155071997542410 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/findUser.md b/src/bdscript/findUser.md index 5b54f172d2e..0718cfacb18 100644 --- a/src/bdscript/findUser.md +++ b/src/bdscript/findUser.md @@ -1,34 +1,36 @@ -# $findUser -Finds a user's ID using username, ID, or mention in the current server. - -## Syntax -``` -$findUser[User;(Return author ID?)] -``` - -### Parameters -- `User` `(Type: String || Flag: Emptiable)`: The user's username, ID, or mention to find. -- `Return author ID?` `(Type: Bool || Flag: Optional)`: Whether to return the author ID if no user was found. The default is `yes`. - -## Example -``` -$nomention -User ID: $findUser[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example BDFD Support -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - User ID: 1009018156494368798 -``` - -> [How `$message` works?](./message.md) +# $findUser +Finds a user's ID using username, ID, or mention in the current server. + +## Syntax +``` +$findUser[User;(Return author ID?)] +``` + +### Parameters +- `User` `(Type: String || Flag: Emptiable)`: The user's username, ID, or mention to find. +- `Return author ID?` `(Type: Bool || Flag: Optional)`: Whether to return the author ID if no user was found. The default is `yes`. + +## Example +``` +$nomention +User ID: $findUser[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD Support +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + User ID: 1009018156494368798 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/floor.md b/src/bdscript/floor.md index 3c89a81c7c9..f2b64fc812a 100644 --- a/src/bdscript/floor.md +++ b/src/bdscript/floor.md @@ -1,55 +1,72 @@ -# $floor -Rounds the number **down** and returns the largest integer less than or equal to a specified number. - -## Syntax -``` -$floor[Number] -``` - -### Parameters -- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded. - -## Example -``` -$nomention -Result: $floor[$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 6.2 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: 6 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -6.4 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: -7 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 9 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Result: 9 -``` +# $floor +Rounds the number **down** and returns the largest integer less than or equal to a specified number. + +## Syntax +``` +$floor[Number] +``` + +### Parameters +- `Number` `(Type: Integer, Float || Flag: Required)`: The number that will be rounded. + +## Example +``` +$nomention +Result: $floor[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 6.2 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 6 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example -6.4 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: -7 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 9 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 9 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $floor[] +
+
+

Output:

+ Result: 1 +
+
diff --git a/src/bdscript/footer.md b/src/bdscript/footer.md index cde9c0deb4a..adddfd30012 100644 --- a/src/bdscript/footer.md +++ b/src/bdscript/footer.md @@ -1,19 +1,33 @@ -# $footer -Sets the embed footer text. - -## Syntax -``` -$footer[Text;(Index)] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to set the footer as. It cannot exceed more than 2048 characters. -- `Index` `(Type: Integer || Flag: Optional)`: What embed the footer text should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$footer[Hi! I'm a footer.] -``` - -![example](https://user-images.githubusercontent.com/69215413/125977730-17b79b15-9b0d-494d-8d7b-39c50ccb2b0a.png) +# $footer +Sets the embed footer text. + +## Syntax +``` +$footer[Text;(Index)] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to set the footer as. It cannot exceed more than 2048 characters. +- `Index` `(Type: Integer || Flag: Optional)`: What embed the footer text should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$footer[Hello! I'm footer👋] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + footer: + text: Hello! I'm footer👋 +``` diff --git a/src/bdscript/footerIcon.md b/src/bdscript/footerIcon.md index 7f445476a8a..5a3e02481df 100644 --- a/src/bdscript/footerIcon.md +++ b/src/bdscript/footerIcon.md @@ -1,22 +1,40 @@ -# $footerIcon -Sets the embed footer icon. - -> 🧙‍♂ī¸ There must be footer text in order to set the footer icon. - -## Syntax -``` -$footerIcon[Icon URL;(Index)] -``` - -### Parameters -- `Icon URL` `(Type: URL || Flag: Emptiable)`: The URL to set the footer icon as. Must be a valid image URL. -- `Index` `(Type: Integer || Flag: Vacantable)`: What embed the footer icon should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$footer[âŦ…ī¸ That is a footer icon!] -$footerIcon[$authorAvatar] -``` - -![example](https://user-images.githubusercontent.com/69215413/123020288-1544f180-d3a0-11eb-9378-3e83e1d1cb60.png) +# $footerIcon +Sets the embed footer icon. + +## Syntax +``` +$footerIcon[Icon URL;(Index)] +``` + +```admonish failure +`$footerIcon[]` will not work if there is no text provided in [`$footer[]`](./footer.md). +``` + +### Parameters +- `Icon URL` `(Type: URL || Flag: Emptiable)`: The URL to set the footer icon as. Must be a valid image URL. +- `Index` `(Type: Integer || Flag: Vacantable)`: What embed the footer icon should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$footer[âŦ…ī¸ That is the footer icon. This is the footer text.] +$footerIcon[$authorAvatar] +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: + embed: + footer: + text: âŦ…ī¸ That is the footer icon. This is the footer text. + image: https://user-images.githubusercontent.com/111157596/257052136-4b8d5715-b381-4d5f-8c46-8ae0be53c8d8.png +``` diff --git a/src/bdscript/getBanReason.md b/src/bdscript/getBanReason.md index 4ac200e924f..b01ab5aa917 100644 --- a/src/bdscript/getBanReason.md +++ b/src/bdscript/getBanReason.md @@ -1,34 +1,34 @@ -# $getBanReason -Gets the user's ban reason. - - -## Syntax -``` -$getBanReason[User ID;(Guild ID)] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: User to get the ban reason for -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server id from which to get the ban reason. - - -## Example -``` -$nomention -Ban Reason: $getBanReason[154148273307910144] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Ban Reason: Too cute -``` +# $getBanReason +Gets the user's ban reason. + + +## Syntax +``` +$getBanReason[User ID;(Guild ID)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: User to get the ban reason for +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server id from which to get the ban reason. + + +## Example +``` +$nomention +Ban Reason: $getBanReason[154148273307910144] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Ban Reason: Too cute +``` diff --git a/src/bdscript/getBotInvite.md b/src/bdscript/getBotInvite.md index dc2e458705e..da6f7fc3b8d 100644 --- a/src/bdscript/getBotInvite.md +++ b/src/bdscript/getBotInvite.md @@ -1,35 +1,38 @@ -# $getBotInvite -Returns the bot's invite URL. - -## Syntax -``` -$getBotInvite -``` - -> **Invitation perms can be configured in the BDFD App**: -> 1. Select the bot, -> 2. Click "➤ Invite bot to server" button, -> 3. Select "🔓 Edit invite link permissions", -> 4. Pick permissions - -## Example -``` -$nomention -Invite Me! $getBotInvite -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 390515191819010058 - username: kubastick - color: "#378afa" - bot: true - content: | - Invite Me! https://discordapp.com/oauth2/authorize?client_id=390515191819010058&scope=bot&permissions=2146958847 -``` - -> *The invitation link in **this** example is fake, so it doesn’t work.* +# $getBotInvite +Returns the bot's invite URL. + +## Syntax +``` +$getBotInvite +``` + +```admonish note title="Invitation perms can be configured in the BDFD App:" +1. Select the bot, +2. Click "➤ Invite bot to server" button, +3. Select "🔓 Edit invite link permissions", +4. Pick permissions +``` + +## Example +``` +$nomention +Invite Me! $getBotInvite +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 390515191819010058 + username: kubastick + color: "#378afa" + bot: true + content: | + Invite Me! https://discordapp.com/oauth2/authorize?client_id=390515191819010058&scope=bot&permissions=2146958847 +``` + +```admonish example +The invitation link in **this** example is fake, so it doesn’t work. +``` diff --git a/src/bdscript/getChannelVar.md b/src/bdscript/getChannelVar.md index 7113494b7cf..4bf0832f755 100644 --- a/src/bdscript/getChannelVar.md +++ b/src/bdscript/getChannelVar.md @@ -1,35 +1,35 @@ -# $getChannelVar -Returns the value of the provided channel variable. - -## Syntax -``` -$getChannelVar[Variable name;(Channel ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. -- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to get the value for. If no "Channel ID" is present, then the current channel will be used. - -## Example -``` -$nomention -Command used `$getChannelVar[Uses]` times in this channel -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Command used 1 times in this channel -``` - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $getChannelVar +Returns the value of the provided channel variable. + +## Syntax +``` +$getChannelVar[Variable name;(Channel ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to get the value for. If no "Channel ID" is present, then the current channel will be used. + +## Example +``` +$nomention +Command used `$getChannelVar[Uses]` times in this channel +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Command used 1 times in this channel +``` + +```admonish info title="Read more" +For more information, read the the [Variables Guide](../guides/introduction/variables.md). +``` diff --git a/src/bdscript/getCooldown.md b/src/bdscript/getCooldown.md index b1b23274018..ba9d0ea0f51 100644 --- a/src/bdscript/getCooldown.md +++ b/src/bdscript/getCooldown.md @@ -1,23 +1,51 @@ -# $getCooldown -Returns how long is left on the cooldown, in seconds. - -> This function can be used in the "Error message" field of cooldown functions. - -## Syntax -``` -$getCooldown[Cooldown type (normal/server/global)] -``` - -### Parameters -- `Cooldown type` `(Type: Enum || Flag: Required)`: The type of the cooldown. Cooldown types: - - `normal` - Normal cooldown ([`$cooldown`](./cooldown.md)) - - `server` - Server cooldown ([`$serverCooldown`](./serverCooldown.md)) - - `global` - Global cooldown ([`$globalCooldown`](./globalCooldown.md)) - -## Example -``` -$nomention -$cooldown[1h;You're on cooldown! ()] -Hello World! -$c[This example should be used in BDScript 2 only.] -``` +# $getCooldown +Returns how long is left on the cooldown, in seconds. + +```admonish note +This function can be used in the "Error message" field of cooldown functions. +``` + +## Syntax +``` +$getCooldown[Cooldown type (normal/server/global)] +``` + +### Parameters +- `Cooldown type` `(Type: Enum || Flag: Required)`: The type of the cooldown. Cooldown types: + - `normal` - Normal cooldown ([`$cooldown`](./cooldown.md)) + - `server` - Server cooldown ([`$serverCooldown`](./serverCooldown.md)) + - `global` - Global cooldown ([`$globalCooldown`](./globalCooldown.md)) + +## Example +``` +$nomention +$cooldown[1h;You're on cooldown! ()] +Hello world! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello world! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + You're on cooldown! (
In 1 hour
) +``` diff --git a/src/bdscript/getCustomStatus.md b/src/bdscript/getCustomStatus.md index 39d704df8ed..98d82d610da 100644 --- a/src/bdscript/getCustomStatus.md +++ b/src/bdscript/getCustomStatus.md @@ -1,33 +1,35 @@ -# $getCustomStatus -Returns a user's custom status. - -## Syntax -``` -$getCustomStatus[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose custom status to get. - -## Example -``` -$nomention -Custom status: $getCustomStatus[$authorID] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Custom status: Hello! I'm RainbowKey -``` - -> [How `$authorID` works?](./authorID.md) +# $getCustomStatus +Returns a user's custom status. + +## Syntax +``` +$getCustomStatus[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose custom status to get. + +## Example +``` +$nomention +Custom status: $getCustomStatus[$authorID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Custom status: Hello! I'm RainbowKey +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/getEmbedData.md b/src/bdscript/getEmbedData.md index 1a34994ae3b..dff44d6bd20 100644 --- a/src/bdscript/getEmbedData.md +++ b/src/bdscript/getEmbedData.md @@ -1,28 +1,28 @@ -# $getEmbedData -Fetches embed data from the provided message. - -## Syntax -``` -$getEmbedData[Channel ID;Message ID;Embed index;Embed property (title/description/footer/color/image/timestamp)] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel this message belongs to. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get this embed data from. -- `Embed index` `(Type: HowMany || Flag: Required)`: The embed of this message to get data from. Use `1` for the first embed of this message. [(learn more)](../resources/embedIndexes.md) -- `Embed property` `(Type: Enum || Flag: Required)`: The embed property to return. Embed properties: - - `title` - The title of the embed. - - `description` - The description of the embed. - - `footer` - The footer of the embed. - - `color` - The color border hex of the embed. - - `image` - The image of the embed. - - `timestamp` - The timestamp of the embed. - -## Example -``` -$nomention -Title: $getEmbedData[876920205526319144;878299081380876339;1;title] -Description: $getEmbedData[876920205526319144;878299081380876339;1;description] -Footer: $getEmbedData[876920205526319144;878299081380876339;1;footer] -``` -![example](https://user-images.githubusercontent.com/69215413/130266834-50421e8e-fe9f-4b2e-8937-c9b870f3296d.png) +# $getEmbedData +Fetches embed data from the provided message. + +## Syntax +``` +$getEmbedData[Channel ID;Message ID;Embed index;Embed property (title/description/footer/color/image/timestamp)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel this message belongs to. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get this embed data from. +- `Embed index` `(Type: HowMany || Flag: Required)`: The embed of this message to get data from. Use `1` for the first embed of this message. [(learn more)](../resources/embedIndexes.md) +- `Embed property` `(Type: Enum || Flag: Required)`: The embed property to return. Embed properties: + - `title` - The title of the embed. + - `description` - The description of the embed. + - `footer` - The footer of the embed. + - `color` - The color border hex of the embed. + - `image` - The image of the embed. + - `timestamp` - The timestamp of the embed. + +## Example +``` +$nomention +Title: $getEmbedData[876920205526319144;878299081380876339;1;title] +Description: $getEmbedData[876920205526319144;878299081380876339;1;description] +Footer: $getEmbedData[876920205526319144;878299081380876339;1;footer] +``` +![example](https://user-images.githubusercontent.com/69215413/130266834-50421e8e-fe9f-4b2e-8937-c9b870f3296d.png) diff --git a/src/bdscript/getInviteInfo.md b/src/bdscript/getInviteInfo.md index 828fa5d64ef..aee3e1b5045 100644 --- a/src/bdscript/getInviteInfo.md +++ b/src/bdscript/getInviteInfo.md @@ -1,31 +1,31 @@ -# $getInviteInfo -Returns information about the provided invite code. - -## Syntax -``` -$getInviteInfo[Invite code;Invite property] -``` - -### Parameters -- `Invite code` `(Type: String || Flag: Required)`: The invite code to get info about. -- `Invite property` `(Type: Enum || Flag: Required)`: The information to get about this invite. Invite properties: - - `channel` - The channel that this invite is for. - - `creationDate` - The creation date of this invite. - - `inviter` - The ID of the user who created this invite. - - `isTemporary` - Whether or not this invite is temporary. - - `uses` - How many times this invite has been used. - -## Example -``` -$nomention -$argsCheck[>1;Please provide a valid invite code!] -$title[Invite Info] -$description[Uses: $getInviteInfo[$message;uses] -Channel: $getInviteInfo[$message;channel] -Date: $getInviteInfo[$message;creationDate] -Inviter: $getInviteInfo[$message;inviter] -Temporary: $getInviteInfo[$message;isTemporary]] -$color[#673ab7] -``` - -![Example](https://user-images.githubusercontent.com/69215413/122654170-88880280-d117-11eb-9123-947b48354ab6.png) +# $getInviteInfo +Returns information about the provided invite code. + +## Syntax +``` +$getInviteInfo[Invite code;Invite property] +``` + +### Parameters +- `Invite code` `(Type: String || Flag: Required)`: The invite code to get info about. +- `Invite property` `(Type: Enum || Flag: Required)`: The information to get about this invite. Invite properties: + - `channel` - The channel that this invite is for. + - `creationDate` - The creation date of this invite. + - `inviter` - The ID of the user who created this invite. + - `isTemporary` - Whether or not this invite is temporary. + - `uses` - How many times this invite has been used. + +## Example +``` +$nomention +$argsCheck[>1;Please provide a valid invite code!] +$title[Invite Info] +$description[Uses: $getInviteInfo[$message;uses] +Channel: $getInviteInfo[$message;channel] +Date: $getInviteInfo[$message;creationDate] +Inviter: $getInviteInfo[$message;inviter] +Temporary: $getInviteInfo[$message;isTemporary]] +$color[#673ab7] +``` + +![Example](https://user-images.githubusercontent.com/69215413/122654170-88880280-d117-11eb-9123-947b48354ab6.png) diff --git a/src/bdscript/getLeaderboardPosition.md b/src/bdscript/getLeaderboardPosition.md index 01da7d2ab70..248896dc519 100644 --- a/src/bdscript/getLeaderboardPosition.md +++ b/src/bdscript/getLeaderboardPosition.md @@ -1,38 +1,38 @@ -# $getLeaderboardPosition -Get position in a leaderboard for a given variable. - -## Syntax -``` -$getLeaderboardPosition[Variable type;Variable name;Sort type;(User ID)] -``` - -### Parameters -- `Variable type` `(Type: Enum || Flag: Required)`: The variable type. Variable types: - - `user` - [User variable](../guides/introduction/variables.md#user-variables) - - `globalUser` - [Global-User variable](../guides/introduction/variables.md#globalglobal-user-variables) -- `Variable name` `(Type: String || Flag: Required)`: The variable name to generate a leaderboard for. -- `Sort type` `(Type: Enum || Flag: Required)`: The sort type. Sort types: - - `asc` - Sorts values in ascending order. - - `desc` - Sorts values in descending order. -- `User ID`: `(Type: Snowflake || Flag: Optional)`: The ID of a user from whom you want to get a position in a leaderboard. - -## Example -``` -$nomention -Your position in the leaderboard: $getLeaderboardPosition[user;Coins;desc] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Your position in the leaderboard: 2 -``` +# $getLeaderboardPosition +Get position in a leaderboard for a given variable. + +## Syntax +``` +$getLeaderboardPosition[Variable type;Variable name;Sort type;(User ID)] +``` + +### Parameters +- `Variable type` `(Type: Enum || Flag: Required)`: The variable type. Variable types: + - `user` - [User variable](../guides/introduction/variables.md#user-variables) + - `globalUser` - [Global-User variable](../guides/introduction/variables.md#globalglobal-user-variables) +- `Variable name` `(Type: String || Flag: Required)`: The variable name to generate a leaderboard for. +- `Sort type` `(Type: Enum || Flag: Required)`: The sort type. Sort types: + - `asc` - Sorts values in ascending order. + - `desc` - Sorts values in descending order. +- `User ID`: `(Type: Snowflake || Flag: Optional)`: The ID of a user from whom you want to get a position in a leaderboard. + +## Example +``` +$nomention +Your position in the leaderboard: $getLeaderboardPosition[user;Coins;desc] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your position in the leaderboard: 2 +``` diff --git a/src/bdscript/getLeaderboardValue.md b/src/bdscript/getLeaderboardValue.md index 0f2e4dc0716..839f7732c47 100644 --- a/src/bdscript/getLeaderboardValue.md +++ b/src/bdscript/getLeaderboardValue.md @@ -1,40 +1,40 @@ -# $getLeaderboardValue -Gets a leaderboard value. - -## Syntax -``` -$getLeaderboardValue[Variable type;Variable name;Sort type;Position;(Return type)] -``` - -### Parameters -- `Variable type` `(Type: Enum || Flag: Required)`: The type of the variable. Variable types: - - `user` - [User variable](../guides/introduction/variables.md#user-variables) - - `server` - [Server variable](../guides/introduction/variables.md#server-variables) - - `globalUser` - [Global-User variable](../guides/introduction/variables.md#globalglobal-user-variables) -- `Variable name` `(Type: String || Flag: Required)`: The variable name to generate the leaderboard for. -- `Sort type` `(Type: Enum || Flag: Required)`: The sort type. Sort types: - - `asc` - Sorts the values in ascending order. - - `desc` - Sorts the values in descending order. -- `Position` `(Type: HowMany || Flag: Required)`: The leaderboard position to get, e.g `1`, `3`, etc. -- `Return type` `(Type: Enum || Flag: Optional)`: The return type. Return types: - - `id` - Returns the ID of the user belonging to this position. - - `value` - Returns the variable value of this position. - - none - If this field is excluded, it will return `Username - Value`. - -## Example -``` -$nomention -$title[**Global Leaderboard**] -$description[#1 - $getLeaderboardValue[globalUser;Money;asc;1] -#2 - $getLeaderboardValue[globalUser;Money;asc;2] -#3 - $getLeaderboardValue[globalUser;Money;asc;3] -#4 - $getLeaderboardValue[globalUser;Money;asc;4] -#5 - $getLeaderboardValue[globalUser;Money;asc;5] -#6 - $getLeaderboardValue[globalUser;Money;asc;6] -#7 - $getLeaderboardValue[globalUser;Money;asc;7] -#8 - $getLeaderboardValue[globalUser;Money;asc;8] -#9 - $getLeaderboardValue[globalUser;Money;asc;9] -#10 - $getLeaderboardValue[globalUser;Money;asc;10]] -$color[FFFF00] -$c[This is for global-user variables.] -``` +# $getLeaderboardValue +Gets a leaderboard value. + +## Syntax +``` +$getLeaderboardValue[Variable type;Variable name;Sort type;Position;(Return type)] +``` + +### Parameters +- `Variable type` `(Type: Enum || Flag: Required)`: The type of the variable. Variable types: + - `user` - [User variable](../guides/introduction/variables.md#user-variables) + - `server` - [Server variable](../guides/introduction/variables.md#server-variables) + - `globalUser` - [Global-User variable](../guides/introduction/variables.md#globalglobal-user-variables) +- `Variable name` `(Type: String || Flag: Required)`: The variable name to generate the leaderboard for. +- `Sort type` `(Type: Enum || Flag: Required)`: The sort type. Sort types: + - `asc` - Sorts the values in ascending order. + - `desc` - Sorts the values in descending order. +- `Position` `(Type: HowMany || Flag: Required)`: The leaderboard position to get, e.g `1`, `3`, etc. +- `Return type` `(Type: Enum || Flag: Optional)`: The return type. Return types: + - `id` - Returns the ID of the user belonging to this position. + - `value` - Returns the variable value of this position. + - none - If this field is excluded, it will return `Username - Value`. + +## Example +``` +$nomention +$title[**Global Leaderboard**] +$description[#1 - $getLeaderboardValue[globalUser;Money;asc;1] +#2 - $getLeaderboardValue[globalUser;Money;asc;2] +#3 - $getLeaderboardValue[globalUser;Money;asc;3] +#4 - $getLeaderboardValue[globalUser;Money;asc;4] +#5 - $getLeaderboardValue[globalUser;Money;asc;5] +#6 - $getLeaderboardValue[globalUser;Money;asc;6] +#7 - $getLeaderboardValue[globalUser;Money;asc;7] +#8 - $getLeaderboardValue[globalUser;Money;asc;8] +#9 - $getLeaderboardValue[globalUser;Money;asc;9] +#10 - $getLeaderboardValue[globalUser;Money;asc;10]] +$color[FFFF00] +$c[This is for global-user variables.] +``` diff --git a/src/bdscript/getMessage.md b/src/bdscript/getMessage.md index e672d805f64..1ab6c821102 100644 --- a/src/bdscript/getMessage.md +++ b/src/bdscript/getMessage.md @@ -1,28 +1,28 @@ -# $getMessage -Gets data from the provided message. - -## Syntax -``` -$getMessage[Channel ID;Message ID;(Property)] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that this message belongs to. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get the data from. -- `Property` `(Type: Enum || Flag: Optional)`: The message data to get. The default is `content`. Message properties: - - `content` - The content of this message. - - `authorID` - The ID of the message author. - - `username` - The username of the message author. - - `avatar` - The avatar of the message author. - -## Example -``` -$nomention -$argsCheck[>2;Please provide a channel and message ID! Usage: `!quote (channel) (messageID)`] -$description[$getMessage[$findChannel[$message[1]];$message[2]]] -$color[#673ab7] -$authorIcon[$getMessage[$findChannel[$message[1]];$message[2];avatar]] -$author[$getMessage[$findChannel[$message[1]];$message[2];username]#$discriminator[$getMessage[$findChannel[$message[1]];$message[2];authorID]]] -``` - -![example](https://user-images.githubusercontent.com/69215413/122654424-3e078580-d119-11eb-9524-e68f08f787d7.png) +# $getMessage +Gets data from the provided message. + +## Syntax +``` +$getMessage[Channel ID;Message ID;(Property)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that this message belongs to. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get the data from. +- `Property` `(Type: Enum || Flag: Optional)`: The message data to get. The default is `content`. Message properties: + - `content` - The content of this message. + - `authorID` - The ID of the message author. + - `username` - The username of the message author. + - `avatar` - The avatar of the message author. + +## Example +``` +$nomention +$argsCheck[>2;Please provide a channel and message ID! Usage: `!quote (channel) (messageID)`] +$description[$getMessage[$findChannel[$message[1]];$message[2]]] +$color[#673ab7] +$authorIcon[$getMessage[$findChannel[$message[1]];$message[2];avatar]] +$author[$getMessage[$findChannel[$message[1]];$message[2];username]#$discriminator[$getMessage[$findChannel[$message[1]];$message[2];authorID]]] +``` + +![example](https://user-images.githubusercontent.com/69215413/122654424-3e078580-d119-11eb-9524-e68f08f787d7.png) diff --git a/src/bdscript/getReactions.md b/src/bdscript/getReactions.md index d87ba6d7ff2..bc973b7cf9a 100644 --- a/src/bdscript/getReactions.md +++ b/src/bdscript/getReactions.md @@ -1,21 +1,21 @@ -# $getReactions -Returns a list of users who reacted to a message. - -## Syntax -``` -$getReactions[Channel ID;Message ID;Separator;Emoji] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that the message belongs to. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get the user-reactions from. -- `Separator` `(Type: String || Flag: Required)`: The separator between each user. -- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji to get the user's reactions for. - -## Example -``` -$nomention -$getReactions[2394734883474774;38483494328934989;, ;<:tip:3943484884834848483>] -``` - -![example](https://user-images.githubusercontent.com/69215413/123293801-488f9980-d4e2-11eb-9a1b-241c4b51f845.png) +# $getReactions +Returns a list of users who reacted to a message. + +## Syntax +``` +$getReactions[Channel ID;Message ID;Separator;Emoji] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel that the message belongs to. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to get the user-reactions from. +- `Separator` `(Type: String || Flag: Required)`: The separator between each user. +- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji to get the user's reactions for. + +## Example +``` +$nomention +$getReactions[2394734883474774;38483494328934989;, ;<:tip:3943484884834848483>] +``` + +![example](https://user-images.githubusercontent.com/69215413/123293801-488f9980-d4e2-11eb-9a1b-241c4b51f845.png) diff --git a/src/bdscript/getRoleColor.md b/src/bdscript/getRoleColor.md index daa91bc915e..233bae0f7a8 100644 --- a/src/bdscript/getRoleColor.md +++ b/src/bdscript/getRoleColor.md @@ -1,19 +1,34 @@ -# $getRoleColor -Returns a role's color hex. - -## Syntax -``` -$getRoleColor[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to get the color hex from. - -## Example -``` -$nomention -$description[<@$authorID>'s color: `#$getRoleColor[$highestRole[$authorID]]`] -$color[$getRoleColor[$highestRole[$authorID]]] -``` - -![example](https://user-images.githubusercontent.com/69215413/123296726-e7b59080-d4e4-11eb-8b7d-4712af14faa6.png) +# $getRoleColor +Returns a role's color hex. + +## Syntax +``` +$getRoleColor[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to get the color hex from. + +## Example +``` +$nomention +Color: #$getRoleColor[$highestRole[$authorID]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Color: #E67E22 +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) and [`$highestRole[]`](./highestRoleComplex.md) works? +``` diff --git a/src/bdscript/getServerInvite.md b/src/bdscript/getServerInvite.md index 0c7a4963e9a..41291c5ec69 100644 --- a/src/bdscript/getServerInvite.md +++ b/src/bdscript/getServerInvite.md @@ -1,18 +1,18 @@ -# $getServerInvite -Returns the current server's invite URL. - -## Syntax -``` -$getServerInvite -``` - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `createinstantinvite` - -## Example -``` -$nomention -$getServerInvite -``` -![example](https://user-images.githubusercontent.com/111157596/232096767-e57f40a3-08a3-4fd7-8594-5d20643a8bc0.png) +# $getServerInvite +Returns the current server's invite URL. + +## Syntax +``` +$getServerInvite +``` + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `createinstantinvite` + +## Example +``` +$nomention +$getServerInvite +``` +![example](https://user-images.githubusercontent.com/111157596/232096767-e57f40a3-08a3-4fd7-8594-5d20643a8bc0.png) diff --git a/src/bdscript/getServerInviteComplex.md b/src/bdscript/getServerInviteComplex.md index 09bc9e50e05..4d16f35a357 100644 --- a/src/bdscript/getServerInviteComplex.md +++ b/src/bdscript/getServerInviteComplex.md @@ -1,25 +1,29 @@ -# $getServerInvite[] -Returns the provided server's invite URL. +# $getServerInvite[] +Returns the provided server's invite URL. -> 🧙‍♂ī¸ **Note:** The bot must be present in the provided server for it to create an invite. - -## Syntax -``` -$getServerInvite[Guild ID] +```admonish warning +The bot must be present in the provided server (`Guild ID` parameter) for it to create an invite. ``` -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server for which to get the invite. - -> 🧙‍♂ī¸ [How do I find a server/guild ID? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID) - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `createinstantinvite` - -## Example -``` -$nomention -$getServerInvite[$message[1]] +```admonish danger +You should not use this function to join a user's server **unsolicited**. This means that you aren't allowed to join a user's server without their consent, otherwise it may be considered as API abuse and result in a report against you and your bot. ``` -![example](https://user-images.githubusercontent.com/111157596/232099171-ab1a4cea-836a-45e7-9a93-2012ac4012e5.png) + +## Syntax +``` +$getServerInvite[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server for which to get the invite. [How do I find a guild ID? (click-me)](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID) + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `createinstantinvite` + +## Example +``` +$nomention +$getServerInvite[$message] +``` +![example](https://user-images.githubusercontent.com/111157596/232099171-ab1a4cea-836a-45e7-9a93-2012ac4012e5.png) diff --git a/src/bdscript/getServerVar.md b/src/bdscript/getServerVar.md index f7b37f211fd..63dd713763c 100644 --- a/src/bdscript/getServerVar.md +++ b/src/bdscript/getServerVar.md @@ -1,13 +1,13 @@ -# $getServerVar -Returns the value of the provided server variable. - -## Syntax -``` -$getServerVar[Variable name;(Guild ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. -- `Guild ID` `(Type: Snowflake, String || Flag: Optional)`: The server to get the value for. If no guild ID is inputted, then the current server is used. - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $getServerVar +Returns the value of the provided server variable. + +## Syntax +``` +$getServerVar[Variable name;(Guild ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. +- `Guild ID` `(Type: Snowflake, String || Flag: Optional)`: The server to get the value for. If no guild ID is inputted, then the current server is used. + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/getSlowmode.md b/src/bdscript/getSlowmode.md new file mode 100644 index 00000000000..a9883dab95d --- /dev/null +++ b/src/bdscript/getSlowmode.md @@ -0,0 +1,44 @@ +# $getSlowmode +Returns the channel's slowmode time (In Seconds). + +```admonish tip title="Change slowmode time" +To change the slowmode time in the channel use [`$slowmode[]`](./slowmode). +``` + +## Syntax +``` +$getSlowmode[(Channel ID)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to get the slowmode time + +## Example +``` +$nomention +Slowmode time: $getSlowmode[$channelID] seconds +``` + +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Slowmode time: 0 seconds +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + This means there is no slowmode set in this channel. +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) works? +``` diff --git a/src/bdscript/getTextSplitIndex.md b/src/bdscript/getTextSplitIndex.md index c5d4fe06152..5ab34bbde3f 100644 --- a/src/bdscript/getTextSplitIndex.md +++ b/src/bdscript/getTextSplitIndex.md @@ -1,46 +1,46 @@ -# $getTextSplitIndex -Retrieves index from the provided value in [`$textSplit[]`](./textSplit.md). Returns `-1` if it couldn't find the value. - -## Syntax -``` -$getTextSplitIndex[Value] -``` - -### Parameters -- `Value` `(Type: String || Flag: Emptiable)`: The value to search in the text split. - -## Example -``` -$nomention -$textSplit[hello_world_!;_] -> $getTextSplitIndex[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example world -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 2 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example bdfd -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - -1 -``` - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $getTextSplitIndex +Retrieves index from the provided value in [`$textSplit[]`](./textSplit.md). Returns `-1` if it couldn't find the value. + +## Syntax +``` +$getTextSplitIndex[Value] +``` + +### Parameters +- `Value` `(Type: String || Flag: Emptiable)`: The value to search in the text split. + +## Example +``` +$nomention +$textSplit[hello_world_!;_] +> $getTextSplitIndex[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example world +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 2 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example bdfd +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + -1 +``` + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/getTextSplitLength.md b/src/bdscript/getTextSplitLength.md index 07ac941c80c..2c3fd6513cd 100644 --- a/src/bdscript/getTextSplitLength.md +++ b/src/bdscript/getTextSplitLength.md @@ -1,31 +1,31 @@ -# $getTextSplitLength -Returns the number of splits in [`$textSplit[]`](./textSplit.md). - -## Syntax -``` -$getTextSplitLength -``` - -## Example -``` -$nomention -$textSplit[hello%world%!;%] -> $getTextSplitLength -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 3 -``` - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $getTextSplitLength +Returns the number of splits in [`$textSplit[]`](./textSplit.md). + +## Syntax +``` +$getTextSplitLength +``` + +## Example +``` +$nomention +$textSplit[hello%world%!;%] +> $getTextSplitLength +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 3 +``` + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/getTimestamp.md b/src/bdscript/getTimestamp.md index fdce00c18be..1c55763e261 100644 --- a/src/bdscript/getTimestamp.md +++ b/src/bdscript/getTimestamp.md @@ -1,32 +1,32 @@ -# $getTimestamp -Returns the current [unix timestamp](https://www.unixtimestamp.com/) in seconds. - -## Syntax -``` -$getTimestamp -``` - -## Example -``` -$nomention -Current Unix-time: $getTimestamp -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | -
-``` - -> For more info about UNIX timestamps on Discord click [here](../resources/discordTimestamps.md). - - +# $getTimestamp +Returns the current [unix timestamp](https://www.unixtimestamp.com/) in seconds. + +## Syntax +``` +$getTimestamp +``` + +## Example +``` +$nomention +Current Unix-time: $getTimestamp +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +> For more info about UNIX timestamps on Discord click [here](../resources/discordTimestamps.md). + + diff --git a/src/bdscript/getTimestampComplex.md b/src/bdscript/getTimestampComplex.md index 51ac53f6654..63f3162e9a8 100644 --- a/src/bdscript/getTimestampComplex.md +++ b/src/bdscript/getTimestampComplex.md @@ -1,27 +1,43 @@ -# $getTimestamp[] -Returns the current [unix timestamp](https://www.unixtimestamp.com/) in the selected time unit. - -## Syntax -``` -$getTimestamp[Time unit] -``` - -### Parameters -- `Time unit` `(Type: Enum || Flag: Required)`: Sets timestamp time unit. - -> 📝 Time unit value can either be : -> - `s` (seconds) -> - `ms` (milliseconds) -> - `ns` (nanoseconds) - -## Example -``` -$nomention -Unix Timestamp - In Seconds - $getTimestamp[s] - In Milliseconds - $getTimestamp[ms] - In Nanoseconds - $getTimestamp[ns] - ``` - ![example](https://user-images.githubusercontent.com/95774950/188307175-48845a0d-6229-46f3-80eb-f1f9d3fde974.png) - -> 📄 For more info about UNIX timestamps on Discord click [here](../resources/discordTimestamps.md). +# $getTimestamp[] +Returns the current [unix timestamp](https://www.unixtimestamp.com/) in the selected time unit. + +## Syntax +``` +$getTimestamp[Time unit] +``` + +### Parameters +- `Time unit` `(Type: Enum || Flag: Required)`: Sets timestamp time unit. + +> Time unit value can either be : +> - `s` (seconds) +> - `ms` (milliseconds) +> - `ns` (nanoseconds) + +## Example +``` +$nomention +Unix Timestamp +In Seconds - $getTimestamp[s] +In Milliseconds - $getTimestamp[ms] +In Nanoseconds - $getTimestamp[ns] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +> For more info about UNIX timestamps on Discord click [here](../resources/discordTimestamps.md). + + diff --git a/src/bdscript/getUserStatus.md b/src/bdscript/getUserStatus.md index aa2206a8f38..05b3ca04fee 100644 --- a/src/bdscript/getUserStatus.md +++ b/src/bdscript/getUserStatus.md @@ -1,26 +1,45 @@ -# $getUserStatus -Returns the provided user's status/presence. - -> 🧙‍♂ī¸ The user must share atleast 1 server with the bot, for this function to work. - -## Syntax -``` -$getUserStatus[User ID] -``` - -> The different statuses this function will return are: `online`, `dnd`, `idle` and `offline`. - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the status for. - -### Privileged Intents -This function requires the following privileged intents: -- [`Presences Intent`](../guides/introduction/gatewayIntents.md#presence-intent) - -## Example -``` -$nomention -$nickname[$mentioned[1;yes]]'s status is: $getUserStatus[$mentioned[1;yes]] -``` - -![example](https://user-images.githubusercontent.com/69215413/124503888-68517800-dd94-11eb-93e5-c0eea7d8b055.png) +# $getUserStatus +Returns the provided user's status/presence. + +```admonish fail title="Privileged Intents" +This function requires the following privileged intents: +- [`Presences Intent`](../guides/introduction/gatewayIntents.md#presence-intent) +``` + +## Syntax +``` +$getUserStatus[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the status for. + +#### Possible Outputs +- `online`: đŸŸĸ Online +- `dnd`: 🔴 Do not disturb +- `idle`: 🟡 Idle +- `offline`: âšĢ Offline + +## Example +``` +$nomention +My status is: `$getUserStatus[$authorID]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + My status is: dnd +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/getUserVar.md b/src/bdscript/getUserVar.md index 0c531a664d9..7d460c0cca9 100644 --- a/src/bdscript/getUserVar.md +++ b/src/bdscript/getUserVar.md @@ -1,21 +1,21 @@ -# $getUserVar -Returns a local-user variable value. - -## Syntax -``` -$getUserVar[Variable name;(User ID;Guild ID)] -``` -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. -- `User ID` `(Type: String, Snowflake || Flag: Vacantable)`: The user to get the variable value for. If no user is provided, the author is used. -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to get the variable value for. If no guild is provided, the current guild is used. - -## Example -``` -$nomention -<@$mentioned[1;yes]> has $getUserVar[Money;$mentioned[1;yes]] coins. -``` - -![example](https://user-images.githubusercontent.com/69215413/123357288-40157e00-d537-11eb-84bc-71f81764434f.png) - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $getUserVar +Returns a local-user variable value. + +## Syntax +``` +$getUserVar[Variable name;(User ID;Guild ID)] +``` +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get. +- `User ID` `(Type: String, Snowflake || Flag: Vacantable)`: The user to get the variable value for. If no user is provided, the author is used. +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to get the variable value for. If no guild is provided, the current guild is used. + +## Example +``` +$nomention +<@$mentioned[1;yes]> has $getUserVar[Money;$mentioned[1;yes]] coins. +``` + +![example](https://user-images.githubusercontent.com/69215413/123357288-40157e00-d537-11eb-84bc-71f81764434f.png) + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/getVar.md b/src/bdscript/getVar.md index 3828ddec4c9..4cf2bf60eb0 100644 --- a/src/bdscript/getVar.md +++ b/src/bdscript/getVar.md @@ -1,23 +1,23 @@ -# $getVar -Gets the value of a global/global-user variable. - -## Syntax -``` -$getVar[Variable name;(User ID)] -``` - -> 🧙‍♂ī¸ For a global variable, a `User ID` doesn't need to be provided. For a global-user variable, `User ID` must be provided. - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get the value from. -- `User ID` `(Type: Snowflake, String || Flag: Vacantable)`: The user to get the value for (if global-user). - -## Example -``` -$nomention -You have $getVar[Money;$mentioned[1;yes]] coins! -``` - -![example](https://user-images.githubusercontent.com/69215413/126073974-8fbd707f-aaeb-4500-9db2-7ac923b3df74.png) - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $getVar +Gets the value of a global/global-user variable. + +## Syntax +``` +$getVar[Variable name;(User ID)] +``` + +> For a global variable, a `User ID` doesn't need to be provided. For a global-user variable, `User ID` must be provided. + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to get the value from. +- `User ID` `(Type: Snowflake, String || Flag: Vacantable)`: The user to get the value for (if global-user). + +## Example +``` +$nomention +You have $getVar[Money;$mentioned[1;yes]] coins! +``` + +![example](https://user-images.githubusercontent.com/69215413/126073974-8fbd707f-aaeb-4500-9db2-7ac923b3df74.png) + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/giveRole.md b/src/bdscript/giveRole.md index e93c00d68f6..8bf55e08ce0 100644 --- a/src/bdscript/giveRole.md +++ b/src/bdscript/giveRole.md @@ -1,41 +1,40 @@ -# $giveRole -*(deprecated)* - -> 🧙‍♂ī¸ This command is deprecated, instead better use [`$roleGrant[]`](./roleGrant.md). - -Adds a role to the provided user. - -## Syntax -``` -$giveRole[User/Role ID;(Role ID)] -``` - -### Parameters -- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to add the specified role to **or** the role to add to the mentioned users. If only this parameter is provided, it will be read as "Role ID". -- `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to add to the user. If this parameter is used, it reads the first parameter as "User ID". - -## Examples -### Example #1 -``` -$nomention -$onlyPerms[manageroles;Missing permissions!] - -$giveRole[807004801753284618] -Added $roleName[807004801753284618] to $username[$mentioned[1]]! -``` -![example1](https://user-images.githubusercontent.com/69215413/123468942-6e8b6b80-d5c0-11eb-9102-afc48b70f622.png) - -### Example #2 -``` -$nomention -$onlyPerms[manageroles;Missing permissions!] -$trimContent - -$giveRole[$mentioned[1];$message[2]] -Added the role **$roleName[$message[2]]** to **$username[$mentioned[1]]**! -``` -![example2](https://user-images.githubusercontent.com/111157596/250921826-a2a32410-a9da-4609-bee7-4076b8951e8b.png) - -## Related Resources -- [`$roleGrant[]`](./roleGrant.md) -- [`$takeRole[]`](./takeRole.md) +# $giveRole +
+ Deprecated +
+ +> This function is deprecated, instead better to use [`$roleGrant[]`](./roleGrant.md). + +Adds a role to the provided user. + +## Syntax +``` +$giveRole[User/Role ID;(Role ID)] +``` + +### Parameters +- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to add the specified role to **or** the role to add to the mentioned users. If only this parameter is provided, it will be read as "Role ID". +- `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to add to the user. If this parameter is used, it reads the first parameter as "User ID". + +## Examples +### Example #1 +``` +$nomention +$giveRole[807004801753284618] +Added $roleName[807004801753284618] to $username[$mentioned[1]]! +``` +![example1](https://user-images.githubusercontent.com/69215413/123468942-6e8b6b80-d5c0-11eb-9102-afc48b70f622.png) + +### Example #2 +``` +$nomention +$trimContent + +$giveRole[$mentioned[1];$message[2]] +Added the role **$roleName[$message[2]]** to **$username[$mentioned[1]]**! +``` +![example2](https://user-images.githubusercontent.com/111157596/250921826-a2a32410-a9da-4609-bee7-4076b8951e8b.png) + +## Related Resources +- [`$roleGrant[]`](./roleGrant.md) +- [`$takeRole[]`](./takeRole.md) diff --git a/src/bdscript/globalCooldown.md b/src/bdscript/globalCooldown.md index c7b7487dfe7..52b8ac40a1a 100644 --- a/src/bdscript/globalCooldown.md +++ b/src/bdscript/globalCooldown.md @@ -1,22 +1,22 @@ -# $globalCooldown -Applies a cooldown to the command, the user can not run the command in any server until the "Duration" is up. (Unlike `$cooldown`, which only applies the cooldown to the user in the current server) - -## Syntax -``` -$globalCooldown[Duration;Error message] -``` - -### Parameters -- `Duration` `(Type: Duration || Flag: Required)`: The duration until the user can use this command again. -- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the cooldown duration is still ongoing. - -> 🧙‍♂ī¸ You can use `%time%` in the "Error message" argument to get how much time is left until the cooldown is over. - -## Example -``` -$nomention -$globalCooldown[30s;$displayName, You are on cooldown for %time%!] - -Hello $displayName! -``` -![example](https://user-images.githubusercontent.com/111157596/233700254-d0162c40-8870-4976-bceb-c18fc7b7c0d4.gif) +# $globalCooldown +Applies a cooldown to the command, the user can not run the command in any server until the "Duration" is up. (Unlike `$cooldown`, which only applies the cooldown to the user in the current server) + +## Syntax +``` +$globalCooldown[Duration;Error message] +``` + +### Parameters +- `Duration` `(Type: Duration || Flag: Required)`: The duration until the user can use this command again. +- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the cooldown duration is still ongoing. + +> You can use `%time%` in the "Error message" argument to get how much time is left until the cooldown is over. + +## Example +``` +$nomention +$globalCooldown[30s;$displayName, You are on cooldown for %time%!] + +Hello $displayName! +``` +![example](https://user-images.githubusercontent.com/111157596/233700254-d0162c40-8870-4976-bceb-c18fc7b7c0d4.gif) diff --git a/src/bdscript/globalUserLeaderboard.md b/src/bdscript/globalUserLeaderboard.md index ceaa2fa0d81..ea8cd57bc88 100644 --- a/src/bdscript/globalUserLeaderboard.md +++ b/src/bdscript/globalUserLeaderboard.md @@ -1,21 +1,21 @@ -# $globalUserLeaderboard -Returns the top ten user's username and value for the given global-user variable. - -## Syntax -``` -$globalUserLeaderboard[Variable name;Sort type (asc/desc)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. -- `Sort type` `(Type: Enum || Flag: Optional)`: The sort type of the values (default is `desc`). Sort types: - - `asc` - Sorts the values in ascending order. - - `desc` - Sorts the values in descending order. - -> 🧙‍♂ī¸ `$globalUserLeaderboard` automatically generates a description. So, `$description` should not be used in the code. - -## Example -``` -$nomention -$globalUserLeaderboard[Money;desc] -``` +# $globalUserLeaderboard +Returns the top ten user's username and value for the given global-user variable. + +## Syntax +``` +$globalUserLeaderboard[Variable name;Sort type (asc/desc)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. +- `Sort type` `(Type: Enum || Flag: Optional)`: The sort type of the values (default is `desc`). Sort types: + - `asc` - Sorts the values in ascending order. + - `desc` - Sorts the values in descending order. + +> `$globalUserLeaderboard` automatically generates a description. So, `$description` should not be used in the code. + +## Example +``` +$nomention +$globalUserLeaderboard[Money;desc] +``` diff --git a/src/bdscript/guildExists.md b/src/bdscript/guildExists.md index b721a9c1161..ade0727acb6 100644 --- a/src/bdscript/guildExists.md +++ b/src/bdscript/guildExists.md @@ -1,34 +1,32 @@ -# $guildExists -Checks if the provided guild/server exists. - -> Returns `true` if the server exists. Returns `false` if the server doesn't exist or the bot isn't present in the provided server. - -## Syntax -``` -$guildExists[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake, String || Flag: Emptiable)`: The ID of the hypothetical server. - -## Example -``` -$nomention -$guildExists[$message[1]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example 566363823137882154 -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $guildExists +Checks if the provided guild/server exists. + +> Returns `true` if the server exists. Returns `false` if the server doesn't exist or the bot isn't present in the provided server. + +## Syntax +``` +$guildExists[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake, String || Flag: Emptiable)`: The ID of the hypothetical server. + +## Example +``` +$nomention +$guildExists[$message[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +``` diff --git a/src/bdscript/guildID.md b/src/bdscript/guildID.md index 41b61b18f13..d738a2258eb 100644 --- a/src/bdscript/guildID.md +++ b/src/bdscript/guildID.md @@ -1,14 +1,28 @@ -# $guildID -Returns the current server's ID. - -## Syntax -``` -$guildID -``` - -## Example -``` -$nomention -Server ID is : $guildID -``` -![example](https://user-images.githubusercontent.com/70468667/219971308-f7d8d7dd-4d1d-4e82-9548-921bbd29e737.jpg) +# $guildID +Returns the current server's ID. + +## Syntax +``` +$guildID +``` + +## Example +``` +$nomention +Server's ID: $guildID +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Server's ID: 566363823137882154 +``` diff --git a/src/bdscript/guildIDComplex.md b/src/bdscript/guildIDComplex.md index 014719a6788..03e28569a39 100644 --- a/src/bdscript/guildIDComplex.md +++ b/src/bdscript/guildIDComplex.md @@ -1,19 +1,17 @@ -# $guildID[] -Finds a server ID using a server's name. - -> 🧙‍♂ī¸ **Note:** The bot must be present in the server in order to get the server ID. - -## Syntax -``` -$guildID[Server name] -``` - -### Parameters -- `Server name` `(Type: String || Flag: Emptiable)`: The name of the server. - -## Example -``` -$nomention -$noMentionMessage ID is : $guildID[$noMentionMessage] -``` -![example](https://user-images.githubusercontent.com/70468667/219971506-204ba3e1-0909-448c-bf3f-63361ffdc62e.jpg) +# $guildID[] +Finds a server ID using a server's name. + +## Syntax +``` +$guildID[Server name] +``` + +### Parameters +- `Server name` `(Type: String || Flag: Emptiable)`: The name of the server. + +## Example +``` +$nomention +$noMentionMessage ID is : $guildID[$noMentionMessage] +``` +![example](https://user-images.githubusercontent.com/70468667/219971506-204ba3e1-0909-448c-bf3f-63361ffdc62e.jpg) diff --git a/src/bdscript/hasRole.md b/src/bdscript/hasRole.md index 7ad25ba5033..901d1fe5069 100644 --- a/src/bdscript/hasRole.md +++ b/src/bdscript/hasRole.md @@ -1,35 +1,33 @@ -# $hasRole -Returns whether or not a user has the provided role. - -> 🧙‍♂ī¸ "true" means the user has the role, "false" means they don't. - -## Syntax -``` -$hasRole[User ID;Role ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check for the role. -- `Role ID` `(Type: Snowflake || Flag: Emptiable)`: The role that the bot is checking the user for. - -## Example -``` -$nomention -$hasRole[$authorID;858376972303204362] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $hasRole +Returns whether or not a user has the provided role. + +> "true" means the user has the role, "false" means they don't. + +## Syntax +``` +$hasRole[User ID;Role ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check for the role. +- `Role ID` `(Type: Snowflake || Flag: Emptiable)`: The role that the bot is checking the user for. + +## Example +``` +$nomention +$hasRole[$authorID;858376972303204362] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +``` diff --git a/src/bdscript/highestRole.md b/src/bdscript/highestRole.md index 980fb4b9338..03bdf37c220 100644 --- a/src/bdscript/highestRole.md +++ b/src/bdscript/highestRole.md @@ -1,14 +1,14 @@ -# $highestRole -Returns the ID of the current server's highest role (according to its position). - -## Syntax -``` -$highestRole -``` - -## Example -``` -$nomention -The server's highest role: <@&$highestRole> ($highestRole) -``` -![example](https://user-images.githubusercontent.com/111157596/232101211-e3692eab-3df1-4906-a8cf-9f16ccef8ac0.png) +# $highestRole +Returns the ID of the current server's highest role (according to its position). + +## Syntax +``` +$highestRole +``` + +## Example +``` +$nomention +The server's highest role: <@&$highestRole> ($highestRole) +``` +![example](https://user-images.githubusercontent.com/111157596/232101211-e3692eab-3df1-4906-a8cf-9f16ccef8ac0.png) diff --git a/src/bdscript/highestRoleComplex.md b/src/bdscript/highestRoleComplex.md index bec7e86658f..26ce166c8ed 100644 --- a/src/bdscript/highestRoleComplex.md +++ b/src/bdscript/highestRoleComplex.md @@ -1,17 +1,17 @@ -# $highestRole[] -Returns the ID of the provided user's highest role (according to its position). - -## Syntax -``` -$highestRole[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user for which to return the highest role. - -## Example -``` -$nomention -$username[$mentioned[1;yes]]'s highest role: $roleName[$highestRole[$mentioned[1;yes]]] ($highestRole[$mentioned[1;yes]]) -``` -![example](https://user-images.githubusercontent.com/69215413/123514088-e90ac880-d65e-11eb-9e40-66dd3485b321.png) +# $highestRole[] +Returns the ID of the provided user's highest role (according to its position). + +## Syntax +``` +$highestRole[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user for which to return the highest role. + +## Example +``` +$nomention +$username[$mentioned[1;yes]]'s highest role: $roleName[$highestRole[$mentioned[1;yes]]] ($highestRole[$mentioned[1;yes]]) +``` +![example](https://user-images.githubusercontent.com/69215413/123514088-e90ac880-d65e-11eb-9e40-66dd3485b321.png) diff --git a/src/bdscript/highestRoleWithPerms.md b/src/bdscript/highestRoleWithPerms.md index 217828c7fa0..57e2efc18ea 100644 --- a/src/bdscript/highestRoleWithPerms.md +++ b/src/bdscript/highestRoleWithPerms.md @@ -1,18 +1,18 @@ -# $highestRoleWithPerms -Returns the highest role in the current server that has all the provided permissions. - -## Syntax -``` -$highestRoleWithPerms[Permissions] -``` - -### Parameters -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the role needs to have. - -## Example -``` -$nomention -Highest Role with Administrator: $roleName[$highestRoleWithPerms[admin]] ($highestRoleWithPerms[admin]) -``` - -![example](https://user-images.githubusercontent.com/69215413/123514351-a4802c80-d660-11eb-9ff1-3270e561982a.png) +# $highestRoleWithPerms +Returns the highest role in the current server that has all the provided permissions. + +## Syntax +``` +$highestRoleWithPerms[Permissions] +``` + +### Parameters +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the role needs to have. + +## Example +``` +$nomention +Highest Role with Administrator: $roleName[$highestRoleWithPerms[admin]] ($highestRoleWithPerms[admin]) +``` + +![example](https://user-images.githubusercontent.com/69215413/123514351-a4802c80-d660-11eb-9ff1-3270e561982a.png) diff --git a/src/bdscript/hostingExpireTime.md b/src/bdscript/hostingExpireTime.md index 5843749452a..b8b1514439b 100644 --- a/src/bdscript/hostingExpireTime.md +++ b/src/bdscript/hostingExpireTime.md @@ -1,14 +1,27 @@ -# $hostingExpireTime -Returns your bot's hosting expiration date. - -## Syntax -``` -$hostingExpireTime -``` - -## Example -``` -$nomention -$hostingExpireTime -``` -![example1](https://user-images.githubusercontent.com/42785890/151823699-8a5fda67-b837-41df-9df4-51219a73e120.png) +# $hostingExpireTime +Returns your bot's hosting expiration date. + +## Syntax +``` +$hostingExpireTime +``` + +## Example +``` +$nomention +My hosting expiration date: $hostingExpireTime +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + My hosting expiration date: San, 3 Sep 2029 23:59:00 UTC +``` diff --git a/src/bdscript/hostingExpireTimeComplex.md b/src/bdscript/hostingExpireTimeComplex.md index a5dd1e7ec1a..569c50c7314 100644 --- a/src/bdscript/hostingExpireTimeComplex.md +++ b/src/bdscript/hostingExpireTimeComplex.md @@ -1,17 +1,30 @@ -# $hostingExpireTime[] -Returns your bot's hosting expiration date. If "yes" is provided, the function returns the expiration date in a UNIX timestamp. - -## Syntax -``` -$hostingExpireTime[Return unix timestamp?] -``` - -### Parameters -- `Return unix timestamp?` `(Type: Bool || Flag: Required)`: Whether to return the expiration date in a UNIX timestamp or not. - -## Example -``` -$nomention -I will be offline -``` -![example2](https://user-images.githubusercontent.com/98183987/153687914-221aa7f1-5134-47fe-87d9-c7ae75c4a91f.jpg) +# $hostingExpireTime[] +Returns your bot's hosting expiration date. If "yes" is provided, the function returns the expiration date in a UNIX timestamp. + +## Syntax +``` +$hostingExpireTime[Return unix timestamp?] +``` + +### Parameters +- `Return unix timestamp?` `(Type: Bool || Flag: Required)`: Whether to return the expiration date in a UNIX timestamp or not. + +## Example +``` +$nomention +I will be offline +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I will be offline
In 4 years
+``` diff --git a/src/bdscript/hour.md b/src/bdscript/hour.md index 93c020c62af..ecf7b8a3bdd 100644 --- a/src/bdscript/hour.md +++ b/src/bdscript/hour.md @@ -1,33 +1,35 @@ -# $hour -Returns the current hour. - -> You can use [`$time`](./time.md) to change the timezone. - -> The `$hour` function uses the twenty-four-hour clock instead of two groups of twelve hours; this is also known as "Military Time". - -## Syntax -``` -$hour -``` - -## Example -``` -$nomention -Current Hour: $hour -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !hour -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - content: | -
-``` - - +# $hour +Returns the current hour. + +> The `$hour` function uses the twenty-four-hour clock instead of two groups of twelve hours; this is also known as "Military Time". + +## Syntax +``` +$hour +``` + +## Example +``` +$nomention +Current Hour: $hour +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !hour +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/hypesquad.md b/src/bdscript/hypesquad.md index fb32eb16ae8..979dae59f50 100644 --- a/src/bdscript/hypesquad.md +++ b/src/bdscript/hypesquad.md @@ -1,18 +1,35 @@ -# $hypesquad -Returns the hypesquad house name of the provided user. - -## Syntax -``` -$hypesquad[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user whose hypesquad house name should be returned. - -## Example -``` -$nomention -You are in $hypesquad[$authorID] house. -``` - -![example](https://user-images.githubusercontent.com/95774950/187594740-3eab54bf-1df1-4c4e-a2fe-372f8a45eb39.png) +# $hypesquad +Returns the hypesquad house name of the provided user. + +## Syntax +``` +$hypesquad[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user whose hypesquad house name should be returned. + +## Example +``` +$nomention +You are in $hypesquad[$authorID] house. +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + You are in balance house. +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/if.md b/src/bdscript/if.md index f0262376a49..a84dc077bd1 100644 --- a/src/bdscript/if.md +++ b/src/bdscript/if.md @@ -1,63 +1,61 @@ -# $if -Executes the following block of code if the provided condition is true. - -## Syntax -``` -$if[Condition] -``` - -### Parameters -- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. - -### Signs -`==` - Equal - -`!=` - Not Equal - -`<` - Less Than - -`>` - Greater Than - -`>=` - Greater Than Or Equal To - -`<=` - Less Than Or Equal To -- These signs could vary in meaning based on the order or intent of the if statement. -- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. - -## Example -``` -$nomention -$if[$authorID==$botOwnerID] - $sendMessage[You are the developer of this bot!] -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - You are the developer of this bot! -- user_id: 154148273307910144 - username: MineBartekSA - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - color: "#f1bdee" - content: | - !example -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - Nothing -``` - -> For more info, see the [If Guide](../guides/ifStatements.md). +# $if +Executes the following block of code if the provided condition is true. + +## Syntax +``` +$if[Condition] +``` + +### Parameters +- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. + +### Signs +`==` - Equal + +`!=` - Not Equal + +`<` - Less Than + +`>` - Greater Than + +`>=` - Greater Than Or Equal To + +`<=` - Less Than Or Equal To +- These signs could vary in meaning based on the order or intent of the if statement. +- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. + +## Example +``` +$nomention +$if[$authorID==$botOwnerID] + $sendMessage[You are the developer of this bot!] +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + You are the developer of this bot! +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Nothing +``` + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/ignoreChannels.md b/src/bdscript/ignoreChannels.md index 01bdbd1acd1..57d789fceb0 100644 --- a/src/bdscript/ignoreChannels.md +++ b/src/bdscript/ignoreChannels.md @@ -1,27 +1,27 @@ -# $ignoreChannels -The command can't be executed in any of the provided channels. If the channel is ignored, then the provided "Error message" is returned. - -## Syntax -``` -$ignoreChannels[Channel IDs;...;Error message] -``` - -### Parameters -- `Channel IDs` `(Type: Snowflake || Flag: Emptiable)`: The channels to ignore. Use semicolons `;` as a separator to separate multiple channel IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the channel is ignored. - -## Example -``` -$nomention -$ignoreChannels[1099033713687404614;❌ That command can't be used in this channel!] - -Hello $username! -``` - -**Ignored channel** - -![example1](https://user-images.githubusercontent.com/111157596/233706189-0d168572-a0e8-4c3d-803e-abf31826bb43.png) - -**Whitelisted channel** - -![example2](https://user-images.githubusercontent.com/111157596/233706206-0926d4bc-f0de-47b4-acb0-e7802772575b.png) +# $ignoreChannels +The command can't be executed in any of the provided channels. If the channel is ignored, then the provided "Error message" is returned. + +## Syntax +``` +$ignoreChannels[Channel IDs;...;Error message] +``` + +### Parameters +- `Channel IDs` `(Type: Snowflake || Flag: Emptiable)`: The channels to ignore. Use semicolons `;` as a separator to separate multiple channel IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the channel is ignored. + +## Example +``` +$nomention +$ignoreChannels[1099033713687404614;❌ That command can't be used in this channel!] + +Hello $username! +``` + +**Ignored channel** + +![example1](https://user-images.githubusercontent.com/111157596/233706189-0d168572-a0e8-4c3d-803e-abf31826bb43.png) + +**Whitelisted channel** + +![example2](https://user-images.githubusercontent.com/111157596/233706206-0926d4bc-f0de-47b4-acb0-e7802772575b.png) diff --git a/src/bdscript/image.md b/src/bdscript/image.md index f57248fdea1..05fb5a7aa96 100644 --- a/src/bdscript/image.md +++ b/src/bdscript/image.md @@ -1,19 +1,19 @@ -# $image -Adds an image to the embed. - -## Syntax -``` -$image[Image URL;(Index)] -``` - -### Parameters -- `Image URL` `(Type: URL || Flag: Emptiable)`: The URL of the image that appears. Must be a valid image URL. -- `Index` `(Type: Integer || Flag: Optional)`: What embed the image should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) - -## Example -``` -$nomention -$image[$userAvatar[$botID]] -``` - -![example](https://user-images.githubusercontent.com/69215413/123516701-76ecb080-d66b-11eb-9c65-fb7bbb5710b4.png) +# $image +Adds an image to the embed. + +## Syntax +``` +$image[Image URL;(Index)] +``` + +### Parameters +- `Image URL` `(Type: URL || Flag: Emptiable)`: The URL of the image that appears. Must be a valid image URL. +- `Index` `(Type: Integer || Flag: Optional)`: What embed the image should belong to. The default is `1`. [(learn more)](../resources/embedIndexes.md) + +## Example +``` +$nomention +$image[$userAvatar[$botID]] +``` + +![example](https://user-images.githubusercontent.com/69215413/123516701-76ecb080-d66b-11eb-9c65-fb7bbb5710b4.png) diff --git a/src/bdscript/isAdmin.md b/src/bdscript/isAdmin.md index 893589713fa..f79e0658aaa 100644 --- a/src/bdscript/isAdmin.md +++ b/src/bdscript/isAdmin.md @@ -1,33 +1,33 @@ -# $isAdmin -Returns whether the provided user has the administrator permission or not. - -> "true" means the user has the administrator permission, "false" means they don't. - -## Syntax -``` -$isAdmin[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. - -## Example -``` -$nomention -Are you an admin?: `$isAdmin[$authorID]` -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Are you an admin?: true -``` +# $isAdmin +Returns whether the provided user has the administrator permission or not. + +> "true" means the user has the administrator permission, "false" means they don't. + +## Syntax +``` +$isAdmin[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. + +## Example +``` +$nomention +Are you an admin?: `$isAdmin[$authorID]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Are you an admin?: true +``` diff --git a/src/bdscript/isBanned.md b/src/bdscript/isBanned.md index a0b106587d8..546b99132c7 100644 --- a/src/bdscript/isBanned.md +++ b/src/bdscript/isBanned.md @@ -1,19 +1,19 @@ -# $isBanned -Returns whether a user is banned from the current server or not. Requires the `BAN_MEMBERS` permission. - -> 🧙‍♂ī¸ "true" means the user is banned, "false" means they aren't. - -## Syntax -``` -$isBanned[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check its ban status. - -## Example -``` -$nomention -$isBanned[$message[1]] -``` -![example](https://user-images.githubusercontent.com/111157596/233709040-50d9987e-094d-4ddb-b85e-d01db865c840.png) +# $isBanned +Returns whether a user is banned from the current server or not. Requires the `BAN_MEMBERS` permission. + +> "true" means the user is banned, "false" means they aren't. + +## Syntax +``` +$isBanned[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check its ban status. + +## Example +``` +$nomention +$isBanned[$message[1]] +``` +![example](https://user-images.githubusercontent.com/111157596/233709040-50d9987e-094d-4ddb-b85e-d01db865c840.png) diff --git a/src/bdscript/isBoolean.md b/src/bdscript/isBoolean.md index d2e997a51fc..8d8a75bf48b 100644 --- a/src/bdscript/isBoolean.md +++ b/src/bdscript/isBoolean.md @@ -1,65 +1,84 @@ -# $isBoolean -Returns whether the provided text is a boolean or not. - -> "true" means the text is a boolean, "false" means it isn't. - -## Syntax -``` -$isBoolean[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to check. - -### Supported Booleans -Positive | Negative --------- | -------- -true | false -yes | no -on | off -enable | disable - -## Example -``` -$nomention -Is boolean?: `$isBoolean[$message]` -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example yes -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Is boolean?: true -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example false -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Is boolean?: true -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example text -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Is boolean?: false -``` +# $isBoolean +Returns whether the provided text is a boolean or not. + +```admonish note +`true` means the text is a boolean, `false` means it isn’t. +``` + +## Syntax +``` +$isBoolean[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to check. + +### Supported Booleans +Positive | Negative +-------- | -------- +true | false +yes | no +on | off +enable | disable + +## Example +``` +$nomention +Is boolean? $isBoolean[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example yes +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is boolean? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example false +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is boolean? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example text +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is boolean? false +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $isBoolean[] +
+
+

Output:

+ Is boolean? true +
+
diff --git a/src/bdscript/isBooster.md b/src/bdscript/isBooster.md index 03d70a91e82..c3cf0108174 100644 --- a/src/bdscript/isBooster.md +++ b/src/bdscript/isBooster.md @@ -1,35 +1,35 @@ -# $isBooster -Returns if user is boosting guild with nitro. - -> "true" means the user is a booster, "false" means it isn't. - -## Syntax -``` -$isBooster[(User ID;Guild ID)] -``` - -### Parameters - -## Example -``` -$nomention -Booster? $isBooster[$mentioned[1]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@kubastick> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Booster? true -``` - -> You can use `$isBooster[]` to get the status of author.\ -> [How `$mentioned[]` works?](./mentioned.md) +# $isBooster +Returns if user is boosting guild with nitro. + +> "true" means the user is a booster, "false" means it isn't. + +## Syntax +``` +$isBooster[(User ID;Guild ID)] +``` + +### Parameters + +## Example +``` +$nomention +Booster? $isBooster[$mentioned[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@kubastick> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Booster? true +``` + +> You can use `$isBooster[]` to get the status of author.\ +> [How `$mentioned[]` works?](./mentioned.md) diff --git a/src/bdscript/isBot.md b/src/bdscript/isBot.md index 645a8b2a70d..a07f6e12d16 100644 --- a/src/bdscript/isBot.md +++ b/src/bdscript/isBot.md @@ -1,45 +1,45 @@ -# $isBot -Returns whether the provided user is a bot or not. - -> "true" means the user is a bot, "false" means they aren't. - -## Syntax -``` -$isBot[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to check. - -## Example -``` -$nomention -Bot?: $isBot[$mentioned[1]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@MineBarekSA> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Bot?: false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example <@BDFD Support> -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Bot?: true -``` +# $isBot +Returns whether the provided user is a bot or not. + +> "true" means the user is a bot, "false" means they aren't. + +## Syntax +``` +$isBot[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Emptiable)`: The user to check. + +## Example +``` +$nomention +Bot?: $isBot[$mentioned[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@MineBarekSA> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Bot?: false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@BDFD Support> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Bot?: true +``` diff --git a/src/bdscript/isEmojiAnimated.md b/src/bdscript/isEmojiAnimated.md new file mode 100644 index 00000000000..41bd20c0cd4 --- /dev/null +++ b/src/bdscript/isEmojiAnimated.md @@ -0,0 +1,35 @@ +# $isEmojiAnimated[] +Checks if the emoji's animated. + +## Syntax +``` +$isEmojiAnimated[Emoji ID] +``` + +### Parameters +- `Emoji ID` `(Type: Snowflake || Flag: Required)`: The emoji's id to check if it's animated. + +## Example +``` +$nomention +Is emoji animated?: $isEmojiAnimated[$message] +``` + +``` discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example 760463263879135242 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Is emoji animated?: false +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` \ No newline at end of file diff --git a/src/bdscript/isHoisted.md b/src/bdscript/isHoisted.md index db90b2277bd..dc0138a7f05 100644 --- a/src/bdscript/isHoisted.md +++ b/src/bdscript/isHoisted.md @@ -1,20 +1,20 @@ -# $isHoisted -Returns whether a role is displayed separately or not. - -> 🧙‍♂ī¸ "true" means the role is hoisted, "false" means it isn't. - -## Syntax -``` -$isHoisted[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to check its hoisted status. - -## Example -``` -$nomention -$isHoisted[$findRole[$message]] -``` - -![example](https://user-images.githubusercontent.com/69215413/126853587-2be4d152-7254-4424-9fa0-5ab1d93837f7.png) +# $isHoisted +Returns whether a role is displayed separately or not. + +> "true" means the role is hoisted, "false" means it isn't. + +## Syntax +``` +$isHoisted[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to check its hoisted status. + +## Example +``` +$nomention +$isHoisted[$findRole[$message]] +``` + +![example](https://user-images.githubusercontent.com/69215413/126853587-2be4d152-7254-4424-9fa0-5ab1d93837f7.png) diff --git a/src/bdscript/isInteger.md b/src/bdscript/isInteger.md index 2431de3b4a7..b07cd09262f 100644 --- a/src/bdscript/isInteger.md +++ b/src/bdscript/isInteger.md @@ -1,59 +1,76 @@ -# $isInteger -Checks if the specified value is an integer or not. - -```admonish tip -`true` means the value is an integer, `false` means it isn’t. -``` - -## Syntax -``` -$isInteger[Value] -``` - -### Parameters -- `Value` `(Type: String || Flag: Required)`: The string that will be checked. - -## Example -``` -$nomention -Integer?: $isInteger[$message] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example number -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Integer?: false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 1.8 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Integer?: false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 4 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Integer?: true -``` +# $isInteger +Checks if the specified value is an integer or not. + +```admonish note +`true` means the value is an integer, `false` means it isn’t. +``` + +## Syntax +``` +$isInteger[Value] +``` + +### Parameters +- `Value` `(Type: String || Flag: Required)`: The string that will be checked. + +## Example +``` +$nomention +Is integer? $isInteger[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example number +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is integer? false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1.8 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is integer? false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 4 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is integer? true +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $isInteger[] +
+
+

Output:

+ Is integer? true +
+
diff --git a/src/bdscript/isMentionable.md b/src/bdscript/isMentionable.md index 13216364477..200bcd8af14 100644 --- a/src/bdscript/isMentionable.md +++ b/src/bdscript/isMentionable.md @@ -1,22 +1,22 @@ -# $isMentionable -Returns whether a role is mentionable by everyone or not. - -> 🧙‍♂ī¸ "true" means the role is mentionable, "false" means it isn't. - -![setting](https://user-images.githubusercontent.com/69215413/123517230-e5327280-d66d-11eb-8337-35dac5f276e7.png) - -## Syntax -``` -$isMentionable[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to check for its mentionable status. - -## Example -``` -$nomention -$isMentionable[$findRole[$message]] -``` - -![example](https://user-images.githubusercontent.com/69215413/126853667-5263fa7a-3e79-4691-b33d-509f507670c5.png) +# $isMentionable +Returns whether a role is mentionable by everyone or not. + +> "true" means the role is mentionable, "false" means it isn't. + +![example](https://user-images.githubusercontent.com/69215413/123517230-e5327280-d66d-11eb-8337-35dac5f276e7.png) + +## Syntax +``` +$isMentionable[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to check for its mentionable status. + +## Example +``` +$nomention +$isMentionable[$findRole[$message]] +``` + +![example](https://user-images.githubusercontent.com/69215413/126853667-5263fa7a-3e79-4691-b33d-509f507670c5.png) diff --git a/src/bdscript/isNSFW.md b/src/bdscript/isNSFW.md index 86da3cd954d..3e127d1c52b 100644 --- a/src/bdscript/isNSFW.md +++ b/src/bdscript/isNSFW.md @@ -1,20 +1,62 @@ -# $isNSFW -Returns whether the provided channel is NSFW (Not Safe For Work) or not. - -> 🧙‍♂ī¸ "true" means the channel is NSFW, "false" means it isn't. - -## Syntax -``` -$isNSFW[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to check. - -## Example -``` -$nomention -Is <#$channelID> NSFW?: `$isNSFW[$channelID]` -``` - -![example](https://user-images.githubusercontent.com/69215413/123517430-dd270280-d66e-11eb-95cb-4edb5a9ed78c.png) +# $isNSFW +Returns whether the provided channel is NSFW (Not Safe For Work) or not. + +> "true" means the channel is NSFW, "false" means it isn't. + +## Syntax +``` +$isNSFW[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to check. + +## Example +``` +$nomention +Is this channel NSFW?: `$isNSFW[$channelID]` +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + NSFW Channel đŸ¤Ģ +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is this channel NSFW?: true +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + It's a main chat here! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is this channel NSFW?: false +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md) works? +``` diff --git a/src/bdscript/isNumber.md b/src/bdscript/isNumber.md index 701d8b5204e..43fea0c94f6 100644 --- a/src/bdscript/isNumber.md +++ b/src/bdscript/isNumber.md @@ -1,20 +1,76 @@ -# $isNumber -Returns whether the provided value is a number or not. - -> 🧙‍♂ī¸ "true" means the value is a number, "false" means it isn't. - -## Syntax -``` -$isNumber[Value] -``` - -### Parameters -- `Value` `(Type: String || Flag: Emptiable)`: The text to check. - -## Example -``` -$nomention -$isNumber[$message] -``` - -![example](https://user-images.githubusercontent.com/69215413/126853722-cb6b4721-0a9f-4300-b3d3-c0f6e2c601b2.png) +# $isNumber +Returns whether the provided value is a number or not. + +```admonish tip +`true` means the value is a number, `false` means it isn’t. +``` + +## Syntax +``` +$isNumber[Value] +``` + +### Parameters +- `Value` `(Type: String || Flag: Emptiable)`: The text to check. + +## Example +``` +$nomention +Is number? $isNumber[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 52 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is number? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 52.4 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is number? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hello +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is number? false +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $isNumber[] +
+
+

Output:

+ Is number? true +
+
diff --git a/src/bdscript/isSlash.md b/src/bdscript/isSlash.md index 0fcb3129072..3f7ae948ca8 100644 --- a/src/bdscript/isSlash.md +++ b/src/bdscript/isSlash.md @@ -1,21 +1,41 @@ -# $isSlash -Returns whether the command was ran as a slash command or not. - -> 🧙‍♂ī¸ "true" means the command was ran as a slash command, "false" means it wasn't. - -## Syntax -``` -$isSlash -``` - -## Example -``` -$nomention -$if[$isSlash==true] -$message[text] -$else -$message -$endif -``` - -![example](https://user-images.githubusercontent.com/69215413/123517923-b0c0b580-d671-11eb-8e10-ef56a4a5792e.png) +# $isSlash +Returns whether the command was ran as a slash command or not. + +> "true" means the command was ran as a slash command, "false" means it wasn't. + +## Syntax +``` +$isSlash +``` + +## Example +``` +$nomention +Is slash?: `$isSlash` +``` + +```discord yaml +- username: Flowcharts + user_id: 566613317972394004 + color: "#748bd4" + bot: true + command: + user_id: 803569638084313098 + author: RainbowKey + command: /example + color: "#E67E22" + content: | + Is slash?: true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is slash?: false +``` diff --git a/src/bdscript/isTicket.md b/src/bdscript/isTicket.md index 58299ab2bc2..6e093655813 100644 --- a/src/bdscript/isTicket.md +++ b/src/bdscript/isTicket.md @@ -1,24 +1,24 @@ -# $isTicket -Checks whether the current or specified channel is a ticket or not. - -> 🧙‍♂ī¸ "true" means the channel is a ticket, "false" means it isn't. - -## Syntax -``` -$isTicket[(Channel ID)] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to check. _(Defaults to the current channel)_ - -## Example -``` -$nomention -$onlyIf[$isTicket[]==true;This command can only be used in a ticket!] -This is a ticket! -``` -![example](https://user-images.githubusercontent.com/113303649/212466758-7a11f906-f356-438d-8f64-0977c28b5a3c.png)\ -![example](https://user-images.githubusercontent.com/113303649/212466712-3e8d1768-af20-4ea3-9402-8668ae8d9ccc.png) - -> To create a ticket, use the [`$newTicket[]`](./newTicket.md) function. - +# $isTicket +Checks whether the current or specified channel is a ticket or not. + +> "true" means the channel is a ticket, "false" means it isn't. + +## Syntax +``` +$isTicket[(Channel ID)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to check. _(Defaults to the current channel)_ + +## Example +``` +$nomention +$onlyIf[$isTicket[]==true;This command can only be used in a ticket!] +This is a ticket! +``` +![example](https://user-images.githubusercontent.com/113303649/212466758-7a11f906-f356-438d-8f64-0977c28b5a3c.png)\ +![example](https://user-images.githubusercontent.com/113303649/212466712-3e8d1768-af20-4ea3-9402-8668ae8d9ccc.png) + +> To create a ticket, use the [`$newTicket[]`](./newTicket.md) function. + diff --git a/src/bdscript/isTimedOut.md b/src/bdscript/isTimedOut.md index 3cdec6ed6ae..2a644e1f1f9 100644 --- a/src/bdscript/isTimedOut.md +++ b/src/bdscript/isTimedOut.md @@ -1,19 +1,19 @@ -# $isTimedOut -Checks whether the specified user is timed out or not. - -> 🧙‍♂ī¸ "true" means the user is timed out, "false" means they aren't. - -## Syntax -``` -$isTimedOut[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. - -## Example -``` -$nomention -User is timed out: $isTimedOut[$mentioned[1]] -``` -![example](https://user-images.githubusercontent.com/94063167/198900738-ed1059b6-0d73-4e97-8669-40c770281e51.png) +# $isTimedOut +Checks whether the specified user is timed out or not. + +> "true" means the user is timed out, "false" means they aren't. + +## Syntax +``` +$isTimedOut[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. + +## Example +``` +$nomention +User is timed out: $isTimedOut[$mentioned[1]] +``` +![example](https://user-images.githubusercontent.com/94063167/198900738-ed1059b6-0d73-4e97-8669-40c770281e51.png) diff --git a/src/bdscript/isUserDMEnabled.md b/src/bdscript/isUserDMEnabled.md index 23611b6d605..c962badc400 100644 --- a/src/bdscript/isUserDMEnabled.md +++ b/src/bdscript/isUserDMEnabled.md @@ -1,22 +1,22 @@ -# $isUserDMEnabled -Checks whether the bot can DM the user or not. - -> 🧙‍♂ī¸ "true" means the bot can DM the user, "false" means it can't. - -## Syntax -``` -$isUserDMEnabled[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. - -## Example -``` -$nomention -$onlyIf[$isUserDMEnabled[$authorID]==true;❌ Failed to DM you. Make sure you have your DMs on!] -$dm -$message -``` - -![example](https://user-images.githubusercontent.com/69215413/123518295-46a91000-d673-11eb-9a1e-39f9d9f83bb9.png) +# $isUserDMEnabled +Checks whether the bot can DM the user or not. + +> "true" means the bot can DM the user, "false" means it can't. + +## Syntax +``` +$isUserDMEnabled[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check. + +## Example +``` +$nomention +$onlyIf[$isUserDMEnabled[$authorID]==true;❌ Failed to DM you. Make sure you have your DMs on!] +$dm +$message +``` + +![example](https://user-images.githubusercontent.com/69215413/123518295-46a91000-d673-11eb-9a1e-39f9d9f83bb9.png) diff --git a/src/bdscript/isValidHex.md b/src/bdscript/isValidHex.md index b142e66b47b..ae22a146774 100644 --- a/src/bdscript/isValidHex.md +++ b/src/bdscript/isValidHex.md @@ -1,19 +1,76 @@ -# $isValidHex -Checks whether the given color hex is valid or not. - -> 🧙‍♂ī¸ "true" means the color hex is valid, "false" means it isn't. - -## Syntax -``` -$isValidHex[Color hex] -``` - -### Parameters -- `Color hex` `(Type: String || Flag: Emptiable)`: The [color hex](https://htmlcolorcodes.com/color-picker) to check. - -## Example -``` -$nomention -$isValidHex[$message[1]] -``` -![example](https://user-images.githubusercontent.com/111157596/233782902-c447b41a-38a5-4fc8-ba3b-7fbbef0bca71.png) +# $isValidHex +Checks whether the given color hex is valid or not. + +```admonish note +`true` means the color hex is valid, `false` means it isn’t. +``` + +## Syntax +``` +$isValidHex[Color hex] +``` + +### Parameters +- `Color hex` `(Type: String || Flag: Emptiable)`: The [color hex](https://htmlcolorcodes.com/color-picker) to check. + +## Example +``` +$nomention +Is valid HEX? $isValidHex[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example #E67E22 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is valid HEX? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example E67E22 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is valid HEX? true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example text +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is valid HEX? false +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $isValidHex[] +
+
+

Output:

+ Is valid HEX? true +
+
diff --git a/src/bdscript/joinSplitText.md b/src/bdscript/joinSplitText.md index 8b746cc2f6e..58bfb41516b 100644 --- a/src/bdscript/joinSplitText.md +++ b/src/bdscript/joinSplitText.md @@ -1,36 +1,34 @@ -# $joinSplitText -Joins [`$textSplit[]`](./textSplit.md) values with a provided separator. - -## Syntax -``` -$joinSplitText[Separator] -``` - -### Parameters -- `Separator` `(Type: String || Flag: Emptiable)`: The separator to be put between the text split values. - -## Example -We are joining the text split value with a new line, replacing the provided separator in `$textSplit[]`. -``` -$nomention -$textSplit[$message;-] -$joinSplitText[+] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example hello-world-! -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - hello+wolrd+! -``` - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $joinSplitText +Joins [`$textSplit[]`](./textSplit.md) values with a provided separator. + +## Syntax +``` +$joinSplitText[Separator] +``` + +### Parameters +- `Separator` `(Type: String || Flag: Emptiable)`: The separator to be put between the text split values. + +## Example +We are joining the text split value with a new line, replacing the provided separator in `$textSplit[]`. +``` +$nomention +$textSplit[$message;-] +$joinSplitText[+] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example hello-world-! +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + hello+wolrd+! +``` + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/kick.md b/src/bdscript/kick.md index dab91a3fa7a..a797679be9e 100644 --- a/src/bdscript/kick.md +++ b/src/bdscript/kick.md @@ -1,11 +1,11 @@ -# $kick -Kicks the user who ran the command. - -## Syntax -``` -$kick -``` - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `kick` +# $kick +Kicks the user who ran the command. + +## Syntax +``` +$kick +``` + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `kick` diff --git a/src/bdscript/kickComplex.md b/src/bdscript/kickComplex.md index 9f45352638f..b47ab51344f 100644 --- a/src/bdscript/kickComplex.md +++ b/src/bdscript/kickComplex.md @@ -1,22 +1,20 @@ -# $kick[] -Kicks the provided user. - -## Syntax -``` -$kick[user ID;(reason)] -``` - -### Parameters -- `user ID` `(Type: Snowflake || Flag: Required)`: The user to kick from the server. -- `reason` `(Type: String || Flag: Vacantable)`: The audit-log reason for the kick. - -## Example -``` -$nomention -$onlyPerms[kick;❌ You need the `kick` permission to use that!] -$argsCheck[>1;❌ Please provide a user to kick. Usage: `!kick (user) `.] -$kick[$mentioned[1];$noMentionMessage] -✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`! -``` - -![example](https://user-images.githubusercontent.com/69215413/123518740-4742a600-d675-11eb-8581-1707b6989203.png) +# $kick[] +Kicks the provided user with specified reason. + +## Syntax +``` +$kick[User ID;(Reason)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to kick from the server. +- `Reason` `(Type: String || Flag: Vacantable)`: The audit-log reason for the kick. + +## Example +``` +$nomention +$kick[$mentioned[1];$noMentionMessage] +✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`! +``` + +![example](https://user-images.githubusercontent.com/69215413/123518740-4742a600-d675-11eb-8581-1707b6989203.png) diff --git a/src/bdscript/kickMention.md b/src/bdscript/kickMention.md index 4c9df9f3511..3b4d59e8bb0 100644 --- a/src/bdscript/kickMention.md +++ b/src/bdscript/kickMention.md @@ -1,25 +1,25 @@ -# $kickMention -A simplified version of `$kick`. Kicks the mentioned user. - -> **Note:** The user running the command must have the "kick" permission. - -## Syntax -``` -$kickMention[Reason] -``` - -### Parameters -- `Reason` `(Type: String || Flag: Emptiable)`: The audit-log reason for the kick. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `kick` - -## Example -``` -$nomention -$kickMention[$noMentionMessage] -✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`! -``` - -![example](https://user-images.githubusercontent.com/69215413/123518897-0f882e00-d676-11eb-9c32-4ee9bddd787d.png) +# $kickMention +A simplified version of `$kick`. Kicks the mentioned user. + +> **Note:** The user running the command must have the "kick" permission. + +## Syntax +``` +$kickMention[Reason] +``` + +### Parameters +- `Reason` `(Type: String || Flag: Emptiable)`: The audit-log reason for the kick. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `kick` + +## Example +``` +$nomention +$kickMention[$noMentionMessage] +✅ Kicked `$username[$mentioned[1]]#$discriminator[$mentioned[1]]`! +``` + +![example](https://user-images.githubusercontent.com/69215413/123518897-0f882e00-d676-11eb-9c32-4ee9bddd787d.png) diff --git a/src/bdscript/lastMessageID.md b/src/bdscript/lastMessageID.md new file mode 100644 index 00000000000..dfffad3fe38 --- /dev/null +++ b/src/bdscript/lastMessageID.md @@ -0,0 +1,28 @@ +# $lastMessageID +Returns last message ID in the current channel (**excluding the bot's response**). + +## Syntax +``` +$lastMessageID +``` + +## Example +``` +$nomention +Last Message ID: $lastMessageID +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Last Message ID: 1328323490490880032 +``` \ No newline at end of file diff --git a/src/bdscript/lastPinTimestamp.md b/src/bdscript/lastPinTimestamp.md new file mode 100644 index 00000000000..5fae7c6f072 --- /dev/null +++ b/src/bdscript/lastPinTimestamp.md @@ -0,0 +1,28 @@ +# $lastPinTimestamp +Returns the last pinned message timestamp in the current channel. + +## Syntax +``` +$lastPinTimestamp +``` + +## Example +``` +$nomention +Last Pin Timestamp: $lastPinTimestamp +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Last Pin Timestamp: 1753454520 +``` diff --git a/src/bdscript/lowestRole.md b/src/bdscript/lowestRole.md index 5ba4b8baf76..de6f070c6a3 100644 --- a/src/bdscript/lowestRole.md +++ b/src/bdscript/lowestRole.md @@ -1,14 +1,14 @@ -# $lowestRole -Returns the ID of the current server's lowest role (according to its position). - -## Syntax -``` -$lowestRole -``` - -## Example -``` -$nomention -The server's lowest role: <@&$lowestRole> ($lowestRole) -``` -![example](https://user-images.githubusercontent.com/111157596/232103422-9c7ec995-adac-493d-8d2a-887d2b6dd2eb.png) +# $lowestRole +Returns the ID of the current server's lowest role (according to its position). + +## Syntax +``` +$lowestRole +``` + +## Example +``` +$nomention +The server's lowest role: <@&$lowestRole> ($lowestRole) +``` +![example](https://user-images.githubusercontent.com/111157596/232103422-9c7ec995-adac-493d-8d2a-887d2b6dd2eb.png) diff --git a/src/bdscript/lowestRoleComplex.md b/src/bdscript/lowestRoleComplex.md index 38c6768ab9d..3254f72b0d4 100644 --- a/src/bdscript/lowestRoleComplex.md +++ b/src/bdscript/lowestRoleComplex.md @@ -1,16 +1,16 @@ -# $lowestRole[] -Returns the ID of the provided user's lowest role (according to its position). - -## Syntax -``` -$lowestRole[User ID] -``` -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user for which to return the lowest role. - -## Example -``` -$nomention -$username[$mentioned[1;yes]]'s lowest role: $roleName[$lowestRole[$mentioned[1;yes]]] ($lowestRole[$mentioned[1;yes]]) -``` -![example](https://user-images.githubusercontent.com/69215413/123518995-a523bd80-d676-11eb-94ce-3c08fa888464.png) +# $lowestRole[] +Returns the ID of the provided user's lowest role (according to its position). + +## Syntax +``` +$lowestRole[User ID] +``` +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user for which to return the lowest role. + +## Example +``` +$nomention +$username[$mentioned[1;yes]]'s lowest role: $roleName[$lowestRole[$mentioned[1;yes]]] ($lowestRole[$mentioned[1;yes]]) +``` +![example](https://user-images.githubusercontent.com/69215413/123518995-a523bd80-d676-11eb-94ce-3c08fa888464.png) diff --git a/src/bdscript/lowestRoleWithPerms.md b/src/bdscript/lowestRoleWithPerms.md index 403c5f11564..3df8d4db255 100644 --- a/src/bdscript/lowestRoleWithPerms.md +++ b/src/bdscript/lowestRoleWithPerms.md @@ -1,18 +1,18 @@ -# $lowestRoleWithPerms -Returns the lowest role in the server that has all the provided permissions. - -## Syntax -``` -$lowestRoleWithPerms[Permissions;...] -``` - -### Parameters -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the role needs to have. Use semicolons `;` as a separator to separate multiple permissions. - -## Example -``` -$nomention -Lowest Role with Administrator: $roleName[$lowestRoleWithPerms[admin]] ($lowestRoleWithPerms[admin]) -``` - -![example](https://user-images.githubusercontent.com/69215413/123529558-7c73e600-d6bf-11eb-9716-9f217ac1bac0.png) +# $lowestRoleWithPerms +Returns the lowest role in the server that has all the provided permissions. + +## Syntax +``` +$lowestRoleWithPerms[Permissions;...] +``` + +### Parameters +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the role needs to have. Use semicolons `;` as a separator to separate multiple permissions. + +## Example +``` +$nomention +Lowest Role with Administrator: $roleName[$lowestRoleWithPerms[admin]] ($lowestRoleWithPerms[admin]) +``` + +![example](https://user-images.githubusercontent.com/69215413/123529558-7c73e600-d6bf-11eb-9716-9f217ac1bac0.png) diff --git a/src/bdscript/max.md b/src/bdscript/max.md index 10d4efc47d6..68371949221 100644 --- a/src/bdscript/max.md +++ b/src/bdscript/max.md @@ -1,31 +1,31 @@ -# $max -Returns the largest number from the provided numbers. - -## Syntax -``` -$max[A;B;...] -``` - -### Parameters -- `A,B,...` `(Type: Integer || Flag: Required)`: The numbers to get the maximum from. **At least two numbers must be provided!** Use semicolons `;` as a separator to separate multiple numbers. - -## Example -``` -$nomention -$max[100;20;50] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 100 -``` +# $max +Returns the largest number from the provided numbers. + +## Syntax +``` +$max[A;B;...] +``` + +### Parameters +- `A,B,...` `(Type: Integer || Flag: Required)`: The numbers to get the maximum from. **At least two numbers must be provided!** Use semicolons `;` as a separator to separate multiple numbers. + +## Example +``` +$nomention +$max[100;20;50] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 100 +``` diff --git a/src/bdscript/membersCountComplex.md b/src/bdscript/membersCountComplex.md index 6be32c42382..e50689874e5 100644 --- a/src/bdscript/membersCountComplex.md +++ b/src/bdscript/membersCountComplex.md @@ -1,26 +1,26 @@ -# $membersCount[] -Returns the amount of members in the current guild with provided presence. - -## Syntax -``` -$membersCount[Presence] -``` - -### Parameters -- `Presence` `(Type: Enum || Flag: Required)`: Returns the amount of members that have their presences set. Presence types: - - `online` - - `offline` - - `idle` - - `dnd` - - `invisible` - -### Privileged Intents -This function requires the following privileged intents: -- [`Presences intent`](../guides/gatewayIntents.md#presence-intent) - -## Example -``` -$nomention -there are $membersCount[online] online users in this server -``` -![example](https://user-images.githubusercontent.com/70468667/219971665-9185a0b7-52e8-44eb-8d43-e5e2455bcbe3.jpg) +# $membersCount[] +Returns the amount of members in the current guild with provided presence. + +## Syntax +``` +$membersCount[Presence] +``` + +### Parameters +- `Presence` `(Type: Enum || Flag: Required)`: Returns the amount of members that have their presences set. Presence types: + - `online` + - `offline` + - `idle` + - `dnd` + - `invisible` + +### Privileged Intents +This function requires the following privileged intents: +- [`Presences intent`](../guides/gatewayIntents.md#presence-intent) + +## Example +``` +$nomention +there are $membersCount[online] online users in this server +``` +![example](https://user-images.githubusercontent.com/70468667/219971665-9185a0b7-52e8-44eb-8d43-e5e2455bcbe3.jpg) diff --git a/src/bdscript/mentioned.md b/src/bdscript/mentioned.md index cab43f9fd25..be4a60a67f5 100644 --- a/src/bdscript/mentioned.md +++ b/src/bdscript/mentioned.md @@ -1,19 +1,64 @@ -# $mentioned -Returns the ID of the mentioned user. - -## Syntax -``` -$mentioned[Mention number;(Return author?)] -``` - -### Parameters -- `Mention number` `(Type: HowMany || Flag: Required)`: The user-mention to get from the author's message (`1` = first user-mention, `2` = second, etc). -- `Return author?` `(Type: Bool || Flag: Optional)`: Whether to return the author's ID if no user is mentioned or not. - -## Example -``` -$nomention -$mentioned[1] -``` - -![example](https://user-images.githubusercontent.com/69215413/126917181-5e4c71e3-6b8e-4d9d-96ef-2a9b8af7faf2.png) +# $mentioned +Returns the ID of the mentioned user. + +```admonish fail +You can't use this function in slash command! Instead of this use [`$message[]`](./messageComplex.md). +``` + +## Syntax +``` +$mentioned[Mention number;(Return author?)] +``` + +### Parameters +- `Mention number` `(Type: HowMany || Flag: Required)`: The user-mention to get from the author's message (`1` = first user-mention, `2` = second, etc). +- `Return author?` `(Type: Bool || Flag: Optional)`: Whether to return the author's ID if no user is mentioned or not. Default is `yes`. + +## Example +``` +$nomention +$mentioned[1;no] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@Master Bot> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + User ID: 566613317972394004 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@Menhera Bread> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + User ID: 177535709731749890 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example text +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + User ID: +``` + +```admonish example +Using `$mentioned[1]` (which is the same as `$mentioned[1;yes]`) will return **your** ID instead of an empty value. +``` diff --git a/src/bdscript/mentionedChannels.md b/src/bdscript/mentionedChannels.md index 5aa537eb572..9b3688d1d23 100644 --- a/src/bdscript/mentionedChannels.md +++ b/src/bdscript/mentionedChannels.md @@ -1,19 +1,23 @@ -# $mentionedChannels -Returns the ID of the mentioned channel. - -## Syntax -``` -$mentionedChannels[Mention number;(Return current?)] -``` - -### Parameters -- `Mention number` `(Type: HowMany || Flag: Required)`: The channel-mention to get from the author's message (`1` = first channel-mention, `2` = second, etc). -- `Return current?` `(Type: Bool || Flag: Optional)`: Whether to return the current channel ID if no channel is mentioned or not. - -## Example -``` -$nomention -$mentionedChannels[1] -``` - -![example](https://user-images.githubusercontent.com/69215413/126917253-33db5d96-fdb3-43a3-b614-1ac061701fb1.png) +# $mentionedChannels +Returns the ID of the mentioned channel. + +```admonish fail +You can't use this function in slash command! Instead of this use [`$message[]`](./messageComplex.md). +``` + +## Syntax +``` +$mentionedChannels[Mention number;(Return current?)] +``` + +### Parameters +- `Mention number` `(Type: HowMany || Flag: Required)`: The channel-mention to get from the author's message (`1` = first channel-mention, `2` = second, etc). +- `Return current?` `(Type: Bool || Flag: Optional)`: Whether to return the current channel ID if no channel is mentioned or not. + +## Example +``` +$nomention +$mentionedChannels[1] +``` + +![example](https://user-images.githubusercontent.com/69215413/126917253-33db5d96-fdb3-43a3-b614-1ac061701fb1.png) diff --git a/src/bdscript/mentionedRoles.md b/src/bdscript/mentionedRoles.md index 31b72b53ac8..10d5d27f14e 100644 --- a/src/bdscript/mentionedRoles.md +++ b/src/bdscript/mentionedRoles.md @@ -1,18 +1,22 @@ -# $mentionedRoles -Returns the ID of the mentioned role. - -## Syntax -``` -$mentionedRoles[Mention number] -``` - -### Parameters -- `Mention number` `(Type: HowMany || Flag: Required)`: The role-mention to get from the author's message (`1` = first role-mention, `2` = second, etc). - -## Example -``` -$nomention -$mentionedRoles[1] -``` - -![example](https://user-images.githubusercontent.com/69215413/126917307-96384c6f-ccfe-4117-927d-40ad87b5bf8f.png) +# $mentionedRoles +Returns the ID of the mentioned role. + +```admonish fail +You can't use this function in slash command! Instead of this use [`$message[]`](./messageComplex.md). +``` + +## Syntax +``` +$mentionedRoles[Mention number] +``` + +### Parameters +- `Mention number` `(Type: HowMany || Flag: Required)`: The role-mention to get from the author's message (`1` = first role-mention, `2` = second, etc). + +## Example +``` +$nomention +$mentionedRoles[1] +``` + +![example](https://user-images.githubusercontent.com/69215413/126917307-96384c6f-ccfe-4117-927d-40ad87b5bf8f.png) diff --git a/src/bdscript/message.md b/src/bdscript/message.md index 59a0f2750b4..e6d34511763 100644 --- a/src/bdscript/message.md +++ b/src/bdscript/message.md @@ -1,27 +1,27 @@ -# $message -Returns the user's message *(without the command trigger)*. - -## Syntax -``` -$message -``` - -## Example -``` -$nomention -$message -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !say Hello everyone 👋 -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - content: | - Hello everyone 👋 -``` +# $message +Returns the user's message *(without the command trigger)*. + +## Syntax +``` +$message +``` + +## Example +``` +$nomention +$message +``` + +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !say Hello everyone 👋 +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + content: | + Hello everyone 👋 +``` diff --git a/src/bdscript/messageComplex.md b/src/bdscript/messageComplex.md index 53aeec05a51..1d21bb31121 100644 --- a/src/bdscript/messageComplex.md +++ b/src/bdscript/messageComplex.md @@ -1,55 +1,55 @@ -# $message[] -Returns an argument from the message or the input of a slash command option. - -## Syntax -``` -$message[Argument number;(Argument name)] -``` - -### Parameters -- `Argument number` `(Type: HowMany, String || Flag: Required)`: Returns the argument matching the provided number. -- `Argument name` `(Type: String || Flag: Optional)`: Returns the input of the matching slash command option. - -> 🧙‍♂ī¸ For example, `$message[1]` would just return the first word of the message. You can also use `$message[>]` to get the last argument/word of the user's message. - -### Optimization -If you want this function to work in a slash command **only**, then you can use `$message[Argument name]`. If this function should work in a normal **and** slash command, then you can use `$message[Argument number;Argument name]`. - -> 🧙‍♂ī¸ For example, `$message[message]` would just return the input of the slash command option named "message". `$message[1;text]` would return the first word of the message **or** the input of the slash command option named "text". - -Find more info about optimizing `$message[]` for slash commands [here](../guides/general/interactions/slashCommands/aboutSlashCommands.md#retrieving-value-from-options). - -## Examples -### Normal command -``` -$nomention -First word: $message[1] -Second word: $message[2] -Third word: $message[3] -``` -![example1](https://user-images.githubusercontent.com/111157596/231827506-1436330e-1231-4eb6-97df-e2218f29ac26.png) - -### Slash command -We retrieve the input of the slash command option named "message". -``` -$nomention -$message[message] -``` -![example2](https://user-images.githubusercontent.com/95774950/179398322-d9a27169-0030-458d-8abc-ed4462637862.png) -![example3](https://user-images.githubusercontent.com/95774950/179398327-6c1f1c00-205f-4dcf-a0ce-08cefed5c937.png) - -### Normal and Slash command -We retrieve the first argument of the message or the input of the slash command option named "text". -``` -$nomention -$message[1;text] -``` - -**Normal** - -![example4](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/4d743aaa-0b86-4cdf-aa5f-32dbfdf4057e) - -**Slash** - -![example5](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/67f1202c-61d3-49f1-a055-91e21b90d934) -![example6](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/1e381e99-bc5b-4d02-8d09-35f397c5ff75) +# $message[] +Returns an argument from the message or the input of a slash command option. + +## Syntax +``` +$message[Argument number;(Argument name)] +``` + +### Parameters +- `Argument number` `(Type: HowMany, String || Flag: Required)`: Returns the argument matching the provided number. +- `Argument name` `(Type: String || Flag: Optional)`: Returns the input of the matching slash command option. + +> For example, `$message[1]` would just return the first word of the message. You can also use `$message[>]` to get the last argument/word of the user's message. + +### Optimization +If you want this function to work in a slash command **only**, then you can use `$message[Argument name]`. If this function should work in a normal **and** slash command, then you can use `$message[Argument number;Argument name]`. + +> For example, `$message[message]` would just return the input of the slash command option named "message". `$message[1;text]` would return the first word of the message **or** the input of the slash command option named "text". + +Find more info about optimizing `$message[]` for slash commands [here](../guides/general/interactions/slashCommands/aboutSlashCommands.md#retrieving-value-from-options). + +## Examples +### Normal command +``` +$nomention +First word: $message[1] +Second word: $message[2] +Third word: $message[3] +``` +![example1](https://user-images.githubusercontent.com/111157596/231827506-1436330e-1231-4eb6-97df-e2218f29ac26.png) + +### Slash command +We retrieve the input of the slash command option named "message". +``` +$nomention +$message[message] +``` +![example](https://user-images.githubusercontent.com/95774950/179398322-d9a27169-0030-458d-8abc-ed4462637862.png) +![example](https://user-images.githubusercontent.com/95774950/179398327-6c1f1c00-205f-4dcf-a0ce-08cefed5c937.png) + +### Normal and Slash command +We retrieve the first argument of the message or the input of the slash command option named "text". +``` +$nomention +$message[1;text] +``` + +**Normal** + +![example](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/4d743aaa-0b86-4cdf-aa5f-32dbfdf4057e) + +**Slash** + +![example](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/67f1202c-61d3-49f1-a055-91e21b90d934) +![example](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/1e381e99-bc5b-4d02-8d09-35f397c5ff75) diff --git a/src/bdscript/messageID.md b/src/bdscript/messageID.md index 8512db2cbab..e76ecc6c596 100644 --- a/src/bdscript/messageID.md +++ b/src/bdscript/messageID.md @@ -1,17 +1,19 @@ -# $messageID -Returns the ID of the author's message. - -> 📝 If `$messageID` is written in `$onInteraction` commands, it will return the bot's message ID. - -## Syntax -``` -$messageID -``` - -## Example -``` -$nomention -$messageID -``` - -![example](https://user-images.githubusercontent.com/69215413/126917461-39754ee4-37dd-4a3e-9d72-258b514a8c7d.png) +# $messageID +Returns the ID of the author's message. + +```admonish info +If this function is written in `$onInteraction`/`$onInteraction[]` commands, it will return the bot's message ID. +``` + +## Syntax +``` +$messageID +``` + +## Example +``` +$nomention +$messageID +``` + +![example](https://user-images.githubusercontent.com/69215413/126917461-39754ee4-37dd-4a3e-9d72-258b514a8c7d.png) diff --git a/src/bdscript/min.md b/src/bdscript/min.md index 9a38fc52137..9e5dda68819 100644 --- a/src/bdscript/min.md +++ b/src/bdscript/min.md @@ -1,31 +1,31 @@ -# $min -Returns the smallest number from the provided numbers. - -## Syntax -``` -$min[A;B;...] -``` - -### Parameters -- `A,B,...` `(Type: Integer || Flag: Required)`: The numbers to get the minimum from. **At least two numbers must be provided!** Use semicolons `;` as a separator to separate multiple numbers. - -## Example -``` -$nomention -$min[3;5;1] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 1 -``` +# $min +Returns the smallest number from the provided numbers. + +## Syntax +``` +$min[A;B;...] +``` + +### Parameters +- `A,B,...` `(Type: Integer || Flag: Required)`: The numbers to get the minimum from. **At least two numbers must be provided!** Use semicolons `;` as a separator to separate multiple numbers. + +## Example +``` +$nomention +$min[3;5;1] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 1 +``` diff --git a/src/bdscript/minute.md b/src/bdscript/minute.md index 4c3c2854d22..15a44984847 100644 --- a/src/bdscript/minute.md +++ b/src/bdscript/minute.md @@ -1,32 +1,34 @@ -# $minute -Returns the current minute of this hour. - -> You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$minute -``` - -## Example -``` -$nomention -Current Minute: $minute -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | -
-``` - - +# $minute +Returns the current minute of this hour. + +## Syntax +``` +$minute +``` + +## Example +``` +$nomention +Current Minute: $minute +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/modifyChannel.md b/src/bdscript/modifyChannel.md index 6b0ba271d65..ce648cb05b8 100644 --- a/src/bdscript/modifyChannel.md +++ b/src/bdscript/modifyChannel.md @@ -1,30 +1,30 @@ -# $modifyChannel -Edits a channel with the data provided. - -> 🧙‍♂ī¸ You can use `!unchanged` as an argument for the option to remain in its current state. - -## Syntax -``` -$modifyChannel[channelID;(channelName;topic;NSFW;position;categoryID)] -``` - -### Parameters -- `channelID` `(Type: Snowflake || Flag: Required)`: The channel the bot will edit. -- `channelName` `(Type: String || Flag: Vacantable)`: New channel name. -- `topic` `(Type: String || Flag: Vacantable)`: New channel topic/description. -- `NSFW` `(Type: Bool || Flag: Vacantable)`: Whether the channel will be marked as NSFW or not. -- `position` `(Type: Integer || Flag: Vacantable)`: The new channel position *(1 = top)*. -- `categoryID` `(Type: Snowflake || Flag: Vacantable)`: The category to which the channel should belong to. - -> 🧙‍♂ī¸ You can use `$channelID[category/channelName]` to get the ID of a category or channel. - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `managechannels` - -## Example -*For this example, we will be changing the channel name from 'general' to 'chill-chat'. As well as changing the channel topic to 'A chill chat!'.* -``` -$nomention -$modifyChannel[$channelID[general];chill-chat;A chill chat!;!unchanged;!unchanged] -``` +# $modifyChannel +Edits a channel with the data provided. + +## Syntax +``` +$modifyChannel[Channel ID;(Channel Name;Topic;Make NSFW?;Position;Category ID)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel the bot will edit. +- `Channel Name` `(Type: String || Flag: Vacantable)`: New channel name. +- `Topic` `(Type: String || Flag: Vacantable)`: New channel topic/description. +- `Make NSFW?` `(Type: Bool || Flag: Vacantable)`: Whether the channel will be marked as NSFW or not. +- `Position` `(Type: Integer || Flag: Vacantable)`: The new channel position *(1 = top)*. +- `Category ID` `(Type: Snowflake || Flag: Vacantable)`: The category to which the channel should belong to. + +> You can use `!unchanged` as an parameter for the option to remain in its current state. + +> You can use `$channelID[Category/Channel Name]` to get the ID of a category or channel. + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `managechannels` + +## Example +*For this example, we will be changing the channel name from 'general' to 'chill-chat'. As well as changing the channel topic to 'A chill chat!'.* +``` +$nomention +$modifyChannel[$channelID[general];chill-chat;A chill chat!;!unchanged;!unchanged] +``` diff --git a/src/bdscript/modifyChannelPerms.md b/src/bdscript/modifyChannelPerms.md index a7104e607d8..1fbd841ae26 100644 --- a/src/bdscript/modifyChannelPerms.md +++ b/src/bdscript/modifyChannelPerms.md @@ -1,37 +1,37 @@ -# $modifyChannelPerms -*(deprecated)* - -> 🧙‍♂ī¸ This command is deprecated, instead better use [`$editChannelPerms[]`](./editChannelPerms.md). - -Modifies a channel's permissions. - -## Syntax -``` -$modifyChannelPerms[Channel ID;Permissions;User/Role ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to change the permissions for. -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) to add/remove. `+` means allow, `-` means deny, `/` means neutral permission. -- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The role or user to modify the permissions for. Use `$guildID` for *@everyone*. - -## Example -**Lock:** -``` -$nomention -$onlyPerms[managechannels;❌ You need the manage_channels permission to use that!] -✅ Successfully locked <#$mentionedChannels[1;yes]>! -$modifyChannelPerms[$mentionedChannels[1;yes];-sendmessages;$guildID] -``` - -![example1](https://user-images.githubusercontent.com/69215413/123529809-19d01980-d6c2-11eb-9cc6-c9c9d559c5cb.png) - -**Unlock:** -``` -$nomention -$onlyPerms[managechannels;❌ You need the manage_channels permission to use that!] -✅ Successfully unlocked <#$mentionedChannels[1;yes]>! -$modifyChannelPerms[$mentionedChannels[1;yes];+sendmessages;$guildID] -``` - -![example2](https://user-images.githubusercontent.com/69215413/123529818-33716100-d6c2-11eb-99d9-c9f04399287a.png) +# $modifyChannelPerms +
+ Deprecated +
+ +> This function is deprecated, instead better use [`$editChannelPerms[]`](./editChannelPerms.md). + +Modifies a channel's permissions. + +## Syntax +``` +$modifyChannelPerms[Channel ID;Permissions;User/Role ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to change the permissions for. +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) to add/remove. `+` means allow, `-` means deny, `/` means neutral permission. +- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The role or user to modify the permissions for. Use `$guildID` for *@everyone*. + +## Example +**Lock:** +``` +$nomention +✅ Successfully locked <#$mentionedChannels[1;yes]>! +$modifyChannelPerms[$mentionedChannels[1;yes];-sendmessages;$guildID] +``` + +![example1](https://user-images.githubusercontent.com/69215413/123529809-19d01980-d6c2-11eb-9cc6-c9c9d559c5cb.png) + +**Unlock:** +``` +$nomention +✅ Successfully unlocked <#$mentionedChannels[1;yes]>! +$modifyChannelPerms[$mentionedChannels[1;yes];+sendmessages;$guildID] +``` + +![example2](https://user-images.githubusercontent.com/69215413/123529818-33716100-d6c2-11eb-99d9-c9f04399287a.png) diff --git a/src/bdscript/modifyRole.md b/src/bdscript/modifyRole.md index e0ad1eea4d6..b7e2a4709f1 100644 --- a/src/bdscript/modifyRole.md +++ b/src/bdscript/modifyRole.md @@ -1,31 +1,29 @@ -# $modifyRole -Modifies an existing role. - -## Syntax -``` -$modifyRole[Role ID;(Role name;Color hex;Hoisted?;Mentionable?)] -``` - -> 🧙‍♂ī¸ You can use `!unchanged` as an argument to leave the setting as-is. - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The ID of the role to modify. -- `Role name` `(Type: String || Flag: Optional)`: The new role name. -- `Color hex` `(Type: Color || Flag: Optional)`: The new role color. -- `Hoisted?` `(Type: Bool || Flag: Optional)`: Whether the role should be displayed separately or not. -- `Mentionable?` `(Type: Bool || Flag: Optional)`: Whether the role should be mentionable by everyone or not. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `manageroles` - -## Example -``` -$nomention -$argsCheck[>2;❌ Please provide the needed arguments! Usage: `!role-name (role) (newRoleName)`] -$onlyPerms[manageroles;❌ You are missing the manage_roles permission!] -$modifyRole[$findRole[$message[1]];$replaceText[$message;$message[1];;1];!unchanged;!unchanged;!unchanged] -$description[✅ Changed role name of <@&$findRole[$message[1]]>] -``` - -![example](https://user-images.githubusercontent.com/69215413/123530371-771a9980-d6c7-11eb-987d-c4ba3bb40bd1.png) +# $modifyRole +Modifies an existing role. + +## Syntax +``` +$modifyRole[Role ID;(Role name;Color hex;Hoisted?;Mentionable?)] +``` + +> You can use `!unchanged` as an argument to leave the setting as-is. + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The ID of the role to modify. +- `Role name` `(Type: String || Flag: Optional)`: The new role name. +- `Color hex` `(Type: Color || Flag: Optional)`: The new role color. +- `Hoisted?` `(Type: Bool || Flag: Optional)`: Whether the role should be displayed separately or not. +- `Mentionable?` `(Type: Bool || Flag: Optional)`: Whether the role should be mentionable by everyone or not. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `manageroles` + +## Example +``` +$nomention +$modifyRole[$findRole[$message[1]];$replaceText[$message;$message[1];;1];!unchanged;!unchanged;!unchanged] +$description[✅ Changed role name of <@&$findRole[$message[1]]>] +``` + +![example](https://user-images.githubusercontent.com/69215413/123530371-771a9980-d6c7-11eb-987d-c4ba3bb40bd1.png) diff --git a/src/bdscript/modifyRolePerms.md b/src/bdscript/modifyRolePerms.md index 20b9b74e115..2bace1a0a34 100644 --- a/src/bdscript/modifyRolePerms.md +++ b/src/bdscript/modifyRolePerms.md @@ -1,11 +1,11 @@ -# $modifyRolePerms -Modifies a role's permissions. - -## Syntax -``` -$modifyRolePerms[Role ID;Permissions;...] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to modify the permissions for. Use `$guildID` for the *@everyone* role. -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) to toggle. Use semicolons `;` as a separator to separate multiple permissions. +# $modifyRolePerms +Modifies a role's permissions. + +## Syntax +``` +$modifyRolePerms[Role ID;Permissions;...] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to modify the permissions for. Use `$guildID` for the *@everyone* role. +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) to toggle. Use semicolons `;` as a separator to separate multiple permissions. diff --git a/src/bdscript/modulo.md b/src/bdscript/modulo.md index a41e233f371..86fe48b6e46 100644 --- a/src/bdscript/modulo.md +++ b/src/bdscript/modulo.md @@ -1,20 +1,75 @@ -# $modulo -Returns remainder between numbers. - -## Syntax -``` -$modulo[A;B] -``` - -### Parameters -- `A` `(Type: Integer || Flag: Required)`: The dividend. -- `B` `(Type: Integer || Flag: Required)`: The divisor. - -## Example -``` -$nomention -$argsCheck[>2;❌ Invalid usage. Usage: `!modulo (number1) (number2)`] -$modulo[$message[1];$message[2]] -``` - -![example](https://user-images.githubusercontent.com/69215413/123551143-8d177100-d73e-11eb-811a-b72259c67edb.png) +# $modulo +Returns remainder between numbers. + +## Syntax +``` +$modulo[A;B] +``` + +### Parameters +- `A` `(Type: Integer || Flag: Required)`: The dividend. +- `B` `(Type: Integer || Flag: Required)`: The divisor. + +## Example +``` +$nomention +$modulo[$message[1];$message[2]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5 10 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 5 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Explanation: 5/10==0.5 => Remainder is 5 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 10 100 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 10 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Explanation: 10/100==0.10 => Remainder is 10 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 25 5 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 0 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Explanation: 25/5==5 => Remainder is 0 +``` + +```admonish question title="What is this?" +How [`$message[]`](./messageComplex.md) works? +``` diff --git a/src/bdscript/month.md b/src/bdscript/month.md index b94dcb4a822..d51c3d4a231 100644 --- a/src/bdscript/month.md +++ b/src/bdscript/month.md @@ -1,17 +1,34 @@ -# $month -Returns the current month of this year. - -> 🧙‍♂ī¸ You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$month -``` - -## Example -``` -$nomention -Current Month: $month -``` - -![example](https://user-images.githubusercontent.com/69215413/122829373-edc52a80-d2b4-11eb-861c-e0a629f258ff.png) +# $month +Returns the current month of this year. + +## Syntax +``` +$month +``` + +## Example +``` +$nomention +Current Month: $month +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/multi.md b/src/bdscript/multi.md index 509d804ac03..de64885efee 100644 --- a/src/bdscript/multi.md +++ b/src/bdscript/multi.md @@ -1,19 +1,31 @@ -# $multi -Muliplies the provided numbers. - -## Syntax -``` -$multi[Number;..] -``` - -### Parameters -- `Number` `(Type: Float, Integer || Flag: Required)`: The numbers to multiply. Use semicolons `;` as a separator to separate multiple numbers. - -## Example -``` -$nomention -$argsCheck[>2;❌ Invalid usage. Usage: `!multiply (number1) (number2)`] -$multi[$message[1];$message[2]] -``` - -![example](https://user-images.githubusercontent.com/69215413/123551357-60178e00-d73f-11eb-9a21-578799084b88.png) +# $multi +Muliplies the provided numbers. + +## Syntax +``` +$multi[Number;..] +``` + +### Parameters +- `Number` `(Type: Float, Integer || Flag: Required)`: The numbers to multiply. Use semicolons `;` as a separator to separate multiple numbers. + +## Example +``` +$nomention +$multi[5;2;9] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Result: 90 +``` diff --git a/src/bdscript/mute.md b/src/bdscript/mute.md index 8dce03dc43e..ea7c65872b7 100644 --- a/src/bdscript/mute.md +++ b/src/bdscript/mute.md @@ -1,24 +1,25 @@ -# $mute -*(deprecated)* - -> 🧙‍♂ī¸ This command is deprecated, instead better use [`$timeout[]`](https://nilpointer-software.github.io/bdfd-wiki/bdscript/timeout.html). - -Mutes the mentioned user. - -## Syntax -``` -$mute[mutedRoleName] -``` - -### Parameters -- `mutedRoleName` `(Type: String || Flag: Required)`: The name of the 'Muted' role (case sensitive). - -## Example -``` -$nomention -$onlyPerms[manageroles;❌ You are missing permission: `MANAGE_ROLES`.] -$mute[Muted] -✅ Successfully muted $username[$mentioned[1]]#$discriminator[$mentioned[1]]! -``` - -![example](https://user-images.githubusercontent.com/69215413/123551542-4aef2f00-d740-11eb-82ca-381f5c5efcb3.png) +# $mute +
+ Deprecated +
+ +> This function is deprecated, instead better use [`$timeout[]`](https://nilpointer-software.github.io/bdfd-wiki/bdscript/timeout.html). + +Mutes the mentioned user. + +## Syntax +``` +$mute[Muted Role Name] +``` + +### Parameters +- `Muted Role Name` `(Type: String || Flag: Required)`: The name of the 'Muted' role (case sensitive). + +## Example +``` +$nomention +$mute[Muted] +✅ Successfully muted $username[$mentioned[1]]#$discriminator[$mentioned[1]]! +``` + +![example](https://user-images.githubusercontent.com/69215413/123551542-4aef2f00-d740-11eb-82ca-381f5c5efcb3.png) diff --git a/src/bdscript/newTicket.md b/src/bdscript/newTicket.md index 9e2fd5c1cfb..f58779fd77a 100644 --- a/src/bdscript/newTicket.md +++ b/src/bdscript/newTicket.md @@ -1,35 +1,35 @@ -# $newTicket -Creates a new ticket. - -## Syntax -``` -$newTicket[Category ID/Name;No question message;In ticket message;Message to user;Error message;(Ticket number;Return ID of the ticket message?)] -``` - -### Parameters -- `Category ID/Name` `(Type: String || Flag: Emptiable)`: The category to put the ticket channels in. Can be a category ID or name. - > 🧙‍♂ī¸ Setup the ticket category permissions:\ - > ![tickets](https://user-images.githubusercontent.com/111157596/249498738-ba98d976-0315-4dbd-b398-632e710fd039.png) -- `No question message` `(Type: String || Flag: Emptiable)`: The message that appears in `{subject}` when the user doesn't provide a subject. -- `In ticket message` `(Type: String || Flag: Emptiable)`: The message that is sent in the new ticket channel. -- `Message to user` `(Type: String || Flag: Emptiable)`: The message that gets sent in the current channel. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that gets returned when the ticket can't be created. -- `Ticket number` `(Type: Integer || Flag: Optional)`: For custom ticket number. -- `Return ID of the ticket message?` `(Type: Bool || Flag: Optional)`: Whether you want the ticket message to return its ID. - -### Subset Functions -You can use these subset functions in `$newTicket` : - -- `{subject}` - Returns the ticket subject (user's message). -- `{channel}` - Mentions the new ticket channel. - -## Example -``` -$nomention -$newTicket[Tickets;No subject was provided.;Thanks for making a ticket. Please explain your issue in detail so we can help. -Subject: {subject} -User: <@$authorID>;Created ticket! {channel};Failed to make ticket!] -``` - -![example1](https://user-images.githubusercontent.com/69215413/123530091-b8f61080-d6c4-11eb-93c1-1786dc2dba99.png)\ -![example2](https://user-images.githubusercontent.com/69215413/123530097-cd3a0d80-d6c4-11eb-9f9f-efae06e660f2.png) +# $newTicket +Creates a new ticket. + +## Syntax +``` +$newTicket[Category ID/Name;No question message;In ticket message;Message to user;Error message;(Ticket number;Return ID of the ticket message?)] +``` + +### Parameters +- `Category ID/Name` `(Type: String || Flag: Emptiable)`: The category to put the ticket channels in. Can be a category ID or name. + > Setup the ticket category permissions:\ + > ![tickets](https://user-images.githubusercontent.com/111157596/249498738-ba98d976-0315-4dbd-b398-632e710fd039.png) +- `No question message` `(Type: String || Flag: Emptiable)`: The message that appears in `{subject}` when the user doesn't provide a subject. +- `In ticket message` `(Type: String || Flag: Emptiable)`: The message that is sent in the new ticket channel. +- `Message to user` `(Type: String || Flag: Emptiable)`: The message that gets sent in the current channel. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that gets returned when the ticket can't be created. +- `Ticket number` `(Type: Integer || Flag: Optional)`: For custom ticket number. +- `Return ID of the ticket message?` `(Type: Bool || Flag: Optional)`: Whether you want the ticket message to return its ID. + +### Subset Functions +You can use these subset functions in `$newTicket` : + +- `{subject}` - Returns the ticket subject (user's message). +- `{channel}` - Mentions the new ticket channel. + +## Example +``` +$nomention +$newTicket[Tickets;No subject was provided.;Thanks for making a ticket. Please explain your issue in detail so we can help. +Subject: {subject} +User: <@$authorID>;Created ticket! {channel};Failed to make ticket!] +``` + +![example1](https://user-images.githubusercontent.com/69215413/123530091-b8f61080-d6c4-11eb-93c1-1786dc2dba99.png)\ +![example2](https://user-images.githubusercontent.com/69215413/123530097-cd3a0d80-d6c4-11eb-9f9f-efae06e660f2.png) diff --git a/src/bdscript/nickname.md b/src/bdscript/nickname.md index 27b81305720..752c1d4bacb 100644 --- a/src/bdscript/nickname.md +++ b/src/bdscript/nickname.md @@ -1,16 +1,30 @@ -# $nickname -Returns the nickname of the author of the message. - -> 🧙‍♂ī¸ Nickname means the user's server nickname. If the user doesn't have a nickname then their display name is returned instead. - -## Syntax -``` -$nickname -``` - -## Example -``` -$nomention -Your nickname is `$nickname` -``` -![example](https://user-images.githubusercontent.com/111157596/231830656-9ea02db8-2245-4a33-ae21-e8c5b4eb7885.png) +# $nickname +Returns the nickname of the author of the message. + +> Nickname means the user's server nickname. If the user doesn't have a nickname then their display name is returned instead. + +## Syntax +``` +$nickname +``` + +## Example +``` +$nomention +Your nickname is `$nickname`! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Your nickname is RainbowKey! +``` diff --git a/src/bdscript/nicknameComplex.md b/src/bdscript/nicknameComplex.md index 0f1751ed1b8..e0fc0e26b54 100644 --- a/src/bdscript/nicknameComplex.md +++ b/src/bdscript/nicknameComplex.md @@ -1,20 +1,20 @@ -# $nickname[] -Returns the nickname of the given user. - -> 🧙‍♂ī¸ Nickname means the user's server nickname. If the user doesn't have a nickname then their display name is returned instead. - -## Syntax -``` -$nickname[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the nickname for. - -## Example -``` -$nomention -<@$mentioned[1;yes]>'s nickname is `$nickname[$mentioned[1;yes]]` -``` - -![example](https://user-images.githubusercontent.com/69215413/124502356-53271a00-dd91-11eb-8d72-778c9141f296.png) +# $nickname[] +Returns the nickname of the given user. + +> Nickname means the user's server nickname. If the user doesn't have a nickname then their display name is returned instead. + +## Syntax +``` +$nickname[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the nickname for. + +## Example +``` +$nomention +<@$mentioned[1;yes]>'s nickname is `$nickname[$mentioned[1;yes]]` +``` + +![example](https://user-images.githubusercontent.com/69215413/124502356-53271a00-dd91-11eb-8d72-778c9141f296.png) diff --git a/src/bdscript/noMentionMessage.md b/src/bdscript/noMentionMessage.md index 382a9f34304..8019b3c1f6e 100644 --- a/src/bdscript/noMentionMessage.md +++ b/src/bdscript/noMentionMessage.md @@ -1,14 +1,45 @@ -# $noMentionMessage -Returns the user's full message without any mentions *(without the command trigger)*. - -## Syntax -``` -$noMentionMessage -``` - -## Example -``` -$nomention -$noMentionMessage -``` -![example](https://user-images.githubusercontent.com/69215413/123551762-2182d300-d741-11eb-8d98-1d2e4619dfb0.png) +# $noMentionMessage +Returns the user's full message without any mentions *(without the command trigger)*. + +## Syntax +``` +$noMentionMessage +``` + +## Example +``` +$nomention +Message: $noMentionMessage +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello <@MineBartekSA>! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello ! +``` + +- Lets use [`$message`](./message.md) instead of `$noMentionMessage`: + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello <@MineBartekSA>! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello @MineBartekSA! +``` diff --git a/src/bdscript/noMentionMessageComplex.md b/src/bdscript/noMentionMessageComplex.md index 0078c8edf6d..2bf3593dbe4 100644 --- a/src/bdscript/noMentionMessageComplex.md +++ b/src/bdscript/noMentionMessageComplex.md @@ -1,21 +1,21 @@ -# $noMentionMessage[] -Returns an argument from the user's message omitting any mentions. - -## Syntax -``` -$noMentionMessage[Argument number] -``` - -### Parameters -- `Argument number` `(Type: HowMany || Flag: Required)`: Returns the argument matching the provided number *(excluding mentions)*. - -> 🧙‍♂ī¸ For example, `$noMentionMessage[1]` would just return the first word of the message, ignoring any possible mentions before. You can also use `$noMentionMessage[>]` to get the last argument/word of the user's message. - -## Example -``` -$nomention -1. $noMentionMessage[1] -3. $noMentionMessage[3] -Last: $noMentionMessage[>] -``` -![example](https://user-images.githubusercontent.com/111157596/232108897-109e42ec-69d0-486c-bd1f-501aa783ed4a.png) +# $noMentionMessage[] +Returns an argument from the user's message omitting any mentions. + +## Syntax +``` +$noMentionMessage[Argument number] +``` + +### Parameters +- `Argument number` `(Type: HowMany || Flag: Required)`: Returns the argument matching the provided number *(excluding mentions)*. + +> For example, `$noMentionMessage[1]` would just return the first word of the message, ignoring any possible mentions before. You can also use `$noMentionMessage[>]` to get the last argument/word of the user's message. + +## Example +``` +$nomention +1. $noMentionMessage[1] +3. $noMentionMessage[3] +Last: $noMentionMessage[>] +``` +![example](https://user-images.githubusercontent.com/111157596/232108897-109e42ec-69d0-486c-bd1f-501aa783ed4a.png) diff --git a/src/bdscript/nodeVersion.md b/src/bdscript/nodeVersion.md index e623cec7d80..af220a8a1ec 100644 --- a/src/bdscript/nodeVersion.md +++ b/src/bdscript/nodeVersion.md @@ -1,30 +1,30 @@ -# $nodeVersion -Returns the version of the current node. - -## Syntax -``` -$nodeVersion -``` - -## Example -``` -$nomention -Node version: $nodeVersion -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Node version: 11-08-2024-44c8617 -``` - -> You can use [`$botNode`](./botNode.md) to find out which node your bot is on. +# $nodeVersion +Returns the version of the current node. + +## Syntax +``` +$nodeVersion +``` + +## Example +``` +$nomention +Node version: $nodeVersion +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Node version: 06-09-2024-6c7eada +``` + +> You can use [`$botNode`](./botNode.md) to find out which node your bot is on. diff --git a/src/bdscript/nodeVersionComplex.md b/src/bdscript/nodeVersionComplex.md index cfaa3fc1956..702aea42fec 100644 --- a/src/bdscript/nodeVersionComplex.md +++ b/src/bdscript/nodeVersionComplex.md @@ -1,34 +1,34 @@ -# $nodeVersion[] -Returns the version of the specified node. - -## Syntax -``` -$nodeVersion[Node Number] -``` - -### Parameters -- `Node Number` `(Type: Integer || Flag: Required)`: The number of the node for which to return its version. - -> You can use [`$botNode`](./botNode.md) to find out which node your bot is on. - -## Example -``` -$nomention -13 Node Version: $nodeVersion[13] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - 13 Node Version: 05-07-2023-c8800d6 -``` - +# $nodeVersion[] +Returns the version of the specified node. + +## Syntax +``` +$nodeVersion[Node Number] +``` + +### Parameters +- `Node Number` `(Type: Integer || Flag: Required)`: The number of the node for which to return its version. + +> You can use [`$botNode`](./botNode.md) to find out which node your bot is on. + +## Example +``` +$nomention +13 Node Version: $nodeVersion[13] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 13 Node version: 06-09-2024-6c7eada +``` + diff --git a/src/bdscript/nomention.md b/src/bdscript/nomention.md index 180de916ad7..a707ad38b4f 100644 --- a/src/bdscript/nomention.md +++ b/src/bdscript/nomention.md @@ -1,16 +1,46 @@ -# $nomention -Disables the default author mention. - -## Syntax -``` -$nomention -``` - -## Example -**With `$nomention`:** - -![example](https://user-images.githubusercontent.com/69215413/126917956-197108f9-7cd4-4e96-9a24-12d36b1886d8.png) - -**Without `$nomention`:** - -![example](https://user-images.githubusercontent.com/69215413/126917978-723c1a83-c95d-4517-b0fd-deb4d088558d.png) +# $nomention +Disables the default author mention. + +## Syntax +``` +$nomention +``` + +## Example +``` +$nomention +Hello World! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello world! +``` + +- Without `$nomention`: + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + highlight: true + content: | + <@RainbowKey> Hello world! +``` diff --git a/src/bdscript/numberSeparator.md b/src/bdscript/numberSeparator.md index 3f65fe619d4..11e99385665 100644 --- a/src/bdscript/numberSeparator.md +++ b/src/bdscript/numberSeparator.md @@ -1,19 +1,48 @@ -# $numberSeparator -Separates the thousands in a number. - -## Syntax -``` -$numberSeparator[Number;(Separator)] -``` - -### Parameters -- `Number` `(Type: Integer || Flag: Required)`: The number to apply the separator to. -- `Separator` `(Type: String || Flag: Vacantable)`: The separator between each thousand. The default is `,`. - -## Example -``` -$nomention -$numberSeparator[5000] -``` - -![image](https://user-images.githubusercontent.com/69215413/126918009-8f4ba7d1-875b-43da-a24b-5126464996b9.png) +# $numberSeparator +Separates the thousands in a number. + +## Syntax +``` +$numberSeparator[Number;(Separator)] +``` + +### Parameters +- `Number` `(Type: Integer || Flag: Required)`: The number to apply the separator to. +- `Separator` `(Type: String || Flag: Vacantable)`: The separator between each thousand. The default is `,`. + +## Example +``` +$nomention +Result: $numberSeparator[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5000 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 5,000 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 2536000 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 2,536,000 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/onlyAdmin.md b/src/bdscript/onlyAdmin.md index 2ce065e1cbd..262185b1348 100644 --- a/src/bdscript/onlyAdmin.md +++ b/src/bdscript/onlyAdmin.md @@ -1,18 +1,18 @@ -# $onlyAdmin -Allows command execution only for users with *administrator* permission. - -## Syntax -``` -$onlyAdmin[Error message] -``` - -### Parameters -- `Error message` `(Type: String || Flag: Emptiable)`: The error message that is returned when the user isn't an administrator. - -## Example -``` -$nomention -$onlyAdmin[❌ Only administrators can use this command!] - -$c[Put your code here.] -``` +# $onlyAdmin +Allows command execution only for users with *administrator* permission. + +## Syntax +``` +$onlyAdmin[Error message] +``` + +### Parameters +- `Error message` `(Type: String || Flag: Emptiable)`: The error message that is returned when the user isn't an administrator. + +## Example +``` +$nomention +$onlyAdmin[❌ Only administrators can use this command!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyBotChannelPerms.md b/src/bdscript/onlyBotChannelPerms.md index 484e93a0b12..c7fa61da347 100644 --- a/src/bdscript/onlyBotChannelPerms.md +++ b/src/bdscript/onlyBotChannelPerms.md @@ -1,19 +1,19 @@ -# $onlyBotChannelPerms -The command can only be executed if the bot has all of the provided permissions in a given channel. - -## Syntax -``` -$onlyBotChannelPerms[Channel ID;Permissions;...;Error message] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Emptiable)`: The channel to check the permissions for. Use `$channelID` for the current channel. -- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the bot needs to execute the command. Use semicolons `;` as a separator to separate multiple permissions. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the bot doesn't have the needed permissions. - -## Example -``` -$nomention -$onlyBotChannelPerms[$channelID;sendmessages;embedlinks;❌ Missing permissions!] -$description[Hey! I have `Embed links` permission in the current channel.] -``` +# $onlyBotChannelPerms +The command can only be executed if the bot has all of the provided permissions in a given channel. + +## Syntax +``` +$onlyBotChannelPerms[Channel ID;Permissions;...;Error message] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Emptiable)`: The channel to check the permissions for. Use `$channelID` for the current channel. +- `Permissions` `(Type: Permission || Flag: Required)`: The [permissions](../resources/permissions.md) that the bot needs to execute the command. Use semicolons `;` as a separator to separate multiple permissions. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the bot doesn't have the needed permissions. + +## Example +``` +$nomention +$onlyBotChannelPerms[$channelID;sendmessages;embedlinks;❌ Missing permissions!] +$description[Hey! I have `Embed links` permission in the current channel.] +``` diff --git a/src/bdscript/onlyBotPerms.md b/src/bdscript/onlyBotPerms.md index e78ca3efb70..de209357c69 100644 --- a/src/bdscript/onlyBotPerms.md +++ b/src/bdscript/onlyBotPerms.md @@ -1,18 +1,18 @@ -# $onlyBotPerms -The command can only be executed if bot has all of the provided permissions. - -## Syntax -``` -$onlyBotPerms[Permissions;...;Error message] -``` - -### Parameters -- `Permissions` `(Type: Permission || Flag: Emptiable)`: The [permissions](../resources/permissions.md) that the bot needs to run the command. Use semicolons `;` as a separator to separate multiple permissions. -- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the bot doesn't have all the provided permissions. - -## Example -``` -$nomention -$onlyBotPerms[sendmessages;embedlinks;❌ Missing permissions!] -$description[Hey! I have `Embed links` permission.] -``` +# $onlyBotPerms +The command can only be executed if bot has all of the provided permissions. + +## Syntax +``` +$onlyBotPerms[Permissions;...;Error message] +``` + +### Parameters +- `Permissions` `(Type: Permission || Flag: Emptiable)`: The [permissions](../resources/permissions.md) that the bot needs to run the command. Use semicolons `;` as a separator to separate multiple permissions. +- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the bot doesn't have all the provided permissions. + +## Example +``` +$nomention +$onlyBotPerms[sendmessages;embedlinks;❌ Missing permissions!] +$description[Hey! I have `Embed links` permission.] +``` diff --git a/src/bdscript/onlyForCategories.md b/src/bdscript/onlyForCategories.md index 4d19416258a..5d8a7e2c4bb 100644 --- a/src/bdscript/onlyForCategories.md +++ b/src/bdscript/onlyForCategories.md @@ -1,19 +1,19 @@ -# $onlyForCategories -The command can only be executed in the provided categories. - -## Syntax -``` -$onlyForCategories[Category IDs;...;Error message] -``` - -### Parameters -- `Category IDs` `(Type: Snowflake || Flag: Emptiable)`: The categories where the command can be executed in. Use semicolons `;` as a separator to separate multiple category IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is executed in non-whitelisted categories. - -## Example -``` -$nomention -$onlyForCategories[790620501927526462;❌ This command can't be executed in this category!] - -$c[Put your code here.] -``` +# $onlyForCategories +The command can only be executed in the provided categories. + +## Syntax +``` +$onlyForCategories[Category IDs;...;Error message] +``` + +### Parameters +- `Category IDs` `(Type: Snowflake || Flag: Emptiable)`: The categories where the command can be executed in. Use semicolons `;` as a separator to separate multiple category IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is executed in non-whitelisted categories. + +## Example +``` +$nomention +$onlyForCategories[790620501927526462;❌ This command can't be executed in this category!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyForChannels.md b/src/bdscript/onlyForChannels.md index 40be454c82a..1acb9f50d73 100644 --- a/src/bdscript/onlyForChannels.md +++ b/src/bdscript/onlyForChannels.md @@ -1,19 +1,19 @@ -# $onlyForChannels -The command can only be executed in the provided channels. - -## Syntax -``` -$onlyForChannels[Channel IDs;...;Error message] -``` - -### Parameters -- `Channel IDs` `(Type: Snowflake || Flag: Emptiable)`: The channels that the command can be executed in. Use semicolons `;` as a separator to separate multiple channel IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used in a non-whitelisted channel. - -## Example -``` -$nomention -$onlyForChannels[1050809741137412177;816767374610923601;❌ This command can't be executed in this channel!] - -$c[Put your code here.] -``` +# $onlyForChannels +The command can only be executed in the provided channels. + +## Syntax +``` +$onlyForChannels[Channel IDs;...;Error message] +``` + +### Parameters +- `Channel IDs` `(Type: Snowflake || Flag: Emptiable)`: The channels that the command can be executed in. Use semicolons `;` as a separator to separate multiple channel IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used in a non-whitelisted channel. + +## Example +``` +$nomention +$onlyForChannels[1050809741137412177;816767374610923601;❌ This command can't be executed in this channel!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyForIDs.md b/src/bdscript/onlyForIDs.md index 717591c3529..4d092ea8647 100644 --- a/src/bdscript/onlyForIDs.md +++ b/src/bdscript/onlyForIDs.md @@ -1,20 +1,20 @@ -# $onlyForIDs -The command can only be executed by the provided users. - -## Syntax -``` -$onlyForIDs[User IDs;...;Error message] -``` - -### Parameters -- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The users that can use this command. Use semicolons `;` as a separator to separate multiple user IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The error message that is returned, when the user running the command is not whitelisted. - -## Example -``` -$nomention -$onlyForIDs[$botOwnerID;❌ You are not my owner!] -$eval[$message] - -$c[This can only be executed in BDScript 2.] -``` +# $onlyForIDs +The command can only be executed by the provided users. + +## Syntax +``` +$onlyForIDs[User IDs;...;Error message] +``` + +### Parameters +- `User IDs` `(Type: Snowflake || Flag: Emptiable)`: The users that can use this command. Use semicolons `;` as a separator to separate multiple user IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The error message that is returned, when the user running the command is not whitelisted. + +## Example +``` +$nomention +$onlyForIDs[$botOwnerID;❌ You are not my owner!] +$eval[$message] + +$c[This can only be executed in BDScript 2.] +``` diff --git a/src/bdscript/onlyForRoleIDs.md b/src/bdscript/onlyForRoleIDs.md index 1f66e880f1c..e5ac69a2b29 100644 --- a/src/bdscript/onlyForRoleIDs.md +++ b/src/bdscript/onlyForRoleIDs.md @@ -1,19 +1,19 @@ -# $onlyForRoleIDs -The command can only be executed by users with any of the provided roles. - -## Syntax -``` -$onlyForRoleIDs[Role IDs;...;Error message] -``` - -### Parameters -- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role IDs which are allowed to execute the command. Use semicolons `;` as a separator to separate multiple role IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the user doesn't have the required roles. - -## Example -``` -$nomention -$onlyForRoleIDs[790625761480146967;❌ You don't have any of the required roles to use this command!] - -$c[Put your code here.] -``` +# $onlyForRoleIDs +The command can only be executed by users with any of the provided roles. + +## Syntax +``` +$onlyForRoleIDs[Role IDs;...;Error message] +``` + +### Parameters +- `Role IDs` `(Type: Snowflake || Flag: Emptiable)`: The role IDs which are allowed to execute the command. Use semicolons `;` as a separator to separate multiple role IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the user doesn't have the required roles. + +## Example +``` +$nomention +$onlyForRoleIDs[790625761480146967;❌ You don't have any of the required roles to use this command!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyForRoles.md b/src/bdscript/onlyForRoles.md index 665819d9e33..34f8c8a36a3 100644 --- a/src/bdscript/onlyForRoles.md +++ b/src/bdscript/onlyForRoles.md @@ -1,19 +1,19 @@ -# $onlyForRoles -The command can only be executed by users with any of the provided roles. - -## Syntax -``` -$onlyForRoles[Role names;...;Error message] -``` - -### Parameters -- `Role names` `(Type: String || Flag: Emptiable)`: The roles that can use this command. Use semicolons `;` as a separator to separate multiple role names. -- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the user doesn't have the required roles. - -## Example -``` -$nomention -$onlyForRoles[Moderator;Admin;❌ You don't have any of the required roles to use this command!] - -$c[Put your code here.] -``` +# $onlyForRoles +The command can only be executed by users with any of the provided roles. + +## Syntax +``` +$onlyForRoles[Role names;...;Error message] +``` + +### Parameters +- `Role names` `(Type: String || Flag: Emptiable)`: The roles that can use this command. Use semicolons `;` as a separator to separate multiple role names. +- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the user doesn't have the required roles. + +## Example +``` +$nomention +$onlyForRoles[Moderator;Admin;❌ You don't have any of the required roles to use this command!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyForServers.md b/src/bdscript/onlyForServers.md index 51dae489c78..9e7ee387d66 100644 --- a/src/bdscript/onlyForServers.md +++ b/src/bdscript/onlyForServers.md @@ -1,19 +1,19 @@ -# $onlyForServers -The command can only be executed in the provided servers. - -## Syntax -``` -$onlyForServers[Server IDs;...;Error message] -``` - -### Parameters -- `Server IDs` `(Type: Snowflake || Flag: Emptiable)`: The servers that the command can be executed in. Use semicolons `;` as a separator to separate multiple server IDs. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used in a non-whitelisted server. - -## Example -``` -$nomention -$onlyForServers[566363823137882154;❌ This command can't be executed in this server!] - -$c[Put your code here.] -``` +# $onlyForServers +The command can only be executed in the provided servers. + +## Syntax +``` +$onlyForServers[Server IDs;...;Error message] +``` + +### Parameters +- `Server IDs` `(Type: Snowflake || Flag: Emptiable)`: The servers that the command can be executed in. Use semicolons `;` as a separator to separate multiple server IDs. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used in a non-whitelisted server. + +## Example +``` +$nomention +$onlyForServers[566363823137882154;❌ This command can't be executed in this server!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyForUsers.md b/src/bdscript/onlyForUsers.md index fc46ff7c76b..c4f32d52a77 100644 --- a/src/bdscript/onlyForUsers.md +++ b/src/bdscript/onlyForUsers.md @@ -1,19 +1,19 @@ -# $onlyForUsers -The command can only be executed by users with certain 'usernames'. - -## Syntax -``` -$onlyForUsers[Usernames;...;Error message] -``` - -### Parameters -- `Usernames` `(Type: String || Flag: Emptiable)`: The names of the users that can execute this command. Use semicolons `;` as a separator to separate multiple usernames. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used by a non-whitelisted user. - -## Example -``` -$nomention -$onlyForUsers[Nicky;❌ Only users with the username `Nicky` can execute this command!] - -$c[Put your code here.] -``` +# $onlyForUsers +The command can only be executed by users with certain 'usernames'. + +## Syntax +``` +$onlyForUsers[Usernames;...;Error message] +``` + +### Parameters +- `Usernames` `(Type: String || Flag: Emptiable)`: The names of the users that can execute this command. Use semicolons `;` as a separator to separate multiple usernames. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is used by a non-whitelisted user. + +## Example +``` +$nomention +$onlyForUsers[Nicky;❌ Only users with the username `Nicky` can execute this command!] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyIf.md b/src/bdscript/onlyIf.md index 324b9142260..7afa1626be7 100644 --- a/src/bdscript/onlyIf.md +++ b/src/bdscript/onlyIf.md @@ -1,58 +1,58 @@ -# $onlyIf -If *value1* is related accordingly (based on the "sign") with *value2* then the code runs. If not, the provided error message is returned. - -## Syntax -``` -$onlyIf[Condition;Error message] -``` - -### Parameters -- `Condition` `(Type: String || Flag: Required)`: The condition to check (e.g. value1!=value2). -- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the condition isn't true. - -### Signs -- `==` - Equal -- `!=` - Not Equal -- `<` - Less Than -- `>` - Greater Than -- `<=` - Less Than Or Equal To -- `>=` - Greater Than Or Equal To - -> ⚠ī¸ The signs `<`, `>`, `<=` and `>=` only work with numbers. - -## Examples -#### Equal (`==`) -``` -$nomention -$onlyIf[$message[1]==BDFD;❌ The first argument of your message must be "BDFD"!] -``` - -#### Not Equal (`!=`) -``` -$nomention -$onlyIf[$message[1]!=BDFD;❌ The first argument of your message can't be "BDFD"!] -``` - -#### Less Than (`<`) -``` -$nomention -$onlyIf[$message[1]<3000;❌ The number must be less than 3000!] -``` - -#### Greater Than (`>`) -``` -$nomention -$onlyIf[$message[1]>3000;❌ The number must be greater than 3000!] -``` - -#### Less Than Or Equal To (`<=`) -``` -$nomention -$onlyIf[$message[1]<=50000;❌ The number must be less than or qual to 50000!] -``` - -#### Greater Than Or Equal To (`>=`) -``` -$nomention -$onlyIf[$message[1]>=50000;❌ The number must be greater than or qual to 50000!] -``` +# $onlyIf +If *value1* is related accordingly (based on the "sign") with *value2* then the code runs. If not, the provided error message is returned. + +## Syntax +``` +$onlyIf[Condition;Error message] +``` + +### Parameters +- `Condition` `(Type: String || Flag: Required)`: The condition to check (e.g. value1!=value2). +- `Error message` `(Type: String || Flag: Emptiable)`: The message to return when the condition isn't true. + +### Signs +- `==` - Equal +- `!=` - Not Equal +- `<` - Less Than +- `>` - Greater Than +- `<=` - Less Than Or Equal To +- `>=` - Greater Than Or Equal To + +> ⚠ī¸ The signs `<`, `>`, `<=` and `>=` only work with numbers. + +## Examples +#### Equal (`==`) +``` +$nomention +$onlyIf[$message[1]==BDFD;❌ The first argument of your message must be "BDFD"!] +``` + +#### Not Equal (`!=`) +``` +$nomention +$onlyIf[$message[1]!=BDFD;❌ The first argument of your message can't be "BDFD"!] +``` + +#### Less Than (`<`) +``` +$nomention +$onlyIf[$message[1]<3000;❌ The number must be less than 3000!] +``` + +#### Greater Than (`>`) +``` +$nomention +$onlyIf[$message[1]>3000;❌ The number must be greater than 3000!] +``` + +#### Less Than Or Equal To (`<=`) +``` +$nomention +$onlyIf[$message[1]<=50000;❌ The number must be less than or qual to 50000!] +``` + +#### Greater Than Or Equal To (`>=`) +``` +$nomention +$onlyIf[$message[1]>=50000;❌ The number must be greater than or qual to 50000!] +``` diff --git a/src/bdscript/onlyIfMessageContains.md b/src/bdscript/onlyIfMessageContains.md index ae152818fed..279f570c5f2 100644 --- a/src/bdscript/onlyIfMessageContains.md +++ b/src/bdscript/onlyIfMessageContains.md @@ -1,20 +1,74 @@ -# $onlyIfMessageContains -Checks if the provided message contains every provided word, otherwise the provided error message is returned. - -## Syntax -``` -$onlyIfMessageContains[Message;Word;...;Error message] -``` - -### Parameters -- `Message` `(Type: String || Flag: Emptiable)`: The text to check. -- `Word` `(Type: String || Flag: Emptiable)`: The words that the message must contain. Use semicolons `;` as a separator to separate multiple words. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned if the text doesn't contain all the provided words. - -## Example -``` -$nomention -$onlyIfMessageContains[$message;Hello;Hi;❌ Your message must contain `Hello` and `Hi`!] - -$c[Put your code here.] -``` +# $onlyIfMessageContains +Checks if the provided message contains every provided word, otherwise the provided error message is returned. + +## Syntax +``` +$onlyIfMessageContains[Message;Word;...;Error message] +``` + +### Parameters +- `Message` `(Type: String || Flag: Emptiable)`: The text to check. +- `Word` `(Type: String || Flag: Emptiable)`: The words that the message must contain. Use semicolons `;` as a separator to separate multiple words. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned if the text doesn't contain all the provided words. + +## Example +``` +$nomention +$onlyIfMessageContains[$message;Hello;Hi;❌ Your message must contain `Hello` and `Hi`!] +Hello world! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Bye +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + ❌ Your message must contain Hello and Hi! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + ❌ Your message must contain Hello and Hi! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello Hi +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello world! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello <@MineBartekSA>. Hi! +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello world! +``` + +```admonish question title="What is this?" +How [`$username`](./username.md) works? +``` diff --git a/src/bdscript/onlyNSFW.md b/src/bdscript/onlyNSFW.md index 2a07c72bde5..718fb65ea07 100644 --- a/src/bdscript/onlyNSFW.md +++ b/src/bdscript/onlyNSFW.md @@ -1,18 +1,18 @@ -# $onlyNSFW -Only allows the command to be executed in [NSFW channels](https://support.discord.com/hc/en-us/articles/115000084051-NSFW-Channels-and-Content). - -## Syntax -``` -$onlyNSFW[Error message] -``` - -### Parameters -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is executed outside of an NSFW channel. - -## Example -``` -$nomention -$onlyNSFW[❌ That command can only be executed in NSFW channels.] - -$c[Put your code here.] -``` +# $onlyNSFW +Only allows the command to be executed in [NSFW channels](https://support.discord.com/hc/en-us/articles/115000084051-NSFW-Channels-and-Content). + +## Syntax +``` +$onlyNSFW[Error message] +``` + +### Parameters +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the command is executed outside of an NSFW channel. + +## Example +``` +$nomention +$onlyNSFW[❌ That command can only be executed in NSFW channels.] + +$c[Put your code here.] +``` diff --git a/src/bdscript/onlyPerms.md b/src/bdscript/onlyPerms.md index 1c4d4c69560..b5d79eb52b4 100644 --- a/src/bdscript/onlyPerms.md +++ b/src/bdscript/onlyPerms.md @@ -1,18 +1,18 @@ -# $onlyPerms -The command can only be executed if the user running the command has all of the provided permissions. - -## Syntax -``` -$onlyPerms[Permissions;...;Error message] -``` - -### Parameters -- `Permissions` `(Type: Permission || Flag: Emptiable)`: The required [permissions](../resources/permissions.md). Use semicolons `;` as a separator to separate multiple permissions. -- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the user is missing the required permissions. - -## Example -``` -$nomention -$onlyPerms[kick;❌ You need the `kick` permission to use this command!] -$kickMention[$noMentionMessage] -``` +# $onlyPerms +The command can only be executed if the user running the command has all of the provided permissions. + +## Syntax +``` +$onlyPerms[Permissions;...;Error message] +``` + +### Parameters +- `Permissions` `(Type: Permission || Flag: Emptiable)`: The required [permissions](../resources/permissions.md). Use semicolons `;` as a separator to separate multiple permissions. +- `Error message` `(Type: String || Flag: Emptiable)`: The message that is returned when the user is missing the required permissions. + +## Example +``` +$nomention +$onlyPerms[kick;❌ You need the `kick` permission to use this command!] +$kickMention[$noMentionMessage] +``` diff --git a/src/bdscript/optOff.md b/src/bdscript/optOff.md index 79a8833bda0..f33a9798051 100644 --- a/src/bdscript/optOff.md +++ b/src/bdscript/optOff.md @@ -1,41 +1,41 @@ -# $optOff -Can only be used in **BDScript 2**. Executes functions with turned off optimizations. - -> As stated in the function description, `$optOff` disables the optimization of the functions in its arguments.\ -This means that functions such as `$random`, `$randomText` and others won't return the previous response, but instead a new response will be returned. - -## Syntax -``` -$optOff[Functions to be executed] -``` - -### Parameters -- `Functions to be executed` `(Type: String || Flag: Emptiable)`: The functions to execute with turned off optimizations. - -## Example -Let's try to run this simple code without `$optOff`: -``` -The 1st random: $random[1;101] -The 2nd random: $random[1;101] -The 3rd random: $random[1;101] -``` -![Example](https://user-images.githubusercontent.com/70456337/206849839-8c9fc256-f16f-41f2-aaab-a3e8b65dbebb.png) - -As we can see, all three randoms returned the same number. Let's fix this by adding `$optOff`: -``` -$optOff[ -The 1st random: $random[1;101] -The 2nd random: $random[1;101] -The 3rd random: $random[1;101] -] -``` -![Example](https://user-images.githubusercontent.com/70456337/206849845-79dd7f5c-382f-43c6-a9b0-8918af260715.png) - -But what if we want to make only the 1st random different from others? In that case we shouldn't put all this code into `$optOff`, but only put a particular random into it - the 2nd one: -``` -The 1st random: $random[1;101] -The 2nd random: $optOff[$random[1;101]] -The 3rd random: $random[1;101] -``` -![Example](https://user-images.githubusercontent.com/70456337/206849854-7d5c9f16-24fc-4889-b9bf-9a3cda810699.png) -> As you can see, the 3rd random will inherit the response of the 2nd one, since it's not included in `$optOff`. +# $optOff +Can only be used in **BDScript 2**. Executes functions with turned off optimizations. + +> As stated in the function description, `$optOff` disables the optimization of the functions in its arguments.\ +This means that functions such as `$random`, `$randomText` and others won't return the previous response, but instead a new response will be returned. + +## Syntax +``` +$optOff[Functions to be executed] +``` + +### Parameters +- `Functions to be executed` `(Type: String || Flag: Emptiable)`: The functions to execute with turned off optimizations. + +## Example +Let's try to run this simple code without `$optOff`: +``` +The 1st random: $random[1;101] +The 2nd random: $random[1;101] +The 3rd random: $random[1;101] +``` +![Example](https://user-images.githubusercontent.com/70456337/206849839-8c9fc256-f16f-41f2-aaab-a3e8b65dbebb.png) + +As we can see, all three randoms returned the same number. Let's fix this by adding `$optOff`: +``` +$optOff[ +The 1st random: $random[1;101] +The 2nd random: $random[1;101] +The 3rd random: $random[1;101] +] +``` +![Example](https://user-images.githubusercontent.com/70456337/206849845-79dd7f5c-382f-43c6-a9b0-8918af260715.png) + +But what if we want to make only the 1st random different from others? In that case we shouldn't put all this code into `$optOff`, but only put a particular random into it - the 2nd one: +``` +The 1st random: $random[1;101] +The 2nd random: $optOff[$random[1;101]] +The 3rd random: $random[1;101] +``` +![Example](https://user-images.githubusercontent.com/70456337/206849854-7d5c9f16-24fc-4889-b9bf-9a3cda810699.png) +> As you can see, the 3rd random will inherit the response of the 2nd one, since it's not included in `$optOff`. diff --git a/src/bdscript/or.md b/src/bdscript/or.md index 7970c535055..5cd77a165d5 100644 --- a/src/bdscript/or.md +++ b/src/bdscript/or.md @@ -1,86 +1,86 @@ -# $or -Returns `true` if at least one of the provided conditions is `true`, otherwise `false` is returned. - -## Syntax -``` -$or[Conditions;...] -``` - -### Parameters -- `Conditions` `(Type: String || Flag: Required)`: The condition to check. Separate conditions using `;`. - -### Signs -`==` - Equal - -`!=` - Not Equal - -`<` - Less Than - -`>` - Greater Than - -`>=` - Greater Than Or Equal To - -`<=` - Less Than Or Equal To -- These signs could vary in meaning based on the order or intent of the if statement. -- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. - -## Example -``` -$nomention -$or[$nickname==MineBartekSA;$message==Update] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example Update -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 154148273307910144 - username: MineBartekSA - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - color: "#f1bdee" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -- user_id: 154148273307910144 - username: MineBartekSA - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/1ecd3b3a-4bdf-441a-98ad-361254426a74 - color: "#f1bdee" - content: | - !example Update -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true - ``` +# $or +Returns `true` if at least one of the provided conditions is `true`, otherwise `false` is returned. + +## Syntax +``` +$or[Conditions;...] +``` + +### Parameters +- `Conditions` `(Type: String || Flag: Required)`: The condition to check. Separate conditions using `;`. + +### Signs +`==` - Equal + +`!=` - Not Equal + +`<` - Less Than + +`>` - Greater Than + +`>=` - Greater Than Or Equal To + +`<=` - Less Than Or Equal To +- These signs could vary in meaning based on the order or intent of the if statement. +- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. + +## Example +``` +$nomention +$or[$nickname==MineBartekSA;$message==Update] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Update +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + true +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + true +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example Update +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + true +``` + +```admonish info title="Read more" +For more information, read the the [If Statements Guide](../guides/ifStatements.md). +``` diff --git a/src/bdscript/parentID.md b/src/bdscript/parentID.md index 96fd4b22c34..017ca9b8834 100644 --- a/src/bdscript/parentID.md +++ b/src/bdscript/parentID.md @@ -1,14 +1,14 @@ -# $parentID -Returns the current channel's parent category ID. - -## Syntax -``` -$parentID -``` - -## Example -``` -$nomention -Current category: $parentID -``` -![example](https://user-images.githubusercontent.com/94063167/199015904-8c1635fc-ae14-40e6-9102-5f0a94a65cb7.png) +# $parentID +Returns the current channel's parent category ID. + +## Syntax +``` +$parentID +``` + +## Example +``` +$nomention +Current category: $parentID +``` +![example](https://user-images.githubusercontent.com/94063167/199015904-8c1635fc-ae14-40e6-9102-5f0a94a65cb7.png) diff --git a/src/bdscript/parentIDComplex.md b/src/bdscript/parentIDComplex.md index 2c955358ce2..4417434351c 100644 --- a/src/bdscript/parentIDComplex.md +++ b/src/bdscript/parentIDComplex.md @@ -1,17 +1,17 @@ -# $parentID[] -Returns the parent category ID for the given channel ID. - -## Syntax -``` -$parentID[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel from which to retrieve the category ID. - -## Example -``` -$nomention -Category ID: $parentID[$mentionedChannels[1]] -``` -![example](https://user-images.githubusercontent.com/94063167/199022843-84b86272-d690-4630-99ba-80e024ffea52.png) +# $parentID[] +Returns the parent category ID for the given channel ID. + +## Syntax +``` +$parentID[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel from which to retrieve the category ID. + +## Example +``` +$nomention +Category ID: $parentID[$mentionedChannels[1]] +``` +![example](https://user-images.githubusercontent.com/94063167/199022843-84b86272-d690-4630-99ba-80e024ffea52.png) diff --git a/src/bdscript/pinMessage.md b/src/bdscript/pinMessage.md index b4361a3eb89..433d64e46e0 100644 --- a/src/bdscript/pinMessage.md +++ b/src/bdscript/pinMessage.md @@ -1,18 +1,18 @@ -# $pinMessage -Pins the bot's response message in the current channel. - -> ⚠ī¸ A channel can have a maximum of 50 pinned messages. - -## Syntax -``` -$pinMessage -``` - -## Example -``` -$nomention -$pinMessage -This is a cool pinned message! 😎 -``` - -![example](https://user-images.githubusercontent.com/69215413/123554940-97db0180-d750-11eb-95b5-2a995ff9c895.png) +# $pinMessage +Pins the bot's response message in the current channel. + +> ⚠ī¸ A channel can have a maximum of 50 pinned messages. + +## Syntax +``` +$pinMessage +``` + +## Example +``` +$nomention +$pinMessage +This is a cool pinned message! 😎 +``` + +![example](https://user-images.githubusercontent.com/69215413/123554940-97db0180-d750-11eb-95b5-2a995ff9c895.png) diff --git a/src/bdscript/pinMessageComplex.md b/src/bdscript/pinMessageComplex.md index 5105ae23a53..35bdc079746 100644 --- a/src/bdscript/pinMessageComplex.md +++ b/src/bdscript/pinMessageComplex.md @@ -1,21 +1,21 @@ -# $pinMessage[] -Pins a specific message using its channel and message ID. - -> ⚠ī¸ A channel can have a maximum of 50 pinned messages. - -## Syntax -``` -$pinMessage[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to pin. - -## Example -``` -$nomention -$pinMessage[$channelID;$messageID] -I have pinned your message! -``` -![example](https://user-images.githubusercontent.com/95774950/180184192-bb11736d-1f92-4ce9-b3e0-df513179fa0c.png) +# $pinMessage[] +Pins a specific message using its channel and message ID. + +> ⚠ī¸ A channel can have a maximum of 50 pinned messages. + +## Syntax +``` +$pinMessage[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to pin. + +## Example +``` +$nomention +$pinMessage[$channelID;$messageID] +I have pinned your message! +``` +![example](https://user-images.githubusercontent.com/95774950/180184192-bb11736d-1f92-4ce9-b3e0-df513179fa0c.png) diff --git a/src/bdscript/premiumExpireTime.md b/src/bdscript/premiumExpireTime.md index 50ee48632fb..66fb8f51d6b 100644 --- a/src/bdscript/premiumExpireTime.md +++ b/src/bdscript/premiumExpireTime.md @@ -1,28 +1,45 @@ -# $premiumExpireTime -Returns how long until premium expires. - -> 🧙‍♂ī¸ Returns "expired" if the bot is not premium. - -## Syntax -``` -$premiumExpireTime[(Unix timestamp)] -``` - -### Parameters -- `Unix timestamp` `(Type: Bool || Flag: Optional)`: If "yes" is written, it will return the premium expiration value in UNIX timestamp and if "no", it will output as normal time format. Defaults to "no". - -## Example - -#### When no premium -``` -$nomention -My premium expires in: $premiumExpireTime -``` -![example](https://user-images.githubusercontent.com/69215413/123555040-38c9bc80-d751-11eb-963d-92c7b36f9d38.png) - -#### When premium -``` -$nomention -My premium expires in: $premiumExpireTime (UNIX Timestamp : $premiumExpireTime[yes]) -``` -![example](https://user-images.githubusercontent.com/95774950/180188899-4a28bfcf-5180-4f35-9491-525c9a9c2c32.png) +# $premiumExpireTime +Returns how long until premium expires. + +> Returns "expired" if the bot is not premium. + +## Syntax +``` +$premiumExpireTime[(Return unix timestamp?)] +``` + +### Parameters +- `Return unix timestamp?` `(Type: Bool || Flag: Optional)`: If "yes" is written, it will return the premium expiration value in UNIX timestamp and if "no", it will output as normal time format. Defaults to "no". + +## Example +``` +$nomention +My premium expires in: $premiumExpireTime (Unix Timestamp: $premiumExpireTime[yes]) +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + My premium expires in: Mon, Nov 03 2025 12:02:09 UTC (Unix Timestamp: 1762171329) +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !bot +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + My premium expires in: expired (Unix Timestamp: expired) +``` diff --git a/src/bdscript/publishMessage.md b/src/bdscript/publishMessage.md index 2557a037afb..8971a5e58e7 100644 --- a/src/bdscript/publishMessage.md +++ b/src/bdscript/publishMessage.md @@ -1,21 +1,21 @@ -# $publishMessage -Publishes a message from an announcement channel to all following servers. - -## Syntax -``` -$publishMessage[channel ID;message ID] -``` - -### Parameters -- `channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is. -- `message ID` `(Type: Snowflake || Flag: Required)`: The message which will be published. - -## Example -``` -$nomention -$publishMessage[$mentionedChannels[1;no];$noMentionMessage] -Message has been published! -``` - -![Screenshot_20221023_010339](https://user-images.githubusercontent.com/95774950/197359418-650ef696-0947-4082-81a2-212396d165eb.png) -![Screenshot_20221023_004859](https://user-images.githubusercontent.com/95774950/197359045-95cd01bd-d7af-42bb-bfa3-7d0c0d7bad14.png) +# $publishMessage +Publishes a message from an announcement channel to all following servers. + +## Syntax +``` +$publishMessage[channel ID;message ID] +``` + +### Parameters +- `channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is. +- `message ID` `(Type: Snowflake || Flag: Required)`: The message which will be published. + +## Example +``` +$nomention +$publishMessage[$mentionedChannels[1;no];$noMentionMessage] +Message has been published! +``` + +![Screenshot_20221023_010339](https://user-images.githubusercontent.com/95774950/197359418-650ef696-0947-4082-81a2-212396d165eb.png) +![Screenshot_20221023_004859](https://user-images.githubusercontent.com/95774950/197359045-95cd01bd-d7af-42bb-bfa3-7d0c0d7bad14.png) diff --git a/src/bdscript/random.md b/src/bdscript/random.md index 2a4bbdb0d17..f3d4552aff8 100644 --- a/src/bdscript/random.md +++ b/src/bdscript/random.md @@ -1,14 +1,27 @@ -# $random -Returns a random number between 0 and 9. - -## Syntax -``` -$random -``` - -## Example -``` -$nomention -The random number is **$random**! -``` -![example](https://user-images.githubusercontent.com/111157596/231841104-5640d8c0-004b-45c1-8b23-2360596a17ae.png) +# $random +Returns a random number between 0 and 9. + +## Syntax +``` +$random +``` + +## Example +``` +$nomention +The random number is **$random** +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + The random number is 4 +``` diff --git a/src/bdscript/randomCategoryID.md b/src/bdscript/randomCategoryID.md index de5fc0c98e4..a94b0fe652d 100644 --- a/src/bdscript/randomCategoryID.md +++ b/src/bdscript/randomCategoryID.md @@ -1,32 +1,35 @@ -# $randomCategoryID -Returns a random category ID from the current server or from the provided server. - -## Syntax -``` -$randomCategoryID[(Guild ID)] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server from which to get a random category ID. _(Defaults to the current server)_ - -## Example -``` -$nomention -Random Category: $channelName[$randomCategoryID[]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Random Category: BDFD -``` +# $randomCategoryID +Returns a random category ID from the current server or from the provided server. + +## Syntax +``` +$randomCategoryID[(Guild ID)] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server from which to get a random category ID. _(Defaults to the current server)_ + +## Example +``` +$nomention +Random Category: $channelName[$randomCategoryID[]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Category: BDFD +``` + +```admonish question title="What is this?" +How [`$channelName`](./channelName.md) works? +``` diff --git a/src/bdscript/randomChannelID.md b/src/bdscript/randomChannelID.md index d73c1c1ecda..234973b735e 100644 --- a/src/bdscript/randomChannelID.md +++ b/src/bdscript/randomChannelID.md @@ -1,15 +1,15 @@ -# $randomChannelID -Returns a random channel ID from the current server. - -## Syntax -``` -$randomChannelID -``` - -## Example -``` -$nomention -Here's A Random Channel: <#$randomChannelID> -``` - -![example](https://user-images.githubusercontent.com/69215413/123358259-2aa15380-d539-11eb-995e-71d92bd9e67c.png) +# $randomChannelID +Returns a random channel ID from the current server. + +## Syntax +``` +$randomChannelID +``` + +## Example +``` +$nomention +Here's A Random Channel: <#$randomChannelID> +``` + +![example](https://user-images.githubusercontent.com/69215413/123358259-2aa15380-d539-11eb-995e-71d92bd9e67c.png) diff --git a/src/bdscript/randomComplex.md b/src/bdscript/randomComplex.md index d37d1994731..df0efe59844 100644 --- a/src/bdscript/randomComplex.md +++ b/src/bdscript/randomComplex.md @@ -1,20 +1,42 @@ -# $random[] -Returns a random number between 'minimum' and 'maximum'. - -> 📌 `$random[]` never returns the 'maximum' value, as it's right side exclusive range. Basically, to get a random number between 1 and 10; you'd put 11 as the 'maximum' instead of 10 i.e `$random[1;11]`. - -## Syntax -``` -$random[minimum;maximum] -```` - -### Parameters -- `minimum` `(Type: Integer, Float || Flag: Required)`: The minimum value. -- `maximum` `(Type: Integer, Float || Flag: Required)`: The maximum value. - -## Example -``` -$nomention -🎲 You rolled `$random[1;7]`! -``` -![example](https://user-images.githubusercontent.com/69215413/123555172-0d939d00-d752-11eb-9d30-975bf6e8e99f.png) +# $random[] +Returns a random number between `min` and `max`. + +```admonish warning +`$random[]` never returns the 'max' value, as it's right side exclusive range. Basically, to get a random number between 1 and 5; you'd put 6 as the `Max` instead of 5 i.e `$random[1;6]` will return: 1, 2, 3, 4, 5. +``` + +## Syntax +``` +$random[Min;Max] +```` + +### Parameters +- `Min` `(Type: Integer, Float || Flag: Required)`: The minimum value. +- `Max` `(Type: Integer, Float || Flag: Required)`: The maximum value. + +```admonish failure +The `Max` value cannot be greater than or equal to the `Min` value. +- ❌ `Max` <= `Min` +- ✅ `Max` > `Min` +``` + +## Example +``` +$nomention +The random number is **$random[1;21]** +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + The random number is 16 +``` diff --git a/src/bdscript/randomGuildID.md b/src/bdscript/randomGuildID.md index 3f1ff6431eb..bd2333f4d07 100644 --- a/src/bdscript/randomGuildID.md +++ b/src/bdscript/randomGuildID.md @@ -1,29 +1,28 @@ -# $randomGuildID -Returns a random guild ID from servers the bot is in. - -## Syntax -``` -$randomGuildID -``` -## Example -``` -$nomention -Random Guild: $serverName[$randomGuildID] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Random Guild: Bot Designer for Discord Official Server -``` - +# $randomGuildID +Returns a random guild ID from servers the bot is in. + +## Syntax +``` +$randomGuildID +``` +## Example +``` +$nomention +Random Guild: $serverName[$randomGuildID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Guild: Bot Designer for Discord Official Server +``` + diff --git a/src/bdscript/randomMention.md b/src/bdscript/randomMention.md index 355da4181d0..4ac8362427d 100644 --- a/src/bdscript/randomMention.md +++ b/src/bdscript/randomMention.md @@ -1,14 +1,14 @@ -# $randomMention -Returns a random mention of a user from the current server. - -## Syntax -``` -$randomMention -``` - -## Example -``` -$nomention -Random User: $randomMention -``` -![example](https://user-images.githubusercontent.com/111157596/233840567-c149b9b3-35d5-4a81-95f2-5b2bdc6a5271.png) +# $randomMention +Returns a random mention of a user from the current server. + +## Syntax +``` +$randomMention +``` + +## Example +``` +$nomention +Random User: $randomMention +``` +![example](https://user-images.githubusercontent.com/111157596/233840567-c149b9b3-35d5-4a81-95f2-5b2bdc6a5271.png) diff --git a/src/bdscript/randomRoleID.md b/src/bdscript/randomRoleID.md index d67e20ade95..c9870dea678 100644 --- a/src/bdscript/randomRoleID.md +++ b/src/bdscript/randomRoleID.md @@ -1,51 +1,53 @@ -# $randomRoleID -Returns a random role ID from the current server or from the provided server. - -## Syntax -``` -$randomRoleID[(Guild ID)] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server from which to get a random role ID. _(Defaults to the current server)_ - -## Example -``` -$nomention -Random Role: $roleName[$randomRoleID[]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Random Role: Owner -``` - -> It can return the `@everyone` role ID! - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Random Role: <@everyone> - highlight: true -``` +# $randomRoleID +Returns a random role ID from the current server or from the provided server. + +## Syntax +``` +$randomRoleID[(Guild ID)] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The server from which to get a random role ID. _(Defaults to the current server)_ + +## Example +``` +$nomention +Random Role: $roleName[$randomRoleID[]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Role: Owner +``` + +> It can return the `@everyone` role ID! + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Role: <@everyone> + highlight: true +``` + +```admonish question title="What is this?" +How [`$roleName`](./roleName.md) works? +``` diff --git a/src/bdscript/randomString.md b/src/bdscript/randomString.md index 5be16fe22ac..1cf1375f5e7 100644 --- a/src/bdscript/randomString.md +++ b/src/bdscript/randomString.md @@ -1,18 +1,44 @@ -# $randomString -Generates a random combination of letters/numbers. - -## Syntax -``` -$randomString[Length] -``` - -### Parameters -- `Length` `(Type: Integer || Flag: Required)`: How long the string should be (max `10`). - -## Example -``` -$nomention -String: `$randomString[$message]` -``` - -![example](https://user-images.githubusercontent.com/69215413/123555398-847d6580-d753-11eb-9da3-e238861ad989.png) +# $randomString +Generates a random combination of letters/numbers. + +## Syntax +``` +$randomString[Length] +``` + +### Parameters +- `Length` `(Type: Integer || Flag: Required)`: How long the string should be (maximum is `10`). + +## Example +``` +$nomention +Random String: `$randomString[5]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random String: Nuxo5 +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $randomString[] +
+
+

Output:

+ Random String: Nuxo5 +
+
diff --git a/src/bdscript/randomText.md b/src/bdscript/randomText.md index 89fdefb1ffa..08abc4eed85 100644 --- a/src/bdscript/randomText.md +++ b/src/bdscript/randomText.md @@ -1,18 +1,67 @@ -# $randomText -Picks one value from the provided values randomly. - -## Syntax -``` -$randomText[Text;...] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to choose from. Separate different texts with `;`. - -## Example -``` -$nomention -$randomText[Hello;Hi;Hey]! -``` - -![example](https://user-images.githubusercontent.com/69215413/123556366-e42a3f80-d758-11eb-94fa-8836cccc882f.png) +# $randomText +Picks one value from the provided values randomly. + +## Syntax +``` +$randomText[Text;...] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to choose from. Separate different texts with `;`. + +## Example +``` +$nomention +$randomText[Hello;Hi;Hey]! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Text: Hello! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Text: Hey! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Text: Hello! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Text: Hi! +``` diff --git a/src/bdscript/randomUser.md b/src/bdscript/randomUser.md index a8060cfe45f..c14d402df39 100644 --- a/src/bdscript/randomUser.md +++ b/src/bdscript/randomUser.md @@ -1,14 +1,28 @@ -# $randomUser -Returns a random username from the current server. - -## Syntax -``` -$randomUser -``` - -## Example -``` -$nomention -Random Username: $randomUser -``` -![example](https://user-images.githubusercontent.com/111157596/233840842-f3845ea5-be53-4c55-b98f-23608b9b47e2.png) +# $randomUser +Returns a random username from the current server. + +## Syntax +``` +$randomUser +``` + +## Example +``` +$nomention +Random Username: $randomUser +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random Username: minebarteksa +``` diff --git a/src/bdscript/randomUserID.md b/src/bdscript/randomUserID.md index 94b82548ec8..e0ccd2b5fc4 100644 --- a/src/bdscript/randomUserID.md +++ b/src/bdscript/randomUserID.md @@ -1,14 +1,28 @@ -# $randomUserID -Returns a random user ID from the current server. - -## Syntax -``` -$randomUserID -``` - -## Example -``` -$nomention -Random User ID: $randomUserID -``` -![example](https://user-images.githubusercontent.com/111157596/233841026-56d019d5-792c-4099-8b2d-3724dcdc6018.png) +# $randomUserID +Returns a random user ID from the current server. + +## Syntax +``` +$randomUserID +``` + +## Example +``` +$nomention +Random User ID: $randomUserID +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Random User ID: 154148273307910144 +``` diff --git a/src/bdscript/registerGuildCommands.md b/src/bdscript/registerGuildCommands.md index e83211849af..0393988d1fd 100644 --- a/src/bdscript/registerGuildCommands.md +++ b/src/bdscript/registerGuildCommands.md @@ -1,15 +1,15 @@ -# $registerGuildCommands -Registers all guild slash commands in the current guild. - -## Syntax -``` -$registerGuildCommands -``` - -## Example -``` -$nomention -$registerGuildCommands -Successfully registered all guild slash commands! -``` -![example](https://user-images.githubusercontent.com/111157596/231836696-5a87d5a5-cb1a-47f2-89d6-cc117f20f801.png) +# $registerGuildCommands +Registers all guild slash commands in the current guild. + +## Syntax +``` +$registerGuildCommands +``` + +## Example +``` +$nomention +$registerGuildCommands +Successfully registered all guild slash commands! +``` +![example](https://user-images.githubusercontent.com/111157596/231836696-5a87d5a5-cb1a-47f2-89d6-cc117f20f801.png) diff --git a/src/bdscript/registerGuildCommandsComplex.md b/src/bdscript/registerGuildCommandsComplex.md index e802407a7e4..c09396d0598 100644 --- a/src/bdscript/registerGuildCommandsComplex.md +++ b/src/bdscript/registerGuildCommandsComplex.md @@ -1,31 +1,31 @@ -# $registerGuildCommands[] -Registers provided guild slash commands in the current guild. - -> 📝 Slash commands doesn't need to be enabled or marked as guild command. - -## Syntax -``` -$registerGuildCommands[Slash command name;...] -``` - -### Parameters -- `Slash command name` `(Type: String || Flag: Required)`: Name of the guild slash command to register. Use semicolons `;` as a separator to separate multiple guild slash command names. - -## Examples -### Example #1: -``` -$nomention -$registerGuildCommands[help] -Successfully registered the guild slash command `/help`! -``` -![example1](https://user-images.githubusercontent.com/111157596/233842038-1477b1f9-2e82-4cfc-90d9-ba318a9e8856.png) - -### Example #2: -``` -$nomention -$argsCheck[>1;Provide guild slash command names!] - -$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]] -Successfully registered the provided guild slash commands! -``` -![example2](https://user-images.githubusercontent.com/111157596/233842084-413aec63-8cdd-4295-b3d3-0fe660b13792.png) +# $registerGuildCommands[] +Registers provided guild slash commands in the current guild. + +> 📝 Slash commands doesn't need to be enabled or marked as guild command. + +## Syntax +``` +$registerGuildCommands[Slash command name;...] +``` + +### Parameters +- `Slash command name` `(Type: String || Flag: Required)`: Name of the guild slash command to register. Use semicolons `;` as a separator to separate multiple guild slash command names. + +## Examples +### Example #1: +``` +$nomention +$registerGuildCommands[help] +Successfully registered the guild slash command `/help`! +``` +![example1](https://user-images.githubusercontent.com/111157596/233842038-1477b1f9-2e82-4cfc-90d9-ba318a9e8856.png) + +### Example #2: +``` +$nomention +$argsCheck[>1;Provide guild slash command names!] + +$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]] +Successfully registered the provided guild slash commands! +``` +![example2](https://user-images.githubusercontent.com/111157596/233842084-413aec63-8cdd-4295-b3d3-0fe660b13792.png) diff --git a/src/bdscript/removeAllComponents.md b/src/bdscript/removeAllComponents.md index 658b8535856..e632f83b308 100644 --- a/src/bdscript/removeAllComponents.md +++ b/src/bdscript/removeAllComponents.md @@ -1,9 +1,9 @@ -# $removeAllComponents -Removes all components from the current message. - -> **Note** : Components are [buttons](../guides/general/interactions/buttons/aboutButtons.md) and [select menus](../guides/general/interactions/selectMenus/aboutSelectMenu.md). - -## Syntax -``` -$removeAllComponents -``` +# $removeAllComponents +Removes all components from the current message. + +> **Note** : Components are [buttons](../guides/general/interactions/buttons/aboutButtons.md) and [select menus](../guides/general/interactions/selectMenus/aboutSelectMenu.md). + +## Syntax +``` +$removeAllComponents +``` diff --git a/src/bdscript/removeAllComponentsComplex.md b/src/bdscript/removeAllComponentsComplex.md index f171ac1402c..8a1ed626413 100644 --- a/src/bdscript/removeAllComponentsComplex.md +++ b/src/bdscript/removeAllComponentsComplex.md @@ -1,20 +1,20 @@ -# $removeAllComponents[] -Removes all components from a message. - -> **Note** : Components are [buttons](../guides/general/interactions/buttons/aboutButtons.md) and [select menus](../guides/general/interactions/selectMenus/aboutSelectMenu.md). - -## Syntax -``` -$removeAllComponents[Message ID] -``` - -### Parameters -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which all components will be removed. - -## Example -``` -$nomention -$removeAllComponents[1093603455320457307] -``` - -> **Note** : When providing "Message ID", make sure the message author is the bot. +# $removeAllComponents[] +Removes all components from a message. + +> **Note** : Components are [buttons](../guides/general/interactions/buttons/aboutButtons.md) and [select menus](../guides/general/interactions/selectMenus/aboutSelectMenu.md). + +## Syntax +``` +$removeAllComponents[Message ID] +``` + +### Parameters +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which all components will be removed. + +## Example +``` +$nomention +$removeAllComponents[1093603455320457307] +``` + +> **Note** : When providing "Message ID", make sure the message author is the bot. diff --git a/src/bdscript/removeButtons.md b/src/bdscript/removeButtons.md index f2aea19461b..3d7a7f355ff 100644 --- a/src/bdscript/removeButtons.md +++ b/src/bdscript/removeButtons.md @@ -1,8 +1,8 @@ -# $removeButtons -Removes all buttons from the current message. - -## Syntax -``` -$removeButtons -``` -> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +# $removeButtons +Removes all buttons from the current message. + +## Syntax +``` +$removeButtons +``` +> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). diff --git a/src/bdscript/removeButtonsComplex.md b/src/bdscript/removeButtonsComplex.md index 56f88397f89..5381acc2a67 100644 --- a/src/bdscript/removeButtonsComplex.md +++ b/src/bdscript/removeButtonsComplex.md @@ -1,23 +1,23 @@ -# $removeButtons[] -Removes all buttons from a message. - -## Syntax -``` -$removeButtons[Message ID] -``` - -### Parameters -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which all buttons will be removed. - -> 📝 When providing "Message ID", make sure the message author is the bot. - -## Example -``` -$nomention -$removeButtons[$message[1]] -Successfully removed all buttons from the message. -``` -![example](https://user-images.githubusercontent.com/111157596/231867111-33a39b32-3d41-469f-802e-c8fe0eb360c9.png) -![example](https://user-images.githubusercontent.com/111157596/231867140-4e9a4917-4787-4caf-9aa6-9a4e88d51c95.png) - -> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). +# $removeButtons[] +Removes all buttons from a message. + +## Syntax +``` +$removeButtons[Message ID] +``` + +### Parameters +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which all buttons will be removed. + +> 📝 When providing "Message ID", make sure the message author is the bot. + +## Example +``` +$nomention +$removeButtons[$message[1]] +Successfully removed all buttons from the message. +``` +![example](https://user-images.githubusercontent.com/111157596/231867111-33a39b32-3d41-469f-802e-c8fe0eb360c9.png) +![example](https://user-images.githubusercontent.com/111157596/231867140-4e9a4917-4787-4caf-9aa6-9a4e88d51c95.png) + +> For more info, see the [Buttons Guide](../guides/general/interactions/buttons/aboutButtons.md). diff --git a/src/bdscript/removeComponent.md b/src/bdscript/removeComponent.md index 33598e0d569..f9080d9d9e9 100644 --- a/src/bdscript/removeComponent.md +++ b/src/bdscript/removeComponent.md @@ -1,11 +1,11 @@ -# $removeComponent -Removes a certain component from a message. - -## Syntax -``` -$removeComponent[Custom ID;(Message ID)] -``` - -### Parameters -- `Custom ID` `(Type: String || Flag: Required)`: The select-menu/button custom ID to remove from the message. -- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: The message to remove the component from, uses the bot's current message if no `Message ID` is provided. +# $removeComponent +Removes a certain component from a message. + +## Syntax +``` +$removeComponent[Custom ID;(Message ID)] +``` + +### Parameters +- `Custom ID` `(Type: String || Flag: Required)`: The select-menu/button custom ID to remove from the message. +- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: The message to remove the component from, uses the bot's current message if no `Message ID` is provided. diff --git a/src/bdscript/removeContains.md b/src/bdscript/removeContains.md index 737fe8ee200..d21d6a20f42 100644 --- a/src/bdscript/removeContains.md +++ b/src/bdscript/removeContains.md @@ -1,19 +1,18 @@ -# $removeContains -Removes messages that contains provided words. Removes up to the given `Amount` of latest messages. - -## Syntax -``` -$removeContains[Word;...;Amount] -``` - -### Parameters -- `Word` `(Type: String || Flag: Emptiable)`: The words/phrases to delete. Use semicolons `;` as a separator to separate multiple words/phrases. -- `Amount` `(Type: Integer || Flag: Required)`: The number of messages containing given words to delete (Max is `100`). - -## Example -``` -$nomention -$onlyPerms[managemessages;❌ You are missing the `MANAGE_MESSAGES` permission!] -$removeContains[https://discord.gg/;discord.gg/;https://discord.com/invite;$noMentionMessage] -Successful purged `$noMentionMessage` messages containing invites! -``` +# $removeContains +Removes messages that contains provided words. Removes up to the given `Amount` of latest messages. + +## Syntax +``` +$removeContains[Word;...;Amount] +``` + +### Parameters +- `Word` `(Type: String || Flag: Emptiable)`: The words/phrases to delete. Use semicolons `;` as a separator to separate multiple words/phrases. +- `Amount` `(Type: Integer || Flag: Required)`: The number of messages containing given words to delete (Max is `100`). + +## Example +``` +$nomention +$removeContains[https://discord.gg/;discord.gg/;https://discord.com/invite;$noMentionMessage] +Successful purged `$noMentionMessage` messages containing invites! +``` diff --git a/src/bdscript/removeEmoji.md b/src/bdscript/removeEmoji.md index 76d8d2050e0..ca2f60ae9c1 100644 --- a/src/bdscript/removeEmoji.md +++ b/src/bdscript/removeEmoji.md @@ -1,31 +1,31 @@ -# $removeEmoji -Removes the given emoji from the server. - -## Syntax -``` -$removeEmoji[Emoji ID] -``` - -### Parameters -- `Emoji ID` `(Type: Snowflake || Flag: Required)`: The ID of the emoji which will be removed from the server. - -## Example -``` -$nomention -$removeEmoji[$message[1]] -Successfully removed the emoji. -``` -![example1](https://user-images.githubusercontent.com/111157596/249171795-f499430e-f783-44e4-92ef-af6704dab5e8.png)\ -![example2](https://user-images.githubusercontent.com/111157596/249172623-ba3d0889-c092-4b1c-ad12-893b3a40f9ef.png) - -### How to get emoji ID? - -> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! - -1. Type `\:TheEmojiName:` -2. Send the message. -3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:ID>`. If the emoji is animated, it should look like this: ``) -4. Remove `<:emojiName:`/`` to leave just the Discord emoji ID. (e.g. `<:hollyDab:828628880629825546>` -> `828628880629825546`) -5. Input the Discord emoji ID into `$removeEmoji[]`. (e.g. `$removeEmoji[828628880629825546]`) - -![example3](https://media.discordapp.net/attachments/609162277312266280/745309789491298415/My_Movie_0.gif) +# $removeEmoji +Removes the given emoji from the server. + +## Syntax +``` +$removeEmoji[Emoji ID] +``` + +### Parameters +- `Emoji ID` `(Type: Snowflake || Flag: Required)`: The ID of the emoji which will be removed from the server. + +## Example +``` +$nomention +$removeEmoji[$message[1]] +Successfully removed the emoji. +``` +![example1](https://user-images.githubusercontent.com/111157596/249171795-f499430e-f783-44e4-92ef-af6704dab5e8.png)\ +![example2](https://user-images.githubusercontent.com/111157596/249172623-ba3d0889-c092-4b1c-ad12-893b3a40f9ef.png) + +### How to get emoji ID? + +> This method requires [Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) to be enabled! + +1. Type `\:TheEmojiName:` +2. Send the message. +3. Copy the ID it returns. (The emoji ID should be in this format: `<:emojiName:ID>`. If the emoji is animated, it should look like this: ``) +4. Remove `<:emojiName:`/`` to leave just the Discord emoji ID. (e.g. `<:hollyDab:828628880629825546>` -> `828628880629825546`) +5. Input the Discord emoji ID into `$removeEmoji[]`. (e.g. `$removeEmoji[828628880629825546]`) + +![example3](https://media.discordapp.net/attachments/609162277312266280/745309789491298415/My_Movie_0.gif) diff --git a/src/bdscript/removeLinks.md b/src/bdscript/removeLinks.md index 55b3449ed1e..59fd45b5797 100644 --- a/src/bdscript/removeLinks.md +++ b/src/bdscript/removeLinks.md @@ -1,23 +1,23 @@ -# $removeLinks -Removes all links from the bot's reply. - -## Syntax -``` -$removeLinks -``` - -## Example -### With `$removeLinks` -``` -$nomention -$removeLinks -A cool link: https://botdesignerdiscord.com/ -``` -![image](https://user-images.githubusercontent.com/111157596/231875551-3c034f0a-b122-46b0-a495-e2c94afd5ca2.png) - -### Without `$removeLinks` -``` -$nomention -A cool link: https://botdesignerdiscord.com/ -``` -![example](https://user-images.githubusercontent.com/111157596/231875367-4655873d-7b62-4e4f-9227-757b760fc00d.png) +# $removeLinks +Removes all links from the bot's reply. + +## Syntax +``` +$removeLinks +``` + +## Example +### With `$removeLinks` +``` +$nomention +$removeLinks +A cool link: https://botdesignerdiscord.com/ +``` +![image](https://user-images.githubusercontent.com/111157596/231875551-3c034f0a-b122-46b0-a495-e2c94afd5ca2.png) + +### Without `$removeLinks` +``` +$nomention +A cool link: https://botdesignerdiscord.com/ +``` +![example](https://user-images.githubusercontent.com/111157596/231875367-4655873d-7b62-4e4f-9227-757b760fc00d.png) diff --git a/src/bdscript/removeLinksComplex.md b/src/bdscript/removeLinksComplex.md index a318212a17e..74d7ca2425d 100644 --- a/src/bdscript/removeLinksComplex.md +++ b/src/bdscript/removeLinksComplex.md @@ -1,17 +1,17 @@ -# $removeLinks[] -Removes all links from the provided text. - -## Syntax -``` -$removeLinks[text] -``` - -### Parameters -- `text` `(Type: String || Flag: Emptiable)`: The text from which all links will be removed. - -## Example -``` -$nomention -$removeLinks[$noMentionMessage] -``` -![example](https://user-images.githubusercontent.com/69215413/123530440-40914e80-d6c8-11eb-9fa1-e1aa488a1c80.png) +# $removeLinks[] +Removes all links from the provided text. + +## Syntax +``` +$removeLinks[text] +``` + +### Parameters +- `text` `(Type: String || Flag: Emptiable)`: The text from which all links will be removed. + +## Example +``` +$nomention +$removeLinks[$noMentionMessage] +``` +![example](https://user-images.githubusercontent.com/69215413/123530440-40914e80-d6c8-11eb-9fa1-e1aa488a1c80.png) diff --git a/src/bdscript/removeSplitTextElement.md b/src/bdscript/removeSplitTextElement.md index 463d8b62197..a77410aa9e1 100644 --- a/src/bdscript/removeSplitTextElement.md +++ b/src/bdscript/removeSplitTextElement.md @@ -1,14 +1,14 @@ -# $removeSplitTextElement -Removes a certain element from the [`$textSplit[]`](./textSplit.md) values. - -> 🧙‍♂ī¸ This function is unneeded, if `$textSplit[]` isn't present in the code. - -## Syntax -``` -$removeSplitTextElement[Index] -``` - -### Parameters -- `Index` `(Type: Integer || Flag: Required)`: The index of the `$textSplit[]` value to remove. - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $removeSplitTextElement +Removes a certain element from the [`$textSplit[]`](./textSplit.md) values. + +> This function is unneeded, if `$textSplit[]` isn't present in the code. + +## Syntax +``` +$removeSplitTextElement[Index] +``` + +### Parameters +- `Index` `(Type: Integer || Flag: Required)`: The index of the `$textSplit[]` value to remove. + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/repeatMessage.md b/src/bdscript/repeatMessage.md index b0310cbaa5e..73eef757718 100644 --- a/src/bdscript/repeatMessage.md +++ b/src/bdscript/repeatMessage.md @@ -1,28 +1,36 @@ -# $repeatMessage -Repeats the provided text a certain amount of times. - -## Syntax -``` -$repeatMessage[Amount;Message] -``` - -### Parameters -- `Amount` `(Type: Integer || Flag: Required)`: The number of times to repeat the given text (max `10` times). -- `Message` `(Type: String || Flag: Emptiable)`: The text to repeat. - -## Examples -### Example #1 -``` -$nomention -$repeatMessage[5;Hello World] -``` -![example1](https://user-images.githubusercontent.com/69215413/126245014-85c3953b-ad54-4658-95df-fb83719dcfa0.png) - -### Example #2 -> 🧙‍♂ī¸ You can use a space at the end of "text", so there are spaces in-between repeats. - -``` -$nomention -$repeatMessage[5;Hello World! ] -``` -![example2](https://user-images.githubusercontent.com/69215413/126245000-6bac6c11-39d2-40ec-a6d3-0d8123c6a2fd.png) +# $repeatMessage +Repeats the provided text a certain amount of times. + +## Syntax +``` +$repeatMessage[Amount;Message] +``` + +### Parameters +- `Amount` `(Type: Integer || Flag: Required)`: The number of times to repeat the given text (max `10` times). +- `Message` `(Type: String || Flag: Emptiable)`: The text to repeat. + +## Example +``` +$nomention +$repeatMessage[5;Hello World!] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Hello World!Hello World!Hello World!Hello World!Hello World! +``` + +```admonish info +You can use a space at the end of "text" in the `Message` parameter, so there are spaces in-between repeats. +``` diff --git a/src/bdscript/replaceText.md b/src/bdscript/replaceText.md index a3aee7b2533..904df9f7000 100644 --- a/src/bdscript/replaceText.md +++ b/src/bdscript/replaceText.md @@ -1,27 +1,37 @@ -# $replaceText -Replaces 'Sample' with 'New' from 'Text', you can choose how many 'Sample' is replaced by inputting 'Amount'. - -## Syntax -``` -$replaceText[Text;Sample;New;(Amount)] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text where the bot is searching for the 'Sample'. -- `Sample` `(Type: String || Flag: Emptiable)`: The text to replace with 'New'. -- `New` `(Type: String || Flag: Emptiable)`: The text to replace 'Sample' with. -- `Amount` `(Type: Integer || Flag: Optional)`: The number of times, at most, the bot should replace the sample. Use `-1` to replace all 'Sample' in 'Text' with 'New'. - -## Examples - -**Example #1:** -- Input: `$replaceText[Hello World! Hello Earth!;Hello;Hi;1]` -- Output: `Hi World! Hello Earth!` - -**Example #2:** -- Input: `$replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi;-1]` -- Output: `Hi World! Hi Earth! Hello Dog!` - -**Example #3:** -- Input: `$replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi;-1]` or `$replaceText[Hello World! Hello Earth! Hello Dog!;Hello;Hi]` -- Output: `Hi World! Hi Earth! Hi Dog!` +# $replaceText +Replaces 'Sample' with 'New' from 'Text', you can choose how many 'Sample' is replaced by inputting 'Amount'. + +## Syntax +``` +$replaceText[Text;Sample;New;(Amount)] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text where the bot is searching for the 'Sample'. +- `Sample` `(Type: String || Flag: Emptiable)`: The text to replace with 'New'. +- `New` `(Type: String || Flag: Emptiable)`: The text to replace 'Sample' with. +- `Amount` `(Type: Integer || Flag: Optional)`: The number of times, at most, the bot should replace the sample. Use `-1` to replace all 'Sample' in 'Text' with 'New'. Default is `1`. + +## Example +``` +$nomention +Result 1: $replaceText[Hello world!;Hello;Bye] +Result 2: $replaceText[Hello world!;ll;o;-1] +Result 3: $replaceText[Hello world!;!;] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: "Result 1: Bye world!\n +Result 2: Heoo world!\n +Result 3: Hello world" +``` diff --git a/src/bdscript/repliedMessageID.md b/src/bdscript/repliedMessageID.md index cac77ba31b4..632057e70ec 100644 --- a/src/bdscript/repliedMessageID.md +++ b/src/bdscript/repliedMessageID.md @@ -1,17 +1,17 @@ -# $repliedMessageID -Returns the ID of the replied message. - -> 📌 If the message is not a reply, no response will be returned. - -## Syntax -``` -$repliedMessageID -``` - -## Example -``` -$nomention -The message ID you replied to is: $repliedMessageID -``` -![example](https://user-images.githubusercontent.com/94063167/198900570-ad5b8a25-56ad-4e66-9c3e-6495406d7fda.png) - +# $repliedMessageID +Returns the ID of the replied message. + +> 📌 If the message is not a reply, no response will be returned. + +## Syntax +``` +$repliedMessageID +``` + +## Example +``` +$nomention +The message ID you replied to is: $repliedMessageID +``` +![example](https://user-images.githubusercontent.com/94063167/198900570-ad5b8a25-56ad-4e66-9c3e-6495406d7fda.png) + diff --git a/src/bdscript/repliedMessageIDComplex.md b/src/bdscript/repliedMessageIDComplex.md index 6817c914da4..f4db4ce335e 100644 --- a/src/bdscript/repliedMessageIDComplex.md +++ b/src/bdscript/repliedMessageIDComplex.md @@ -1,19 +1,19 @@ -# $repliedMessageID[] -Returns the ID of the replied message form the given message. - -## Syntax -``` -$repliedMessageID[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which the ID of the replied message will be taken from. - -## Example -``` -$nomention -The message ID you replied to is: $repliedMessageID[$channelID;$messageID] -``` -![example](https://user-images.githubusercontent.com/94063167/198900570-ad5b8a25-56ad-4e66-9c3e-6495406d7fda.png) - +# $repliedMessageID[] +Returns the ID of the replied message form the given message. + +## Syntax +``` +$repliedMessageID[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message from which the ID of the replied message will be taken from. + +## Example +``` +$nomention +The message ID you replied to is: $repliedMessageID[$channelID;$messageID] +``` +![example](https://user-images.githubusercontent.com/94063167/198900570-ad5b8a25-56ad-4e66-9c3e-6495406d7fda.png) + diff --git a/src/bdscript/reply.md b/src/bdscript/reply.md index fab552a4aca..0a8f66ba38c 100644 --- a/src/bdscript/reply.md +++ b/src/bdscript/reply.md @@ -1,16 +1,39 @@ -# $reply -Replies to the author's message. - -## Syntax -``` -$reply -``` - -## Example -``` -$nomention -$reply -$allowUserMentions[] -Hello $displayName 👋đŸģ -``` -![image](https://user-images.githubusercontent.com/42785890/151721130-51524143-b136-4cfc-b028-694b1d09e84a.png) +# $reply +Replies to the author's message. + +## Syntax +``` +$reply +``` + +## Example +``` +$nomention +$reply +Hello, $displayName! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + reply: + user_id: 803569638084313098 + author: RainbowKey + mentions: true + content: "!example" + highlight: true + content: | + Hello, RainbowKey! +``` + +```admonish note +You can use [`$allowUserMentions[]`](./allowUserMentions.md) to disable the reply ping (mention). +``` diff --git a/src/bdscript/replyComplex.md b/src/bdscript/replyComplex.md index 93a0715dda8..10a38bd052c 100644 --- a/src/bdscript/replyComplex.md +++ b/src/bdscript/replyComplex.md @@ -1,19 +1,19 @@ -# $reply[] -Replies to a provided message. - -## Syntax -``` -$reply[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to reply. - -## Example -``` -$nomention -$reply[$mentionedChannels[1];$noMentionMessage] -Replied! -``` -![image](https://user-images.githubusercontent.com/113247745/199210421-a7833741-34ff-4670-99d5-d756ef85629e.png) +# $reply[] +Replies to a provided message. + +## Syntax +``` +$reply[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to reply. + +## Example +``` +$nomention +$reply[$mentionedChannels[1];$noMentionMessage] +Replied! +``` +![image](https://user-images.githubusercontent.com/113247745/199210421-a7833741-34ff-4670-99d5-d756ef85629e.png) diff --git a/src/bdscript/replyIn.md b/src/bdscript/replyIn.md index cce02cf5083..ab954a4727c 100644 --- a/src/bdscript/replyIn.md +++ b/src/bdscript/replyIn.md @@ -1,19 +1,19 @@ -# $replyIn -The bot waits *x (amount of time)* before executing the code. - -## Syntax -``` -$replyIn[Time] -``` - -### Parameters -- `Time` `(Type: Duration || Flag: Required)`: How long the command is delayed for (e.g: 10s, 10m, 40m). (max is `40` minutes *(`120` minutes for premium users)*, min is `1` second) - -## Example -*The bot replies after 3 seconds of the command execution.* -``` -$nomention -$replyIn[3s] -Hi $displayName! -``` -![example](https://user-images.githubusercontent.com/111157596/234020126-ae36612d-11ae-4f36-80bd-69f771643603.gif) +# $replyIn +The bot waits *x (amount of time)* before executing the code. + +## Syntax +``` +$replyIn[Time] +``` + +### Parameters +- `Time` `(Type: Duration || Flag: Required)`: How long the command is delayed for (e.g: 10s, 10m, 40m). (max is `40` minutes *(`120` minutes for premium users)*, min is `1` second) + +## Example +*The bot replies after 3 seconds of the command execution.* +``` +$nomention +$replyIn[3s] +Hi $displayName! +``` +![example](https://user-images.githubusercontent.com/111157596/234020126-ae36612d-11ae-4f36-80bd-69f771643603.gif) diff --git a/src/bdscript/resetChannelVar.md b/src/bdscript/resetChannelVar.md index b5389524f7c..2d621b39b30 100644 --- a/src/bdscript/resetChannelVar.md +++ b/src/bdscript/resetChannelVar.md @@ -1,12 +1,12 @@ -# $resetChannelVar -Resets a channel variable back to its default value *(the one provided in the app)* **for every channel in every server**. - -> 🧙‍♂ī¸ Use this function wisely! - -## Syntax -``` -$resetChannelVar[Variable name] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. +# $resetChannelVar +Resets a channel variable back to its default value *(the one provided in the app)* **for every channel in every server**. + +> Use this function wisely! + +## Syntax +``` +$resetChannelVar[Variable name] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. diff --git a/src/bdscript/resetServerVar.md b/src/bdscript/resetServerVar.md index 011578a9597..8c1d9e2e270 100644 --- a/src/bdscript/resetServerVar.md +++ b/src/bdscript/resetServerVar.md @@ -1,12 +1,12 @@ -# $resetServerVar -Resets a server variable back to its default value *(the one inputted in the app)* **for every server**. - -> 🧙‍♂ī¸ Use this function wisely! - -## Syntax -``` -$resetServerVar[Variable name] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. +# $resetServerVar +Resets a server variable back to its default value *(the one inputted in the app)* **for every server**. + +> 🧙‍♂ī¸ Use this function wisely! + +## Syntax +``` +$resetServerVar[Variable name] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. diff --git a/src/bdscript/resetUserVar.md b/src/bdscript/resetUserVar.md index f848ec2100e..dcbce73960c 100644 --- a/src/bdscript/resetUserVar.md +++ b/src/bdscript/resetUserVar.md @@ -1,13 +1,13 @@ -# $resetUserVar -Resets a user variable back to its default value *(the one inputted in the app)* **for every user, or just the provided user**. - -> 🧙‍♂ī¸ Use this function wisely! - -## Syntax -``` -$resetUserVar[Variable name;(User ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. -- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to reset the variable for. If no user is provided, the variable will be reset for **everyone**. +# $resetUserVar +Resets a user variable back to its default value *(the one inputted in the app)* **for every user, or just the provided user**. + +> Use this function wisely! + +## Syntax +``` +$resetUserVar[Variable name;(User ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The name of the variable to reset. +- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to reset the variable for. If no user is provided, the variable will be reset for **everyone**. diff --git a/src/bdscript/roleCount.md b/src/bdscript/roleCount.md index 0a89f7793ec..c17f5fcd25f 100644 --- a/src/bdscript/roleCount.md +++ b/src/bdscript/roleCount.md @@ -1,15 +1,28 @@ -# $roleCount -Returns how many roles are in the current server. - -## Syntax -``` -$roleCount -``` - -## Example -``` -$nomention -There are $roleCount roles in $serverName[$guildID] -``` - -![example](https://imgur.com/cyGQeVT.png) +# $roleCount +Returns how many roles are in the current server. + +## Syntax +``` +$roleCount +``` + +## Example +``` +$nomention +This server currently has $roleCount role(s). +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This server currently has 19 role(s). +``` diff --git a/src/bdscript/roleExists.md b/src/bdscript/roleExists.md index e2374b9aee7..8df47951589 100644 --- a/src/bdscript/roleExists.md +++ b/src/bdscript/roleExists.md @@ -1,29 +1,29 @@ -# $roleExists -Returns whether or not the provided ID is an actual role. - -> 🧙‍♂ī¸ "true" means the role exists, "false" means it doesn't. - -## Syntax -``` -$roleExists[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake, String || Flag: Emptiable)`: The role to check for. - -## Examples -### Example #1 -``` -$nomention -$roleExists[1239039039030939] -$c[This role doesn't exist!] -``` -![example1](https://user-images.githubusercontent.com/69215413/126244456-b468fa0c-1134-4f31-b55d-4a331145a94d.png) - -### Example #2 -``` -$nomention -$roleExists[858334189899087943] -$c[This role exists!] -``` -![example2](https://user-images.githubusercontent.com/69215413/126244524-5d8ec2cb-2a6b-4ec7-abc4-bbb949f0e384.png) +# $roleExists +Returns whether or not the provided ID is an actual role. + +> "true" means the role exists, "false" means it doesn't. + +## Syntax +``` +$roleExists[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake, String || Flag: Emptiable)`: The role to check for. + +## Examples +### Example #1 +``` +$nomention +$roleExists[1239039039030939] +$c[This role doesn't exist!] +``` +![example1](https://user-images.githubusercontent.com/69215413/126244456-b468fa0c-1134-4f31-b55d-4a331145a94d.png) + +### Example #2 +``` +$nomention +$roleExists[858334189899087943] +$c[This role exists!] +``` +![example2](https://user-images.githubusercontent.com/69215413/126244524-5d8ec2cb-2a6b-4ec7-abc4-bbb949f0e384.png) diff --git a/src/bdscript/roleGrant.md b/src/bdscript/roleGrant.md index 5d205b4d288..ba9200a5d48 100644 --- a/src/bdscript/roleGrant.md +++ b/src/bdscript/roleGrant.md @@ -1,26 +1,26 @@ -# $roleGrant -Adds or removes roles from the provided user. - -## Syntax -``` -$roleGrant[User ID;+/-Role ID;...] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to grant roles to. -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to add or remove. Prepend `+` (to add it) or `-` (to remove it) to the role ID. Use semicolons `;` as a separator to separate multiple role IDs. - -## Examples -### Example #1 -``` -$nomention -$roleGrant[3869969062509936;-9368562753613496] -``` - -### Example #2 -``` -$nomention -$roleGrant[$mentioned[1];+$mentionedRoles[1]] -<@$mentioned[1]> user was given <@&$mentionedRoles[1]> role -``` -![example2](https://user-images.githubusercontent.com/42785890/153126389-d8c9bf0d-4fee-49ce-8e16-7dd39987a368.png) +# $roleGrant +Adds or removes roles from the provided user. + +## Syntax +``` +$roleGrant[User ID;+/-Role ID;...] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to grant roles to. +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role to add or remove. Prepend `+` (to add it) or `-` (to remove it) to the role ID. Use semicolons `;` as a separator to separate multiple role IDs. + +## Examples +### Example #1 +``` +$nomention +$roleGrant[3869969062509936;-9368562753613496] +``` + +### Example #2 +``` +$nomention +$roleGrant[$mentioned[1];+$mentionedRoles[1]] +<@$mentioned[1]> user was given <@&$mentionedRoles[1]> role +``` +![example2](https://user-images.githubusercontent.com/42785890/153126389-d8c9bf0d-4fee-49ce-8e16-7dd39987a368.png) diff --git a/src/bdscript/roleID.md b/src/bdscript/roleID.md index 297f2510ee6..2e494ee3b90 100644 --- a/src/bdscript/roleID.md +++ b/src/bdscript/roleID.md @@ -1,18 +1,18 @@ -# $roleID -Returns a role's ID using its name. - -## Syntax -``` -$roleID[Role name] -``` - -### Parameters -- `Role name` `(Type: String || Flag: Required)`: The name of the role for which to get its ID. - -## Example -``` -$nomention -Role ID For "$message": $roleID[$message] -``` - -![example](https://user-images.githubusercontent.com/69215413/126243977-63a4ae68-2005-48b7-8560-31fc2397a872.png) +# $roleID +Returns a role's ID using its name. + +## Syntax +``` +$roleID[Role name] +``` + +### Parameters +- `Role name` `(Type: String || Flag: Required)`: The name of the role for which to get its ID. + +## Example +``` +$nomention +Role ID For "$message": $roleID[$message] +``` + +![example](https://user-images.githubusercontent.com/69215413/126243977-63a4ae68-2005-48b7-8560-31fc2397a872.png) diff --git a/src/bdscript/roleInfo.md b/src/bdscript/roleInfo.md index 85a8ffb21c9..e15220fa391 100644 --- a/src/bdscript/roleInfo.md +++ b/src/bdscript/roleInfo.md @@ -1,36 +1,36 @@ -# $roleInfo -Returns information about the mentioned role. `$roleInfo` allows you to create a role info command without using a bunch of different functions at once. - -## Syntax -``` -$roleInfo[Message] -``` - -### Parameters -- `Message` `(Type: String || Flag: Required)`: The message format. Check below for more information. - -### Message format -You can use the following "commands" within `$roleInfo[]`: - -- `{name}` - Returns the role's name. -- `{ID}` - Returns the role's ID. -- `{mentionable}` - Returns if the role is mentionable by everyone. -- `{hoist}` - Returns if the role is hoisted (displayed separately). -- `{color}` - Returns the role's color. -- `{position}` - Returns the role's position on the "roles list". - -> 🧙‍♂ī¸ `$roleInfo[]` automatically generates a description. So, `$description[]` should not be used in the code. - -## Example -``` -$nomention -$roleInfo[Name: {name} -ID: {ID} -Mentionable?: {mentionable} -Hoisted?: {hoist} -Color: {color} -Position: {position}] -$title[Role Info] -``` - -![example](https://user-images.githubusercontent.com/69215413/122831224-8f4d7b80-d2b7-11eb-838a-fc2ba7cd7476.png) +# $roleInfo +Returns information about the mentioned role. `$roleInfo` allows you to create a role info command without using a bunch of different functions at once. + +## Syntax +``` +$roleInfo[Message] +``` + +### Parameters +- `Message` `(Type: String || Flag: Required)`: The message format. Check below for more information. + +### Message format +You can use the following "commands" within `$roleInfo[]`: + +- `{name}` - Returns the role's name. +- `{ID}` - Returns the role's ID. +- `{mentionable}` - Returns if the role is mentionable by everyone. +- `{hoist}` - Returns if the role is hoisted (displayed separately). +- `{color}` - Returns the role's color. +- `{position}` - Returns the role's position on the "roles list". + +> `$roleInfo[]` automatically generates a description. So, `$description[]` should not be used in the code. + +## Example +``` +$nomention +$roleInfo[Name: {name} +ID: {ID} +Mentionable?: {mentionable} +Hoisted?: {hoist} +Color: {color} +Position: {position}] +$title[Role Info] +``` + +![example](https://user-images.githubusercontent.com/69215413/122831224-8f4d7b80-d2b7-11eb-838a-fc2ba7cd7476.png) diff --git a/src/bdscript/roleName.md b/src/bdscript/roleName.md index 7ac64462ef0..8763f0adb01 100644 --- a/src/bdscript/roleName.md +++ b/src/bdscript/roleName.md @@ -1,18 +1,18 @@ -# $roleName -Returns a role's name using its ID. - -## Syntax -``` -$roleName[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role for which to get its name. - -## Example -``` -$nomention -$roleName[$highestRole[$authorID]] -``` - -![example](https://user-images.githubusercontent.com/69215413/126243723-36bf1e90-01bc-46af-bc81-2bbae05b0d01.png) +# $roleName +Returns a role's name using its ID. + +## Syntax +``` +$roleName[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role for which to get its name. + +## Example +``` +$nomention +$roleName[$highestRole[$authorID]] +``` + +![example](https://user-images.githubusercontent.com/69215413/126243723-36bf1e90-01bc-46af-bc81-2bbae05b0d01.png) diff --git a/src/bdscript/roleNames.md b/src/bdscript/roleNames.md index ce58d524c1d..cadf51bc2dd 100644 --- a/src/bdscript/roleNames.md +++ b/src/bdscript/roleNames.md @@ -1,15 +1,15 @@ -# $roleNames -Returns the name of every role in the current server. - -## Syntax -``` -$roleNames -``` - -## Example -``` -$nomention -$description[Server Roles: $roleNames] -``` - -![example](https://user-images.githubusercontent.com/69215413/125832346-7f0914e3-64c3-435e-8438-6f216c0e5fbf.png) +# $roleNames +Returns the name of every role in the current server. + +## Syntax +``` +$roleNames +``` + +## Example +``` +$nomention +$description[Server Roles: $roleNames] +``` + +![example](https://user-images.githubusercontent.com/69215413/125832346-7f0914e3-64c3-435e-8438-6f216c0e5fbf.png) diff --git a/src/bdscript/rolePosition.md b/src/bdscript/rolePosition.md index becce66f64a..873e489e32b 100644 --- a/src/bdscript/rolePosition.md +++ b/src/bdscript/rolePosition.md @@ -1,18 +1,18 @@ -# $rolePosition -Returns a role's position *(1 being the highest role)*. - -## Syntax -``` -$rolePosition[Role ID] -``` - -### Parameters -- `Role ID` `(Type: Snowflake || Flag: Required)`: The role for which to get its position. - -## Example -``` -$nomention -$description[<@&$findRole[$message]>'s Position: $rolePosition[$findRole[$message]]] -``` - -![example](https://user-images.githubusercontent.com/69215413/126246527-d3ca814d-8c7d-4acf-bb1e-ec7286c741f0.png) +# $rolePosition +Returns a role's position *(1 being the highest role)*. + +## Syntax +``` +$rolePosition[Role ID] +``` + +### Parameters +- `Role ID` `(Type: Snowflake || Flag: Required)`: The role for which to get its position. + +## Example +``` +$nomention +$description[<@&$findRole[$message]>'s Position: $rolePosition[$findRole[$message]]] +``` + +![example](https://user-images.githubusercontent.com/69215413/126246527-d3ca814d-8c7d-4acf-bb1e-ec7286c741f0.png) diff --git a/src/bdscript/round.md b/src/bdscript/round.md index 2b2fbe2e96a..477561f5426 100644 --- a/src/bdscript/round.md +++ b/src/bdscript/round.md @@ -1,32 +1,45 @@ -# $round -Rounds up the provided number. - -## Syntax -``` -$round[Number;(Decimal place)] -``` - -### Parameters -- `Number` `(Type: Float || Flag: Required)`: The number to round. -- `Decimal place` `(Type: Integer || Flag: Vacantable)`: The number of decimal places to round the number to. Defaults to `0`. - -## Example -``` -$nomention -Result: $round[100.123;1] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Result: 100.1 -``` +# $round +Rounds up the provided number. + +## Syntax +``` +$round[Number;(Decimal place)] +``` + +### Parameters +- `Number` `(Type: Float || Flag: Required)`: The number to round. +- `Decimal place` `(Type: Integer || Flag: Vacantable)`: The number of decimal places to round the number to. Defaults to `0`. + +## Example +``` +$nomention +Result: $round[100.123;1] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Result: 100.1 +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $round[] +
+
+

Output:

+ Result: 1 +
+
diff --git a/src/bdscript/rulesChannelID.md b/src/bdscript/rulesChannelID.md new file mode 100644 index 00000000000..8b724d5d2d0 --- /dev/null +++ b/src/bdscript/rulesChannelID.md @@ -0,0 +1,78 @@ +# $rulesChannelID +Returns the servers rule channel's ID (**returns an error if there isn't such a channel*") + +## Syntax +``` +$rulesChannelID[(Guild ID)] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to get the rule channel's ID. + +## Example +``` +$nomention +Rule channel's ID: $rulesChannelID[$guildID] +``` + +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Rule channel's ID: 594598851155984426 +``` + +~~~admonish tip title="How to stop the error message?" +The `$rulesChannelID[]` function as said in above returns an error if there isn't any rule channel set on the server and there is a way to stop that. +``` +$nomention +$try + Rule channel's ID: $ruleChannelID[$guildID] +$catch + No rule channel found! +$endtry +``` + +- Without try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Function $rulesChannelID at 2:33 returned an error: No rule channel set in this server! +``` + +- With try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + No rule channel found! +``` + +> For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). + +~~~ diff --git a/src/bdscript/scriptLanguage.md b/src/bdscript/scriptLanguage.md index 82ce9705866..c1d5e4e7aaa 100644 --- a/src/bdscript/scriptLanguage.md +++ b/src/bdscript/scriptLanguage.md @@ -1,21 +1,21 @@ -# $scriptLanguage -Returns the name of scripting language used by the command. - -## Syntax -``` -$scriptLanguage -``` - -## Example -``` -$nomention -This command uses `$scriptLanguage`. -``` -![](https://user-images.githubusercontent.com/70456337/183467283-fb264df3-27ea-4111-85bd-9d336d221fa9.png) - -> **Note:** After each execution of the command, we changed the script to another one. - -### Output value -- BDScript -- BDScript 2 +# $scriptLanguage +Returns the name of scripting language used by the command. + +## Syntax +``` +$scriptLanguage +``` + +## Example +``` +$nomention +This command uses `$scriptLanguage`. +``` +![](https://user-images.githubusercontent.com/70456337/183467283-fb264df3-27ea-4111-85bd-9d336d221fa9.png) + +> **Note:** After each execution of the command, we changed the script to another one. + +### Output value +- BDScript +- BDScript 2 - BDScript Unstable \ No newline at end of file diff --git a/src/bdscript/second.md b/src/bdscript/second.md index f45b86dcb2b..db369263e1b 100644 --- a/src/bdscript/second.md +++ b/src/bdscript/second.md @@ -1,32 +1,34 @@ -# $second -Returns the current second of this minute. - -> You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$second -``` - -## Example -``` -$nomention -Current Second: $second -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | -
-``` - - +# $second +Returns the current second of this minute. + +## Syntax +``` +$second +``` + +## Example +``` +$nomention +Current Second: $second +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/bdscript/sendEmbedMessage.md b/src/bdscript/sendEmbedMessage.md index 6dbc6193abd..932e74b1cfe 100644 --- a/src/bdscript/sendEmbedMessage.md +++ b/src/bdscript/sendEmbedMessage.md @@ -1,30 +1,30 @@ -# $sendEmbedMessage -Sends an embed message to the provided channel. Not needed fields can be left empty. - -## Syntax -``` -$sendEmbedMessage[Channel ID;Content;(Title;Title URL;Description;Color;Author;Author icon;Footer;Footer icon;Thumbnail;Image;Add timestamp?;Return ID?)] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message will be sent to. -- `Content` `(Type: String || Flag: Emptiable)`: The text that is shown above the embed. -- `Title` `(Type: String || Flag: Vacantable)`: The text that will be used as the title. -- `Title URL` `(Type: URL || Flag: Vacantable)`: The URL that will be applied to the title. -- `Description` `(Type: String || Flag: Vacantable)`: The description that will be applied to the embed. -- `Color` `(Type: Color || Flag: Vacantable)`: The [color hex](https://htmlcolorcodes.com/color-picker/) or integer to set the embed border color as. -- `Author` `(Type: String || Flag: Vacantable )`: The text that appears at the author. -- `Author icon` `(Type: URL || Flag: Vacantable)`: The image that appears next to the author. Must be a valid image URL. -- `Footer` `(Type: String || Flag: Vacantable)`: The text to set the footer as. -- `Footer icon` `(Type: URL || Flag: Vacantable)`: The image that appears next to the footer. Must be a valid image URL. -- `Thumbnail` `(Type: URL || Flag: Vacantable)`: The image to set as the thumbnail. -- `Image` `(Type: URL || Flag: Vacantable)`: The image that appears above the footer. Must be a valid image URL. -- `Add timestamp?` `(Type: Bool || Flag: Vacantable)`: Adds a timestamp to the footer (use `yes` or `no`). -- `Return ID?` `(Type: Bool || Flag: Vacantable)`: Outputs the message ID outside the embed (use `yes` or `no`). - -## Example -``` -$nomention -$sendEmbedMessage[$channelID;;Title;https://discord.com/;description;000000;author;$authorAvatar;footer;$authorAvatar;$authorAvatar;$authorAvatar;no;no] -``` -![image](https://user-images.githubusercontent.com/42785890/151873621-10b17532-93ee-421c-8eea-515f40f1a124.png) +# $sendEmbedMessage +Sends an embed message to the provided channel. Not needed fields can be left empty. + +## Syntax +``` +$sendEmbedMessage[Channel ID;Content;(Title;Title URL;Description;Color;Author;Author icon;Footer;Footer icon;Thumbnail;Image;Add timestamp?;Return ID?)] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message will be sent to. +- `Content` `(Type: String || Flag: Emptiable)`: The text that is shown above the embed. +- `Title` `(Type: String || Flag: Vacantable)`: The text that will be used as the title. +- `Title URL` `(Type: URL || Flag: Vacantable)`: The URL that will be applied to the title. +- `Description` `(Type: String || Flag: Vacantable)`: The description that will be applied to the embed. +- `Color` `(Type: Color || Flag: Vacantable)`: The [color hex](https://htmlcolorcodes.com/color-picker/) or integer to set the embed border color as. +- `Author` `(Type: String || Flag: Vacantable )`: The text that appears at the author. +- `Author icon` `(Type: URL || Flag: Vacantable)`: The image that appears next to the author. Must be a valid image URL. +- `Footer` `(Type: String || Flag: Vacantable)`: The text to set the footer as. +- `Footer icon` `(Type: URL || Flag: Vacantable)`: The image that appears next to the footer. Must be a valid image URL. +- `Thumbnail` `(Type: URL || Flag: Vacantable)`: The image to set as the thumbnail. +- `Image` `(Type: URL || Flag: Vacantable)`: The image that appears above the footer. Must be a valid image URL. +- `Add timestamp?` `(Type: Bool || Flag: Vacantable)`: Adds a timestamp to the footer (use `yes` or `no`). +- `Return ID?` `(Type: Bool || Flag: Vacantable)`: Outputs the message ID outside the embed (use `yes` or `no`). + +## Example +``` +$nomention +$sendEmbedMessage[$channelID;;Title;https://discord.com/;description;000000;author;$authorAvatar;footer;$authorAvatar;$authorAvatar;$authorAvatar;no;no] +``` +![image](https://user-images.githubusercontent.com/42785890/151873621-10b17532-93ee-421c-8eea-515f40f1a124.png) diff --git a/src/bdscript/sendMessage.md b/src/bdscript/sendMessage.md index 800f630bb34..420539e867e 100644 --- a/src/bdscript/sendMessage.md +++ b/src/bdscript/sendMessage.md @@ -1,30 +1,30 @@ -# $sendMessage -Sends a new message to the current channel. - -## Syntax -``` -$sendMessage[Text;(Return message ID?)] -``` - -### Parameters -- `Text` `(Type: String || Flag: Required)`: The text to send in the new message. -- `Return message ID?` `(Type: Bool || Flag: Optional)`: Whether to return the ID of the newly sent message, in another message. Defaults to `no`. - -## Examples -### Example #1 -``` -$nomention -$sendMessage[This is message #1!] -$sendMessage[This is message #2!] -$sendMessage[This is message #3!] -``` -![example1](https://user-images.githubusercontent.com/69215413/126246807-7beaac06-4fd4-4ae3-a944-dcc66f7c0774.png) - - -### Example #2 -``` -$nomention -$sendMessage[This is message #1!;yes] -$sendMessage[This is message #2!;yes] -``` -![example2](https://user-images.githubusercontent.com/69215413/126246945-2fb29b3f-ab58-4de3-8341-a56a574db423.png) +# $sendMessage +Sends a new message to the current channel. + +## Syntax +``` +$sendMessage[Text;(Return message ID?)] +``` + +### Parameters +- `Text` `(Type: String || Flag: Required)`: The text to send in the new message. +- `Return message ID?` `(Type: Bool || Flag: Optional)`: Whether to return the ID of the newly sent message, in another message. Defaults to `no`. + +## Examples +### Example #1 +``` +$nomention +$sendMessage[This is message #1!] +$sendMessage[This is message #2!] +$sendMessage[This is message #3!] +``` +![example1](https://user-images.githubusercontent.com/69215413/126246807-7beaac06-4fd4-4ae3-a944-dcc66f7c0774.png) + + +### Example #2 +``` +$nomention +$sendMessage[This is message #1!;yes] +$sendMessage[This is message #2!;yes] +``` +![example2](https://user-images.githubusercontent.com/69215413/126246945-2fb29b3f-ab58-4de3-8341-a56a574db423.png) diff --git a/src/bdscript/serverChannelExists.md b/src/bdscript/serverChannelExists.md index 857914555a2..86475c971b3 100644 --- a/src/bdscript/serverChannelExists.md +++ b/src/bdscript/serverChannelExists.md @@ -1,17 +1,17 @@ -# $serverChannelExists -Checks if the channel exists in the current server. - -## Syntax -``` -$serverChannelExists[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake, String || Flag: Emptiable)`: Returns "true" if the channel exists, otherwise "false" is returned. - -## Example -``` -$nomention -$serverChannelExists[$message[1]] -``` -![example](https://user-images.githubusercontent.com/111157596/234031742-e57f230d-5086-4552-83e9-31b6c6bbe7b6.png) +# $serverChannelExists +Checks if the channel exists in the current server. + +## Syntax +``` +$serverChannelExists[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake, String || Flag: Emptiable)`: Returns "true" if the channel exists, otherwise "false" is returned. + +## Example +``` +$nomention +$serverChannelExists[$message[1]] +``` +![example](https://user-images.githubusercontent.com/111157596/234031742-e57f230d-5086-4552-83e9-31b6c6bbe7b6.png) diff --git a/src/bdscript/serverCooldown.md b/src/bdscript/serverCooldown.md index 570029b561f..eff93f443b8 100644 --- a/src/bdscript/serverCooldown.md +++ b/src/bdscript/serverCooldown.md @@ -1,13 +1,13 @@ -# $serverCooldown -Sets a server cooldown. After the command is used, no one in the server will be able to run the command until the `Duration` is up. - -## Syntax -``` -$serverCooldown[Duration;Error message] -``` - -### Parameters -- `Duration` `(Type: Duration || Flag: Required)`: The duration of this cooldown. -- `Error message` `(Type: String || Flag: Emptiable)`: The error to return when the cooldown is still ongoing. - -> 🧙‍♂ī¸ You can use `%time%` to get how much time is left on the cooldown, in `Error message`. +# $serverCooldown +Sets a server cooldown. After the command is used, no one in the server will be able to run the command until the `Duration` is up. + +## Syntax +``` +$serverCooldown[Duration;Error message] +``` + +### Parameters +- `Duration` `(Type: Duration || Flag: Required)`: The duration of this cooldown. +- `Error message` `(Type: String || Flag: Emptiable)`: The error to return when the cooldown is still ongoing. + +> You can use `%time%` to get how much time is left on the cooldown, in `Error message`. diff --git a/src/bdscript/serverCount.md b/src/bdscript/serverCount.md index fd2efd59271..460ce2166f1 100644 --- a/src/bdscript/serverCount.md +++ b/src/bdscript/serverCount.md @@ -1,30 +1,30 @@ -# $serverCount -Returns how many servers the bot is in. - -## Syntax -``` -$serverCount -``` - -## Example -``` -$nomention -I'm currently in $serverCount servers! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - I'm currently in 203 servers! -``` - -> Can be used in bot status +# $serverCount +Returns how many servers the bot is in. + +## Syntax +``` +$serverCount +``` + +## Example +``` +$nomention +I'm currently in $serverCount servers! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + I'm currently in 203 servers! +``` + +> Can be used in bot status diff --git a/src/bdscript/serverDescription.md b/src/bdscript/serverDescription.md index 1e81fced9de..9ce776f180e 100644 --- a/src/bdscript/serverDescription.md +++ b/src/bdscript/serverDescription.md @@ -1,28 +1,28 @@ -# $serverDescription -Returns server description. Returns an empty result if the server has no description. - -## Syntax -``` -$serverDescription -``` - -## Example -``` -$nomention -Server description: $serverDescription -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Server description: Welcome to the Official Bot Designer For Discord community server! -``` +# $serverDescription +Returns server description. Returns an empty result if the server has no description. + +## Syntax +``` +$serverDescription +``` + +## Example +``` +$nomention +Server description: $serverDescription +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Server description: Welcome to the Official Bot Designer For Discord community server! +``` diff --git a/src/bdscript/serverDescriptionComplex.md b/src/bdscript/serverDescriptionComplex.md index f0822489d8d..70e712eaf62 100644 --- a/src/bdscript/serverDescriptionComplex.md +++ b/src/bdscript/serverDescriptionComplex.md @@ -1,31 +1,31 @@ -# $serverDescription[] -Returns the server's description of provided guild ID. Returns an empty result if the server has no description. - -## Syntax -``` -$serverDescription[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server from which to get the description. - -## Example -``` -$nomention -Server description: $serverDescription[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 1009018669982031912 -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Server description: Welcome to the BDFD Support server! Enjoy stay with us! -``` +# $serverDescription[] +Returns the server's description of provided guild ID. Returns an empty result if the server has no description. + +## Syntax +``` +$serverDescription[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server from which to get the description. + +## Example +``` +$nomention +Server description: $serverDescription[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1009018669982031912 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Server description: Welcome to the BDFD Support server! Enjoy stay with us! +``` diff --git a/src/bdscript/serverEmojis.md b/src/bdscript/serverEmojis.md index 843886a8b33..e6c04add054 100644 --- a/src/bdscript/serverEmojis.md +++ b/src/bdscript/serverEmojis.md @@ -1,18 +1,18 @@ -# $serverEmojis -Returns all emojis of the provided guild. - -## Syntax -``` -$serverEmojis[Guild ID;Separator] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild from which to return emojis. -- `Separator` `(Type: String || Flag: Emptiable)`: The separator to separate the emojis with. - -## Example -``` -$nomention -$serverEmojis[$guildID; ] -``` -![example](https://user-images.githubusercontent.com/95774950/202883215-04ca23ce-b9c4-4828-ac98-22b0dd69e731.png) +# $serverEmojis +Returns all emojis of the provided guild. + +## Syntax +``` +$serverEmojis[Guild ID;Separator] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild from which to return emojis. +- `Separator` `(Type: String || Flag: Emptiable)`: The separator to separate the emojis with. + +## Example +``` +$nomention +$serverEmojis[$guildID; ] +``` +![example](https://user-images.githubusercontent.com/95774950/202883215-04ca23ce-b9c4-4828-ac98-22b0dd69e731.png) diff --git a/src/bdscript/serverIcon.md b/src/bdscript/serverIcon.md index 4d21fec6721..506fd7c7a4b 100644 --- a/src/bdscript/serverIcon.md +++ b/src/bdscript/serverIcon.md @@ -1,14 +1,14 @@ -# $serverIcon -Returns the current server's icon. - -## Syntax -``` -$serverIcon -``` - -## Example -``` -$nomention -$image[$serverIcon] -``` -![example](https://user-images.githubusercontent.com/111157596/231850327-e2d0f75b-4b80-49d4-8936-d43de69789e3.png) +# $serverIcon +Returns the current server's icon. + +## Syntax +``` +$serverIcon +``` + +## Example +``` +$nomention +$image[$serverIcon] +``` +![example](https://user-images.githubusercontent.com/111157596/231850327-e2d0f75b-4b80-49d4-8936-d43de69789e3.png) diff --git a/src/bdscript/serverIconComplex.md b/src/bdscript/serverIconComplex.md index 9db1ebda288..785d634500e 100644 --- a/src/bdscript/serverIconComplex.md +++ b/src/bdscript/serverIconComplex.md @@ -1,17 +1,17 @@ -# $serverIcon[] -Returns server icon for the given server ID. - -## Syntax -``` -$serverIcon[Server ID] -``` - -### Parameters -- `Server ID` `(Type: Snowflake || Flag: Required)`: The server from which to get the icon. - -## Example -``` -$nomention -$image[$serverIcon[566363823137882154]] -``` -![example](https://user-images.githubusercontent.com/69215413/126366328-80246e22-4e8c-41f6-9cb0-c0b547236c66.png) +# $serverIcon[] +Returns server icon for the given server ID. + +## Syntax +``` +$serverIcon[Server ID] +``` + +### Parameters +- `Server ID` `(Type: Snowflake || Flag: Required)`: The server from which to get the icon. + +## Example +``` +$nomention +$image[$serverIcon[566363823137882154]] +``` +![example](https://user-images.githubusercontent.com/69215413/126366328-80246e22-4e8c-41f6-9cb0-c0b547236c66.png) diff --git a/src/bdscript/serverInfo.md b/src/bdscript/serverInfo.md index a9a2dbc3a4d..461d46af94c 100644 --- a/src/bdscript/serverInfo.md +++ b/src/bdscript/serverInfo.md @@ -1,38 +1,38 @@ -# $serverInfo -Allows you to make a server info command without using a bunch of different functions at once. This function returns info about the current server. - -> ⚠ī¸ You can not include `$serverInfo[]` in a command with a [`$description[]`](./description.md) (because it makes one automatically). - -## Syntax -``` -$serverInfo[Message;(Thumbnail?)] -``` - -### Parameters -- `Message` `(Type: String || Flag: Required)`: The message format. Check [below](#subset-functions) for more information. -- `Thumbnail?` `(Type: Bool || Flag: Optional)`: Whether or not to show the server icon as the thumbnail. The default is `yes`. - -### Subset-Functions -You can use the following "subset-functions" within `$serverInfo[]`: -- `{name}` - Returns the server's name. -- `{region}` - Returns the server's region. -- `{emoji}` - Returns the server's emojis in a list. -- `{owner}` - Returns the server owner's username. -- `{ID}` - Returns the server's ID. -- `{verificationLvl}` - Returns the server's verification level. -- `{large}` - Finds out if the server is considered "large". Returns `true` or `false`. - -## Example -``` -$nomention -$title[Server Info] -$serverInfo[Server Name: {name} -Region: {region} -Owner: {owner} -Server ID: {ID} -Verify Level: {verificationLvl} -Emojis: {emoji} -Large Server?: {large};no] -``` - -![example](https://user-images.githubusercontent.com/69215413/122832982-3206f980-d2ba-11eb-9a31-8f94cad26df7.png) +# $serverInfo +Allows you to make a server info command without using a bunch of different functions at once. This function returns info about the current server. + +> ⚠ī¸ You can not include `$serverInfo[]` in a command with a [`$description[]`](./description.md) (because it makes one automatically). + +## Syntax +``` +$serverInfo[Message;(Thumbnail?)] +``` + +### Parameters +- `Message` `(Type: String || Flag: Required)`: The message format. Check [below](#subset-functions) for more information. +- `Thumbnail?` `(Type: Bool || Flag: Optional)`: Whether or not to show the server icon as the thumbnail. The default is `yes`. + +### Subset-Functions +You can use the following "subset-functions" within `$serverInfo[]`: +- `{name}` - Returns the server's name. +- `{region}` - Returns the server's region. +- `{emoji}` - Returns the server's emojis in a list. +- `{owner}` - Returns the server owner's username. +- `{ID}` - Returns the server's ID. +- `{verificationLvl}` - Returns the server's verification level. +- `{large}` - Finds out if the server is considered "large". Returns `true` or `false`. + +## Example +``` +$nomention +$title[Server Info] +$serverInfo[Server Name: {name} +Region: {region} +Owner: {owner} +Server ID: {ID} +Verify Level: {verificationLvl} +Emojis: {emoji} +Large Server?: {large};no] +``` + +![example](https://user-images.githubusercontent.com/69215413/122832982-3206f980-d2ba-11eb-9a31-8f94cad26df7.png) diff --git a/src/bdscript/serverLeaderboard.md b/src/bdscript/serverLeaderboard.md index 4c3faa4a2a2..a20cfc905fd 100644 --- a/src/bdscript/serverLeaderboard.md +++ b/src/bdscript/serverLeaderboard.md @@ -1,15 +1,46 @@ -# $serverLeaderboard -Creates a server leaderboard (top-10). - -> 🧙‍♂ī¸ `$serverLeaderboard` automatically generates a description. So, `$description` should not be used in the code. - -## Syntax -``` -$serverLeaderboard[Variable name;(Sort type)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. -- `Sort type` `(Type: Enum || Flag: Optional)`: The sort type of the values (default is `desc`). Sort types: - - `asc` - Sorts the values in ascending order. - - `desc` - Sorts the values in descending order. +# $serverLeaderboard +Creates a server leaderboard (top-10). + +```admonish warning +`$serverLeaderboard[]` automatically generates a description. So, [`$description[]`](./description.md) of index `1` **should be avoided** in the code. +``` + +## Syntax +``` +$serverLeaderboard[Variable name;(Sort type)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. +- `Sort type` `(Type: Enum || Flag: Optional)`: The sort type of the values (default is `desc`). Sort types: + - `asc` - Sorts the values in ascending order. + - `desc` - Sorts the values in descending order. + +## Example +``` +$nomention +$serverLeaderboard[Reputation;asc] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + embed: + description: "1. Bot Designer for Discord Official Server - 89\n +2. Bot Designer List - 63\n +3. B. Support - 60\n +4. BDFD Appeals Server - 42" +``` + +```admonish question title="Why is my leaderboard showing inaccurate values?" +Leaderboard values are not updated in real-time. The previous values are cached for a short duration. It will take about 5 minutes to show the updated values. +``` diff --git a/src/bdscript/serverName.md b/src/bdscript/serverName.md index abb1da873d7..5cf7d8661a7 100644 --- a/src/bdscript/serverName.md +++ b/src/bdscript/serverName.md @@ -1,19 +1,36 @@ -# $serverName -Returns a server's name. - -## Syntax -``` -$serverName[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server to get the name of. Use [`$guildID`](./guildID.md) for the current server. - -> 🧙‍♂ī¸ The bot must be present in the server to return its name. - -## Example -``` -$nomention -Server Name: $serverName[$guildID] -``` -![example](https://user-images.githubusercontent.com/69215413/126522125-78166781-6dbf-4dbd-8000-ed4262ca5db8.png) +# $serverName +Returns a server's name. + +## Syntax +``` +$serverName[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server to get the name of. Use [`$guildID`](./guildID.md) for the current server. + +> The bot must be present in the server to return its name. + +## Example +``` +$nomention +Server Name: $serverName[$guildID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Server Name: Bot Designer for Discord Official Server +``` + +```admonish question title="What is this?" +How [`$guildID`](./guildID.md) works? +``` diff --git a/src/bdscript/serverNames.md b/src/bdscript/serverNames.md index bceeb0427ca..8403cf7ef7a 100644 --- a/src/bdscript/serverNames.md +++ b/src/bdscript/serverNames.md @@ -1,28 +1,28 @@ -# $serverNames -Returns 10 server names in which the bot is in. - -## Syntax -``` -$serverNames -``` - -## Example -``` -$nomention -$serverNames -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Bot Designer for Discord Official Server, B. Support, Bot Designer List, BDFD Appeals Server, Synthexia, Roblox, Minecraft, Discord Developers, Discord API, BDFD Development -``` +# $serverNames +Returns 10 server names in which the bot is in. + +## Syntax +``` +$serverNames +``` + +## Example +``` +$nomention +$serverNames +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Bot Designer for Discord Official Server, B. Support, Bot Designer List, BDFD Appeals Server, Synthexia, Roblox, Minecraft, Discord Developers, Discord API, BDFD Development +``` diff --git a/src/bdscript/serverNamesComplex.md b/src/bdscript/serverNamesComplex.md index 5fbb1aa4f53..9249eeb4bb3 100644 --- a/src/bdscript/serverNamesComplex.md +++ b/src/bdscript/serverNamesComplex.md @@ -1,19 +1,34 @@ -# $serverNames[] -Returns *x* server names in which the bot is in. - -## Syntax -``` -$serverNames[Amount;Separator] -``` - -### Parameters -- `Amount` `(Type: Integer || Flag: Required)`: The amount of server names you want. Use `-1` if you want to return all server names. -- `Separator` `(Type: String || Flag: Emptiable)`: A custom separator for separating the server names. - -## Example -``` -$nomention -$serverNames[3; -] -``` -![example](https://user-images.githubusercontent.com/111157596/232112782-0912f671-eb2b-4c5b-814d-df6544a710cd.png) +# $serverNames[] +Returns *x* (`Amoount`) server names in which the bot is in. + +## Syntax +``` +$serverNames[Amount;Separator] +``` + +### Parameters +- `Amount` `(Type: Integer || Flag: Required)`: The amount of server names you want. Use `-1` if you want to return all server names. +- `Separator` `(Type: String || Flag: Emptiable)`: A custom separator for separating the server names. + +## Example +``` +$nomention +$serverNames[3; +] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: "Bot Designer for Discord Official Server\n + B. Support\n + Bot Designer List" +``` diff --git a/src/bdscript/serverOwner.md b/src/bdscript/serverOwner.md index 83386a4a5ec..56bf4ecbd32 100644 --- a/src/bdscript/serverOwner.md +++ b/src/bdscript/serverOwner.md @@ -1,30 +1,29 @@ -# $serverOwner -Returns the ID of the current server's owner. - -## Syntax -``` -$serverOwner -``` - -## Example -``` -$nomention -This server is owned by <@$serverOwner>! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - highlight: true - content: | - This server is owned by <@RainbowKey>! -``` +# $serverOwner +Returns the ID of the current server's owner. + +## Syntax +``` +$serverOwner +``` + +## Example +``` +$nomention +This server is owned by <@$serverOwner>! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + highlight: true + content: | + This server is owned by <@RainbowKey>! +``` diff --git a/src/bdscript/serverOwnerComplex.md b/src/bdscript/serverOwnerComplex.md index a0d160fc615..6e0b7cb841e 100644 --- a/src/bdscript/serverOwnerComplex.md +++ b/src/bdscript/serverOwnerComplex.md @@ -1,35 +1,38 @@ -# $serverOwner[] -Returns the ID of the provided server's owner. - -## Syntax -``` -$serverOwner[Guild ID] -``` - -### Parameters -- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server to get the owner ID for. - -> The bot must be present in the server in order to get the server owner ID. - -## Example -``` -$nomention -This server is owned by <@$serverOwner[$guildID]>! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - This server is owned by <@RainbowKey>! - highlight: true -``` +# $serverOwner[] +Returns the ID of the provided server's owner. + +## Syntax +``` +$serverOwner[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The server to get the owner ID for. + +> The bot must be present in the server in order to get the server owner ID. + +## Example +``` +$nomention +This server is owned by <@$serverOwner[$guildID]>! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + This server is owned by <@RainbowKey>! + highlight: true +``` + +```admonish question title="What is this?" +How [`$guildID`](./guildID.md) works? +``` diff --git a/src/bdscript/serverRegion.md b/src/bdscript/serverRegion.md index 664d6bf1e6f..dd83280957c 100644 --- a/src/bdscript/serverRegion.md +++ b/src/bdscript/serverRegion.md @@ -1,33 +1,34 @@ -# $serverRegion -*(deprecated)* - -> This function is deprecated, because Discord removed the server region setting. For more information, [click here](https://support.discord.com/hc/en-us/articles/360060570993). - -Returns the server's region. - -## Syntax -``` -$serverRegion -``` - -## Example -``` -$nomention -Server Region: $serverRegion -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - Server Region: europe -``` +# $serverRegion +
+ Deprecated +
+ +> This function is deprecated, because Discord removed the server region setting. For more information, [click here](https://support.discord.com/hc/en-us/articles/360060570993). + +Returns the server's region. + +## Syntax +``` +$serverRegion +``` + +## Example +``` +$nomention +Server Region: $serverRegion +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Server Region: europe +``` diff --git a/src/bdscript/serverVerificationLvl.md b/src/bdscript/serverVerificationLvl.md index 03cda2a6563..4dc0dae1432 100644 --- a/src/bdscript/serverVerificationLvl.md +++ b/src/bdscript/serverVerificationLvl.md @@ -1,29 +1,27 @@ -# $serverVerificationLvl -The server's verification level. Returns `None`, `Low`, `Medium`, `High`, or `Very High`. - -## Syntax -``` -$serverVerificationLvl -``` - -## Example -``` -$nomention -This server's verification level is $serverVerificationLvl -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - This server's verification level is Low -``` +# $serverVerificationLvl +The server's verification level. Returns `None`, `Low`, `Medium`, `High`, or `Very High`. + +## Syntax +``` +$serverVerificationLvl +``` + +## Example +``` +$nomention +This server's verification level is $serverVerificationLvl +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This server's verification level is Low +``` diff --git a/src/bdscript/setChannelVar.md b/src/bdscript/setChannelVar.md index b3d5291bd2f..a6e248c75b3 100644 --- a/src/bdscript/setChannelVar.md +++ b/src/bdscript/setChannelVar.md @@ -1,16 +1,16 @@ -# $setChannelVar -Updates a variable's value for a channel. - -## Syntax -``` -$setChannelVar[Variable name;New value;(Channel ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to update. -- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. -- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to assign the new value to. If no "Channel ID" is present, the current channel will be used. - -> 📝 Channel variable values have a max character limit of **499** *(for premium users, it's **4999**)*. - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $setChannelVar +Updates a variable's value for a channel. + +## Syntax +``` +$setChannelVar[Variable name;New value;(Channel ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to update. +- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel to assign the new value to. If no "Channel ID" is present, the current channel will be used. + +> 📝 Channel variable values have a max character limit of **499** *(for premium users, it's **4999**)*. + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/setServerVar.md b/src/bdscript/setServerVar.md index daca2a2e5c4..c5b08865cca 100644 --- a/src/bdscript/setServerVar.md +++ b/src/bdscript/setServerVar.md @@ -1,16 +1,16 @@ -# $setServerVar -Updates a variable's value for a server. - -## Syntax -``` -$setServerVar[Variable name;New value;(Server ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to update. -- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. -- `Server ID` `(Type: Snowflake || Flag: Optional)`: The server to assign the new value to. Uses the current server if no "Server ID" is provided. - -> 📝 Server variable values have a max character limit of **499** _(for premium users, it's **4999**)_. - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $setServerVar +Updates a variable's value for a server. + +## Syntax +``` +$setServerVar[Variable name;New value;(Server ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to update. +- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. +- `Server ID` `(Type: Snowflake || Flag: Optional)`: The server to assign the new value to. Uses the current server if no "Server ID" is provided. + +> 📝 Server variable values have a max character limit of **499** _(for premium users, it's **4999**)_. + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/setUserRoles.md b/src/bdscript/setUserRoles.md index 2684ee4b966..3d782ab090a 100644 --- a/src/bdscript/setUserRoles.md +++ b/src/bdscript/setUserRoles.md @@ -1,63 +1,71 @@ -# $setUserRoles -Overrides all roles of the given user. - -## Syntax -``` -$setUserRoles[User ID;Role ID;...] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: ID of the user to set the role. -- `Role ID` `(Type: Snowflake || Flag: Required)`: Roles to be given to the user. Separate roles using `;`. - -## Example -``` -$nomention -$setUserRoles[$authorID;$roleID[Support]] -We've reset all your roles! Now you have "Support" role. -``` -*In this example, we will remove all roles and give one role with "Support" name*. - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - content: | - !roles -- user_id: 1009018156494368798 - username: BDFD Support - bot: true - verified: true - content: | - Cool - BDFD - Moderator -- user_id: 803569638084313098 - username: RainbowKey - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - bot: true - verified: true - content: | - We've reset all your roles! Now you have "Support" role. -- user_id: 803569638084313098 - username: RainbowKey - content: | - !roles -- user_id: 1009018156494368798 - username: BDFD Support - bot: true - verified: true - content: | - Support -``` - -> How [$roleID[]](./roleID.md) and [$authorID](./authorID.md) works? - -### Code for `!roles` command: -``` -$nomention -$userRoles[$authorID] -``` -> [How $userRoles[] works?](./userRoles.md) +# $setUserRoles +Overrides all roles of the given user. + +## Syntax +``` +$setUserRoles[User ID;Role ID;...] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: ID of the user to set the role. +- `Role ID` `(Type: Snowflake || Flag: Required)`: Roles to be given to the user. Separate roles using `;`. + +## Example +1. Create two commands and set the trigger `!example` for one command and `!roles` for the other. (`!roles` is not required) +- Code with trigger `!example`: + +``` +$nomention +$setUserRoles[$authorID;$roleID[Support]] +We've reset all your roles! Now you have "Support" role. +``` + +- Code with trigger `!roles`: + +``` +$nomention +$userRoles[$authorID] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + content: | + !roles +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Cool + BDFD + Moderator +- user_id: 803569638084313098 + username: RainbowKey + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + We've reset all your roles! Now you have "Support" role. +- user_id: 803569638084313098 + username: RainbowKey + content: | + !roles +- user_id: 1009018156494368798 + username: BDFD Support + bot: true + verified: true + content: | + Support +``` + +*In this example, we will remove all roles and give one role with "Support" name*. + +```admonish question title="What is this?" +How [`$roleID[]`](./roleID.md), [`$authorID`](./authorID.md) and [`$userRoled[]`](./userRoles.md) works? +``` diff --git a/src/bdscript/setUserVar.md b/src/bdscript/setUserVar.md index 319fd9a5bcf..49e54a61995 100644 --- a/src/bdscript/setUserVar.md +++ b/src/bdscript/setUserVar.md @@ -1,17 +1,17 @@ -# $setUserVar -Updates a variable's value for a user. - -## Syntax -``` -$setUserVar[Variable name;New value;(User ID;Guild ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to update. -- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. -- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to assign the new value to. Uses the author if no "User ID" is provided. -- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to assign the new value to. Uses the current guild if no "Guild ID" is provided. - -> 📝 User variable values have a max character limit of **4999**. - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $setUserVar +Updates a variable's value for a user. + +## Syntax +``` +$setUserVar[Variable name;New value;(User ID;Guild ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to update. +- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. +- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to assign the new value to. Uses the author if no "User ID" is provided. +- `Guild ID` `(Type: Snowflake || Flag: Optional)`: The guild to assign the new value to. Uses the current guild if no "Guild ID" is provided. + +> 📝 User variable values have a max character limit of **4999**. + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/setVar.md b/src/bdscript/setVar.md index b73d9f183a2..cc07fb715b8 100644 --- a/src/bdscript/setVar.md +++ b/src/bdscript/setVar.md @@ -1,16 +1,16 @@ -# $setVar -Sets a variable's value globally, or for a user globally. - -## Syntax -``` -$setVar[Variable name;New value;(User ID)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to update. -- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. -- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to globally assign the new value to. Sets the variable type as global-user, if "User ID" is present. - -> 📝 Global variable values have a max character limit of **499** *(for premium users, it's **4999**)*. - -> For more info, see the [Variables Guide](../guides/introduction/variables.md). +# $setVar +Sets a variable's value globally, or for a user globally. + +## Syntax +``` +$setVar[Variable name;New value;(User ID)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to update. +- `New value` `(Type: String || Flag: Emptiable)`: The new variable value. +- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to globally assign the new value to. Sets the variable type as global-user, if "User ID" is present. + +> 📝 Global variable values have a max character limit of **499** *(for premium users, it's **4999**)*. + +> For more info, see the [Variables Guide](../guides/introduction/variables.md). diff --git a/src/bdscript/shardID.md b/src/bdscript/shardID.md index 9f6fe61cae1..28a12ac0643 100644 --- a/src/bdscript/shardID.md +++ b/src/bdscript/shardID.md @@ -1,28 +1,28 @@ -# $shardID -Returns the shard ID of the current guild. - -## Syntax -``` -$shardID -``` - -## Example -``` -$nomention -Shard: $shardID -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Shard: 1 -``` +# $shardID +Returns the shard ID of the current guild. + +## Syntax +``` +$shardID +``` + +## Example +``` +$nomention +Shard: $shardID +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Shard: 1 +``` diff --git a/src/bdscript/shardIDComplex.md b/src/bdscript/shardIDComplex.md index 888cfd23ebf..86b3574d52c 100644 --- a/src/bdscript/shardIDComplex.md +++ b/src/bdscript/shardIDComplex.md @@ -1,11 +1,35 @@ -# $shardID[] -Returns the shard ID of the provided guild. - -## Syntax -``` -$shardID[guild ID] -``` - -### Parameters -- `guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get it's shard ID. - +# $shardID[] +Returns the shard ID of the provided guild. + +## Syntax +``` +$shardID[Guild ID] +``` + +### Parameters +- `Guild ID` `(Type: Snowflake || Flag: Required)`: The guild to get it's shard ID. + +## Example +``` +$nomention +Shard: $shardID[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 566363823137882154 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Shard: 2 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/slashCommandsCount.md b/src/bdscript/slashCommandsCount.md index 91a62b202c5..fbd8561ef5e 100644 --- a/src/bdscript/slashCommandsCount.md +++ b/src/bdscript/slashCommandsCount.md @@ -1,28 +1,28 @@ -# $slashCommandsCount -Returns the number of [slash commands](../guides/general/interactions/slashCommands/aboutSlashCommands.md) the bot has enabled. - -## Syntax -``` -$slashCommandsCount -``` - -## Example -``` -$nomention -I have $slashCommandsCount slash commands! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - I have 4 slash commands! -``` +# $slashCommandsCount +Returns the number of [slash commands](../guides/general/interactions/slashCommands/aboutSlashCommands.md) the bot has enabled. + +## Syntax +``` +$slashCommandsCount +``` + +## Example +``` +$nomention +I have $slashCommandsCount slash commands! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + I have 4 slash commands! +``` diff --git a/src/bdscript/slashID.md b/src/bdscript/slashID.md index dc57b0dec99..eb514b94a0e 100644 --- a/src/bdscript/slashID.md +++ b/src/bdscript/slashID.md @@ -1,15 +1,27 @@ -# $slashID -Returns ID of the executed slash command. - -## Syntax -``` -$slashID -``` - -## Example -``` -$nomention -ID of this slash command: $slashID -``` -![Without](https://user-images.githubusercontent.com/70456337/191593122-4fd47d30-f108-4b4a-b44b-b1f3b5df9980.png) - +# $slashID +Returns ID of the executed slash command. + +## Syntax +``` +$slashID +``` + +## Example +``` +$nomention +ID of this slash command: $slashID +``` + +``` discord yaml +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + command: + author: RainbowKey + user_id: 803569638084313098 + command: /example + color: "#E67E22" + content: | + ID of this slash command: 1199084158555787377 +``` + diff --git a/src/bdscript/slashIDComplex.md b/src/bdscript/slashIDComplex.md index b32f1946f44..bcc55627ece 100644 --- a/src/bdscript/slashIDComplex.md +++ b/src/bdscript/slashIDComplex.md @@ -1,18 +1,18 @@ -# $slashID[] -Returns ID of the provided slash command. - -## Syntax -``` -$slashID[Slash command name] -``` - -### Parameters -- `Slash command name` `(Type: String || Flag: Required)`: Name of the global slash command. - -## Example -``` -$nomention -ID of `$message` slash command: $slashID[$message] -``` -![With](https://user-images.githubusercontent.com/70456337/191593196-6ec89d57-a84c-47d8-b982-63aa3471b40d.png) - +# $slashID[] +Returns ID of the provided slash command. + +## Syntax +``` +$slashID[Slash command name] +``` + +### Parameters +- `Slash command name` `(Type: String || Flag: Required)`: Name of the global slash command. + +## Example +``` +$nomention +ID of `$message` slash command: $slashID[$message] +``` +![With](https://user-images.githubusercontent.com/70456337/191593196-6ec89d57-a84c-47d8-b982-63aa3471b40d.png) + diff --git a/src/bdscript/slowmode.md b/src/bdscript/slowmode.md index 65d35a4b39d..66cf8e4e73e 100644 --- a/src/bdscript/slowmode.md +++ b/src/bdscript/slowmode.md @@ -1,29 +1,29 @@ -# $slowmode -Sets a slowmode for the provided channel. - -> With slowmode enabled in a channel, it will limit the number of messages a user is able to send in a channel based on a timed cooldown. `$slowmode[]` is used to change a channel's slowmode using a bot. - -## Syntax -``` -$slowmode[Channel ID;Slowmode time] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel in which the slowmode is being modified in. -- `Slowmode time` `(Type: Duration || Flag: Required)`: The new slowmode delay *(e.g. `5`, `10s`, `40m`, `1h`, etc)*. Use `0`/`0s` to disable the slowmode. - - > 🧙‍♂ī¸ Slowmode time can't be set over 6 hours/21600 seconds. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `managechannels` - -## Example -``` -$nomention -$argsCheck[>1;:x: Incorrect Usage! Example: `!slowmode 5s`] -$slowmode[$mentionedChannels[1;yes];$message[1]] -Slowmode changed to $message[1]! -``` - -![example](https://user-images.githubusercontent.com/69215413/126920569-eef1a425-e57d-4062-ba1f-84a09c17ed84.png) +# $slowmode +Sets a slowmode for the provided channel. + +> With slowmode enabled in a channel, it will limit the number of messages a user is able to send in a channel based on a timed cooldown. `$slowmode[]` is used to change a channel's slowmode using a bot. + +## Syntax +``` +$slowmode[Channel ID;Slowmode time] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel in which the slowmode is being modified in. +- `Slowmode time` `(Type: Duration || Flag: Required)`: The new slowmode delay *(e.g. `5`, `10s`, `40m`, `1h`, etc)*. Use `0`/`0s` to disable the slowmode. + +> Slowmode time can't be set over 6 hours/21600 seconds. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `managechannels` + +## Example +``` +$nomention +$argsCheck[>1;:x: Incorrect Usage! Example: `!slowmode 5s`] +$slowmode[$mentionedChannels[1;yes];$message[1]] +Slowmode changed to $message[1]! +``` + +![example](https://user-images.githubusercontent.com/69215413/126920569-eef1a425-e57d-4062-ba1f-84a09c17ed84.png) diff --git a/src/bdscript/sort.md b/src/bdscript/sort.md index c48cdf40da2..a3d456613b9 100644 --- a/src/bdscript/sort.md +++ b/src/bdscript/sort.md @@ -1,36 +1,36 @@ -# $sort -Sorts the provided numbers. - -## Syntax -``` -$sort[Numbers;...;Direction;Return amount;Separator] -``` - -### Parameters -- `Numbers` `(Type: Float, Integer || Flag: Required)`: The numbers to sort. Use semicolons `;` as a separator to separate multiple numbers. -- `Direction` `(Type: Enum || Flag : Required)`: The direction in which to sort. Direction types: - - `asc` - Sorts the numbers in ascending order. - - `desc` - Sorts the numbers in descending order. -- `Return amount` `(Type: Integer || Flag: Required)`: How many numbers will be returned. Use `-1` to return all numbers. -- `Separator` `(Type: String || Flag: Required)`: The separator between each number. - -## Example -``` -$nomention -Result: $sort[8;5;9;1;3;asc;4; - ] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Result: 1 - 3 - 5 - 8 -``` +# $sort +Sorts the provided numbers. + +## Syntax +``` +$sort[Numbers;...;Direction;Return amount;Separator] +``` + +### Parameters +- `Numbers` `(Type: Float, Integer || Flag: Required)`: The numbers to sort. Use semicolons `;` as a separator to separate multiple numbers. +- `Direction` `(Type: Enum || Flag : Required)`: The direction in which to sort. Direction types: + - `asc` - Sorts the numbers in ascending order. + - `desc` - Sorts the numbers in descending order. +- `Return amount` `(Type: Integer || Flag: Required)`: How many numbers will be returned. Use `-1` to return all numbers. +- `Separator` `(Type: String || Flag: Required)`: The separator between each number. + +## Example +``` +$nomention +Result: $sort[8;5;9;1;3;asc;4; - ] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Result: 1 - 3 - 5 - 8 +``` diff --git a/src/bdscript/splitText.md b/src/bdscript/splitText.md index f47d1969d43..210e821a32b 100644 --- a/src/bdscript/splitText.md +++ b/src/bdscript/splitText.md @@ -1,22 +1,22 @@ -# $splitText -Retrieves a value from [`$textSplit[]`](./textSplit.md). - -> ⚠ī¸ This function is used with `$textSplit[]`. - -## Syntax -``` -$splitText[Index] -``` - -### Parameters -- `Index` `(Type: HowMany || Flag: Required)`: The split value to get (e.g. `2` for the second split). You can also use `>` to return the last split value i.e `$splitText[>]`. - -## Example -``` -$nomention -$textSplit[Hi-Hello-Hey;-] -$splitText[2] -``` -> The above example will return output as `Hello`. - -> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). +# $splitText +Retrieves a value from [`$textSplit[]`](./textSplit.md). + +> ⚠ī¸ This function is used with `$textSplit[]`. + +## Syntax +``` +$splitText[Index] +``` + +### Parameters +- `Index` `(Type: HowMany || Flag: Required)`: The split value to get (e.g. `2` for the second split). You can also use `>` to return the last split value i.e `$splitText[>]`. + +## Example +``` +$nomention +$textSplit[Hi-Hello-Hey;-] +$splitText[2] +``` +> The above example will return output as `Hello`. + +> For more info, see the [Text Splitting Guide](../guides/general/textSplitting.md). diff --git a/src/bdscript/sqrt.md b/src/bdscript/sqrt.md new file mode 100644 index 00000000000..a96855b1585 --- /dev/null +++ b/src/bdscript/sqrt.md @@ -0,0 +1,76 @@ +# $sqrt +Returns the square root of the specified number. + +## Syntax +``` +$sqrt[Number] +``` + +### Parameters +- `Number` `(Type: Integer, Float || Flag: Required)`: The number greater than or equal to 0. + +## Example +``` +$nomention +Result: $sqrt[$message] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 25 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 5 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example -2 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Function $sqrt at 2:9 returned an error: the input number can't be negative. +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 2 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Result: 1 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +```admonish note +When calculating roots, use [`$enableDecimals[]`](..enableDecimals.md) to get decimal results for numbers like 1, 2, 3, 5, etc... +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $sqrt[] +
+
+

Output:

+ Result: 5 +
+
diff --git a/src/bdscript/startThread.md b/src/bdscript/startThread.md index 6245bf087c6..d7b69769dfe 100644 --- a/src/bdscript/startThread.md +++ b/src/bdscript/startThread.md @@ -1,25 +1,25 @@ -# $startThread -Creates a new thread in the provided channel. - -## Syntax -``` -$startThread[Name;Channel ID;Message ID;(Archive duration;Return thread/channel ID)] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the newly created thread. -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the thread will be created. -- `Message ID` `(Type: Snowflake || Flag: Emptiable)`: The message from which the thread will be created. Can be left empty. -- `Archive duration` `(Type: Integer || Flag: Optional)`: The duration after which the thread will be auto-archived due to inactivity. Accepts `60` (1 hour), `1440` (1 day), `4320` (3 days), or `10080` (7 days) as input. Defaults to `60`. -- `Return thread/channel ID` `(Type: Bool || Flag: Optional)`: Whether to return the thread channel ID or not. Defaults to `no`. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `createpublicthreads` - -## Example -``` -$nomention -I created a new thread! <#$startThread[Cool Thread;$channelID;;1440;yes]> -``` -![example](https://user-images.githubusercontent.com/69215413/128615731-c61c95c1-d1ec-42cf-9964-e8722df30dfe.png) +# $startThread +Creates a new thread in the provided channel. + +## Syntax +``` +$startThread[Name;Channel ID;Message ID;(Archive duration;Return thread/channel ID)] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name of the newly created thread. +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the thread will be created. +- `Message ID` `(Type: Snowflake || Flag: Emptiable)`: The message from which the thread will be created. Can be left empty. +- `Archive duration` `(Type: Integer || Flag: Optional)`: The duration after which the thread will be auto-archived due to inactivity. Accepts `60` (1 hour), `1440` (1 day), `4320` (3 days), or `10080` (7 days) as input. Defaults to `60`. +- `Return thread/channel ID` `(Type: Bool || Flag: Optional)`: Whether to return the thread channel ID or not. Defaults to `no`. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `createpublicthreads` + +## Example +``` +$nomention +I created a new thread! <#$startThread[Cool Thread;$channelID;;1440;yes]> +``` +![example](https://user-images.githubusercontent.com/69215413/128615731-c61c95c1-d1ec-42cf-9964-e8722df30dfe.png) diff --git a/src/bdscript/stop.md b/src/bdscript/stop.md index 1ba34d9d76d..53fb879aa41 100644 --- a/src/bdscript/stop.md +++ b/src/bdscript/stop.md @@ -1,52 +1,52 @@ -# $stop -Stops the command execution. Works with "If Statements" and "Error Handling" functions. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$stop -``` - -## Example -``` -$nomention -$try - $calculate[$message] -$catch - $stop -$endtry -Expression: $message -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a+5 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 6+10 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 16 - Expression: 6+10 -``` -*As we can see, the bot did not send "Expression: a+5" when we tried to use "`!example a+5`".* - -```admonish question title="What is this?" -How [`$calculate[]`](./calculate.md), [`$message`](./message.md), [`$try`](./try.md), [`$endtry`](./endtry.md) and [`$catch`](./catch.md) works? -``` - -```admonish info title="Read more" -For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md) or [If Statements guide](../guides/general/ifStatements.md). -``` +# $stop +Stops the command execution. Works with "If Statements" and "Error Handling" functions. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$stop +``` + +## Example +``` +$nomention +$try + $calculate[$message] +$catch + $stop +$endtry +Expression: $message +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a+5 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 6+10 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 16 + Expression: 6+10 +``` +*As we can see, the bot did not send "Expression: a+5" when we tried to use "`!example a+5`".* + +```admonish question title="What is this?" +How [`$calculate[]`](./calculate.md), [`$message`](./message.md), [`$try`](./try.md), [`$endtry`](./endtry.md) and [`$catch`](./catch.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md) or [If Statements guide](../guides/general/ifStatements.md). +``` diff --git a/src/bdscript/sub.md b/src/bdscript/sub.md index 66ca99ef127..ab978060bda 100644 --- a/src/bdscript/sub.md +++ b/src/bdscript/sub.md @@ -1,31 +1,31 @@ -# $sub -Returns the subtraction of the provided numbers. - -## Syntax -``` -$sub[Number;...] -``` - -### Parameters -- `Number` `(Type: Integer, Float || Flag: Required)`: The numbers to subtract. Separate multiple values using `;`. - -## Example -``` -$nomention -Result: $sub[20;10;6] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Result: 4 -``` +# $sub +Returns the subtraction of the provided numbers. + +## Syntax +``` +$sub[Number;...] +``` + +### Parameters +- `Number` `(Type: Integer, Float || Flag: Required)`: The numbers to subtract. Separate multiple values using `;`. + +## Example +``` +$nomention +Result: $sub[20;10;6] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Result: 4 +``` diff --git a/src/bdscript/sum.md b/src/bdscript/sum.md index 6678995f78e..9b15d879aeb 100644 --- a/src/bdscript/sum.md +++ b/src/bdscript/sum.md @@ -1,31 +1,31 @@ -# $sum -Returns the addition of the provided numbers. - -## Syntax -``` -$sum[Number;...] -``` - -### Parameters -- `Number` `(Type: Integer, Float || Flag: Required)`: The numbers to add. Separate multiple values using `;`. - -## Example -``` -$nomention -Result: $sum[5;6;1] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Result: 12 -``` +# $sum +Returns the addition of the provided numbers. + +## Syntax +``` +$sum[Number;...] +``` + +### Parameters +- `Number` `(Type: Integer, Float || Flag: Required)`: The numbers to add. Separate multiple values using `;`. + +## Example +``` +$nomention +Result: $sum[5;6;1] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Result: 12 +``` diff --git a/src/bdscript/suppressErrors.md b/src/bdscript/suppressErrors.md index b5f3dfb2934..ecf6de86cc8 100644 --- a/src/bdscript/suppressErrors.md +++ b/src/bdscript/suppressErrors.md @@ -1,19 +1,19 @@ -# $suppressErrors -Blocks sending any error messages whenever an error occurs. - -## Syntax -``` -$suppressErrors -``` - -## Example -``` -$nomention -$suppressErrors -$argsCheck[>1;Usage : ` !command `] -$calculate[$message] -``` -![example](https://user-images.githubusercontent.com/95774950/198821156-3752e153-2289-4cd8-8bfb-07ae72455530.png) - -## Related Resources -- [$embedSuppressErrors](./embedSuppressErrors.md) +# $suppressErrors +Blocks sending any error messages whenever an error occurs. + +## Syntax +``` +$suppressErrors +``` + +## Example +``` +$nomention +$suppressErrors +$argsCheck[>1;Usage : ` !command `] +$calculate[$message] +``` +![example](https://user-images.githubusercontent.com/95774950/198821156-3752e153-2289-4cd8-8bfb-07ae72455530.png) + +## Related Resources +- [$embedSuppressErrors](./embedSuppressErrors.md) diff --git a/src/bdscript/suppressErrorsComplex.md b/src/bdscript/suppressErrorsComplex.md index 4eac86f6587..354a3b248dc 100644 --- a/src/bdscript/suppressErrorsComplex.md +++ b/src/bdscript/suppressErrorsComplex.md @@ -1,22 +1,22 @@ -# $suppressErrors[] -Blocks sending any error messages whenever an error occurs and sends the provided custom error instead. - -## Syntax -``` -$suppressErrors[Error message] -``` - -### Parameters -- `Error message` `(Type: String || Flag: Emptiable)`: The custom error message to send. - -### Example -``` -$nomention -$suppressErrors[**Error** : ` Invalid math expression! `] -$argsCheck[>1;Usage : ` !command `] -$calculate[$message] -``` -![example](https://user-images.githubusercontent.com/95774950/198820510-bc2140f0-838b-4357-80e7-e12c69b3739f.png) - -## Related Resources -- [$embedSuppressErrors](./embedSuppressErrors.md) +# $suppressErrors[] +Blocks sending any error messages whenever an error occurs and sends the provided custom error instead. + +## Syntax +``` +$suppressErrors[Error message] +``` + +### Parameters +- `Error message` `(Type: String || Flag: Emptiable)`: The custom error message to send. + +### Example +``` +$nomention +$suppressErrors[**Error** : ` Invalid math expression! `] +$argsCheck[>1;Usage : ` !command `] +$calculate[$message] +``` +![example](https://user-images.githubusercontent.com/95774950/198820510-bc2140f0-838b-4357-80e7-e12c69b3739f.png) + +## Related Resources +- [$embedSuppressErrors](./embedSuppressErrors.md) diff --git a/src/bdscript/systemChannelID.md b/src/bdscript/systemChannelID.md new file mode 100644 index 00000000000..a9946abd721 --- /dev/null +++ b/src/bdscript/systemChannelID.md @@ -0,0 +1,76 @@ +# $systemChannelID +Returns the server's system channel ID (**returns an error if there isn’t such a channel**). + +## Syntax +``` +$systemChannelID +``` + +## Example +``` +$nomention +System channel ID: $systemChannelID +``` + +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + System channel ID: 566364581522440232 +``` + + +~~~admonish tip title="How to stop the error message?" +The `$systemChannelID` function as said in above returns an error if there isn't any system channel set on the server and there is a way to stop that. +``` +$nomention +$try + System channel ID: $systemChannelID +$catch + No system channel found! +$endtry +``` + +- Without try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Function $systemChannelID at 3:37 returned an error: No system channel set in this server! +``` + +- With try block: +```discord yaml +- user_id: 1262009115689881702 + username: GettingBeatenByKito + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + No system channel found! +``` + +> For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). + +~~~ diff --git a/src/bdscript/takeRole.md b/src/bdscript/takeRole.md index 479bb3cd78b..32296a5ed6c 100644 --- a/src/bdscript/takeRole.md +++ b/src/bdscript/takeRole.md @@ -1,44 +1,46 @@ -# $takeRole -*(deprecated)* - -> 📌 As of December 2021, this function has been deprecated in favor of [`$roleGrant[]`](./roleGrant.md). -> -> 📌 In order to remove a role from a user, the bot must have the `manageroles` permission. - -Removes a role from the provided/mentioned user. - -## Syntax -``` -$takeRole[User/Role ID;(Role ID)] -``` - -### Parameters -- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to remove the specified role from **or** the role to remove from the mentioned users. If only this parameter is provided, it will be read as "Role ID". -- `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to remove from the user. If this parameter is used, it reads the first parameter as "User ID". - -## Examples -### Example #1 -``` -$nomention -$allowRoleMentions[] - -$takeRole[$mentionedRoles[1]] -Removed <@&$mentionedRoles[1]> from the mentioned users! -``` -![example1](https://user-images.githubusercontent.com/95774950/198837013-a39c8a69-29aa-4cec-b319-0b04365c200d.png) - -### Example #2 -``` -$nomention -$allowMention -$allowRoleMentions[] - -$takeRole[$message[1];$mentionedRoles[1]] -Removed the role <@&$mentionedRoles[1]> from <@$message[1]>! -``` -![example2](https://user-images.githubusercontent.com/111157596/250922731-73a8a86d-d5ba-4cbf-a4cd-87f13440eeea.png)\ -![example2](https://user-images.githubusercontent.com/111157596/250922753-4db7473e-a85a-43d3-b88b-f97e0e869533.png) - -## Related Resources -- [`$roleGrant[]`](./roleGrant.md) -- [`$giveRole[]`](./giveRole.md) +# $takeRole +
+ Deprecated +
+ +> As of December 2021, this function has been deprecated in favor of [`$roleGrant[]`](./roleGrant.md). + +> In order to remove a role from a user, the bot must have the `manageroles` permission. + +Removes a role from the provided/mentioned user. + +## Syntax +``` +$takeRole[User/Role ID;(Role ID)] +``` + +### Parameters +- `User/Role ID` `(Type: Snowflake || Flag: Required)`: The user to remove the specified role from **or** the role to remove from the mentioned users. If only this parameter is provided, it will be read as "Role ID". +- `Role ID` `(Type: Snowflake || Flag: Optional)`: The role to remove from the user. If this parameter is used, it reads the first parameter as "User ID". + +## Examples +### Example #1 +``` +$nomention +$allowRoleMentions[] + +$takeRole[$mentionedRoles[1]] +Removed <@&$mentionedRoles[1]> from the mentioned users! +``` +![example1](https://user-images.githubusercontent.com/95774950/198837013-a39c8a69-29aa-4cec-b319-0b04365c200d.png) + +### Example #2 +``` +$nomention +$allowMention +$allowRoleMentions[] + +$takeRole[$message[1];$mentionedRoles[1]] +Removed the role <@&$mentionedRoles[1]> from <@$message[1]>! +``` +![example2](https://user-images.githubusercontent.com/111157596/250922731-73a8a86d-d5ba-4cbf-a4cd-87f13440eeea.png)\ +![example2](https://user-images.githubusercontent.com/111157596/250922753-4db7473e-a85a-43d3-b88b-f97e0e869533.png) + +## Related Resources +- [`$roleGrant[]`](./roleGrant.md) +- [`$giveRole[]`](./giveRole.md) diff --git a/src/bdscript/textSplit.md b/src/bdscript/textSplit.md index d5555d240fa..5a6201f9293 100644 --- a/src/bdscript/textSplit.md +++ b/src/bdscript/textSplit.md @@ -1,31 +1,31 @@ -# $textSplit -Splits the provided text by a given separator and saves the value temporarily. - -> 📌 To retrieve the split values, use [`$splitText`](./splitText.md). - -## Syntax -``` -$textSplit[Text;Separator] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to split. -- `Separator` `(Type: String || Flag: Emptiable)`: The separator to split the text with. If this parameter is empty, it separates the text by each character. - -### Example -``` -$nomention -$textSplit[Coffee, Tea, Milk;,] -$splitText[1] -``` -![Screenshot_20221029_203537](https://user-images.githubusercontent.com/95774950/198839569-338c0892-80ef-4e7a-bbb7-dd696c6ab15b.png) - -###### _In the above example, [`$textSplit`](#textsplit) splits the provided text using a comma (`,`) as the separator. After that, [`$splitText`](./splitText.md) is used to retrieve the first split value._ - -## Related Resources -- [Text Splitting Guide](../guides/general/textSplitting.md) -- [$getTextSplitIndex](./getTextSplitIndex.md) -- [$getTextSplitLength](./getTextSplitLength.md) -- [$joinSplitText](./joinSplitText.md) -- [$removeSplitTextElement](./removeSplitTextElement.md) -- [$splitText](./splitText.md) +# $textSplit +Splits the provided text by a given separator and saves the value temporarily. + +> 📌 To retrieve the split values, use [`$splitText`](./splitText.md). + +## Syntax +``` +$textSplit[Text;Separator] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to split. +- `Separator` `(Type: String || Flag: Emptiable)`: The separator to split the text with. If this parameter is empty, it separates the text by each character. + +### Example +``` +$nomention +$textSplit[Coffee, Tea, Milk;,] +$splitText[1] +``` +![Screenshot_20221029_203537](https://user-images.githubusercontent.com/95774950/198839569-338c0892-80ef-4e7a-bbb7-dd696c6ab15b.png) + +###### _In the above example, [`$textSplit`](#textsplit) splits the provided text using a comma (`,`) as the separator. After that, [`$splitText`](./splitText.md) is used to retrieve the first split value._ + +## Related Resources +- [Text Splitting Guide](../guides/general/textSplitting.md) +- [$getTextSplitIndex](./getTextSplitIndex.md) +- [$getTextSplitLength](./getTextSplitLength.md) +- [$joinSplitText](./joinSplitText.md) +- [$removeSplitTextElement](./removeSplitTextElement.md) +- [$splitText](./splitText.md) diff --git a/src/bdscript/threadAddMember.md b/src/bdscript/threadAddMember.md index bb387927a73..ceedb6649ef 100644 --- a/src/bdscript/threadAddMember.md +++ b/src/bdscript/threadAddMember.md @@ -1,26 +1,26 @@ -# $threadAddMember -Adds a user to a thread. - -## Syntax -``` -$threadAddMember[Thread ID;User ID] -``` - -### Parameters -- `Thread ID` `(Type: Snowflake || Flag: Required)`: The ID of the thread channel to add the user to. -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to add to the thread. - -## Example -``` -$nomention -$var[thread;$startThread[Cool Thread;$channelID;;60;yes]] -$threadAddMember[$var[thread];$authorID] -``` -![example1](https://user-images.githubusercontent.com/69215413/130260166-768cb59f-2377-49e3-9588-6425028484d9.png)\ -![example2](https://user-images.githubusercontent.com/69215413/130260148-0c6b54ec-96ea-4f94-9aee-8a583667d80d.png) - -## Related Resources -- [Threads Guide](../guides/threads.md) -- [$editThread](./editThread.md) -- [$startThread](./startThread.md) -- [$threadRemoveMember](./threadRemoveMember.md) +# $threadAddMember +Adds a user to a thread. + +## Syntax +``` +$threadAddMember[Thread ID;User ID] +``` + +### Parameters +- `Thread ID` `(Type: Snowflake || Flag: Required)`: The ID of the thread channel to add the user to. +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to add to the thread. + +## Example +``` +$nomention +$var[thread;$startThread[Cool Thread;$channelID;;60;yes]] +$threadAddMember[$var[thread];$authorID] +``` +![example1](https://user-images.githubusercontent.com/69215413/130260166-768cb59f-2377-49e3-9588-6425028484d9.png)\ +![example2](https://user-images.githubusercontent.com/69215413/130260148-0c6b54ec-96ea-4f94-9aee-8a583667d80d.png) + +## Related Resources +- [Threads Guide](../guides/threads.md) +- [$editThread](./editThread.md) +- [$startThread](./startThread.md) +- [$threadRemoveMember](./threadRemoveMember.md) diff --git a/src/bdscript/threadMessageCount.md b/src/bdscript/threadMessageCount.md new file mode 100644 index 00000000000..7090f210ee9 --- /dev/null +++ b/src/bdscript/threadMessageCount.md @@ -0,0 +1,43 @@ +# $threadMessageCount +Returns the total number of users in the current thread. (**not including bot's response**) + +## Syntax +``` +$threadMessageCount +``` + +## Example +``` +$nomention +This thread has a total of $threadMessageCount messages sent! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Hello guys! +- user_id: 390515191819010058 + username: kubastick + color: "#FF0000" + content: | + Hello RainbowKey! 👋 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This thread has a total of 3 messages sent! +- user_id: 390515191819010058 + username: kubastick + color: "#FF0000" + content: | + Nice! +``` diff --git a/src/bdscript/threadRemoveMember.md b/src/bdscript/threadRemoveMember.md index 9a6af11b35d..4b2f405dd91 100644 --- a/src/bdscript/threadRemoveMember.md +++ b/src/bdscript/threadRemoveMember.md @@ -1,24 +1,24 @@ -# $threadRemoveMember -Removes a user from a thread. - -## Syntax -``` -$threadRemoveMember[Thread ID;User ID] -``` - -### Parameters -- `Thread ID` `(Type: Snowflake || Flag: Required)`: The ID of the thread channel to remove the user from. -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to remove from the thread. - -## Example -``` -$nomention -$threadRemoveMember[878305123707785218;$authorID] -``` -![example](https://user-images.githubusercontent.com/69215413/130261147-1d44af9b-a951-4286-88a3-1908702d3fe0.png) - -## Related Resources -- [Threads Guide](../guides/threads.md) -- [$editThread](./editThread.md) -- [$startThread](./startThread.md) -- [$threadAddMember](./threadAddMember.md) +# $threadRemoveMember +Removes a user from a thread. + +## Syntax +``` +$threadRemoveMember[Thread ID;User ID] +``` + +### Parameters +- `Thread ID` `(Type: Snowflake || Flag: Required)`: The ID of the thread channel to remove the user from. +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to remove from the thread. + +## Example +``` +$nomention +$threadRemoveMember[878305123707785218;$authorID] +``` +![example](https://user-images.githubusercontent.com/69215413/130261147-1d44af9b-a951-4286-88a3-1908702d3fe0.png) + +## Related Resources +- [Threads Guide](../guides/threads.md) +- [$editThread](./editThread.md) +- [$startThread](./startThread.md) +- [$threadAddMember](./threadAddMember.md) diff --git a/src/bdscript/threadUserCount.md b/src/bdscript/threadUserCount.md new file mode 100644 index 00000000000..b31fd1279da --- /dev/null +++ b/src/bdscript/threadUserCount.md @@ -0,0 +1,28 @@ +# $threadUserCount +Returns the total number of users in the current thread. + +## Syntax +``` +$threadUserCount +``` + +## Example +``` +$nomention +This thread has $threadUserCount users! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + This thread has 29 users! +``` diff --git a/src/bdscript/thumbnail.md b/src/bdscript/thumbnail.md index 971cc536db9..e41d43ae05f 100644 --- a/src/bdscript/thumbnail.md +++ b/src/bdscript/thumbnail.md @@ -1,25 +1,25 @@ -# $thumbnail -Adds an embedded thumbnail to the bot's response message. - -## Syntax -``` -$thumbnail[Image URL;(Index)] -``` - -### Parameters -- `Image URL` `(Type: URL || Flag: Emptiable)`: The image to set as the thumbnail. -- `Index` `(Type: Integer || Flag: Optional)`: What [embed index](../resources/embedIndexes.md) the thumbnail should belong to, default to `1`. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `sendmessages` -- `sendmessagesinthreads` -- `embedlinks` - -## Example -``` -$nomention -$description[This is the thumbnail ↘ī¸] -$thumbnail[$authorAvatar] -``` -![example](https://user-images.githubusercontent.com/69215413/126551913-b3746b47-615a-48a3-9729-d07529e33f97.png) +# $thumbnail +Adds an embedded thumbnail to the bot's response message. + +## Syntax +``` +$thumbnail[Image URL;(Index)] +``` + +### Parameters +- `Image URL` `(Type: URL || Flag: Emptiable)`: The image to set as the thumbnail. +- `Index` `(Type: Integer || Flag: Optional)`: What [embed index](../resources/embedIndexes.md) the thumbnail should belong to, default to `1`. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `sendmessages` +- `sendmessagesinthreads` +- `embedlinks` + +## Example +``` +$nomention +$description[This is the thumbnail ↘ī¸] +$thumbnail[$authorAvatar] +``` +![example](https://user-images.githubusercontent.com/69215413/126551913-b3746b47-615a-48a3-9729-d07529e33f97.png) diff --git a/src/bdscript/time.md b/src/bdscript/time.md index eba433ae935..d384c327b4e 100644 --- a/src/bdscript/time.md +++ b/src/bdscript/time.md @@ -1,22 +1,46 @@ -# $time -Changes the timezone for date/time functions. - -## Syntax -``` -$time[Timezone] -``` - -### Parameters -- `Timezone` `(Type: String || Flag: Required)`: The timezone to use in the date/time functions. Accepts [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezone name as input. - -## Example -``` -$nomention - -$time[America/New_York] -New York : $hour:$minute:$second - -$time[Europe/Warsaw] -Warsaw : $optOff[$hour:$minute:$second] -``` -![Screenshot_20221029_234758](https://user-images.githubusercontent.com/95774950/198847125-b093d143-7890-4478-a437-1c80c35c4c41.png) +# $time +Changes the timezone for date/time functions. + +## Syntax +``` +$time[Timezone] +``` + +### Parameters +- `Timezone` `(Type: String || Flag: Required)`: The timezone to use in the date/time functions. Accepts [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezone name as input. + +#### Popular Timezons +`Timezone` | UTC +------------------|----- +`Europe/Moscow` | +03:00 +`Europe/Athens` | +03:00 +`Europe/Istanbul` | +03:00 +`Europe/Warsaw` | +02:00 +`Europe/Paris` | +02:00 +`Europe/Berlin` | +02:00 + +## Example +``` +$nomention +$time[America/New_York] +New York Time: $hour:$minute, $day +$time[Europe/Moscow] +Moscow Time: $optOff[$hour:$minute, $day] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + + diff --git a/src/bdscript/timeout.md b/src/bdscript/timeout.md index e4457506ffc..31669372831 100644 --- a/src/bdscript/timeout.md +++ b/src/bdscript/timeout.md @@ -1,35 +1,35 @@ -# $timeout -Timeouts a user for a certain duration. - -## Syntax -``` -$timeout[Duration;(User ID)] -``` - -### Parameters -- `Duration` `(Type: Duration || Flag: Required)`: The amount of time the user should be timed out for. It shouldn't exceed more than "28 days". -- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to timeout. If this parameter is empty, timeouts the mentioned users. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `moderatemembers` - -## Examples -- Without ID - ``` - $nomention - $timeout[$message[1]] - ``` - ![](https://user-images.githubusercontent.com/70456337/183470087-6b72ea9f-9365-4686-9483-09bad385e10b.png) - -- With ID - ``` - $nomention - $allowMention - $timeout[$message[1];$findUser[$message[2];no]] - ``` - ![](https://user-images.githubusercontent.com/70456337/183470187-305f846a-7515-46b5-af7e-6c2f5713656f.png) - -## Related Resources -- [Time Out FAQ](https://support.discord.com/hc/en-us/articles/4413305239191-Time-Out-FAQ) -- [$untimeout](./untimeout.md) +# $timeout +Timeouts a user for a certain duration. + +## Syntax +``` +$timeout[Duration;(User ID)] +``` + +### Parameters +- `Duration` `(Type: Duration || Flag: Required)`: The amount of time the user should be timed out for. It shouldn't exceed more than "28 days". +- `User ID` `(Type: Snowflake || Flag: Optional)`: The user to timeout. If this parameter is empty, timeouts the mentioned users. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `moderatemembers` + +## Examples +- Without ID + ``` + $nomention + $timeout[$message[1]] + ``` + ![](https://user-images.githubusercontent.com/70456337/183470087-6b72ea9f-9365-4686-9483-09bad385e10b.png) + +- With ID + ``` + $nomention + $allowMention + $timeout[$message[1];$findUser[$message[2];no]] + ``` + ![](https://user-images.githubusercontent.com/70456337/183470187-305f846a-7515-46b5-af7e-6c2f5713656f.png) + +## Related Resources +- [Time Out FAQ](https://support.discord.com/hc/en-us/articles/4413305239191-Time-Out-FAQ) +- [$untimeout](./untimeout.md) diff --git a/src/bdscript/title.md b/src/bdscript/title.md index 6e58801e47d..27703782bd4 100644 --- a/src/bdscript/title.md +++ b/src/bdscript/title.md @@ -1,25 +1,41 @@ -# $title -Adds an embedded title to bot's response message. - -## Syntax -``` -$title[Text;(Index)] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to set the title as. It cannot exceed more than 256 characters. -- `Index` `(Type: Integer || Flag: Optional)`: What [embed index](../resources/embedIndexes.md) the title should belong to, defaults to `1`. - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `sendmessages` -- `sendmessagesinthreads` -- `embedlinks` - -## Example -``` -$nomention -$title[This is a title!] -$description[âŦ†ī¸ That is a nice title.] -``` -![example](https://user-images.githubusercontent.com/69215413/123186040-4c310b00-d465-11eb-99b1-6c43828c8ddb.png) +# $title +Adds an embedded title to bot's response message. + +## Syntax +``` +$title[Text;(Index)] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to set the title as. It cannot exceed more than 256 characters. +- `Index` `(Type: Integer || Flag: Optional)`: What [embed index](../resources/embedIndexes.md) the title should belong to, defaults to `1`. + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `sendmessages` +- `sendmessagesinthreads` +- `embedlinks` + +## Example +``` +$nomention +$title[This is a title!] +$description[âŦ†ī¸ That is a nice title.] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + embed: + title: This is a title! + description: âŦ†ī¸ That is a nice title. +``` diff --git a/src/bdscript/toLowercase.md b/src/bdscript/toLowercase.md index c28e6983a4c..a2e7163e6e4 100644 --- a/src/bdscript/toLowercase.md +++ b/src/bdscript/toLowercase.md @@ -1,32 +1,48 @@ -# $toLowercase -Converts the provided text to lowercase format. - -## Syntax -``` -$toLowercase[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. - -## Example -``` -$nomention -$toLowercase[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example BOT DESIGNER For discord -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - bot designer for discord -``` +# $toLowercase +Converts the provided text to lowercase format. + +## Syntax +``` +$toLowercase[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. + +## Example +``` +$nomention +$toLowercase[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BOT DESIGNER For discord +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + bot designer for discord +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $toLowercase[] +
+
+

Output:

+ hello +
+
diff --git a/src/bdscript/toTitleCase.md b/src/bdscript/toTitleCase.md index 6b07fe1847c..b65304703e4 100644 --- a/src/bdscript/toTitleCase.md +++ b/src/bdscript/toTitleCase.md @@ -1,32 +1,48 @@ -# $toTitleCase -Converts the first letter of each word to uppercase in the provided text. - -## Syntax -``` -$toTitleCase[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. - -## Example -``` -$nomention -$toTitleCase[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example bot designer for discord -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Bot Designer For Discord -``` +# $toTitleCase +Converts the first letter of each word to uppercase in the provided text. + +## Syntax +``` +$toTitleCase[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. + +## Example +``` +$nomention +$toTitleCase[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example bot designer for discord +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Bot Designer For Discord +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $toTitleCase[] +
+
+

Output:

+ Hello World! +
+
diff --git a/src/bdscript/toUppercase.md b/src/bdscript/toUppercase.md index 7e59293cd11..77a68fa76a0 100644 --- a/src/bdscript/toUppercase.md +++ b/src/bdscript/toUppercase.md @@ -1,32 +1,48 @@ -# $toUppercase -Converts the provided text to uppercase format. - -## Syntax -``` -$toUppercase[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. - -## Example -``` -$nomention -$toUppercase[$message] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example bot designeR FOR DISCORD -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - BOT DESIGNER FOR DISCORD -``` +# $toUppercase +Converts the provided text to uppercase format. + +## Syntax +``` +$toUppercase[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to convert. + +## Example +``` +$nomention +$toUppercase[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example bot designeR FOR DISCORD +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + BOT DESIGNER FOR DISCORD +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $toUppercase[] +
+
+

Output:

+ HELLO +
+
diff --git a/src/bdscript/trimContent.md b/src/bdscript/trimContent.md index 3f9a24771b0..6f774cbaf8f 100644 --- a/src/bdscript/trimContent.md +++ b/src/bdscript/trimContent.md @@ -1,22 +1,22 @@ -# $trimContent -Removes duplicate spaces from incoming message content. - -## Syntax -``` -$trimContent -``` - -## Example -``` -$nomention -$trimContent - -1. $message[1] -2. $message[2] -3. $message[3] -``` -![Example](https://user-images.githubusercontent.com/70456337/191595057-3bbe9531-3402-44db-a5f4-4c4324d3511c.png) - -> 📌 Removing [`$trimContent`](./trimContent.md) from the above code would result in the following output : -> -> ![Remove](https://user-images.githubusercontent.com/70456337/191595126-8d930e58-9407-44ad-9160-5fedbdeebef2.png) +# $trimContent +Removes duplicate spaces from incoming message content. + +## Syntax +``` +$trimContent +``` + +## Example +``` +$nomention +$trimContent + +1. $message[1] +2. $message[2] +3. $message[3] +``` +![Example](https://user-images.githubusercontent.com/70456337/191595057-3bbe9531-3402-44db-a5f4-4c4324d3511c.png) + +> 📌 Removing [`$trimContent`](./trimContent.md) from the above code would result in the following output : +> +> ![Remove](https://user-images.githubusercontent.com/70456337/191595126-8d930e58-9407-44ad-9160-5fedbdeebef2.png) diff --git a/src/bdscript/trimSpace.md b/src/bdscript/trimSpace.md index a01cf7c1afc..0c8dbfece9e 100644 --- a/src/bdscript/trimSpace.md +++ b/src/bdscript/trimSpace.md @@ -1,32 +1,45 @@ -# $trimSpace -Removes all leading and trailing white-space characters from the provided text. - -## Syntax -``` -$trimSpace[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text from which white-space characters will be removed. - -## Example -``` -$nomention ->$trimSpace[ Hi - ]< -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - >Hi< -``` +# $trimSpace +Removes all leading and trailing white-space characters from the provided text. + +## Syntax +``` +$trimSpace[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text from which white-space characters will be removed. + +## Example +``` +$nomention +>$trimSpace[ Hi + ]< +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + >Hi< +``` + +
+

🤖 Playground

+

Here you can understand how this function works.

+
+

Input:

+ $trimSpace[] +
+
+

Output:

+ Hello world +
+
diff --git a/src/bdscript/try.md b/src/bdscript/try.md index d80e1a3541c..da15bf40eb6 100644 --- a/src/bdscript/try.md +++ b/src/bdscript/try.md @@ -1,47 +1,47 @@ -# $try -Opens the Error Handling block. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$try -``` - -## Example -``` -$nomention -$try - $sum[5;$message] -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 10 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 15 -``` - -```admonish question title="What is this?" -How [`$sum[]`](./sum.md), [`$message`](./message.md) and [`$endtry`](./endtry.md) works? -``` - -```admonish info title="Read more" -For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). -``` +# $try +Opens the Error Handling block. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](../guides/general/bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$try +``` + +## Example +``` +$nomention +$try + $sum[5;$message] +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 10 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 15 +``` + +```admonish question title="What is this?" +How [`$sum[]`](./sum.md), [`$message`](./message.md) and [`$endtry`](./endtry.md) works? +``` + +```admonish info title="Read more" +For more information, read the [Error Handling guide](../guides/general/bds2/errorHandling.md). +``` diff --git a/src/bdscript/tts.md b/src/bdscript/tts.md index 1c45b4dca50..859be433674 100644 --- a/src/bdscript/tts.md +++ b/src/bdscript/tts.md @@ -1,20 +1,20 @@ -# $tts -Enables Text-to-Speech (TTS) functionality on the bot's response message. - -> 📌 The [TTS](https://support.discord.com/hc/en-us/articles/212517297-Text-to-Speech-101) feature is currently supported only in Discord Desktop and Webapp. - -## Syntax -``` -$tts -``` - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `tts` - -## Example -``` -$nomention -$tts -Hello! Can you hear me? -``` +# $tts +Enables Text-to-Speech (TTS) functionality on the bot's response message. + +> 📌 The [TTS](https://support.discord.com/hc/en-us/articles/212517297-Text-to-Speech-101) feature is currently supported only in Discord Desktop and Webapp. + +## Syntax +``` +$tts +``` + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `tts` + +## Example +``` +$nomention +$tts +Hello! Can you hear me? +``` diff --git a/src/bdscript/unban.md b/src/bdscript/unban.md index 904f755bcf7..1e7e2c76690 100644 --- a/src/bdscript/unban.md +++ b/src/bdscript/unban.md @@ -1,20 +1,20 @@ -# $unban -Unbans a user by providing their username in the author's message. - -## Syntax -``` -$unban -``` - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `ban` - -## Example -``` -$nomention -$unban -Successfully unbanned user! -``` -![example](https://user-images.githubusercontent.com/69215413/126552836-f0203ad2-f339-4466-a14a-e352ef45d050.png)\ -![example2](https://user-images.githubusercontent.com/69215413/126552951-3bdbdcdf-c88f-4938-bdca-3b9b43c1e0bf.png) +# $unban +Unbans a user by providing their username in the author's message. + +## Syntax +``` +$unban +``` + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `ban` + +## Example +``` +$nomention +$unban +Successfully unbanned user! +``` +![example](https://user-images.githubusercontent.com/69215413/126552836-f0203ad2-f339-4466-a14a-e352ef45d050.png)\ +![example2](https://user-images.githubusercontent.com/69215413/126552951-3bdbdcdf-c88f-4938-bdca-3b9b43c1e0bf.png) diff --git a/src/bdscript/unbanID.md b/src/bdscript/unbanID.md index ccb5777a060..b0701186feb 100644 --- a/src/bdscript/unbanID.md +++ b/src/bdscript/unbanID.md @@ -1,19 +1,19 @@ -# $unbanID -Unbans a user by using their ID taken from the last argument of the author's message. - -## Syntax -``` -$unbanID -``` - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `ban` - -## Example -``` -$nomention -$unbanID -Successfully unbanned user! -``` -![example](https://user-images.githubusercontent.com/69215413/126553929-c30e6bd8-63ab-4e2a-9dc5-0ec1f23d6221.png) +# $unbanID +Unbans a user by using their ID taken from the last argument of the author's message. + +## Syntax +``` +$unbanID +``` + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `ban` + +## Example +``` +$nomention +$unbanID +Successfully unbanned user! +``` +![example](https://user-images.githubusercontent.com/69215413/126553929-c30e6bd8-63ab-4e2a-9dc5-0ec1f23d6221.png) diff --git a/src/bdscript/unbanIDComplex.md b/src/bdscript/unbanIDComplex.md index 2e14c2e0e06..7576e52980b 100644 --- a/src/bdscript/unbanIDComplex.md +++ b/src/bdscript/unbanIDComplex.md @@ -1,22 +1,22 @@ -# $unbanID[] -Unbans a user by using their ID. - -## Syntax -``` -$unbanID[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user to unban. - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `ban` - -## Example -``` -$nomention -$unbanID[$message[1]] -Successfully unbanned user! -``` -![example](https://user-images.githubusercontent.com/69215413/126553929-c30e6bd8-63ab-4e2a-9dc5-0ec1f23d6221.png) +# $unbanID[] +Unbans a user by using their ID. + +## Syntax +``` +$unbanID[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The ID of the user to unban. + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `ban` + +## Example +``` +$nomention +$unbanID[$message[1]] +Successfully unbanned user! +``` +![example](https://user-images.githubusercontent.com/69215413/126553929-c30e6bd8-63ab-4e2a-9dc5-0ec1f23d6221.png) diff --git a/src/bdscript/unescape.md b/src/bdscript/unescape.md index 0f9dcedb6b7..021f2e9ba76 100644 --- a/src/bdscript/unescape.md +++ b/src/bdscript/unescape.md @@ -1,31 +1,71 @@ -# $unescape -Unescapes semicolons `;` from the provided text. It allows interpreting of escaped semicolons as unescaped ones. - -## Syntax -``` -$unescape[Text] -``` - -### Parameters -- `Text` `(Type: String || Flag: Emptiable)`: The text to unescape. - -## Example -``` -$nomention -$randomText[$unescape[$message]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a;b;c -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - b -``` +# $unescape +Unescapes semicolons `;` from the provided text. It allows interpreting of escaped semicolons as unescaped ones. + +## Syntax +``` +$unescape[Text] +``` + +### Parameters +- `Text` `(Type: String || Flag: Emptiable)`: The text to unescape. + +## Example +``` +$nomention +$randomText[$unescape[$message]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a;b;c +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + b +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a;b;c +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + b +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a;b;c +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + a +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a;b;c +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + c +``` + +```admonish question title="What is this?" +How [`$randomText[]`](./randomText.md) and [`$message`](./message.md) works? +``` diff --git a/src/bdscript/unmute.md b/src/bdscript/unmute.md index ee7876216b4..df0bd6bb542 100644 --- a/src/bdscript/unmute.md +++ b/src/bdscript/unmute.md @@ -1,27 +1,28 @@ -# $unmute -*(deprecated)* - -> 📌 As of December 2021, this function has been deprecated in favor of [`$untimeout[]`](./untimeout.md). - -Unmutes the mentioned user. - -## Syntax -``` -$unmute[Muted] -``` - -### Parameters -- `Muted` `(Type: String || Flag: Required)`: The name of the "Muted" role (case sensitive). - -### Permissions -Required permissions that the bot must have for this function to work properly: -- `manageroles` - -## Example -``` -$nomention -$onlyPerms[manageroles;❌ You are missing permission: `MANAGE_ROLES`.] -$unmute[Muted] -✅ Successfully unmuted $username[$mentioned[1]]#$discriminator[$mentioned[1]]! -``` -![example](https://user-images.githubusercontent.com/69215413/125666289-5aecf227-0ae0-455e-8779-8501307a0894.png) +# $unmute +
+ Deprecated +
+ +> As of December 2021, this function has been deprecated in favor of [`$untimeout[]`](./untimeout.md). + +Unmutes the mentioned user. + +## Syntax +``` +$unmute[Muted Role Name] +``` + +### Parameters +- `Muted Role Name` `(Type: String || Flag: Required)`: The name of the "Muted" role (case sensitive). + +### Permissions +Required permissions that the bot must have for this function to work properly: +- `manageroles` + +## Example +``` +$nomention +$unmute[Muted] +✅ Successfully unmuted $username[$mentioned[1]]#$discriminator[$mentioned[1]]! +``` +![example](https://user-images.githubusercontent.com/69215413/125666289-5aecf227-0ae0-455e-8779-8501307a0894.png) diff --git a/src/bdscript/unpinMessage.md b/src/bdscript/unpinMessage.md index 4af795f91c0..4d81f27a801 100644 --- a/src/bdscript/unpinMessage.md +++ b/src/bdscript/unpinMessage.md @@ -1,24 +1,24 @@ -# $unpinMessage -Unpins a pinned message from the channel. - -## Syntax -``` -$unpinMessage[Channel ID;Message ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to unpin. - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `managemessages` - -## Example -``` -$nomention -$unpinMessage[$mentionedChannels[1];$noMentionMessage] -A message has been unpinned! -``` -![Screenshot_20220925_163311](https://user-images.githubusercontent.com/95774950/192140919-60177751-bc8b-4b64-b892-52e2e4f14b4e.png)\ -![InShot_20220925_163609635](https://user-images.githubusercontent.com/95774950/192140923-3ae37aec-3b12-48a9-907e-d352ba102477.jpg) +# $unpinMessage +Unpins a pinned message from the channel. + +## Syntax +``` +$unpinMessage[Channel ID;Message ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The ID of the message to unpin. + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `managemessages` + +## Example +``` +$nomention +$unpinMessage[$mentionedChannels[1];$noMentionMessage] +A message has been unpinned! +``` +![Screenshot_20220925_163311](https://user-images.githubusercontent.com/95774950/192140919-60177751-bc8b-4b64-b892-52e2e4f14b4e.png)\ +![InShot_20220925_163609635](https://user-images.githubusercontent.com/95774950/192140923-3ae37aec-3b12-48a9-907e-d352ba102477.jpg) diff --git a/src/bdscript/unregisterGuildCommands.md b/src/bdscript/unregisterGuildCommands.md index 0b11c34d1a6..8260dd30def 100644 --- a/src/bdscript/unregisterGuildCommands.md +++ b/src/bdscript/unregisterGuildCommands.md @@ -1,15 +1,15 @@ -# $unregisterGuildCommands -Unregisters all guild slash commands from the current guild. - -## Syntax -``` -$unregisterGuildCommands -``` - -## Example -``` -$nomention -$unregisterGuildCommands -Successfully unregistered all guild slash commands! -``` -![example](https://user-images.githubusercontent.com/95774950/198040434-101a9391-7f93-457a-b59e-adb8a7eda6b3.png) +# $unregisterGuildCommands +Unregisters all guild slash commands from the current guild. + +## Syntax +``` +$unregisterGuildCommands +``` + +## Example +``` +$nomention +$unregisterGuildCommands +Successfully unregistered all guild slash commands! +``` +![example](https://user-images.githubusercontent.com/95774950/198040434-101a9391-7f93-457a-b59e-adb8a7eda6b3.png) diff --git a/src/bdscript/unregisterGuildCommandsComplex.md b/src/bdscript/unregisterGuildCommandsComplex.md index 8a4c9ede325..284b5ae5dfe 100644 --- a/src/bdscript/unregisterGuildCommandsComplex.md +++ b/src/bdscript/unregisterGuildCommandsComplex.md @@ -1,20 +1,20 @@ -# $unregisterGuildCommands[] -Unregisters provided guild slash commands from the current guild. - -## Syntax -``` -$unregisterGuildCommands[Slash command name;...] -``` - -### Parameters -- `Slash command name` `(Type: String || Flag: Required)`: Name of the guild slash command to unregister. Use semicolons `;` as a separator to separate multiple guild slash command names. - -## Example -``` -$nomention -$argsCheck[>1;Provide guild slash command names!] - -$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]] -Successfully unregistered the provided guild slash commands! -``` -![example](https://user-images.githubusercontent.com/95774950/198040479-f19497a7-e93b-4695-95fb-d8b629be5a1d.png) +# $unregisterGuildCommands[] +Unregisters provided guild slash commands from the current guild. + +## Syntax +``` +$unregisterGuildCommands[Slash command name;...] +``` + +### Parameters +- `Slash command name` `(Type: String || Flag: Required)`: Name of the guild slash command to unregister. Use semicolons `;` as a separator to separate multiple guild slash command names. + +## Example +``` +$nomention +$argsCheck[>1;Provide guild slash command names!] + +$unregisterGuildCommands[$unescape[$toLowercase[$replaceText[$trimSpace[$message]; ;]]]] +Successfully unregistered the provided guild slash commands! +``` +![example](https://user-images.githubusercontent.com/95774950/198040479-f19497a7-e93b-4695-95fb-d8b629be5a1d.png) diff --git a/src/bdscript/untimeout.md b/src/bdscript/untimeout.md index f9656112a8d..fda732a43c2 100644 --- a/src/bdscript/untimeout.md +++ b/src/bdscript/untimeout.md @@ -1,30 +1,30 @@ -# $untimeout -Untimeouts a timed out user. - -## Syntax -``` -$untimeout[(User ID)] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Optional)`: The ID of the user to untimeout. If this parameter is empty, untimeouts the mentioned users. - -### Permissions -Required permissions that the bot must have for this function to work properly : -- `moderatemembers` - -## Example -- Without ID - ``` - $nomention - $untimeout[] - ``` - ![](https://user-images.githubusercontent.com/70456337/183473087-e2a109af-bc51-465b-bcb1-456c64011770.gif) - -- With ID - ``` - $nomention - $allowMention - $untimeout[$findUser[$message[1];no]] - ``` - ![](https://user-images.githubusercontent.com/70456337/183473060-8a2a74d0-594c-4794-a22d-c5d2a4732365.gif) +# $untimeout +Untimeouts a timed out user. + +## Syntax +``` +$untimeout[(User ID)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Optional)`: The ID of the user to untimeout. If this parameter is empty, untimeouts the mentioned users. + +### Permissions +Required permissions that the bot must have for this function to work properly : +- `moderatemembers` + +## Example +- Without ID + ``` + $nomention + $untimeout[] + ``` + ![](https://user-images.githubusercontent.com/70456337/183473087-e2a109af-bc51-465b-bcb1-456c64011770.gif) + +- With ID + ``` + $nomention + $allowMention + $untimeout[$findUser[$message[1];no]] + ``` + ![](https://user-images.githubusercontent.com/70456337/183473060-8a2a74d0-594c-4794-a22d-c5d2a4732365.gif) diff --git a/src/bdscript/uptime.md b/src/bdscript/uptime.md index d2e52e10631..def54ad4a60 100644 --- a/src/bdscript/uptime.md +++ b/src/bdscript/uptime.md @@ -1,31 +1,31 @@ -# $uptime -Returns how long the bot has been online. - -## Syntax -``` -$uptime -``` - -### Format -`Hour:Minute:Second` - -## Example -``` -$nomention -I've been online for `$uptime`! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - I've been online for 02:29:12! -``` +# $uptime +Returns how long the bot has been online. + +## Syntax +``` +$uptime +``` + +### Format +`Hour:Minute:Second` + +## Example +``` +$nomention +I've been online for `$uptime`! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + I've been online for 02:29:12! +``` diff --git a/src/bdscript/url.md b/src/bdscript/url.md index 3e7849eaab1..81f76e5916d 100644 --- a/src/bdscript/url.md +++ b/src/bdscript/url.md @@ -1,28 +1,54 @@ -# $url -Encodes or decodes the provided text in the URL encoding format. - -> URL encoding is a method of converting reserved, unsafe, or non-ASCII characters to a URL format that is universally accepted and understood by all web browsers and servers while URL decoding is the vice-versa of URL encoding. - -## Syntax -``` -$url[Mode;Text] -``` - -### Parameters -- `Mode` `(Type: Enum || Flag: Required)`: Whether to encode or decode the provided text. Accepts either `encode` or `decode` as input. -- `Text` `(Type: String || Flag: Emptiable)`: The text to change. - -## Example -- Encoding - ``` - $nomention - https://example.url/encode?convert=$url[encode;Hello world!!] - ``` - ![example](https://user-images.githubusercontent.com/95774950/197517522-e7429268-dfcf-4289-bb48-1554e2d4ecfa.png) - -- Decoding - ``` - $nomention - $url[decode;https://example.url/decode?convert=Hello+world%21%21] - ``` - ![example](https://user-images.githubusercontent.com/95774950/197517477-758829ff-19f6-4134-885d-8a513104f099.png) +# $url +Encodes or decodes the provided text in the URL encoding format. + +> URL encoding is a method of converting reserved, unsafe, or non-ASCII characters to a URL format that is universally accepted and understood by all web browsers and servers while URL decoding is the vice-versa of URL encoding. + +## Syntax +``` +$url[Mode;Text] +``` + +### Parameters +- `Mode` `(Type: Enum || Flag: Required)`: Whether to encode or decode the provided text. Accepts either `encode` or `decode` as input. +- `Text` `(Type: String || Flag: Emptiable)`: The text to change. + +## Example +- Encoding + ``` + $nomention + https://example.url/encode?convert=$url[encode;Hello world!!] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: https://example.url/encode?convert=Hello+world%21%21 +``` + +- Decoding + ``` + $nomention + $url[decode;https://example.url/decode?convert=Hello+world%21%21] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: https://example.url/encode?convert=Hello world!! +``` diff --git a/src/bdscript/useChannel.md b/src/bdscript/useChannel.md index 13246e4c194..88fdc67489c 100644 --- a/src/bdscript/useChannel.md +++ b/src/bdscript/useChannel.md @@ -1,22 +1,81 @@ -# $useChannel -Redirects the bot's response message to a different channel. - -> 📌 [`$useChannel`](./useChannel.md) cannot redirect the original slash command response. - -## Syntax -``` -$useChannel[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel to which the message will be redirected. - -## Example -``` -$nomention -$useChannel[$mentionedChannels[1]] -$title[hello] -$description[hi] -``` -![ex1](https://user-images.githubusercontent.com/69215413/125665386-b0458227-97d7-4aaa-9ca8-b1d869245bce.png)\ -![ex2](https://user-images.githubusercontent.com/69215413/125665365-ade65a36-0c1e-4e1c-a5c5-ad9929f769bc.png) +# $useChannel +Redirects the bot's response message to a different channel. + + + +```admonish warning +`$useChannel[]` **cannot** redirect the original slash command response. +``` + +## Syntax +``` +$useChannel[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel to which the message will be redirected. + +## Example +``` +$nomention +$useChannel[$mentionedChannels[1]] +$description[Hello!] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <#secret-channel> +``` + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + description: Hello! +``` + +```admonish question title="What is this?" +How [`$description[]`](./description.md) and [`$mentionedChannels[]`](./mentionedChannels.md) works? +``` + +```admonish tip +You also can use [`$sendMessage[]`](./sendMessage.md) with `$useChannel[]`. +``` diff --git a/src/bdscript/userAvatar.md b/src/bdscript/userAvatar.md index c3999ba74c6..93f05d8d661 100644 --- a/src/bdscript/userAvatar.md +++ b/src/bdscript/userAvatar.md @@ -1,19 +1,40 @@ -# $userAvatar -Returns a user's avatar URL. - -## Syntax -``` -$userAvatar[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to return the avatar for. - -## Example -``` -$nomention -$image[$userAvatar[$mentioned[1;yes]]] -``` -![example](https://user-images.githubusercontent.com/69215413/125360420-d3bdbb80-e339-11eb-8a52-05289b2a62bf.png) - -> 📌 You can optionally append a query string `?size=VALUE` at the end of the URL to increase the size of the avatar. The `size`'s value supports any power of two between 16 and 4096. +# $userAvatar +Returns a user's avatar URL. + +## Syntax +``` +$userAvatar[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to return the avatar for. + +## Example +``` +$nomention +$image[$userAvatar[$authorID]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + embed: + image: https://github.com/user-attachments/assets/3f669ece-44b2-441d-9051-014c13720978 +``` + +```admonish question title="What is this?" +How [`$image[]`](./image.md) and [`$authorID`](./authorID.md) works? +``` + +```admonish tip title="Image size" +You can use `?size=size` at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. +(e.g. `$image[$userAvatar[$authorID]?size=4096]`) +``` diff --git a/src/bdscript/userBadges.md b/src/bdscript/userBadges.md index 3c3c6997bf4..e53d48582d2 100644 --- a/src/bdscript/userBadges.md +++ b/src/bdscript/userBadges.md @@ -1,53 +1,58 @@ -# $userBadges -Returns a list of user badges separated by a space or the given separator. - -## Syntax -``` -$userBadges[User ID;(Separator)] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the badges from. -- `Separator` `(Type: String || Flag: Optional)`: Will be used to separate each badge. - -| Returns | Name -| ---------------------- | ---------------------- -| staff | Discord Employee -| partner | Partnered Server Owner -| hype_squad | HypeSquad Events Member -| bug_hunter_level_1 | Bug Hunter Level 1 -| hype_squad_bravery | House Bravery Member -| hype_squad_brilliance | House Brilliance Member -| hype_squad_balance | House Balance Member -| premium_early_supporter| Early Nitro Supporter -| team_pseudo_user | User is a team -| bug_hunter_level_2 | Bug Hunter Level 2 -| verified_bot | Verified Bot -| verified_developer | Early Verified Bot Developer -| certified_moderator | Moderator Programs Alumni -| bot_http_interactions | Bot uses only HTTP interactions and is shown in the online member list -| active_developer | User is an Active Developer - - - -## Example -``` -$nomention -`$userBadges[$authorID;` `]` -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example main-chat -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - hype_squad_balance partner -``` - +# $userBadges +Returns a list of user badges separated by a space or the given separator. + +## Syntax +``` +$userBadges[User ID;(Separator)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the badges from. +- `Separator` `(Type: String || Flag: Optional)`: Will be used to separate each badge. + +#### Supported Outputs + +| Returns | Name +| ---------------------- | ---------------------- +| staff | Discord Employee +| partner | Partnered Server Owner +| hype_squad | HypeSquad Events Member +| bug_hunter_level_1 | Bug Hunter Level 1 +| hype_squad_bravery | House Bravery Member +| hype_squad_brilliance | House Brilliance Member +| hype_squad_balance | House Balance Member +| premium_early_supporter| Early Nitro Supporter +| team_pseudo_user | User is a team +| bug_hunter_level_2 | Bug Hunter Level 2 +| verified_bot | Verified Bot +| verified_developer | Early Verified Bot Developer +| certified_moderator | Moderator Programs Alumni +| bot_http_interactions | Bot uses only HTTP interactions and is shown in the online member list +| active_developer | User is an Active Developer + + + +## Example +``` +$nomention +`$userBadges[$authorID;` `]` +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example main-chat +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + hype_squad_balance partner +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userBanner.md b/src/bdscript/userBanner.md index 332715e1533..290d2b64048 100644 --- a/src/bdscript/userBanner.md +++ b/src/bdscript/userBanner.md @@ -1,23 +1,23 @@ -# $userBanner -Returns user banner if the given user has one. - -## Syntax -``` -$userBanner[User ID] -``` -> The function is unable to return the user's server banner. - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the banner for. - -## Example -``` -$nomention -$sendMessage[$userBanner[$findUser[$message]]?size=4096] -``` -![example](https://user-images.githubusercontent.com/113303649/212497271-e2ebad00-2d78-4bdf-a697-c2863df527e2.png) - -![example](https://user-images.githubusercontent.com/113303649/212497313-3824e855-d634-4e8a-848e-975d6d768df3.png) - -> You can use `?size=size` at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. -> (e.g. `$image[$userBanner[$findUser[$message]]?size=4096]`) +# $userBanner +Returns user banner if the given user has one. + +## Syntax +``` +$userBanner[User ID] +``` +> The function is unable to return the user's server banner. + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the banner for. + +## Example +``` +$nomention +$sendMessage[$userBanner[$findUser[$message]]?size=4096] +``` +![example](https://user-images.githubusercontent.com/113303649/212497271-e2ebad00-2d78-4bdf-a697-c2863df527e2.png) + +![example](https://user-images.githubusercontent.com/113303649/212497313-3824e855-d634-4e8a-848e-975d6d768df3.png) + +> You can use `?size=size` at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. +> (e.g. `$image[$userBanner[$findUser[$message]]?size=4096]`) diff --git a/src/bdscript/userBannerColor.md b/src/bdscript/userBannerColor.md index eaffd48589e..483e623a749 100644 --- a/src/bdscript/userBannerColor.md +++ b/src/bdscript/userBannerColor.md @@ -1,33 +1,37 @@ -# $userBannerColor -Returns the color of the given user banner. Returns an empty string if no banner color is set. - -## Syntax -``` -$userBannerColor[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the banner color from. - -## Example -``` -$nomention -#$userBannerColor[$authorID] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - #32D167 -``` -\ -![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/3f1ad81d-2ffb-485d-b5e5-48b2a0ac0728) +# $userBannerColor +Returns the color of the given user banner. Returns an empty string if no banner color is set. + +## Syntax +``` +$userBannerColor[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the banner color from. + +## Example +``` +$nomention +#$userBannerColor[$authorID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + #32D167 +``` +\ +![example](https://github.com/Rainb0wKey/bdfd-wiki/assets/113303649/3f1ad81d-2ffb-485d-b5e5-48b2a0ac0728) + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userExists.md b/src/bdscript/userExists.md index fc2e33f098c..dbbf2a0c060 100644 --- a/src/bdscript/userExists.md +++ b/src/bdscript/userExists.md @@ -1,32 +1,34 @@ -# $userExists -Checks if a user exists in Discord using thier ID. Returns "true" if the user exists, otherwise "false" is returned. - -## Syntax -``` -$userExists[User ID] -``` - -### Parameters -- `User ID` `(Type: String, Snowflake || Flag: Required)`: The ID of the user to check. - -## Example -``` -$nomention -$userExists[$mentioned[1]] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/a9034fd5-40c2-4320-a408-2f2ee0071d9d - color: "#E67E22" - content: | - !example <@Spen> -- username: BDFD Support - avatar: https://github.com/NilPointer-Software/bdfd-wiki/assets/113303649/e5fdc906-6c14-4e19-91c0-4ce95b852c61 - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $userExists +Checks if a user exists in Discord using thier ID. Returns `true` if the user exists, otherwise `false` is returned. + +## Syntax +``` +$userExists[User ID] +``` + +### Parameters +- `User ID` `(Type: String, Snowflake || Flag: Required)`: The ID of the user to check. + +## Example +``` +$nomention +$userExists[$mentioned[1]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@Spen> +- username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + true +``` + +```admonish question title="What is this?" +How [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/userID.md b/src/bdscript/userID.md index 3f7f85285f6..d1abad3ea29 100644 --- a/src/bdscript/userID.md +++ b/src/bdscript/userID.md @@ -1,31 +1,35 @@ -# $userID -Fetches a user's ID using their username or user-tag. - -## Syntax -``` -$userID[Username#Discriminator / Username] -``` - -### Parameters -- `Username#Discriminator / Username` `(Type: String || Flag: Emptiable)`: The user's username or user-tag (User#0000) for whom to return the ID for. - -## Example -``` -$nomention -$userID[$username] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - 803569638084313098 -``` +# $userID +Fetches a user's ID using their username or user-tag. + +## Syntax +``` +$userID[Username#Discriminator / Username] +``` + +### Parameters +- `Username#Discriminator / Username` `(Type: String || Flag: Emptiable)`: The user's username or user-tag (User#0000) for whom to return the ID for. + +## Example +``` +$nomention +$userID[$username] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 803569638084313098 +``` + +```admonish question title="What is this?" +How [`$username`](./username.md) works? +``` diff --git a/src/bdscript/userInfo.md b/src/bdscript/userInfo.md index 1ce15a350b4..c7be49c535b 100644 --- a/src/bdscript/userInfo.md +++ b/src/bdscript/userInfo.md @@ -1,31 +1,58 @@ -# $userInfo -Allows you to make a 'user info' command without using a bunch of different functions at once. Returns information of the first mentioned user. - -> 📌 [`$userInfo`](./userInfo.md) automatically generates a description. So, [`$description`](./description.md) of index `1` should be avoided in the code. - -## Syntax -``` -$userInfo[Message] -``` - -### Parameters -- `Message` `(Type: String || Flag: Required)`: The message format. Check below for more information. - - > 📌 Following are sub-functions which you can use inside [`$userInfo`](./userInfo.md) to return information of the mentioned user : - > - `{username}` : Returns the user's username. - > - `{ID}` : Returns the ID of the user. - > - `{BOT}` : Returns "true" if the user is a bot otherwise, "false". - > - `{discriminator}` : Returns the user's discriminator. - -## Example -``` -$nomention -$title[User Info] -$userInfo[Username: {username} -User ID: {ID} -Bot?: {BOT} -Discriminator: {discriminator}] -``` -![example](https://user-images.githubusercontent.com/69215413/122833288-b6597c80-d2ba-11eb-88b8-9d1d5368b4f5.png) - -> 📌 [`$userInfo`](./userInfo.md) automatically generates a thumbnail of the mentioned user. If you want to remove it, put [`$thumbnail[]`](./thumbnail.md) (with empty argument) below [`$userInfo`](./userInfo.md) function. +# $userInfo +Allows you to make a 'user info' command without using a bunch of different functions at once. Returns information of the first mentioned user. + +```admonish fail +[`$userInfo`](./userInfo.md) automatically generates a description. So, [`$description`](./description.md) of index `1` should be avoided in the code. +``` + +## Syntax +``` +$userInfo[Message] +``` + +### Parameters +- `Message` `(Type: String || Flag: Required)`: The message format. Check below for more information. + +#### Sub-functions +- Following are sub-functions which you can use inside `$userInfo[]` to return information of **the mentioned** user: + +Name | Description | Replacement +------------------|-----------------------------------------------------------|------------- +`{username}` | Returns the user's username. | [`$username[]`](./usernameComplex.md) +`{ID}` | Returns the ID of the user. | [`$findUser[]`](./findUser.md) +`{BOT}` | Returns `true` if the user is a bot otherwise, `false`. | [`$isBot[]`](./isBot.md) +`{discriminator}` | Returns the user's discriminator. *(Depreacted)* | [`$discriminator[]`](./discriminator.md) *(Only For Bots)* + +## Example +``` +$nomention +$title[User Info] +$userInfo[Username: {username} +User ID: {ID} +Bot?: {BOT} +Discriminator: {discriminator}] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@RainbowKey> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + embed: + title: User Info + description: "Username: rainbow_key\n + User ID: 803569638084313098\n + Bot?: false\n + Discriminator: 0000" +``` + +```admonish tip +[`$userInfo`](./userInfo.md) automatically generates a thumbnail of the mentioned user. If you want to remove it, put [`$thumbnail[]`](./thumbnail.md) (with empty argument) below [`$userInfo`](./userInfo.md) function. +``` diff --git a/src/bdscript/userJoined.md b/src/bdscript/userJoined.md index 1c4472bb554..4b137280fe0 100644 --- a/src/bdscript/userJoined.md +++ b/src/bdscript/userJoined.md @@ -1,56 +1,60 @@ -# $userJoined -Returns the server joining date of a given user. - -## Syntax -``` -$userJoined[User ID;(Format)] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose join date will be returned. -- `Format` `(Type: String || Flag: Optional)`: Customize the default time format output. - - > 📌 Click [me](../resources/timeFormat.md) to check all supported time format values. - -## Example -- Default format - ``` - $nomention - $userJoined[$authorID] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - 2022-08-16 -``` - -- Custom format - ``` - $nomention - $userJoined[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - August 16, 2022 at 8:39 AM (UTC +00:00) -``` +# $userJoined +Returns the server joining date of a given user. + +## Syntax +``` +$userJoined[User ID;(Format)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose join date will be returned. +- `Format` `(Type: String || Flag: Optional)`: Customize the default time format output. + + > Click [me](../resources/timeFormat.md) to check all supported time format values. + +## Example +- Default format + ``` + $nomention + $userJoined[$authorID] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 2022-08-16 +``` + +- Custom format + ``` + $nomention + $userJoined[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + August 16, 2022 at 8:39 AM (UTC +00:00) +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userJoinedDiscord.md b/src/bdscript/userJoinedDiscord.md index 06cc6309ce2..8ad63e48e6f 100644 --- a/src/bdscript/userJoinedDiscord.md +++ b/src/bdscript/userJoinedDiscord.md @@ -1,60 +1,66 @@ -# $userJoinedDiscord -*(deprecated)* - -> 📌 As of November 2022, this function has been deprecated in favor of [`$creationDate[]`](./creationDate.md). -> -> 📌 Besides user IDs, `$userJoinedDiscord[]` can also return the creation date of any valid Discord Snowflake ID. - -Returns the account creation date of a given user. - -## Syntax -``` -$userJoinedDiscord[User ID;(Format)] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose account creation date will be returned. -- `Format` `(Type: String || Flag: Optional)`: Customize the default [time format](../resources/timeFormat.md) output. - -## Example -- Default format - ``` - $nomention - $userJoinedDiscord[$authorID] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - 2021-01-26 -``` - -- Custom format - ``` - $nomention - $userJoinedDiscord[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] - ``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - January 26, 2021 at 10:18 AM (UTC +00:00) -``` +# $userJoinedDiscord +
+ Deprecated +
+ +> As of November 2022, this function has been deprecated in favor of [`$creationDate[]`](./creationDate.md). + +> Besides user IDs, `$userJoinedDiscord[]` can also return the creation date of any valid Discord Snowflake ID. + +Returns the account creation date of a given user. + +## Syntax +``` +$userJoinedDiscord[User ID;(Format)] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user whose account creation date will be returned. +- `Format` `(Type: String || Flag: Optional)`: Customize the default [time format](../resources/timeFormat.md) output. + +## Example +- Default format + ``` + $nomention + $userJoinedDiscord[$authorID] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 2021-01-26 +``` + +- Custom format + ``` + $nomention + $userJoinedDiscord[$authorID;January 2, 2006 at 3:04 PM (MST -07:00)] + ``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + January 26, 2021 at 10:18 AM (UTC +00:00) +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userLeaderboard.md b/src/bdscript/userLeaderboard.md index 8a7066044d0..d9cb8f7029c 100644 --- a/src/bdscript/userLeaderboard.md +++ b/src/bdscript/userLeaderboard.md @@ -1,23 +1,43 @@ -# $userLeaderboard -Returns the top 10 users' usernames and values for a given user variable. - -> 📌 [`$userLeaderboard`](./userLeaderboard.md) automatically generates a description. So, [`$description`](./description.md) of index `1` should be avoided in the code. - -## Syntax -``` -$userLeaderboard[Variable name;(Sort)] -``` - -### Parameters -- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. -- `Sort` `(Type: Enum || Flag: Optional)`: Sorts the leaderboard values in ascending (`asc`) or descending (`desc`) order. Defaults to `desc`. - -## Example -``` -$nomention -$userLeaderboard[Money;asc] -``` -![Screenshot_20221023_113048](https://user-images.githubusercontent.com/95774950/197376578-309895b3-4e37-44c8-8bcc-acb73578fe78.png) - -> 📌 Why is my leaderboard showing inaccurate values?\ -Leaderboard values are not updated in real-time. The previous values are cached for a short duration. It will take about 5 minutes to show the updated values. +# $userLeaderboard +Returns the top 10 users' usernames and values for a given user variable. + +```admonish warning +`$userLeaderboard[]` automatically generates a description. So, [`$description[]`](./description.md) of index `1` **should be avoided** in the code. +``` + +## Syntax +``` +$userLeaderboard[Variable name;(Sort)] +``` + +### Parameters +- `Variable name` `(Type: String || Flag: Required)`: The variable to create the leaderboard for. +- `Sort` `(Type: Enum || Flag: Optional)`: Sorts the leaderboard values in ascending (`asc`) or descending (`desc`) order. Defaults to `desc`. + +## Example +``` +$nomention +$userLeaderboard[Money;asc] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + embed: + description: "1. RainbowKey - 2146\n +2. MineBartekSA - 1987\n +3. Menhera Bread - 863" +``` + +```admonish question title="Why is my leaderboard showing inaccurate values?" +Leaderboard values are not updated in real-time. The previous values are cached for a short duration. It will take about 5 minutes to show the updated values. +``` diff --git a/src/bdscript/userPerms.md b/src/bdscript/userPerms.md index dac1d0edadd..4a47f0412fd 100644 --- a/src/bdscript/userPerms.md +++ b/src/bdscript/userPerms.md @@ -1,33 +1,37 @@ -# $userPerms -Returns a user's permissions. - -## Syntax -``` -$userPerms[User ID;Return amount;Separator] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get permissions for. -- `Return amount` `(Type: Integer || Flag: Required)`: The number of permissions to return. Use `-1` to return all. -- `Separator` `(Type: String || Flag: Required)`: A text/character which is used for separating each permission. - -## Example -``` -$nomention -$userPerms[$authorID;-1;, ] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - CREATE_INSTANT_INVITE, ADMINISTRATOR, ADD_REACTIONS, STREAM, VIEW_CHANNEL, SEND_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, MENTION_EVERYONE, USE_EXTERNAL_EMOJIS, CONNECT, SPEAK, USE_VAD, CHANGE_NICKNAME, USE_APPLICATION_COMMANDS, REQUEST_TO_SPEAK, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, USE_EXTERNAL_STICKERS, SEND_MESSAGES_IN_THREADS -``` +# $userPerms +Returns a user's permissions. + +## Syntax +``` +$userPerms[User ID;Return amount;Separator] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get permissions for. +- `Return amount` `(Type: Integer || Flag: Required)`: The number of permissions to return. Use `-1` to return all. +- `Separator` `(Type: String || Flag: Required)`: A text/character which is used for separating each permission. + +## Example +``` +$nomention +$userPerms[$authorID;-1;, ] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + CREATE_INSTANT_INVITE, ADMINISTRATOR, ADD_REACTIONS, STREAM, VIEW_CHANNEL, SEND_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, MENTION_EVERYONE, USE_EXTERNAL_EMOJIS, CONNECT, SPEAK, USE_VAD, CHANGE_NICKNAME, USE_APPLICATION_COMMANDS, REQUEST_TO_SPEAK, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, USE_EXTERNAL_STICKERS, SEND_MESSAGES_IN_THREADS +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userReacted.md b/src/bdscript/userReacted.md index 04c0007bdba..368c01008e1 100644 --- a/src/bdscript/userReacted.md +++ b/src/bdscript/userReacted.md @@ -1,20 +1,73 @@ -# $userReacted -Checks if a user reacted to a message with the provided emoji. Returns "true" if the user did react otherwise, "false". - -## Syntax -``` -$userReacted[Channel ID;Message ID;User ID;Emoji] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. -- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to check the reactions for. -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check the reaction for. -- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji of the reaction to check. - -## Example -``` -$nomention -$userReacted[$channelID;$message;$authorID;🍀] -``` -![Screenshot_20221023_105811](https://user-images.githubusercontent.com/95774950/197375576-dbe6fc17-68cb-44ed-802a-81a16db98ce9.png) +# $userReacted +Checks if a user reacted to a message with the provided emoji. Returns "true" if the user did react otherwise, "false". + +## Syntax +``` +$userReacted[Channel ID;Message ID;User ID;Emoji] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel where the message is located. +- `Message ID` `(Type: Snowflake || Flag: Required)`: The message to check the reactions for. +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to check the reaction for. +- `Emoji` `(Type: Emoji || Flag: Required)`: The emoji of the reaction to check. + +## Example +``` +$nomention +$userReacted[$channelID;$message;$authorID;❤ī¸] +``` + +``` discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Reactions! Message ID: 1291801528054845451 + reactions: + - emoji: https://em-content.zobj.net/thumbs/120/mozilla/36/heavy-black-heart_2764.png + name: ":heart:" + reacted: true + count: 2 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1291801528054845451 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Reacted?: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Reactions! Message ID: 1291802266793414717 + reactions: + - emoji: https://em-content.zobj.net/thumbs/120/mozilla/36/heavy-black-heart_2764.png + name: ":heart:" + count: 1 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1291802266793414717 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Reacted?: false +``` + +```admonish question title="What is this?" +How [`$channelID`](./channelID.md), [`$message`](./message.md) and [`$authorID`](./authorID.md) works? +``` diff --git a/src/bdscript/userRoles.md b/src/bdscript/userRoles.md index ea61225c9e3..ea9a6110413 100644 --- a/src/bdscript/userRoles.md +++ b/src/bdscript/userRoles.md @@ -1,18 +1,42 @@ -# $userRoles -Returns all role names given to the user. - -## Syntax -``` -$userRoles[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user for whom to return the role names. - -## Example -``` -$nomention -$description[<@$mentioned[1;yes]>'s roles: -$userRoles[$mentioned[1;yes]]] -``` -![example](https://user-images.githubusercontent.com/69215413/125122358-4e30d600-e0c3-11eb-8930-07276f1bfbbd.png) +# $userRoles +Returns all role names given to the user. + +## Syntax +``` +$userRoles[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user for whom to return the role names. + +## Example +``` +$nomention +**My roles**: +$userRoles[$authorID] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: "My roles:\n + Support \n + Wiki Contributor \n + User" +``` + +```admonish question title="What is this?" +How [`$authorID`](./authorID.md) works? +``` + +```admonish tip +You can use [`$textSplit[]`](./textSplit.md) to specify a different separator. +``` diff --git a/src/bdscript/userServerAvatar.md b/src/bdscript/userServerAvatar.md index a7a7bda54bb..70eb16989ed 100644 --- a/src/bdscript/userServerAvatar.md +++ b/src/bdscript/userServerAvatar.md @@ -1,17 +1,40 @@ -# $userServerAvatar -Returns the URL for the server avatar of a given user. - -## Syntax -``` -$userServerAvatar[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user from whom to get the server avatar. If the user doesn't have a server avatar, then the default user avatar will be returned instead. - -## Example -``` -$nomention -$image[$userServerAvatar[$authorID]?size=4096] -``` -![example](https://user-images.githubusercontent.com/95774950/187596435-e7d3308a-8723-4750-bb3b-df9325f99637.png) +# $userServerAvatar +Returns the URL for the server avatar of a given user. + +## Syntax +``` +$userServerAvatar[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user from whom to get the server avatar. If the user doesn't have a server avatar, then the default user avatar will be returned instead. + +## Example +``` +$nomention +$image[$userServerAvatar[$authorID]] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + embed: + image: https://github.com/user-attachments/assets/3f669ece-44b2-441d-9051-014c13720978 +``` + +```admonish question title="What is this?" +How [`$image[]`](./image.md) and [`$authorID`](./authorID.md) works? +``` + +```admonish tip title="Image size" +You can use `?size=size` at the end of the banner URL to increase/decrease the image size. Example sizes: 1024, 2048, 4096. +(e.g. `$image[$userServerAvatar[$authorID]?size=4096]`) +``` diff --git a/src/bdscript/username.md b/src/bdscript/username.md index 516b821e04a..a71a0cee64c 100644 --- a/src/bdscript/username.md +++ b/src/bdscript/username.md @@ -1,27 +1,26 @@ -# $username -Returns the username of the author of the message. - -## Syntax -``` -$username -``` - -## Example -``` -$nomention -Hello $username! -``` - -``` discord yaml -- user_id: 696368083517964288 - username: Spen - color: "#b9a0e0" - content: | - !echo - -- username: Wiki Bot - color: "#b9a0e0" - bot: true - content: | - Hello Spen! -``` +# $username +Returns the username of the author of the message. + +## Syntax +``` +$username +``` + +## Example +``` +$nomention +Hello $username! +``` + +``` discord yaml +- user_id: 696368083517964288 + username: Spen + color: "#b9a0e0" + content: | + !example +- username: Wiki Bot + color: "#b9a0e0" + bot: true + content: | + Hello Spen! +``` diff --git a/src/bdscript/usernameComplex.md b/src/bdscript/usernameComplex.md index a5bebe9fa61..4f1ced81b46 100644 --- a/src/bdscript/usernameComplex.md +++ b/src/bdscript/usernameComplex.md @@ -1,17 +1,35 @@ -# $username[] -Returns the username for the provided user ID. - -## Syntax -``` -$username[User ID] -``` - -### Parameters -- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the username for. - -## Example -``` -$nomention -$username just hugged $username[$mentioned[1]]! -``` -![example](https://user-images.githubusercontent.com/69215413/114783383-f430a680-9d47-11eb-91e5-6ade1c6ef234.png) +# $username[] +Returns the username for the provided user ID. + +## Syntax +``` +$username[User ID] +``` + +### Parameters +- `User ID` `(Type: Snowflake || Flag: Required)`: The user to get the username for. + +## Example +``` +$nomention +$username just hugged $username[$mentioned[1]]! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example <@MineBartekSA> +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + RainbowKey just hugged <@MineBartekSA>! +``` + +```admonish question title="What is this?" +How [`$username`](./username.md) and [`$mentioned[]`](./mentioned.md) works? +``` diff --git a/src/bdscript/var.md b/src/bdscript/var.md index 514036a6861..ddc3f2de938 100644 --- a/src/bdscript/var.md +++ b/src/bdscript/var.md @@ -1,31 +1,31 @@ -# $var -Creates a temporary variable. - -Unlike, it's counterpart variables (i.e [`$setVar`](./setVar.md), [`$setUserVar`](./setUserVar.md) etc.) which needs you to create a variable in the app, [`$var[]`](./var.md) doesn't require you to do that. -Instead, it creates the variable automatically during it's runtime and gets deleted once the command execution terminates. - -The data stored in the temporary variable can only be retrieved during its execution period and is removed once it's finished. - -> 📌 This function can only be used in `BDScript 2` script language. - -## Syntax -``` -$var[Name;(Value)] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name of the temporary variable. -- `Value` `(Type: String || Flag: Vacantable)`: The data to store - -> 📌 To retrieve the temporary stored value, type `$var[Name]`, where *"Name"* is the temporary variable name. - -## Example -``` -$nomention -$argsCheck[>1;Type a message!] - -$var[ID;$sendMessage[$toLowercase[$message];yes]] - -$addButton[no;interactionID;Example;secondary;;;$var[ID]] -``` -![Example](https://user-images.githubusercontent.com/70456337/189480166-d37cbdb8-05ce-44e8-8f2e-14d030baa9a9.png) +# $var +Creates a temporary variable. + +Unlike, it's counterpart variables (i.e [`$setVar`](./setVar.md), [`$setUserVar`](./setUserVar.md) etc.) which needs you to create a variable in the app, [`$var[]`](./var.md) doesn't require you to do that. +Instead, it creates the variable automatically during it's runtime and gets deleted once the command execution terminates. + +The data stored in the temporary variable can only be retrieved during its execution period and is removed once it's finished. + +> 📌 This function can only be used in `BDScript 2` script language. + +## Syntax +``` +$var[Name;(Value)] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name of the temporary variable. +- `Value` `(Type: String || Flag: Vacantable)`: The data to store + +> 📌 To retrieve the temporary stored value, type `$var[Name]`, where *"Name"* is the temporary variable name. + +## Example +``` +$nomention +$argsCheck[>1;Type a message!] + +$var[ID;$sendMessage[$toLowercase[$message];yes]] + +$addButton[no;interactionID;Example;secondary;;;$var[ID]] +``` +![Example](https://user-images.githubusercontent.com/70456337/189480166-d37cbdb8-05ce-44e8-8f2e-14d030baa9a9.png) diff --git a/src/bdscript/varExistError.md b/src/bdscript/varExistError.md index c108e61dc03..14ef0a69f36 100644 --- a/src/bdscript/varExistError.md +++ b/src/bdscript/varExistError.md @@ -1,45 +1,45 @@ -# $varExistError -Returns a custom error if a certain variable doesn't exist in the app. - -## Syntax -``` -$varExistError[Name;Error message] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The variable that should exist. -- `Error message` `(Type: String || Flag: Emptiable)`: The custom error message to return if the variable doesn't exist. - -## Example -``` -$nomention -$varExistError[Cool;Add the 'Cool' variable in the app.] -You are now cool! -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - Add the 'Cool' variable in the app. -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - You are now cool! -``` +# $varExistError +Returns a custom error if a certain variable doesn't exist in the app. + +## Syntax +``` +$varExistError[Name;Error message] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The variable that should exist. +- `Error message` `(Type: String || Flag: Emptiable)`: The custom error message to return if the variable doesn't exist. + +## Example +``` +$nomention +$varExistError[Cool;Add the 'Cool' variable in the app.] +You are now cool! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + Add the 'Cool' variable in the app. +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + You are now cool! +``` diff --git a/src/bdscript/varExists.md b/src/bdscript/varExists.md index 6ef05deed4b..a15278341a7 100644 --- a/src/bdscript/varExists.md +++ b/src/bdscript/varExists.md @@ -1,42 +1,46 @@ -# $varExists -Checks if a variable exists. Returns `true` if it exists, otherwise `false`. - -## Syntax -``` -$varExists[Name] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The variable's name to check. - -## Example -``` -$nomention -$varExists[$message] -``` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hi -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - false -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Money -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - true -``` +# $varExists +Checks if a variable exists. Returns `true` if it exists, otherwise `false`. + +## Syntax +``` +$varExists[Name] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The variable's name to check. + +## Example +``` +$nomention +$varExists[$message] +``` +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hi +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + false +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Money +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + true +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` diff --git a/src/bdscript/variablesCount.md b/src/bdscript/variablesCount.md index f30784603a6..bbe240ddce0 100644 --- a/src/bdscript/variablesCount.md +++ b/src/bdscript/variablesCount.md @@ -1,31 +1,31 @@ -# $variablesCount -Returns how many of a certain variable type the bot has. - -## Syntax -``` -$variablesCount[Type] -``` - -### Parameters -- `Type` `(Type: Enum || Flag: Required)`: The variable type to return the count for. Accepts either `user`, `server`, `channel`, or `globaluser` as input. - -## Example -``` -$nomention -$variablesCount[server] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- username: BDFD Support - user_id: 1009018156494368798 - color: "#378afa" - bot: true - verified: true - content: | - 4 -``` +# $variablesCount +Returns how many of a certain variable type the bot has. + +## Syntax +``` +$variablesCount[Type] +``` + +### Parameters +- `Type` `(Type: Enum || Flag: Required)`: The variable type to return the count for. Accepts either `user`, `server`, `channel`, or `globaluser` as input. + +## Example +``` +$nomention +$variablesCount[server] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 4 +``` diff --git a/src/bdscript/voiceUserLimit.md b/src/bdscript/voiceUserLimit.md new file mode 100644 index 00000000000..8d469df74bb --- /dev/null +++ b/src/bdscript/voiceUserLimit.md @@ -0,0 +1,51 @@ +# $voiceUserLimit +Returns the user limit of the provided voice channel. + +## Syntax +``` +$voiceUserLimit[(Voice Channnel ID)] +``` + +### Parameters +- `Voice Channnel ID` `(Type: Snowflake || Flag: Optional)`: What is the voice channel to get the user limit. + +## Example +``` +$nomention +Voice User Limit: $voiceUserLimit[$message] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 611281459080331274 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 0 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 827255538705236019 +- username: BDFD Support + user_id: 1009018156494368798 + color: "#378afa" + bot: true + verified: true + content: | + 99 +``` + +```admonish question title="What is this?" +How [`$message`](./message.md) works? +``` + +```admonish tip +You can use `$voiceUserLimit[]` (without parameters) only in the **voice chat**. +``` diff --git a/src/bdscript/year.md b/src/bdscript/year.md index 302a753e720..289ccb03c36 100644 --- a/src/bdscript/year.md +++ b/src/bdscript/year.md @@ -1,29 +1,34 @@ -# $year -Returns the current year. - -> You can use [`$time`](./time.md) to change the timezone. - -## Syntax -``` -$year -``` - -## Example -``` -$nomention -Current Year: $year -``` - -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !year -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - content: | - Current Year: 2024 -``` +# $year +Returns the current year. + +## Syntax +``` +$year +``` + +## Example +``` +$nomention +Current Year: $year +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | +
+``` + +```admonish info title="Timezone" +You can use [`$time[]`](./time.md) to change the timezone. +``` + + diff --git a/src/callbacks/awaitedCommand.md b/src/callbacks/awaitedCommand.md index 7bfd3e1c343..4f36eb32b01 100644 --- a/src/callbacks/awaitedCommand.md +++ b/src/callbacks/awaitedCommand.md @@ -1,190 +1,194 @@ -# $awaitedCommand -_Triggered when an awaited command gets initiated._ - -`$awaitedCommand[]` is a callback, which means it's used in the command trigger (not the code). The command is ran when an awaited command gets initiated. - -## Syntax -``` -$awaitedCommand[Name;(Filter)] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name used in the [`$awaitFunc[]`](../bdscript/awaitFunc.md) function. -- `Filter` `(Type: String || Flag: Optional)`: It is used to limit the user input. - -### Supported filters -- `` - Accepts only number input. -- `` - Accepts only specified words provided inside `<>`. Use `/` as a separator for multiple words. - -## Example -### Without filter -**Trigger: `$awaitedCommand[say;]`** -``` -$nomention -$message -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !say - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - What do you want me to say? - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - I love BDFD! - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - I love BDFD! -``` -\ -### With choose filter -**Trigger: `$awaitedCommand[odd;]`** -``` -$nomention -$if[$message==yes] - Your answer is correct! -$elseif[$message==no] - Your answer is incorrect! -$elseif[$message==cancel] - Command cancelled! -$endif -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !odd - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Is "19" an odd number? - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - yes - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Your answer is correct! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !odd - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Is "19" an odd number? - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - no - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Your answer is incorrect! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !odd - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Is "19" an odd number? - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - cancel - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Command cancelled! -``` -\ -### With numeric filter -**Trigger: `$awaitedCommand[odd;]`** -``` -$nomention -You have provided a number: $message -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !number - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Provide a number! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - 7 - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - You have provided a number: 7 -``` - -> For more info, see the [Awaited Commands Guide](../guides/general/awaitedCommands.md). +# $awaitedCommand +
+ Callback +
+ +_Triggered when an awaited command gets initiated._ + +`$awaitedCommand[]` is a callback, which means it's used in the command trigger (not the code). The command is ran when an awaited command gets initiated. + +## Syntax +``` +$awaitedCommand[Name;(Filter)] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name used in the [`$awaitFunc[]`](../bdscript/awaitFunc.md) function. +- `Filter` `(Type: String || Flag: Optional)`: It is used to limit the user input. + +### Supported filters +- `` - Accepts only number input. +- `` - Accepts only specified words provided inside `<>`. Use `/` as a separator for multiple words. + +## Example +### Without filter +**Trigger: `$awaitedCommand[say;]`** +``` +$nomention +$message +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !say + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + What do you want me to say? + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + I love BDFD! + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + I love BDFD! +``` +\ +### With choose filter +**Trigger: `$awaitedCommand[odd;]`** +``` +$nomention +$if[$message==yes] + Your answer is correct! +$elseif[$message==no] + Your answer is incorrect! +$elseif[$message==cancel] + Command cancelled! +$endif +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !odd + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Is "19" an odd number? + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + yes + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Your answer is correct! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !odd + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Is "19" an odd number? + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + no + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Your answer is incorrect! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !odd + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Is "19" an odd number? + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + cancel + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Command cancelled! +``` +\ +### With numeric filter +**Trigger: `$awaitedCommand[odd;]`** +``` +$nomention +You have provided a number: $message +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !number + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Provide a number! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + 7 + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + You have provided a number: 7 +``` + +> For more info, see the [Awaited Commands Guide](../guides/general/awaitedCommands.md). diff --git a/src/callbacks/awaitedCommandError.md b/src/callbacks/awaitedCommandError.md index 34854f54df4..3365b6a0e2e 100644 --- a/src/callbacks/awaitedCommandError.md +++ b/src/callbacks/awaitedCommandError.md @@ -1,50 +1,54 @@ -# $awaitedCommandError -_Triggered when an awaited command doesn't match with provided filter._ - -`$awaitedCommandError[]` is a callback, which means it's used in the command trigger (not the code). The command is ran when an awaited command doesn't match with provided filter. - -## Syntax -``` -$awaitedCommandError[Name] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name used in the [`$awaitFunc[]`](../bdscript/awaitFunc.md) function. - -## Example -**Trigger: `$awaitedCommandError[number]`** -``` -$nomention -Invalid number! -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !number - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Provide a number! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - abc - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Invalid number! -``` - -> For more info, see the [Awaited Commands Guide](../guides/general/awaitedCommands.md). +# $awaitedCommandError +
+ Callback +
+ +_Triggered when an awaited command doesn't match with provided filter._ + +`$awaitedCommandError[]` is a callback, which means it's used in the command trigger (not the code). The command is ran when an awaited command doesn't match with provided filter. + +## Syntax +``` +$awaitedCommandError[Name] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name used in the [`$awaitFunc[]`](../bdscript/awaitFunc.md) function. + +## Example +**Trigger: `$awaitedCommandError[number]`** +``` +$nomention +Invalid number! +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !number + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Provide a number! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + abc + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Invalid number! +``` + +> For more info, see the [Awaited Commands Guide](../guides/general/awaitedCommands.md). diff --git a/src/callbacks/introduction.md b/src/callbacks/introduction.md index 6ff58750b4e..cea77cd9d74 100644 --- a/src/callbacks/introduction.md +++ b/src/callbacks/introduction.md @@ -1,4 +1,4 @@ -# Callbacks -Callbacks in BDFD are functions for triggers which are executed when a certain action is performed. These actions include banning, unbanning, user joining, user leaving, and more. - -Callbacks are not used in the command code, they are used in the command trigger. This section will explain the various callbacks you can use. +# Callbacks +Callbacks in BDFD are functions for triggers which are executed when a certain action is performed. These actions include banning, unbanning, user joining, user leaving, and more. + +Callbacks are not used in the command code, they are used in the command trigger. This section will explain the various callbacks you can use. diff --git a/src/callbacks/onBanAdd.md b/src/callbacks/onBanAdd.md index bf0936b950f..3fd5b095c8c 100644 --- a/src/callbacks/onBanAdd.md +++ b/src/callbacks/onBanAdd.md @@ -1,60 +1,64 @@ -# $onBanAdd -*Triggered when a user gets banned from the server.* - -`$onBanAdd[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user is banned from the server. - -## Syntax -``` -$onBanAdd[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. - -## Example -1. Create a command with `$onBanAdd[Channel ID]` as the trigger. - > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! - - ![example1](https://user-images.githubusercontent.com/69215413/129491257-7fa6c9c4-e4b4-47c1-8df0-3f580ffa79bf.png) - -2. Input your code/reply text. - > 🧙‍♂ī¸ You can use functions like `$username`, `$authorID`, `$authorAvatar`, [`$getBanReason[]`](../bdscript/getBanReason.md) here. - - ![example2](https://user-images.githubusercontent.com/69215413/129491086-e6a96af6-edeb-4f2b-b226-0e49ed59f544.png) - -3. Now you have a ban message! ✨ - ``` discord yaml - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - <@User> was struck with the ban hammer! - - - type: leave - content: | - User left. - ``` - -\ -## Advanced -### Per-Server $onBanAdd -Both free and premium users can use `$onBanAdd[]`, and all users can put `$getServerVar[]` within `$onBanAdd[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ -If you own a public bot and want to make it so multiple different servers can use `$onBanAdd[]` *(e.g. set their own logging channel)*, follow these steps: - -1. Create a variable named "`logs`" and the value set to nothing.\ -![image](https://user-images.githubusercontent.com/111157596/239278501-dae381e3-4fe0-4e5f-9cc8-e18d0f56215f.png) - -2. Create a command for setting the logging channel, then put the following in your code: - ``` - $nomention - $onlyAdmin[You need the admin permission to use that!] - $argsCheck[>1;Please mention a channel!] - Logging channel updated! - $setServerVar[logs;$mentionedChannels[1]] - ``` - - > 📝 Servers will need to setup the channel they want the ban message to send to *(by running a command with the code above)*. - -3. Now replace `$onBanAdd[Channel ID]` in your command trigger, with `$onBanAdd[$getServerVar[logs]]` and you're all set! +# $onBanAdd +
+ Callback +
+ +*Triggered when a user gets banned from the server.* + +`$onBanAdd[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user is banned from the server. + +## Syntax +``` +$onBanAdd[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. + +## Example +1. Create a command with `$onBanAdd[Channel ID]` as the trigger. + > You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! + + ![example1](https://user-images.githubusercontent.com/69215413/129491257-7fa6c9c4-e4b4-47c1-8df0-3f580ffa79bf.png) + +2. Input your code/reply text. + > You can use functions like `$username`, `$authorID`, `$authorAvatar`, [`$getBanReason[]`](../bdscript/getBanReason.md) here. + + ![example2](https://user-images.githubusercontent.com/69215413/129491086-e6a96af6-edeb-4f2b-b226-0e49ed59f544.png) + +3. Now you have a ban message! ✨ + ``` discord yaml + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + <@User> was struck with the ban hammer! + + - type: leave + content: | + User left. + ``` + +\ +## Advanced +### Per-Server $onBanAdd +Both free and premium users can use `$onBanAdd[]`, and all users can put `$getServerVar[]` within `$onBanAdd[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ +If you own a public bot and want to make it so multiple different servers can use `$onBanAdd[]` *(e.g. set their own logging channel)*, follow these steps: + +1. Create a variable named "`logs`" and the value set to nothing.\ +![image](https://user-images.githubusercontent.com/111157596/239278501-dae381e3-4fe0-4e5f-9cc8-e18d0f56215f.png) + +2. Create a command for setting the logging channel, then put the following in your code: + ``` + $nomention + $onlyAdmin[You need the admin permission to use that!] + $argsCheck[>1;Please mention a channel!] + Logging channel updated! + $setServerVar[logs;$mentionedChannels[1]] + ``` + + > 📝 Servers will need to setup the channel they want the ban message to send to *(by running a command with the code above)*. + +3. Now replace `$onBanAdd[Channel ID]` in your command trigger, with `$onBanAdd[$getServerVar[logs]]` and you're all set! diff --git a/src/callbacks/onBanRemove.md b/src/callbacks/onBanRemove.md index 7b225e1e7c4..24a1991dc51 100644 --- a/src/callbacks/onBanRemove.md +++ b/src/callbacks/onBanRemove.md @@ -1,56 +1,60 @@ -# $onBanRemove -*Triggered when a user gets unbanned from the server.* - -`$onBanRemove[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user is unbanned from the server. - -## Syntax -``` -$onBanRemove[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. - -## Example -1. Create a command with `$onBanRemove[Channel ID]` as the trigger. - > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! - - ![example1](https://user-images.githubusercontent.com/69215413/129492147-3d51dd5c-9628-43f7-a175-faed03442501.png) - -2. Input your code/reply text. - > 🧙‍♂ī¸ You can use functions like `$username`, `$authorID`, `$authorAvatar` here. - - ![example2](https://user-images.githubusercontent.com/69215413/129492022-8acd4877-638c-4855-8970-13dab37b032e.png) - -3. Now you have an unban message! ✨\ - ``` discord yaml - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Carl-bot (235148962103951360) was unbanned! - ``` - -\ -## Advanced -### Per-Server $onBanRemove -Both free and premium users can use `$onBanRemove[]`, and all users can put `$getServerVar[]` within `$onBanRemove[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ -If you own a public bot and want to make it so multiple different servers can use `$onBanRemove[]` *(e.g. set their own logging channel)*, follow these steps: - -1. Create a variable named "`logs`" and the value set to nothing.\ -![image](https://user-images.githubusercontent.com/111157596/239278501-dae381e3-4fe0-4e5f-9cc8-e18d0f56215f.png) - -2. Create a command for setting the logging channel, then put the following in your code: - ``` - $nomention - $onlyAdmin[You need the admin permission to use that!] - $argsCheck[>1;Please mention a channel!] - Logging channel updated! - $setServerVar[logs;$mentionedChannels[1]] - ``` - - > 📝 Servers will need to setup the channel they want the unban message to send to *(by running a command with the code above)*. - -3. Now replace `$onBanRemove[Channel ID]` in your command trigger, with `$onBanRemove[$getServerVar[logs]]` and you're all set! +# $onBanRemove +
+ Callback +
+ +*Triggered when a user gets unbanned from the server.* + +`$onBanRemove[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user is unbanned from the server. + +## Syntax +``` +$onBanRemove[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. + +## Example +1. Create a command with `$onBanRemove[Channel ID]` as the trigger. + > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! + + ![example1](https://user-images.githubusercontent.com/69215413/129492147-3d51dd5c-9628-43f7-a175-faed03442501.png) + +2. Input your code/reply text. + > 🧙‍♂ī¸ You can use functions like `$username`, `$authorID`, `$authorAvatar` here. + + ![example2](https://user-images.githubusercontent.com/69215413/129492022-8acd4877-638c-4855-8970-13dab37b032e.png) + +3. Now you have an unban message! ✨\ + ``` discord yaml + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Carl-bot (235148962103951360) was unbanned! + ``` + +\ +## Advanced +### Per-Server $onBanRemove +Both free and premium users can use `$onBanRemove[]`, and all users can put `$getServerVar[]` within `$onBanRemove[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ +If you own a public bot and want to make it so multiple different servers can use `$onBanRemove[]` *(e.g. set their own logging channel)*, follow these steps: + +1. Create a variable named "`logs`" and the value set to nothing.\ +![image](https://user-images.githubusercontent.com/111157596/239278501-dae381e3-4fe0-4e5f-9cc8-e18d0f56215f.png) + +2. Create a command for setting the logging channel, then put the following in your code: + ``` + $nomention + $onlyAdmin[You need the admin permission to use that!] + $argsCheck[>1;Please mention a channel!] + Logging channel updated! + $setServerVar[logs;$mentionedChannels[1]] + ``` + + > 📝 Servers will need to setup the channel they want the unban message to send to *(by running a command with the code above)*. + +3. Now replace `$onBanRemove[Channel ID]` in your command trigger, with `$onBanRemove[$getServerVar[logs]]` and you're all set! diff --git a/src/callbacks/onInteraction.md b/src/callbacks/onInteraction.md index 8f7740e02ad..579d4b665fe 100644 --- a/src/callbacks/onInteraction.md +++ b/src/callbacks/onInteraction.md @@ -1,114 +1,118 @@ -# $onInteraction -Triggered upon an interaction being emitted (e.g. a button being clicked). - -## Syntax -``` -$onInteraction -``` - -### Supports -- **[Buttons](../guides/general/interactions/buttons/aboutButtons.md)** -- **[Select Menu](../guides/general/interactions/selectMenus/aboutSelectMenu.md)** -- **[Modals](../guides/general/interactions/modals/aboutModals.md)** -- **[`$customID`](../bdscript/customID.md)** - -## Example -``` -$nomention -$if[$customID==interaction] - $sendMessage[Hello!] -$endif - -$if[$customID==onlyauthor-$authorID] - $sendMessage[Hello $displayName!] -$endif -``` -``` discord yaml -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Click - components: - - - - type: primary - label: Interaction ID: interaction - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Click - components: - - - - type: primary - label: Interaction ID: onlyauthor-$authorID - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello Nicky! -``` - -``` discord yaml -- user_id: 154148273307910144 - username: MineBartekSA - color: "#F1BDEE" - content: | - !example - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Click - components: - - - - type: primary - label: Interaction ID: onlyauthor-$authorID - -- user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello MineBartekSA! - -- user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - I can't use the button -``` - -> How [`$if[]`](../guides/general/ifStatements.md) or [`$customID[]`](../bdscript/customID.md) works? +# $onInteraction +
+ Callback +
+ +Triggered upon an interaction being emitted (e.g. a button being clicked). + +## Syntax +``` +$onInteraction +``` + +### Supports +- **[Buttons](../guides/general/interactions/buttons/aboutButtons.md)** +- **[Select Menu](../guides/general/interactions/selectMenus/aboutSelectMenu.md)** +- **[Modals](../guides/general/interactions/modals/aboutModals.md)** +- **[`$customID`](../bdscript/customID.md)** + +## Example +``` +$nomention +$if[$customID==interaction] + $sendMessage[Hello!] +$endif + +$if[$customID==onlyauthor-$authorID] + $sendMessage[Hello $displayName!] +$endif +``` +``` discord yaml +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Click + components: + - + - type: primary + label: Interaction ID: interaction + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Click + components: + - + - type: primary + label: Interaction ID: onlyauthor-$authorID + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello Nicky! +``` + +``` discord yaml +- user_id: 154148273307910144 + username: MineBartekSA + color: "#F1BDEE" + content: | + !example + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Click + components: + - + - type: primary + label: Interaction ID: onlyauthor-$authorID + +- user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello MineBartekSA! + +- user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + I can't use the button +``` + +> How [`$if[]`](../guides/general/ifStatements.md) or [`$customID[]`](../bdscript/customID.md) works? diff --git a/src/callbacks/onInteractionComplex.md b/src/callbacks/onInteractionComplex.md index 9b08d84468a..61eec49c0f3 100644 --- a/src/callbacks/onInteractionComplex.md +++ b/src/callbacks/onInteractionComplex.md @@ -1,60 +1,64 @@ -# $onInteraction[] -Triggered upon an interaction being emitted (e.g. a button being clicked). - -## Syntax -``` -$onInteraction[Interaction ID] -``` - -### Parameters -- `Interaction ID` `(Type: String || Flag: Required)`: The custom/menu/button/interaction ID used during the creation of buttons, menus, text fields, and other components. - -### Supports -- **[Buttons](../guides/general/interactions/buttons/aboutButtons.md)** -- **[Select Menu](../guides/general/interactions/selectMenus/aboutSelectMenu.md)** -- **[Modals](../guides/general/interactions/modals/aboutModals.md)** - -## Example -1. Create two commands and set the trigger `$onInteraction[example]` for one command and `!example` for the other. - - - Code with trigger `!example`: - ``` - $nomention - Click! - $addButton[no;example;Click!;primary] - ``` - - Code with trigger `$onInteraction[example]`: - ``` - $nomention - $sendMessage[Hello $displayName!] - ``` -2. Execute commands - ``` discord yaml - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - !example - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Click! - components: - - - - type: primary - label: Click Me! - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - Hello Nicky! - ``` - -> How [`$addButton[]`](../bdscript/addButton.md) works? +# $onInteraction[] +
+ Callback +
+ +Triggered upon an interaction being emitted (e.g. a button being clicked). + +## Syntax +``` +$onInteraction[Interaction ID] +``` + +### Parameters +- `Interaction ID` `(Type: String || Flag: Required)`: The custom/menu/button/interaction ID used during the creation of buttons, menus, text fields, and other components. + +### Supports +- **[Buttons](../guides/general/interactions/buttons/aboutButtons.md)** +- **[Select Menu](../guides/general/interactions/selectMenus/aboutSelectMenu.md)** +- **[Modals](../guides/general/interactions/modals/aboutModals.md)** + +## Example +1. Create two commands and set the trigger `$onInteraction[example]` for one command and `!example` for the other. + + - Code with trigger `!example`: + ``` + $nomention + Click! + $addButton[no;example;Click!;primary] + ``` + - Code with trigger `$onInteraction[example]`: + ``` + $nomention + $sendMessage[Hello $displayName!] + ``` +2. Execute commands + ``` discord yaml + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + !example + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Click! + components: + - + - type: primary + label: Click Me! + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + Hello Nicky! + ``` + +> How [`$addButton[]`](../bdscript/addButton.md) works? diff --git a/src/callbacks/onJoined.md b/src/callbacks/onJoined.md index 8708b494690..88ac21d225b 100644 --- a/src/callbacks/onJoined.md +++ b/src/callbacks/onJoined.md @@ -1,88 +1,92 @@ -# $onJoined -*Triggered when a user joins the server.* - -`$onJoined[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user joins the server. - -> 📌 You can only have **1** single `$onJoined[]` per bot. - -## Syntax -``` -$onJoined[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. - -## Example -1. Create a command with the trigger `$onJoined[Channel ID]`. - > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! - - ![example1](https://user-images.githubusercontent.com/69215413/129490506-c91a77b7-ed71-4dc5-9460-d4ec409b36d4.png) - -2. Input your code/reply text. - > 🧙‍♂ī¸ You can use functions like `$username`, `$authorAvatar`, `$authorID`, `$membersCount`, `$serverName[$guildID]` here. - - ![example2](https://user-images.githubusercontent.com/69215413/129490390-98471c1a-6d76-4543-96d1-1f428bfdd8bc.png) - -3. Now, you have a welcome message! ✨ - ``` discord yaml - - type: join - content: | - Welcome Nicky. Say hi! - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - highlight: true - content: | - <@Nicky>, welcome to Cool Server! - ``` - -\ -*Not Working? Check out the [Troubleshooting](#troubleshooting) section.* - -## Troubleshooting -#### Is `$onJoined[]` bugged or not working? - -- You must have at least version `1.17.9` of the app. - -- Go to [Discord Developer Portal](https://discord.com/developers/applications) and select your bot. Then, click on bot's tab and enable Member Intents.\ -![image](https://user-images.githubusercontent.com/69215413/113423563-b83b3000-939c-11eb-8a71-8eaa53d20f2d.png)\ -![image](https://user-images.githubusercontent.com/69215413/113423634-d6089500-939c-11eb-8d2c-083ac87ff66b.png) - -- Open BDFD app and select your bot. Go to bot settings and enable Member Intents.\ -![Screenshot_20220808_042857](https://user-images.githubusercontent.com/95774950/183314334-76b0f2e0-651f-4b25-8be7-08e39725174a.png)\ -![Screenshot_20220808_043030](https://user-images.githubusercontent.com/95774950/183314360-da7320a5-4370-47b1-b8e2-bfd6d4d2ef05.png) - - > 📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.\ -**For example:** If you have `Members Intent` enabled in the Discord Developer Portal then you should respectively -enable them in the app *(unless you don't want to use them at all)*. - -- Make sure `$onJoined[channelID]` is written in the "command trigger" field and not in the code.\ -![image](https://user-images.githubusercontent.com/69215413/113423759-09e3ba80-939d-11eb-95c2-1fe7860f3887.png) - -- Make sure your bot has `VIEW_CHANNEL`, `EMBED_LINKS`, `SEND_MESSAGES` permission in the channel provided in `$onJoined[]`, and that you inputted a valid channel ID. -- Also, make sure you don't have more than 1 `$onJoined[]`. - -## Advanced -### Per-Server $onJoined -Both free and premium users can use `$onJoined[]`, and all users can put `$getServerVar[]` within `$onJoined[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ -If you own a public bot and want to make it so multiple different servers can use `$onJoined[]` *(e.g. set their own welcome channel)*, follow these steps: - -1. Create a variable named "`welcome`" and the value set to nothing.\ -![image](https://user-images.githubusercontent.com/69215413/129489884-9338482c-ab9f-4847-ba01-c618ab746091.png) - -2. Create a command for setting the welcome channel, then put the following in your code: - ``` - $nomention - $onlyAdmin[You need the admin permission to use that!] - $argsCheck[>1;Please mention a channel!] - Welcome channel updated! - $setServerVar[welcome;$mentionedChannels[1]] - ``` - - > 📝 Servers will need to setup the channel they want the welcome message to send to *(by running a command with the code above)*. - -3. Now replace `$onJoined[Channel ID]` in your welcome command trigger, with `$onJoined[$getServerVar[welcome]]` and you're all set! +# $onJoined +
+ Callback +
+ +*Triggered when a user joins the server.* + +`$onJoined[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user joins the server. + +> You can only have **1** single `$onJoined[]` per bot. + +## Syntax +``` +$onJoined[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. + +## Example +1. Create a command with the trigger `$onJoined[Channel ID]`. + > You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! + + ![example1](https://user-images.githubusercontent.com/69215413/129490506-c91a77b7-ed71-4dc5-9460-d4ec409b36d4.png) + +2. Input your code/reply text. + > You can use functions like `$username`, `$authorAvatar`, `$authorID`, `$membersCount`, `$serverName[$guildID]` here. + + ![example2](https://user-images.githubusercontent.com/69215413/129490390-98471c1a-6d76-4543-96d1-1f428bfdd8bc.png) + +3. Now, you have a welcome message! ✨ + ``` discord yaml + - type: join + content: | + Welcome Nicky. Say hi! + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + highlight: true + content: | + <@Nicky>, welcome to Cool Server! + ``` + +\ +*Not Working? Check out the [Troubleshooting](#troubleshooting) section.* + +## Troubleshooting +#### Is `$onJoined[]` bugged or not working? + +- You must have at least version `1.17.9` of the app. + +- Go to [Discord Developer Portal](https://discord.com/developers/applications) and select your bot. Then, click on bot's tab and enable Member Intents.\ +![image](https://user-images.githubusercontent.com/69215413/113423563-b83b3000-939c-11eb-8a71-8eaa53d20f2d.png)\ +![image](https://user-images.githubusercontent.com/69215413/113423634-d6089500-939c-11eb-8d2c-083ac87ff66b.png) + +- Open BDFD app and select your bot. Go to bot settings and enable Member Intents.\ +![Screenshot_20220808_042857](https://user-images.githubusercontent.com/95774950/183314334-76b0f2e0-651f-4b25-8be7-08e39725174a.png)\ +![Screenshot_20220808_043030](https://user-images.githubusercontent.com/95774950/183314360-da7320a5-4370-47b1-b8e2-bfd6d4d2ef05.png) + + > 📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.\ +**For example:** If you have `Members Intent` enabled in the Discord Developer Portal then you should respectively +enable them in the app *(unless you don't want to use them at all)*. + +- Make sure `$onJoined[channelID]` is written in the "command trigger" field and not in the code.\ +![image](https://user-images.githubusercontent.com/69215413/113423759-09e3ba80-939d-11eb-95c2-1fe7860f3887.png) + +- Make sure your bot has `VIEW_CHANNEL`, `EMBED_LINKS`, `SEND_MESSAGES` permission in the channel provided in `$onJoined[]`, and that you inputted a valid channel ID. +- Also, make sure you don't have more than 1 `$onJoined[]`. + +## Advanced +### Per-Server $onJoined +Both free and premium users can use `$onJoined[]`, and all users can put `$getServerVar[]` within `$onJoined[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ +If you own a public bot and want to make it so multiple different servers can use `$onJoined[]` *(e.g. set their own welcome channel)*, follow these steps: + +1. Create a variable named "`welcome`" and the value set to nothing.\ +![image](https://user-images.githubusercontent.com/69215413/129489884-9338482c-ab9f-4847-ba01-c618ab746091.png) + +2. Create a command for setting the welcome channel, then put the following in your code: + ``` + $nomention + $onlyAdmin[You need the admin permission to use that!] + $argsCheck[>1;Please mention a channel!] + Welcome channel updated! + $setServerVar[welcome;$mentionedChannels[1]] + ``` + + > 📝 Servers will need to setup the channel they want the welcome message to send to *(by running a command with the code above)*. + +3. Now replace `$onJoined[Channel ID]` in your welcome command trigger, with `$onJoined[$getServerVar[welcome]]` and you're all set! diff --git a/src/callbacks/onLeave.md b/src/callbacks/onLeave.md index ac7bb5d8cfd..fc585564415 100644 --- a/src/callbacks/onLeave.md +++ b/src/callbacks/onLeave.md @@ -1,86 +1,90 @@ -# $onLeave -*Triggered when a user leaves the server.* - -`$onLeave[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user leaves the server. - -> 📌 You can only have **1** single `$onLeave[]` per bot. - -## Syntax -``` -$onLeave[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. - -## Example -1. Create a command with the trigger `$onLeave[Channel ID]`. - > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channelID [*(See more here...)*](#advanced)! - - ![example1](https://user-images.githubusercontent.com/69215413/129492818-7aca8563-baff-4ebb-b82b-5a1a368339e5.png) - -2. Input your code/reply text. - > 🧙‍♂ī¸ You can use functions like `$username`, `$authorAvatar`, `$authorID`, `$membersCount`, `$serverName[$guildID]` here. - - ![example2](https://user-images.githubusercontent.com/69215413/129492763-1261a971-4d4c-4f33-9e78-757595484672.png) - -3. Now, you have a leave message! ✨ - ``` discord yaml - - type: leave - content: | - Goodbye User. - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - <@User> just left the server :c - ``` - -\ -*Not Working? Check out the [Troubleshooting](#troubleshooting) section.* - -## Troubleshooting -#### Is `$onLeave[]` bugged or not working? - -- You must have at least version `1.17.9` of the app. - -- Go to [Discord Developer Portal](https://discord.com/developers/applications) and select your bot. Then, click on bot's tab and enable Member Intents.\ -![image](https://user-images.githubusercontent.com/69215413/113423563-b83b3000-939c-11eb-8a71-8eaa53d20f2d.png)\ -![image](https://user-images.githubusercontent.com/69215413/113423634-d6089500-939c-11eb-8d2c-083ac87ff66b.png) - -- Open BDFD app and select your bot. Go to bot settings and enable Member Intents.\ -![Screenshot_20220808_042857](https://user-images.githubusercontent.com/95774950/183314334-76b0f2e0-651f-4b25-8be7-08e39725174a.png)\ -![Screenshot_20220808_043030](https://user-images.githubusercontent.com/95774950/183314360-da7320a5-4370-47b1-b8e2-bfd6d4d2ef05.png) - - > 📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.\ -**For example:** If you have `members intent` enabled in the Discord Developer Portal then you should respectively -enable them in the app *(unless you don't want to use them at all)*. - -- Make sure `$onLeave[channelID]` is written in the "command trigger" field and not in the code.\ -![image](https://user-images.githubusercontent.com/69215413/113423759-09e3ba80-939d-11eb-95c2-1fe7860f3887.png) - -- Make sure your bot has `VIEW_CHANNEL`, `EMBED_LINKS`, `SEND_MESSAGES` permission in the channel provided in `$onLeave[]`, and that you inputted a valid channel ID. -- Also, make sure you don't have more than 1 `$onLeave[]`. - -## Advanced -### Per-Server $onLeave -Both free and premium users can use `$onLeave[]`, and all users can put `$getServerVar[]` within `$onLeave[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ -If you own a public bot and want to make it so multiple different servers can use `$onLeave[]` *(e.g. set their own leave message channel)*, follow these steps: - -1. Create a variable named "`leave`" and the value set to nothing.\ -![image](https://user-images.githubusercontent.com/69215413/129492681-5a50ca36-a76d-4add-a4d9-a64c29d0ed33.png) - -2. Create a command for setting the leave channel, then put the following in your code: - ``` - $nomention - $onlyAdmin[You need the admin permission to use that!] - $argsCheck[>1;Please mention a channel!] - Leave channel updated! - $setServerVar[leave;$mentionedChannels[1]] - ``` - > 📝 Servers will need to setup the channel they want the leave message to send to *(by running a command with the code above)*. - -3. Now replace `$onLeave[channelID]` in your leave command trigger, with `$onLeave[$getServerVar[leave]]` and you're all set! +# $onLeave +
+ Callback +
+ +*Triggered when a user leaves the server.* + +`$onLeave[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user leaves the server. + +> You can only have **1** single `$onLeave[]` per bot. + +## Syntax +``` +$onLeave[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The ID of the channel where the message should be sent to. + +## Example +1. Create a command with the trigger `$onLeave[Channel ID]`. + > You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channelID [*(See more here...)*](#advanced)! + + ![example1](https://user-images.githubusercontent.com/69215413/129492818-7aca8563-baff-4ebb-b82b-5a1a368339e5.png) + +2. Input your code/reply text. + > You can use functions like `$username`, `$authorAvatar`, `$authorID`, `$membersCount`, `$serverName[$guildID]` here. + + ![example2](https://user-images.githubusercontent.com/69215413/129492763-1261a971-4d4c-4f33-9e78-757595484672.png) + +3. Now, you have a leave message! ✨ + ``` discord yaml + - type: leave + content: | + Goodbye User. + + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + <@User> just left the server :c + ``` + +\ +*Not Working? Check out the [Troubleshooting](#troubleshooting) section.* + +## Troubleshooting +#### Is `$onLeave[]` bugged or not working? + +- You must have at least version `1.17.9` of the app. + +- Go to [Discord Developer Portal](https://discord.com/developers/applications) and select your bot. Then, click on bot's tab and enable Member Intents.\ +![image](https://user-images.githubusercontent.com/69215413/113423563-b83b3000-939c-11eb-8a71-8eaa53d20f2d.png)\ +![image](https://user-images.githubusercontent.com/69215413/113423634-d6089500-939c-11eb-8d2c-083ac87ff66b.png) + +- Open BDFD app and select your bot. Go to bot settings and enable Member Intents.\ +![Screenshot_20220808_042857](https://user-images.githubusercontent.com/95774950/183314334-76b0f2e0-651f-4b25-8be7-08e39725174a.png)\ +![Screenshot_20220808_043030](https://user-images.githubusercontent.com/95774950/183314360-da7320a5-4370-47b1-b8e2-bfd6d4d2ef05.png) + + > 📝 Enabled intents in the app should reflect the intents enabled in the Discord Developer Portal.\ +**For example:** If you have `members intent` enabled in the Discord Developer Portal then you should respectively +enable them in the app *(unless you don't want to use them at all)*. + +- Make sure `$onLeave[channelID]` is written in the "command trigger" field and not in the code.\ +![image](https://user-images.githubusercontent.com/69215413/113423759-09e3ba80-939d-11eb-95c2-1fe7860f3887.png) + +- Make sure your bot has `VIEW_CHANNEL`, `EMBED_LINKS`, `SEND_MESSAGES` permission in the channel provided in `$onLeave[]`, and that you inputted a valid channel ID. +- Also, make sure you don't have more than 1 `$onLeave[]`. + +## Advanced +### Per-Server $onLeave +Both free and premium users can use `$onLeave[]`, and all users can put `$getServerVar[]` within `$onLeave[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ +If you own a public bot and want to make it so multiple different servers can use `$onLeave[]` *(e.g. set their own leave message channel)*, follow these steps: + +1. Create a variable named "`leave`" and the value set to nothing.\ +![image](https://user-images.githubusercontent.com/69215413/129492681-5a50ca36-a76d-4add-a4d9-a64c29d0ed33.png) + +2. Create a command for setting the leave channel, then put the following in your code: + ``` + $nomention + $onlyAdmin[You need the admin permission to use that!] + $argsCheck[>1;Please mention a channel!] + Leave channel updated! + $setServerVar[leave;$mentionedChannels[1]] + ``` + > 📝 Servers will need to setup the channel they want the leave message to send to *(by running a command with the code above)*. + +3. Now replace `$onLeave[channelID]` in your leave command trigger, with `$onLeave[$getServerVar[leave]]` and you're all set! diff --git a/src/callbacks/onMessageDelete.md b/src/callbacks/onMessageDelete.md index a52ace58b51..15f6797245c 100644 --- a/src/callbacks/onMessageDelete.md +++ b/src/callbacks/onMessageDelete.md @@ -1,77 +1,79 @@ -# $onMessageDelete -*Triggered when a user deletes a message.* - -`$onMessageDelete[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user deletes a message. - -## Syntax -``` -$onMessageDelete[Channel ID] -``` - -### Parameters -- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to which the resulting message will be sent. - -## Example -1. Create a command with the trigger `$onMessageDelete[Channel ID]`. - > 🧙‍♂ī¸ You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! - - ![example1](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/b722b5b7-35f8-4682-a118-b17916978c2a) - -2. Input your code/reply text. - > 🧙‍♂ī¸ You can use functions like `$messageID`, `$getTimestamp` here. - - ![example2](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/027aa71a-9051-4b78-bbc7-3149424fe91b) - -3. Now, you have a logging message! ✨ - ``` discord yaml - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - Hey - - - user_id: 154148273307910144 - username: MineBartekSA - color: "#F1BDEE" - content: | - Hello - ``` - - ``` discord yaml - - user_id: 729343563401265193 - username: Nicky - color: "#EE7908" - content: | - Hey - - - user_id: 566613317972394004 - username: Wiki Bot - color: "#748BD4" - bot: true - verified: true - content: | - A message was deleted! - Message ID: 1133145902865985646 - ``` - -\ -## Advanced -### Per-Server $onMessageDelete -Both free and premium users can use `$onMessageDelete[]`, and all users can put `$getServerVar[]` within `$onMessageDelete[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ -If you own a public bot and want to make it so multiple different servers can use `$onMessageDelete[]` *(e.g. set their own message logging channel)*, follow these steps: - -1. Create a variable named "`logs`" and the value set to nothing.\ -![image](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/dae381e3-4fe0-4e5f-9cc8-e18d0f56215f) - -2. Create a command for setting the logging channel, then put the following in your code: - ``` - $nomention - $onlyAdmin[You need the admin permission to use that!] - $argsCheck[>1;Please mention a channel!] - Message logging channel updated! - $setServerVar[logs;$mentionedChannels[1]] - ``` - - > 📝 Servers will need to setup the channel they want the logging message to send to *(by running a command with the code above)*. - -3. Now replace `$onMessageDelete[Channel ID]` in your command trigger, with `$onMessageDelete[$getServerVar[logs]]` and you're all set! +# $onMessageDelete +
+ Callback +
+ +*Triggered when a user deletes a message.* + +`$onMessageDelete[Channel ID]` is a callback, which means it's used in the command trigger *(not the code)*. The command is ran when a user deletes a message. + +## Syntax +``` +$onMessageDelete[Channel ID] +``` + +### Parameters +- `Channel ID` `(Type: Snowflake || Flag: Required)`: The channel to which the resulting message will be sent. + +## Example +1. Create a command with the trigger `$onMessageDelete[Channel ID]`. + > You must replace "Channel ID" with a [valid channel ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) or a server variable that holds the channel ID [*(See more here...)*](#advanced)! + + ![example1](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/b722b5b7-35f8-4682-a118-b17916978c2a) + +2. Input your code/reply text. + > You can use functions like `$messageID`, `$getTimestamp` here. + + ![example2](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/027aa71a-9051-4b78-bbc7-3149424fe91b) + +3. Now, you have a logging message! ✨ + ``` discord yaml + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + Hey + - user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + Hello + ``` + + ``` discord yaml + - user_id: 729343563401265193 + username: Nicky + color: "#EE7908" + content: | + Hey + - user_id: 566613317972394004 + username: Wiki Bot + color: "#748BD4" + bot: true + verified: true + content: | + A message was deleted! + Message ID: 1133145902865985646 + ``` + +\ +## Advanced +### Per-Server $onMessageDelete +Both free and premium users can use `$onMessageDelete[]`, and all users can put `$getServerVar[]` within `$onMessageDelete[]`. However, non-premium users can not use `$getServerVar[]` outside of callbacks.\ +If you own a public bot and want to make it so multiple different servers can use `$onMessageDelete[]` *(e.g. set their own message logging channel)*, follow these steps: + +1. Create a variable named "`logs`" and the value set to nothing.\ +![image](https://github.com/NilPointer-Software/bdfd-wiki/assets/111157596/dae381e3-4fe0-4e5f-9cc8-e18d0f56215f) + +2. Create a command for setting the logging channel, then put the following in your code: + ``` + $nomention + $onlyAdmin[You need the admin permission to use that!] + $argsCheck[>1;Please mention a channel!] + Message logging channel updated! + $setServerVar[logs;$mentionedChannels[1]] + ``` + + > 📝 Servers will need to setup the channel they want the logging message to send to *(by running a command with the code above)*. + +3. Now replace `$onMessageDelete[Channel ID]` in your command trigger, with `$onMessageDelete[$getServerVar[logs]]` and you're all set! diff --git a/src/entityTransferPolicy.md b/src/entityTransferPolicy.md index 335f19a5fdc..7e9131e4acf 100644 --- a/src/entityTransferPolicy.md +++ b/src/entityTransferPolicy.md @@ -1,31 +1,41 @@ -# Context - -- Bot Designer for Discord is a service provided by NilPointer Software. -- "Our service" refers to "Bot Designer for Discord". -- "Bot" refers to data held by BDFD describing the behaviour of a [Discord Bot](https://discord.com/developers/docs) on our service. -- "Hosting time" refers to the time duration left of a singular bot during which it will be hosted by our service. -- "Premium point" refers to BDFD premium in-app currency, granting users the ability for bots to have extended functionality for a limited time. -- "Premium time" refers to the time duration left for a singular bot during which it can access the extended functionality. - Premium time is related, but not strictly linked, with hosting time. Premium time might end before hosting time, but not vice-versa. -- "Promocode" or "promo code" refers to a randomly generated string of characters used to gain hosting or premium time. -- "BDFD entity" or "entity" refers to any piece of data that is being held by BDFD, that ownership of it or itself can be transferred. - In this policy, "entity" mainly refers to bots, hosting and premium time, and premium points. -- "Transfer request" refers to a request made by a user to BDFD developers for an entity transfer. - These requests can be made through a ticket on our [official Discord server](https://discord.gg/botdesigner). - -# Policy - -- Entities that can be transferred can only be transferred through a transfer request by the user that holds ownership of that entity. -- Requesting users must provide proof of ownership of the entities in question for the request to be granted. -- BDFD Accounts can not be transferred in any way. - -- Bots can only be transferred between BDFD accounts owned by a single user. -- Bot after its transfer retains any hosting or premium time the bot in question had left. -- A bot previously not assigned to any BDFD account can be transferred to an account of the user that holds ownership over the bot in question. - -- Premium points can be transferred between BDFD accounts owned by a single user. -- Premium points can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). - -- Hosting and Premium time can only be transferred between bots owned by a single user. -- Hosting and Premium time can not be transferred to a promocode. -- Only premium time can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). + + +# Context + +- Bot Designer for Discord is a service provided by NilPointer Software. +- "Our service" refers to "Bot Designer for Discord". +- "Bot" refers to data held by BDFD describing the behaviour of a [Discord Bot](https://discord.com/developers/docs) on our service. +- "Hosting time" refers to the time duration left of a singular bot during which it will be hosted by our service. +- "Premium point" refers to BDFD premium in-app currency, granting users the ability for bots to have extended functionality for a limited time. +- "Premium time" refers to the time duration left for a singular bot during which it can access the extended functionality. + Premium time is related, but not strictly linked, with hosting time. Premium time might end before hosting time, but not vice-versa. +- "Promocode" or "promo code" refers to a randomly generated string of characters used to gain hosting or premium time. +- "BDFD entity" or "entity" refers to any piece of data that is being held by BDFD, that ownership of it or itself can be transferred. + In this policy, "entity" mainly refers to bots, hosting and premium time, and premium points. +- "Transfer request" refers to a request made by a user to BDFD developers for an entity transfer. + These requests can be made through a ticket on our [official Discord server](https://discord.gg/botdesigner). + +# Policy + +- Entities that can be transferred can only be transferred through a transfer request by the user that holds ownership of that entity. +- Requesting users must provide proof of ownership of the entities in question for the request to be granted. +- BDFD Accounts can not be transferred in any way. + +- Bots can only be transferred between BDFD accounts owned by a single user. +- Bot after its transfer retains any hosting or premium time the bot in question had left. +- A bot previously not assigned to any BDFD account can be transferred to an account of the user that holds ownership over the bot in question. + +- Premium points can be transferred between BDFD accounts owned by a single user. +- Premium points can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). + +- Hosting and Premium time can only be transferred between bots owned by a single user. +- Hosting and Premium time can not be transferred to a promocode. +- Only premium time can be donated for a giveaway promotion on our [official Discord server](https://discord.gg/botdesigner). + +--- + +_Effective Date: 10 August, 2023._ diff --git a/src/flowchart/addResponseEmbed.md b/src/flowchart/addResponseEmbed.md index b70d817e170..71ed17b94f1 100644 --- a/src/flowchart/addResponseEmbed.md +++ b/src/flowchart/addResponseEmbed.md @@ -1,39 +1,32 @@ - # Add response embed +
+ Flowchart Bot +
+ Adds embed to the response message for the command. ## Inputs -| Name | Type | Descripton | -| :----- | :----- | :------ | -|Title | String |Title Of The Embed Message. | -| Description | String | Description Of The Embed Message. | -| Footer | String | Footer Of The Embed Message. | +- `Title` `(Type: String || Own text: true)`: Title of the embed message. +- `Description` `(Type: String || Own text: true)`: Description of the embed message. +- `Footer` `(Type: String || Own text: true)`: Footer of the embed message. -*** ### Flags - ➤ Execute ## Example -Entry Point ➤ - ➤ Add response embed : - -| Name | Value | -| :----- | :----- | -|Title | Meowing Title | -| Description | Meowing Description | -| Footer | Cats shall rule this footer! | +Entry Point ➤ - ➤ Add response embed (Title: `Meowing Title`, Description: `Meowing Description`, Footer: `Cats shall rule this footer!`) -![image](https://github.com/user-attachments/assets/c99109d3-20df-44a8-be09-a7f5506e71f5) +![example](https://github.com/user-attachments/assets/c99109d3-20df-44a8-be09-a7f5506e71f5) -## Result ```discord yaml -- username: Flowchart +- username: Flowcharts user_id: 566613317972394004 color: "#748bd4" bot: true command: user_id: 713752533763489893 author: Fai-Kun - command: /meow + command: /example color: "#E67E22" content: "" embed: diff --git a/src/flowchart/introduction.md b/src/flowchart/introduction.md new file mode 100644 index 00000000000..ceb766a1fe7 --- /dev/null +++ b/src/flowchart/introduction.md @@ -0,0 +1,4 @@ +# Flowchart + +In this section of the wiki, you will learn about the functions that exist in Flowcharts. +Using functions is an integral part of your bot, because thanks to them you will bring functionality to your bot! \ No newline at end of file diff --git a/src/flowchart/setResponseMessage.md b/src/flowchart/setResponseMessage.md index e073516ff1b..eae620d632e 100644 --- a/src/flowchart/setResponseMessage.md +++ b/src/flowchart/setResponseMessage.md @@ -1,26 +1,30 @@ -# Set response message -Sets the response message for the command. - -## Inputs -- `Content` `(Type: String || Own text: true)`: Content of the sent message. - -### Flags -- ➤ Execute - -## Example -Entry Point ➤ - ➤ Set response message (Content: `Hello`) -![example](https://github.com/user-attachments/assets/ed7d4f3d-c753-4cda-a3d6-57d8f8d4564d) - -```discord yaml -- username: Flowchart - user_id: 566613317972394004 - color: "#748bd4" - bot: true - command: - user_id: 1009018156494368798 - author: RainbowKey - command: /test - color: "#E67E22" - content: | - Hello -``` +# Set response message +
+ Flowchart Bot +
+ +Sets the response message for the command. + +## Inputs +- `Content` `(Type: String || Own text: true)`: Content of the sent message. + +### Flags +- ➤ Execute + +## Example +Entry Point ➤ - ➤ Set response message (Content: `Hello`) +![example](https://github.com/user-attachments/assets/ed7d4f3d-c753-4cda-a3d6-57d8f8d4564d) + +```discord yaml +- username: Flowcharts + user_id: 566613317972394004 + color: "#748bd4" + bot: true + command: + user_id: 803569638084313098 + author: RainbowKey + command: /example + color: "#E67E22" + content: | + Hello +``` diff --git a/src/flowchart/toLowercase.md b/src/flowchart/toLowercase.md new file mode 100644 index 00000000000..43c0a47e582 --- /dev/null +++ b/src/flowchart/toLowercase.md @@ -0,0 +1,31 @@ +# To lowercasse +
+ Flowchart Bot +
+ +Converts the text to lowercase format. + +## Inputs +- `Text` `(Type: String || Own text: true)`: Content that should be lowercased. + +## Outputs +- `Result`: The lowercased text. + +## Example +Entry Point ➤ - ➤ Set response message (Content - Set response message (Result)), To lowercase (Text: `Hello world!`) +![example](https://github.com/user-attachments/assets/a0cfa8d0-7a16-4461-b39f-896d93aa1866) + + +```discord yaml +- username: Flowcharts + user_id: 566613317972394004 + color: "#748bd4" + bot: true + command: + user_id: 803569638084313098 + author: RainbowKey + command: /example + color: "#E67E22" + content: | + hello world! +``` diff --git a/src/foreword.md b/src/foreword.md index 9eb066b557f..3fb781ffac5 100644 --- a/src/foreword.md +++ b/src/foreword.md @@ -1,29 +1,198 @@ -# Foreword -### ✨ Imagine An App... -...That makes building Discord bots easy with beginner-friendly functions. An app that's capable of developing nearly all types of bots - from simple *echo* bots, to advanced multi-purpose administration ones. Where simplicity meets functionality and scalability. That's **Bot Designer for Discord**. + -What are you waiting for? Create the bot of your dreams today! +
+

Bot Designer For Discord

+

BDFD makes building Discord bots easy, from simple to advanced.

+ +
-**Start with [*Bot Designer for Discord*](https://botdesignerdiscord.com)** +
+

Why BDFD?

+
+
+ +

Free hosting

+

By simply watching ads. No need for complicated setup or expensive hosting plans.

+
+
+ +

Anywhere

+

Use our app on your phone, tablet, or computer - your bot is always accessible.

+
+
+ +

Functions

+

From basic "ping! pong!" commands to advanced AI features, BDFD provides everything you need to create unique and engaging bots.

+
+
+ +

Support

+

Join our friendly Discord server, where we’re always happy to help you out with any questions related to BDFD.

+
+
+
-### 📎 Links -- [Discord Server](https://botdesignerdiscord.com/discord) -- [Website](https://botdesignerdiscord.com/) -- [Android App](https://play.google.com/store/apps/details?id=com.jakubtomana.discordbotdesinger) -- [iOS App](https://apps.apple.com/app/bot-designer-for-discord/id1495536477) -- [Web App](https://botdesignerdiscord.com/app/) *(Alpha Version)* ---- -## 📓 Wiki -Welcome to our humble abode. You're currently viewing **Bot Designer for Discord**'s wiki. + -### 📂 Wiki Index -- [Guides](./guides/introduction/aboutSection.md) -- [Resources](./resources/introduction.md) -- [BDScript](./bdscript/introduction.md) -- [Premium](./premium/introduction.md) -- [JavaScript](./javascript/introduction.md) -- [Callbacks](./callbacks/introduction.md) +
+

Download

+
+ + + or use + +
+
+
+

Preview

+

Let’s see what we can do with BDFD! It’s time to dive deep into the world of this powerful tool and unlock its full potential!

+
-#### Want to contribute to the wiki? -Head over to the [GitHub repository contribution file](https://github.com/NilPointer-Software/bdfd-wiki/blob/dev/CONTRIBUTING.md) and learn how you can help out! +```discord yaml +- user_id: 390515191819010058 + username: kubastick + color: "#FF0000" + content: | + Hello guys! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + <@kubastick> Level up! Now your current level is 5 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + command: + user_id: 803569638084313098 + color: "#E67E22" + author: RainbowKey + command: /work + content: | + You worked successfully and earned... + components: + - + - type: secondary + label: đŸĒ™ 50 Coins! +- user_id: 311808747141857292 + username: Lelouch Lamperouge + color: "#39B0E8" + content: | + !bal <@RainbowKey> +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + embed: + title: Balance - RainbowKey + description: đŸĒ™ 2146 Coins! +- user_id: 154148273307910144 + username: MineBartekSa + color: "#FF0000" + content: | + !ban <@Berk> Breaking BDFD ToS +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + reply: + user_id: 154148273307910144 + author: MineBartekSa + color: "#FF0000" + content: | + !ban <@Berk> Breaking BDFD ToS + content: | + <@Berk> was banned with "Breaking BDFD ToS" reason. + Banned by <@MineBartekSA> + reactions: + - emoji: https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Twemoji12_2705.svg/640px-Twemoji12_2705.svg.png + name: ":white_check_mark:" + count: 1 +- content: | + Berk left without pizza. + type: leave +- user_id: 311808747141857292 + username: Lelouch Lamperouge + color: "#39B0E8" + content: | + !prefix - +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Sure! New prefix selected: - +- user_id: 325663449680052227 + username: Emperor Toaster + color: "#B4B4B4" + content: | + -askAi Hello! Who are you? +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I'm an AI designed to assist with a variety of questions and tasks. How can I help you today? +- user_id: 325663449680052227 + username: Emperor Toaster + color: "#B4B4B4" + content: | + What day is today? +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Today is a wonderful day filled with opportunities and potential! +``` diff --git a/src/guides/general/awaitedCommands.md b/src/guides/general/awaitedCommands.md index b12d0bc9035..8d7750ab51f 100644 --- a/src/guides/general/awaitedCommands.md +++ b/src/guides/general/awaitedCommands.md @@ -1,226 +1,501 @@ -# Awaited Commands - -Awaited commands are a special type of command where the bot waits for the user's response. - -## Content -[**Functions Used**](#functions-used) > [**Supported Filters**](#supported-filters) > [**$awaitFunc[]**](#awaitfunc) > [**$awaitedCommand[]**](#awaitedcommand) > [**$awaitedCommandError[]**](#awaitedcommanderror) > [**Creating an awaited command**](#creating-an-awaited-command) - -## Functions Used -- [`$awaitFunc[]`](../../bdscript/awaitFunc.md) -- [`$awaitedCommand[]`](../../callbacks/awaitedCommand.md) -- [`$awaitedCommandError[]`](../../callbacks/awaitedCommandError.md) - -## Supported Filters -- ``: Accepts only number input. -- ``: Accepts only specified words provided inside `<>`. Use `/` as a separator for multiple words. - -# $awaitFunc -Used to initiate an awaited command. - -## Syntax -``` -$awaitFunc[Command name;(User ID;Channel ID)] -``` - -### Parameters -- `Command name` `(Type: String || Flag: Required)`: The name used inside [`$awaitedCommand[]`](#awaitedcommand) and [`$awaitedCommandError[]`](#awaitedcommanderror) callbacks. -- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user the awaited command will trigger for. Uses command author, if `User ID` is not given. -- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel where the command will be awaited. Uses current channel, if `Channel ID` is not given. - -## Example -``` -$nomention -What do you want me to say? -$awaitFunc[say] -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - What do you want me to say? -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - I love BDFD -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - I love BDFD -``` -\ - -# $awaitedCommand -_Triggered when an awaited command gets responded to._ - -`$awaitedCommand[]` is a callback, which means it's used in the command trigger (not the code). The command is only run when an awaited command gets responded to. - -## Syntax -``` -$awaitedCommand[Name;(Filter)] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name used in [`$awaitFunc[]`](#awaitfunc) function. -- `Filter` `(Type: String || Flag: Emptiable)`: Used to limit user input ([Supported filters](#supported-filters)). If no filter is provided, it accepts any input. - -## Example -### Without filter -**Trigger: `$awaitedCommand[say;]`** -``` -$nomention -$message -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - What do you want me to say? -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - I love BDFD -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - I love BDFD -``` -\ - -### With choose filter -**Trigger: `$awaitedCommand[odd;]`** -``` -$nomention -$if[$message==yes] - Your answer is correct! -$elseif[$message==no] - Your answer is incorrect! -$elseif[$message==cancel] - Command cancelled! -$endif -``` -![example](https://user-images.githubusercontent.com/113303649/212088333-54a94584-f854-45cf-8b7e-6980aa370764.png) -### With numeric filter -**Trigger: `$awaitedCommand[odd;]`** -``` -$nomention -You have provided a number: $message -``` -![example](https://user-images.githubusercontent.com/113303649/212089433-e998259a-0e74-4401-9140-a7ea4c6c3776.png) - -# $awaitedCommandError -_Triggered when an awaited command doesn't match with provided filter._ - -`$awaitedCommandError[]` is a callback, which means it's used in the command trigger (not the code). The command is only run when an awaited command doesn't match with provided filter. - -## Syntax -``` -$awaitedCommandError[Name] -``` - -### Parameters -- `Name` `(Type: String || Flag: Required)`: The name used in [`$awaitFunc[]`](#awaitfunc) function. - -## Example -**Trigger: `$awaitedCommandError[number]`** -``` -$nomention -Invalid number! -``` -![example](https://user-images.githubusercontent.com/113303649/212291974-4efa0531-d896-4aa3-ac1a-b8fa7d6794d0.png) - -# Creating an awaited command -## Without filter - -1. Create two commands with `!say` and `$awaitedCommand[say;]` triggers. -2. Paste the following code: - -Code for the `!say` command: -``` -$nomention -What do you want me to say? -$awaitFunc[say] -``` - -Code for the command with the `$awaitedCommand[say;]` trigger: -``` -$nomention -$message -``` - -3. Execute command `!say` - -![example](https://user-images.githubusercontent.com/113303649/212294420-acf01905-c9f5-4673-99f0-375f9d786f25.png) -## With choose filter - -1. Create two commands with `!odd` and `$awaitedCommand[odd;]` triggers. -2. Paste the following code: - -Code for the `!odd` command: -``` -$nomention -Is '19' an odd number? -$awaitFunc[odd] -``` - -Code for the command with the `$awaitedCommand[odd;]` trigger: -``` -$nomention -$if[$message==yes] - Your answer is correct! -$elseif[$message==no] - Your answer is incorrect! -$elseif[$message==cancel] - Command cancelled! -$endif -``` - -3. Execute command `!odd` - -![example](https://user-images.githubusercontent.com/113303649/212088333-54a94584-f854-45cf-8b7e-6980aa370764.png) -## With numeric filter - -1. Create two commands with `!number` and `$awaitedCommand[number;]` triggers. -2. Paste the following code: - -Code for the `!number` command: -``` -$nomention -Provide a number! -$awaitFunc[number] -``` - -Code for the command with the `$awaitedCommand[number;]` trigger: -``` -$nomention -You have provided a number: $message -``` - -3. Execute command `!number` - -![example](https://user-images.githubusercontent.com/113303649/212089433-e998259a-0e74-4401-9140-a7ea4c6c3776.png) +# Awaited Commands + +Awaited commands are a special type of command where the bot waits for the user's response. + +## Content +[**Functions Used**](#functions-used) > [**Supported Filters**](#supported-filters) > [**$awaitFunc[]**](#awaitfunc) > [**$awaitedCommand[]**](#awaitedcommand) > [**$awaitedCommandError[]**](#awaitedcommanderror) > [**Creating an awaited command**](#creating-an-awaited-command) + +## Functions Used +- [`$awaitFunc[]`](../../bdscript/awaitFunc.md) + +## Callbacks Used +- [`$awaitedCommand[]`](../../callbacks/awaitedCommand.md) +- [`$awaitedCommandError[]`](../../callbacks/awaitedCommandError.md) + +## Supported Filters +- ``: Accepts only number input. +- ``: Accepts only specified words provided inside `<>`. Use `/` as a separator for multiple words. + +# $awaitFunc +Used to initiate an awaited command. + +## Syntax +``` +$awaitFunc[Command name;(User ID;Channel ID)] +``` + +### Parameters +- `Command name` `(Type: String || Flag: Required)`: The name used inside [`$awaitedCommand[]`](#awaitedcommand) and [`$awaitedCommandError[]`](#awaitedcommanderror) callbacks. +- `User ID` `(Type: Snowflake || Flag: Vacantable)`: The user the awaited command will trigger for. Uses command author, if `User ID` is not given. +- `Channel ID` `(Type: Snowflake || Flag: Optional)`: The channel where the command will be awaited. Uses current channel, if `Channel ID` is not given. + +## Example +``` +$nomention +What do you want me to say? +$awaitFunc[say] +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + What do you want me to say? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + I love BDFD +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I love BDFD +``` +\ + +# $awaitedCommand +
+ Callback +
+ +_Triggered when an awaited command gets responded to._ + +`$awaitedCommand[]` is a callback, which means it's used in the command trigger (not the code). The command is only run when an awaited command gets responded to. + +## Syntax +``` +$awaitedCommand[Name;(Filter)] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name used in [`$awaitFunc[]`](#awaitfunc) function. +- `Filter` `(Type: String || Flag: Emptiable)`: Used to limit user input ([Supported filters](#supported-filters)). If no filter is provided, it accepts any input. + +## Example +### Without filter +**Trigger: `$awaitedCommand[say;]`** +``` +$nomention +$message +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + What do you want me to say? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + I love BDFD +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I love BDFD +``` +\ + +### With choose filter +**Trigger: `$awaitedCommand[odd;]`** +``` +$nomention +$if[$message==yes] + Your answer is correct! +$elseif[$message==no] + Your answer is incorrect! +$elseif[$message==cancel] + Command cancelled! +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '19' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + yes +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your answer is correct! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '19' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + no +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your answer is incorrect! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '19' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + cancel +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Command cancelled! +``` +\ + +```admonish info title="Read more" +For more information about the functions used can be found in [If Statements Guide](../guides/general/ifStatements.md). +``` + +### With numeric filter +**Trigger: `$awaitedCommand[odd;]`** +``` +$nomention +You have provided a number: $message +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Provide a number! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 52 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + You have provided a number: 52 +``` +\ + +# $awaitedCommandError +
+ Callback +
+ +_Triggered when an awaited command doesn't match with provided filter._ + +`$awaitedCommandError[]` is a callback, which means it's used in the command trigger (not the code). The command is only run when an awaited command doesn't match with provided filter. + +## Syntax +``` +$awaitedCommandError[Name] +``` + +### Parameters +- `Name` `(Type: String || Flag: Required)`: The name used in [`$awaitFunc[]`](#awaitfunc) function. + +## Example +**Trigger: `$awaitedCommandError[number]`** +``` +$nomention +Invalid number! +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Provide a number! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + azbc +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Invalid number! +``` +\ + +# Creating an awaited command +## Without filter + +1. Create two commands with `!say` and `$awaitedCommand[say;]` triggers. +2. Paste the following code: + +Code for the `!say` command: +``` +$nomention +What do you want me to say? +$awaitFunc[say] +``` + +Code for the command with the `$awaitedCommand[say;]` trigger: +``` +$nomention +$message +``` + +3. Execute command `!say` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !say +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + What do you want me to say? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + Hello everyone! +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello everyone! +``` +\ + +```admonish warning +Use [`$allowUserMentions[]`](../../bdscript/allowUserMentions.md) and [`$allowRoleMentions[]`](../../bdscript/allowRoleMentions.md) to disable role, @here and @everyone mentions! +``` + +## With choose filter + +1. Create two commands with `!odd` and `$awaitedCommand[odd;]` triggers. +2. Paste the following code: + +Code for the `!odd` command: +``` +$nomention +Is '21' an odd number? +$awaitFunc[odd] +``` + +Code for the command with the `$awaitedCommand[odd;]` trigger: +``` +$nomention +$if[$message==yes] + Your answer is correct! +$elseif[$message==no] + Your answer is incorrect! +$elseif[$message==cancel] + Command cancelled! +$endif +``` + +3. Execute command `!odd` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !odd +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '21' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + yes +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your answer is correct! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !odd +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '21' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + no +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Your answer is incorrect! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !odd +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Is '21' odd number? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + cancel +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Command cancelled! +``` +\ + +## With numeric filter + +1. Create two commands with `!number` and `$awaitedCommand[number;]` triggers. +2. Paste the following code: + +Code for the `!number` command: +``` +$nomention +Provide a number! +$awaitFunc[number] +``` + +Code for the command with the `$awaitedCommand[number;]` trigger: +``` +$nomention +You have provided a number: $message +``` + +3. Execute command `!number` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !number +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Provide a number! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + 28 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + You have provided a number: 28 +``` diff --git a/src/guides/general/bds2/aboutBDScript2.md b/src/guides/general/bds2/aboutBDScript2.md index 62954bd2e0f..ecc05a91e17 100644 --- a/src/guides/general/bds2/aboutBDScript2.md +++ b/src/guides/general/bds2/aboutBDScript2.md @@ -1,33 +1,33 @@ -# BDScript 2 - -## Introduction -**BDScript 2** is the default in-app scripting language _(as of October 2021)_. It has been created with intention of enhancing its capabilities and fixing some of the problems previous versions had. - -The first edition of **BDScript** has one big issue, commands like `$sum[$sum[3;2];1]` didn't work. The reason it didn't work is because **BDScript** has a pre-defined order for executing functions. - -In order to fix the issue, a new BDScript edition was developed called **BDScript Unstable**. It executes function in a command from bottom to top and from right to left. -It fixes the issue, but the new edition has its quirks which could be problematic for some commands. That's where **BDScript 2** comes in. This edition executes commands from top to bottom and from left to right *(basically, just the way you read most of the books)*.\ -Besides that, **BDScript 2** has additional features like `$eval[]`, `$try` and `$catch` and more. - -## Features -### $eval[] -Evaluates the provided BDScript code. Read [this](../../../bdscript/eval.md) for more information. - -### $try, $catch and $error[] -This works in a very similar way to the equivalents available in other programming languages.\ -You can read more about it [here](./errorHandling.md). - -### $async -Runs functions asynchronously. Read [Async Guide](./asyncScopes.md) for more information. - -### $elseif -Read [If Statements Guide](../ifStatements.md) for more information. - -### $var[] -Creates a temporary variable. Read [this](../../../bdscript/var.md) for more information. - -### $stop -It stops the command execution. It may seem like a useless function but it can come in handy with `$if`s or `$try`s. - -### $optOff[] -Executes functions with turned off optimizations. Read [this](../../../bdscript/optOff.md) for more information. +# BDScript 2 + +## Introduction +**BDScript 2** is the default in-app scripting language _(as of October 2021)_. It has been created with intention of enhancing its capabilities and fixing some of the problems previous versions had. + +The first edition of **BDScript** has one big issue, commands like `$sum[$sum[3;2];1]` didn't work. The reason it didn't work is because **BDScript** has a pre-defined order for executing functions. + +In order to fix the issue, a new BDScript edition was developed called **BDScript Unstable**. It executes function in a command from bottom to top and from right to left. +It fixes the issue, but the new edition has its quirks which could be problematic for some commands. That's where **BDScript 2** comes in. This edition executes commands from top to bottom and from left to right *(basically, just the way you read most of the books)*.\ +Besides that, **BDScript 2** has additional features like `$eval[]`, `$try` and `$catch` and more. + +## Features +### $eval[] +Evaluates the provided BDScript code. Read [this](../../../bdscript/eval.md) for more information. + +### $try, $catch and $error[] +This works in a very similar way to the equivalents available in other programming languages.\ +You can read more about it [here](./errorHandling.md). + +### $async +Runs functions asynchronously. Read [Async Guide](./asyncScopes.md) for more information. + +### $elseif +Read [If Statements Guide](../ifStatements.md) for more information. + +### $var[] +Creates a temporary variable. Read [this](../../../bdscript/var.md) for more information. + +### $stop +It stops the command execution. It may seem like a useless function but it can come in handy with `$if`s or `$try`s. + +### $optOff[] +Executes functions with turned off optimizations. Read [this](../../../bdscript/optOff.md) for more information. diff --git a/src/guides/general/bds2/asyncScopes.md b/src/guides/general/bds2/asyncScopes.md index 2b29411c8aa..959bf520eca 100644 --- a/src/guides/general/bds2/asyncScopes.md +++ b/src/guides/general/bds2/asyncScopes.md @@ -1,35 +1,35 @@ -# Async -Runs functions in the background. Using async features properly can optimize your code and make it faster! -> **Warning:** Async features only work in [BDScript 2](./aboutBDScript2.md). - -### Basics -- Use `$async[name]` to start an async block. The name must be unique for each block. Functions inside async blocks run in the background without blocking the command's thread. -- Use `$endasync` to end the async block. -- Use `$await[name]` to wait for the async block's result. - -### Examples -#### Example #1 -```php -$async[test] - $setVar[money;0] - $addReactions[👌] -$endasync - -Money set to 0 -``` - -#### Example #2 -```php -$async[test1] - $setVar[banned;1] -$endasync - -$async[test2] - $banID[some reason;246604909451935745] -$endasync - -$await[test1] -$await[test2] - -Done -``` +# Async +Runs functions in the background. Using async features properly can optimize your code and make it faster! +> **Warning:** Async features only work in [BDScript 2](./aboutBDScript2.md). + +### Basics +- Use `$async[name]` to start an async block. The name must be unique for each block. Functions inside async blocks run in the background without blocking the command's thread. +- Use `$endasync` to end the async block. +- Use `$await[name]` to wait for the async block's result. + +### Examples +#### Example #1 +```php +$async[test] + $setVar[money;0] + $addReactions[👌] +$endasync + +Money set to 0 +``` + +#### Example #2 +```php +$async[test1] + $setVar[banned;1] +$endasync + +$async[test2] + $banID[some reason;246604909451935745] +$endasync + +$await[test1] +$await[test2] + +Done +``` diff --git a/src/guides/general/bds2/errorHandling.md b/src/guides/general/bds2/errorHandling.md index 9c2d56e917c..546ba7a0a56 100644 --- a/src/guides/general/bds2/errorHandling.md +++ b/src/guides/general/bds2/errorHandling.md @@ -1,411 +1,411 @@ -# Error Handling -In this section, you’ll learn how to use the error handling. - -```admonish danger title="BDScript 2" -You must use **BDScript 2** for the functions to work correctly. -``` - -## Content -[**Functions Used**](#functions-used) > [**$try**](#try) > [**$endtry**](#endtry) > [**$catch**](#catch) > [**$error[]**](#error) > [**$stop**](#stop) > [**Error Type**](#error-type) > [**Create BDScript custom error**](#create-bdscript-custom-error) > [**Create custom error for function**](#create-custom-error-for-function) - -## Functions Used -- [`$try`](../../../bdscript/try.md) -- [`$endtry`](../../../bdscript/endtry.md) -- [`$catch`](../../../bdscript/catch.md) -- [`$error[]`](../../../bdscript/error.md) - -## Support Functions Used -- [`$stop`](../../../bdscript/stop.md) - -# $try -Opens the Error Handling block. - -## Syntax -``` -$try -``` - -## Example -- Let's create 3 commands with different triggers: `!example`, `!test` and `!bot`. - -Command code for `!example` trigger: -``` -$nomention -$try - $sum[2;a] -$endtry -``` - -Command code for `!test` trigger: -``` -$nomention -$try - $sum[2;2] -$endtry -``` - -```admonish question title="What is this?" -How [`$sum[]`](../../../bdscript/sum.md) works? The explanation of how [`$endtry`](#endtry) works will be given below. -``` - -Command code for `!bot` trigger: -``` -$nomention -$sum[2;a] -``` - -Now let's run each command: - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !test -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 4 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !bot -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ Function $sum at 2:9 returned an error: expected integer in position 2, got 'a' -``` - -As you can see only `!test` command returned a response, but why? - -```admonish abstract title="Explanation" -`$try` executes whole code (from top to bottom and from left to right) in its block and stops execution if it encounters an error. -``` - -```admonish danger title="Need to know" -`$try` block does not support some errors. For example not closed bracket in the function. -``` - -# $endtry -Closes the Error Handling block. - -## Syntax -``` -$endtry -``` - -## Example -``` -$nomention -$try - $sum[2;5] -$endtry -``` - -- With `$endtry`: -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 7 -``` - -- Without `$endtry`: -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - $try not closed with $endtry or invalid use of $sum -``` - -# $catch -Used to create a sub-block between `$try` and `$endtry` that will contain the code that will be executed when an error occurs. - -## Syntax -``` -$catch -``` - -## Example -``` -$nomention -$try - $sum[2;$message] -$catch - ❌ Invalid number! -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ Invalid number! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 6 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 8 -``` - -```admonish question title="What is this?" -How [`$message`](../../../bdscript/message.md) works? -``` - -# $error -Used in the `$catch` block to return the BDScript 2 error information. - -## Syntax -``` -$error[Type] -``` - -## Parameters -- `Type` `(Type: Enum || Flag: Required)`: What type of error data to return. - -### Error Type -| Name | Description | Example -| --------- | ---------------------------------------------------------------------- | ---------------------------------------- -| `command` | Returns the name of the function that returned the error. | $sum -| `message` | Returns the error message that was received. | expected integer in position 2, got 'a' -| `source` | Returns the content of the line where the error occurred. | $sum[2;a] -| `row` | Returns the number of the row in the code where the error occurred. | 2 -| `column` | Returns the number of the column in the code where the error occurred. | 10 - -~~~admonish warning title="Syntax sensitivity" -The type input must only be written in lowercase letters.\ -❌ Not correct: -``` -$error[ROW] -``` -✅ Correct: -``` -$error[row] -``` -~~~ - -## Example -``` -$nomention -$try - $description[Hello developer!;] -$catch -❌ An error has occurred! -Function: $error[command] -Error: $error[message] -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - ❌ An error has occurred! - Function: $description - Error: expected valid value in position 2, got empty value -``` - -```admonish question title="What is this?" -How [`$description[]`](../../../bdscript/description.md) works? -``` - -# $stop -Stops the command execution. - -## Syntax -``` -$stop -``` - -## Example -``` -$nomention -$try - $sum[2;$message] -$catch - $stop -$endtry -Number: $message -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 5 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 7 - Number: 5 -``` -*As we can see, the bot did not send "Number: a" when we tried to use "`!example a`".* - -# Create BDScript custom error -With `$error[]` you can create custom error for code! - -``` -$nomention -$try - $sum[2;$message] -$catch - $title[Error!] - $description[🚧 Description: -```$error[message]```] - $addField[Location;Row: `$error[row]` | Column: `$error[column]`] - $footer[🔍 $error[source]] -$endtry -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 100 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 102 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example a -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - embed: - title: | - Error! - description: | - 🚧 Description: - expected valid value in position 2, got empty value - fields: - - name: Location - value: | - Row: 2 | Column: 17 - footer: - text: | - 🔍 $sum[2;] -``` - -# Create custom error for function -With error handling you can embed an error for... -- Cooldown functions: [`$serverCooldown[]`](../../../bdscript/serverCooldown.md), [`$globalCooldown[]`](../../../bdscript/globalCooldown.md), [`$cooldown[]`](../../../bdscript/cooldown.md); -- "Only If" Functions: [`$onlyAdmin[]`](../../../bdscript/onlyAdmin.md), [`$onlyIf[]`](../../../bdscript/onlyIf.md) and other similar "Only If" functions...; -- Enabled function: [`$enabled[]`](../../../bdscript/enabled.md). - -Let's create embed error for `$coodlwon[]` function: - -``` -$nomention -$try - $cooldown[5m;] - Hey, are you making an example for the guide? -$catch - $description[⏱ī¸ You have a cooldown! Wait $getCooldown[normal] seconds.] -$endtry -``` -*This example will work with other functions too, just replace `$cooldown[]` function (Specified above).* - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hey, are you making an example for the guide? -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - embed: - description: | - ⏱ī¸ You have a cooldown! Wait 290 seconds. - ``` - -```admonish question title="What is this?" -How [`$cooldown[]`](../../../bdscript/cooldown.md) and [`$getCooldown[]`](../../../bdscript/getCooldown.md) works? -``` - -```admonish danger title="BDScript 2" -Don't forget to choose **BDScript 2** when using the [Error Handling functions](#functions-used)! -``` +# Error Handling +In this section, you’ll learn how to use the error handling. + +```admonish danger title="BDScript 2" +You must use **BDScript 2** for the functions to work correctly. +``` + +## Content +[**Functions Used**](#functions-used) > [**$try**](#try) > [**$endtry**](#endtry) > [**$catch**](#catch) > [**$error[]**](#error) > [**$stop**](#stop) > [**Error Type**](#error-type) > [**Create BDScript custom error**](#create-bdscript-custom-error) > [**Create custom error for function**](#create-custom-error-for-function) + +## Functions Used +- [`$try`](../../../bdscript/try.md) +- [`$endtry`](../../../bdscript/endtry.md) +- [`$catch`](../../../bdscript/catch.md) +- [`$error[]`](../../../bdscript/error.md) + +## Support Functions Used +- [`$stop`](../../../bdscript/stop.md) + +# $try +Opens the Error Handling block. + +## Syntax +``` +$try +``` + +## Example +- Let's create 3 commands with different triggers: `!example`, `!test` and `!bot`. + +Command code for `!example` trigger: +``` +$nomention +$try + $sum[2;a] +$endtry +``` + +Command code for `!test` trigger: +``` +$nomention +$try + $sum[2;2] +$endtry +``` + +```admonish question title="What is this?" +How [`$sum[]`](../../../bdscript/sum.md) works? The explanation of how [`$endtry`](#endtry) works will be given below. +``` + +Command code for `!bot` trigger: +``` +$nomention +$sum[2;a] +``` + +Now let's run each command: + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !test +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 4 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !bot +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Function $sum at 2:9 returned an error: expected integer in position 2, got 'a' +``` + +As you can see only `!test` command returned a response, but why? + +```admonish abstract title="Explanation" +`$try` executes whole code (from top to bottom and from left to right) in its block and stops execution if it encounters an error. +``` + +```admonish danger title="Need to know" +`$try` block does not support some errors. For example not closed bracket in the function. +``` + +# $endtry +Closes the Error Handling block. + +## Syntax +``` +$endtry +``` + +## Example +``` +$nomention +$try + $sum[2;5] +$endtry +``` + +- With `$endtry`: +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 7 +``` + +- Without `$endtry`: +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + $try not closed with $endtry or invalid use of $sum +``` + +# $catch +Used to create a sub-block between `$try` and `$endtry` that will contain the code that will be executed when an error occurs. + +## Syntax +``` +$catch +``` + +## Example +``` +$nomention +$try + $sum[2;$message] +$catch + ❌ Invalid number! +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ Invalid number! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 6 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 8 +``` + +```admonish question title="What is this?" +How [`$message`](../../../bdscript/message.md) works? +``` + +# $error +Used in the `$catch` block to return the BDScript 2 error information. + +## Syntax +``` +$error[Type] +``` + +## Parameters +- `Type` `(Type: Enum || Flag: Required)`: What type of error data to return. + +### Error Type +| Name | Description | Example +| --------- | ---------------------------------------------------------------------- | ---------------------------------------- +| `command` | Returns the name of the function that returned the error. | $sum +| `message` | Returns the error message that was received. | expected integer in position 2, got 'a' +| `source` | Returns the content of the line where the error occurred. | $sum[2;a] +| `row` | Returns the number of the row in the code where the error occurred. | 2 +| `column` | Returns the number of the column in the code where the error occurred. | 10 + +~~~admonish warning title="Syntax sensitivity" +The type input must only be written in lowercase letters.\ +❌ Not correct: +``` +$error[ROW] +``` +✅ Correct: +``` +$error[row] +``` +~~~ + +## Example +``` +$nomention +$try + $description[Hello developer!;] +$catch +❌ An error has occurred! +Function: $error[command] +Error: $error[message] +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + ❌ An error has occurred! + Function: $description + Error: expected valid value in position 2, got empty value +``` + +```admonish question title="What is this?" +How [`$description[]`](../../../bdscript/description.md) works? +``` + +# $stop +Stops the command execution. + +## Syntax +``` +$stop +``` + +## Example +``` +$nomention +$try + $sum[2;$message] +$catch + $stop +$endtry +Number: $message +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 7 + Number: 5 +``` +*As we can see, the bot did not send "Number: a" when we tried to use "`!example a`".* + +# Create BDScript custom error +With `$error[]` you can create custom error for code! + +``` +$nomention +$try + $sum[2;$message] +$catch + $title[Error!] + $description[🚧 Description: +```$error[message]```] + $addField[Location;Row: `$error[row]` | Column: `$error[column]`] + $footer[🔍 $error[source]] +$endtry +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 100 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 102 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example a +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + title: | + Error! + description: | + 🚧 Description: + expected valid value in position 2, got empty value + fields: + - name: Location + value: | + Row: 2 | Column: 17 + footer: + text: | + 🔍 $sum[2;] +``` + +# Create custom error for function +With error handling you can embed an error for... +- Cooldown functions: [`$serverCooldown[]`](../../../bdscript/serverCooldown.md), [`$globalCooldown[]`](../../../bdscript/globalCooldown.md), [`$cooldown[]`](../../../bdscript/cooldown.md); +- "Only If" Functions: [`$onlyAdmin[]`](../../../bdscript/onlyAdmin.md), [`$onlyIf[]`](../../../bdscript/onlyIf.md) and other similar "Only If" functions...; +- Enabled function: [`$enabled[]`](../../../bdscript/enabled.md). + +Let's create embed error for `$coodlwon[]` function: + +``` +$nomention +$try + $cooldown[5m;] + Hey, are you making an example for the guide? +$catch + $description[⏱ī¸ You have a cooldown! Wait $getCooldown[normal] seconds.] +$endtry +``` +*This example will work with other functions too, just replace `$cooldown[]` function (Specified above).* + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hey, are you making an example for the guide? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + embed: + description: | + ⏱ī¸ You have a cooldown! Wait 290 seconds. + ``` + +```admonish question title="What is this?" +How [`$cooldown[]`](../../../bdscript/cooldown.md) and [`$getCooldown[]`](../../../bdscript/getCooldown.md) works? +``` + +```admonish danger title="BDScript 2" +Don't forget to choose **BDScript 2** when using the [Error Handling functions](#functions-used)! +``` diff --git a/src/guides/general/httpRequests.md b/src/guides/general/httpRequests.md index 126cda50eac..07827eca495 100644 --- a/src/guides/general/httpRequests.md +++ b/src/guides/general/httpRequests.md @@ -1,107 +1,107 @@ -# HTTP Requests -- A HTTP request is an action to be performed on a resource identified by a URL. -> Before reading this guide, please note that this feature is not intended for new BDFD users, as it is pretty advanced. - -## HTTP Request Types -> This is a list of all HTTP request types available. - -**GET** -- Retrieves data from a resource. -``` -$httpGet[url] -``` - -**POST** -- The data sent to the server with POST is stored in the request body of the HTTP request. -``` -$httpPost[url;(body)] -``` - -**PUT** -- The PUT method replaces all current representations of the target resource with the request payload. -``` -$httpPut[url;(body)] -``` - -**DELETE** -- The DELETE method deletes the specified resource. -``` -$httpDelete[url;(body)] -``` - -**PATCH** -- The PATCH method applies partial modifications to a resource. -``` -$httpPatch[url;(body)] -``` - -## HTTP Headers -- HTTP Headers is used to add more information. Most of the time, this is used to send an API Key to the API. -``` -$httpAddHeader[header name;header value] -``` - -## HTTP Statuses -- If the API doesn't return anything after making a request, but you need to know the result, HTTP Statuses can help. You can read more about them [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). -``` -$httpStatus -``` - -## HTTP Results -- To return the result of a HTTP method function, you can use `$httpResult`/`$httpResult[]`. - -### Usage #1 -``` -$httpResult -``` -> Retrieves text value from HTTP request. - -### Usage #2 -``` -$httpResult[JSON Key;...] -``` -> Retrieves JSON from HTTP request. All arguments after *JSON Key* are optional. - -## Examples - -### Basic level -> An example using a `$httpGet` function -``` -$nomention -$httpGet[https://nekos.best/api/v2/neko] -$title[Here is a Neko for you!] -$description[**Source:** $httpResult[results;0;source_url]] -$image[$httpResult[results;0;url]] -$footer[nekos.best API] -$color[#e91e63] -``` - -
Show Example API Response - -```json -{ - "results":[ - { - "artist_href":"https://www.pixiv.net/en/users/4284365", - "artist_name":"イã‚Ģたると", - "source_url":"https://www.pixiv.net/en/artworks/55142454", - "url":"https://nekos.best/api/v2/neko/0023.png" - } - ] -} -``` - -
- -![Neko](https://i.imgur.com/grfUOlX.png) -> API: [nekos.best](https://docs.nekos.best) -### Advanced level -> An example using a function that has a request body (e.g. `$httpPost`) and using `$httpAddHeader` -``` -$httpAddHeader[content-type;application/x-www-form-urlencoded] -$httpPost[https://pastebin.com/api/api_post.php;api_dev_key=7CP52G-BTQP_1AhyBBlTa94qyjE6vHzU&api_paste_code=$url[encode;$message]&api_option=paste] -$httpResult -``` -![Pastebin](https://i.imgur.com/UvjmdsK.png) -![Pastebin](https://i.imgur.com/EalIOA7.png) -> API: [pastebin.com](https://pastebin.com/doc_api) +# HTTP Requests +- A HTTP request is an action to be performed on a resource identified by a URL. +> Before reading this guide, please note that this feature is not intended for new BDFD users, as it is pretty advanced. + +## HTTP Request Types +> This is a list of all HTTP request types available. + +**GET** +- Retrieves data from a resource. +``` +$httpGet[url] +``` + +**POST** +- The data sent to the server with POST is stored in the request body of the HTTP request. +``` +$httpPost[url;(body)] +``` + +**PUT** +- The PUT method replaces all current representations of the target resource with the request payload. +``` +$httpPut[url;(body)] +``` + +**DELETE** +- The DELETE method deletes the specified resource. +``` +$httpDelete[url;(body)] +``` + +**PATCH** +- The PATCH method applies partial modifications to a resource. +``` +$httpPatch[url;(body)] +``` + +## HTTP Headers +- HTTP Headers is used to add more information. Most of the time, this is used to send an API Key to the API. +``` +$httpAddHeader[header name;header value] +``` + +## HTTP Statuses +- If the API doesn't return anything after making a request, but you need to know the result, HTTP Statuses can help. You can read more about them [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). +``` +$httpStatus +``` + +## HTTP Results +- To return the result of a HTTP method function, you can use `$httpResult`/`$httpResult[]`. + +### Usage #1 +``` +$httpResult +``` +> Retrieves text value from HTTP request. + +### Usage #2 +``` +$httpResult[JSON Key;...] +``` +> Retrieves JSON from HTTP request. All arguments after *JSON Key* are optional. + +## Examples + +### Basic level +> An example using a `$httpGet` function +``` +$nomention +$httpGet[https://nekos.best/api/v2/neko] +$title[Here is a Neko for you!] +$description[**Source:** $httpResult[results;0;source_url]] +$image[$httpResult[results;0;url]] +$footer[nekos.best API] +$color[#e91e63] +``` + +
Show Example API Response + +```json +{ + "results":[ + { + "artist_href":"https://www.pixiv.net/en/users/4284365", + "artist_name":"イã‚Ģたると", + "source_url":"https://www.pixiv.net/en/artworks/55142454", + "url":"https://nekos.best/api/v2/neko/0023.png" + } + ] +} +``` + +
+ +![Neko](https://i.imgur.com/grfUOlX.png) +> API: [nekos.best](https://docs.nekos.best) +### Advanced level +> An example using a function that has a request body (e.g. `$httpPost`) and using `$httpAddHeader` +``` +$httpAddHeader[content-type;application/x-www-form-urlencoded] +$httpPost[https://pastebin.com/api/api_post.php;api_dev_key=7CP52G-BTQP_1AhyBBlTa94qyjE6vHzU&api_paste_code=$url[encode;$message]&api_option=paste] +$httpResult +``` +![Pastebin](https://i.imgur.com/UvjmdsK.png) +![Pastebin](https://i.imgur.com/EalIOA7.png) +> API: [pastebin.com](https://pastebin.com/doc_api) diff --git a/src/guides/general/ifStatements.md b/src/guides/general/ifStatements.md index 56e1c40cb97..400852fce9e 100644 --- a/src/guides/general/ifStatements.md +++ b/src/guides/general/ifStatements.md @@ -1,492 +1,492 @@ -# If Statements -In this section, you'll learn how to use the if statement. - -## Content -[**Functions Used**](#functions-used) > [**Signs**](#signs) > [**$if[]**](#if) > [**$endif[]**](#endif) > [**$else**](#else) > [**$elseif[]**](#elseif) > [**$and[]**](#and) > [**$or[]**](#or) > [**$stop**](#stop) > [**Simple Example**](#simple-example) - -## Functions Used -- [`$if[]`](../../bdscript/if.md) -- [`$endif`](../../bdscript/endif.md) -- [`$else`](../../bdscript/else.md) -- [`$elseif[]`](../../bdscript/elseif.md) - -## Support Functions Used -- [`$and[]`](../../bdscript/and.md) -- [`$or[]`](../../bdscript/or.md) -- [`$stop`](../../bdscript/stop.md) - -### Signs -`==` - Equal - -`!=` - Not equal - -`<` - Less than - -`>` - Greater than - -`>=` - Greater than or equal to - -`<=` - Less than or equal to -- These signs could vary in meaning based on the order or intent of the if statement. -- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. - -# $if -Executes the following block of code if the provided condition is `true`. - -## Syntax -``` -$if[Condition] -``` -> `$if[]` uses the format of: if `x` is related accordingly (based on the "sign") with `y` then the code below runs. - -### Parameters -- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. Use [Signs](#signs). -## Example -``` -$nomention -$if[5>$random[0;10]] - 5 is bigger than $random[0;10] -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 5 is bigger than 0 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - No answer because $random[0;10] returned that the number are less than 5 -``` -\ - -# $endif -Ends an if statement. - -## Syntax -``` -$endif -``` -## Example -``` -$nomention -$if[$message==abc] - Good work! -$endif -``` - -### With `$endif` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example abc -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Good work! -``` -\ -### Without `$endif` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example abc -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - $if not closed with $endif -``` -\ - -# $else -A block of code to be executed, if the `$if[]` condition is `false`. - -## Syntax -``` -$else -``` -## Example -``` -$if[5>$random[0;10]] - 5 is bigger than $random[0;10] -$else - 5 is less than $random[0;10] -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 5 is bigger than 0 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 5 is less than 8 -``` -\ - -# $elseif -Checks provided condition only if previous `$if[]` or `$elseif[]` conditions returned `false`. If the provided condition is `true`, the following block of code will be executed. -> You can use multiple `$elseif`s. -> Only for **BDScript 2**! - -## Syntax -``` -$elseif[Condition] -``` -### Parameters -- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. Use [Signs](#signs). -## Example - -**BDScript 2:** -``` -$nomention -$if[5<$random[0;10]] - 5 is less than $random[0;10] -$elseif[5==$random[0;10]] - 5 equals $random[0;10] -$endif -``` -**BDScrpt and BDScript Unstable:** -``` -$nomention -$if[5<$random[0;10]] - 5 is less than $random[0;10] -$else - $if[5==$random[0;10]] - 5 equals $random[0;10] - $endif -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 5 is less than 6 -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - 5 equals 5 -``` -\ - -# $and -Returns `true` if every provided condition is `true`, otherwise `false` is returned. - -## Syntax -``` -$and[Conditions;...] -``` -### Parameters -- `Conditions` `(Type: String || Flag: Required)`: Checks that will be carried out. All conditions must be true for this function to return `true`. Separate conditions using `;`. Use [Signs](#signs). - -## Example -``` -$nomention -$if[$and[$nickname==MineBartekSA;$message==Update]==true] - Hi developer -$else - Hi user -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi user -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi user -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi user -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi developer - ``` - -# $or -Returns `true` if at least one of the provided conditions is `true`, otherwise `false` is returned. - -## Syntax -``` -$or[Conditions;...] -``` -### Parameters -- `Conditions` `(Type: String || Flag: Required)`: The condition to check. Separate conditions using `;`. Use [Signs](#signs). - -## Example -``` -$nomention -$if[$or[$nickname==MineBartekSA;$message==Update]==true] - Hi -$else - Bye -$endif -``` - -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Bye -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi -- user_id: 154148273307910144 - username: MineBartekSA - color: "#f1bdee" - content: | - !example Update -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi - ``` - -# $stop -Stops the command execution. - -```admonish danger title="BDScript 2" -Can only be used in **[BDScript 2](./bds2/aboutBDScript2.md)**. -``` - -## Syntax -``` -$stop -``` - -## Example -``` -$nomention -$if[$message==5] - Yes! -$else - No! - $stop -$endif -$username is winner! -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 6 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - No! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example 5 -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Yes! - RainbowKey is winner! -``` -*As we can see, the bot did not send "RainbowKey is winner!" when we tried to use "`!example 6`".* - -# Simple Example -1. Create command with `!example` trigger. -2. Paste the following code: - ``` - $nomention - $if[$message==BDFD] - Hi BDFD User! - $elseif[$message==Bartek] - Are you Bartek? - $elseif[$message==Premium] - Do you want to get premium? - $else - I can't find this:( - $endif - ``` -3. Execute command `!example` -``` discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example BDFD -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hi BDFD User! -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Bartek -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Are you Bartek? -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Premium -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Do you want to get premium? -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example Hello -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - I can't find this:( -``` +# If Statements +In this section, you'll learn how to use the if statement. + +## Content +[**Functions Used**](#functions-used) > [**Signs**](#signs) > [**$if[]**](#if) > [**$endif**](#endif) > [**$else**](#else) > [**$elseif[]**](#elseif) > [**$and[]**](#and) > [**$or[]**](#or) > [**$stop**](#stop) > [**Simple Example**](#simple-example) + +## Functions Used +- [`$if[]`](../../bdscript/if.md) +- [`$endif`](../../bdscript/endif.md) +- [`$else`](../../bdscript/else.md) +- [`$elseif[]`](../../bdscript/elseif.md) + +## Support Functions Used +- [`$and[]`](../../bdscript/and.md) +- [`$or[]`](../../bdscript/or.md) +- [`$stop`](../../bdscript/stop.md) + +### Signs +`==` - Equal + +`!=` - Not equal + +`<` - Less than + +`>` - Greater than + +`>=` - Greater than or equal to + +`<=` - Less than or equal to +- These signs could vary in meaning based on the order or intent of the if statement. +- If you are using text as your `x` and/or `y`, you can not use any other signs besides `==` and `!=`. However for numbers, you can use any sign shown in the above list. + +# $if +Executes the following block of code if the provided condition is `true`. + +## Syntax +``` +$if[Condition] +``` +> `$if[]` uses the format of: if `x` is related accordingly (based on the "sign") with `y` then the code below runs. + +### Parameters +- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. Use [Signs](#signs). +## Example +``` +$nomention +$if[5>$random[0;10]] + 5 is bigger than $random[0;10] +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 5 is bigger than 0 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + No answer because $random[0;10] returned that the number are less than 5 +``` +\ + +# $endif +Ends an if statement. + +## Syntax +``` +$endif +``` +## Example +``` +$nomention +$if[$message==abc] + Good work! +$endif +``` + +### With `$endif` +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example abc +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Good work! +``` +\ +### Without `$endif` +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example abc +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + $if not closed with $endif +``` +\ + +# $else +A block of code to be executed, if the `$if[]` condition is `false`. + +## Syntax +``` +$else +``` +## Example +``` +$if[5>$random[0;10]] + 5 is bigger than $random[0;10] +$else + 5 is less than $random[0;10] +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 5 is bigger than 0 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 5 is less than 8 +``` +\ + +# $elseif +Checks provided condition only if previous `$if[]` or `$elseif[]` conditions returned `false`. If the provided condition is `true`, the following block of code will be executed. +> You can use multiple `$elseif`s. +> Only for **BDScript 2**! + +## Syntax +``` +$elseif[Condition] +``` +### Parameters +- `Condition` `(Type: String || Flag: Required)`: Check that will be carried out. Use [Signs](#signs). +## Example + +**BDScript 2:** +``` +$nomention +$if[5<$random[0;10]] + 5 is less than $random[0;10] +$elseif[5==$random[0;10]] + 5 equals $random[0;10] +$endif +``` +**BDScrpt and BDScript Unstable:** +``` +$nomention +$if[5<$random[0;10]] + 5 is less than $random[0;10] +$else + $if[5==$random[0;10]] + 5 equals $random[0;10] + $endif +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 5 is less than 6 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + 5 equals 5 +``` +\ + +# $and +Returns `true` if every provided condition is `true`, otherwise `false` is returned. + +## Syntax +``` +$and[Conditions;...] +``` +### Parameters +- `Conditions` `(Type: String || Flag: Required)`: Checks that will be carried out. All conditions must be true for this function to return `true`. Separate conditions using `;`. Use [Signs](#signs). + +## Example +``` +$nomention +$if[$and[$nickname==MineBartekSA;$message==Update]==true] + Hi developer +$else + Hi user +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi user +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi user +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi user +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi developer + ``` + +# $or +Returns `true` if at least one of the provided conditions is `true`, otherwise `false` is returned. + +## Syntax +``` +$or[Conditions;...] +``` +### Parameters +- `Conditions` `(Type: String || Flag: Required)`: The condition to check. Separate conditions using `;`. Use [Signs](#signs). + +## Example +``` +$nomention +$if[$or[$nickname==MineBartekSA;$message==Update]==true] + Hi +$else + Bye +$endif +``` + +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Bye +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi +- user_id: 154148273307910144 + username: MineBartekSA + color: "#FF0000" + content: | + !example Update +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi + ``` + +# $stop +Stops the command execution. + +```admonish danger title="BDScript 2" +Can only be used in **[BDScript 2](./bds2/aboutBDScript2.md)**. +``` + +## Syntax +``` +$stop +``` + +## Example +``` +$nomention +$if[$message==5] + Yes! +$else + No! + $stop +$endif +$username is winner! +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 6 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + No! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 5 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Yes! + RainbowKey is winner! +``` +*As we can see, the bot did not send "RainbowKey is winner!" when we tried to use "`!example 6`".* + +# Simple Example +1. Create command with `!example` trigger. +2. Paste the following code: + ``` + $nomention + $if[$message==BDFD] + Hi BDFD User! + $elseif[$message==Bartek] + Are you Bartek? + $elseif[$message==Premium] + Do you want to get premium? + $else + I can't find this:( + $endif + ``` +3. Execute command `!example` +``` discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example BDFD +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hi BDFD User! +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Bartek +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Are you Bartek? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Premium +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Do you want to get premium? +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example Hello +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + I can't find this:( +``` diff --git a/src/guides/general/interactions/buttons/aboutButtons.md b/src/guides/general/interactions/buttons/aboutButtons.md index 6cec108f4ed..a25fadd1a15 100644 --- a/src/guides/general/interactions/buttons/aboutButtons.md +++ b/src/guides/general/interactions/buttons/aboutButtons.md @@ -1,275 +1,334 @@ -# Buttons -In this section, you'll learn how to use the button component. - -## Content -[**Functions Used**](#functions-used) > [**Button Style**](#button-style) > [**Button Type**](#button-type) > [**$addButton[]**](#addbutton) > [**$editButton[]**](#editbutton) > [**$removeButtons**](#removebuttons) > [**$removeButtons[]**](#removebuttons-1) > [**$removeComponent[]**](#removecomponent) > [**Create Interaction**](#create-interaction) - -## Functions Used -- [`$addButton[]`](../../../../bdscript/addButton.md) -- [`$editButton[]`](../../../../bdscript/editButton.md) -- [`$removeButtons`](../../../../bdscript/removeButtons.md) -- [`$removeButtons[]`](../../../../bdscript/removeButtonsComplex.md) -- [`$removeComponent[]`](../../../../bdscript/removeComponent.md) -- [`$onInteraction`](../../../../callbacks/onInteraction.md) -- [`$onInteraction[]`](../../../../callbacks/onInteractionComplex.md) - -## Button Style -Buttons can have different styles _(background colors)_. -Here, are all possible values for the `style` function argument. -- `primary` - Blue button -- `secondary` - Gray button -- `success` - Green button -- `danger` - Red button -- `link` - Redirect button - -```discord yaml -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Buttons: - components: - - - - type: primary - label: Primary - - type: primary - label: Primary - disabled: true - - - - type: success - label: Success - - type: success - label: Success - disabled: true - - - - type: destructive - label: Danger - - type: destructive - label: Danger - disabled: true - - - - type: secondary - label: Secondary - - type: secondary - label: Secondary - disabled: true -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Other Buttons: - components: - - - - type: secondary - label: Link - url: https://nilpointer-software.github.io/bdfd-wiki/nightly/ - - type: secondary - label: Link - disabled: true - url: https://nilpointer-software.github.io/bdfd-wiki/nightly/ - - - - type: secondary - label: Emoji - emoji: https://em-content.zobj.net/thumbs/120/mozilla/36/heavy-black-heart_2764.png -``` - -> If `link` style is used, the button **won't send** any interactions! - -## Button Type -There are 2 types of buttons : `interactive` and `link`. - -When an interactive button is pressed, it sends an interaction which can be used together with `$onInteraction[ID]`. - -Every interactive button has an `ID`. A `$onInteraction[ID]` callback, will only get triggered when the button with the same `ID` is pressed. -Interactive buttons can use every `style` except `link`. - -> Link buttons **don't send** any interactions. When they're pressed they forward the user to a website. -> -> Link buttons **need to** set their `style` argument value to `link`. - -# $addButton -Adds a button to the response message. -## Syntax -``` -$addButton[New row?;Interaction ID/url;Label;Style;(Disable?;Emoji;Message ID)] -``` -### Parameters -- `New row?` `(Type: Bool || Flag: Required)`: If set to `yes` the button will appear in a new row. If it's set to `no` the button will appear in the same row as a previous button. - - > A message can have a maximum of 25 buttons (5 rows of 5 buttons). - -- `Interaction ID/URL` `(Type: String, URL || Flag: Required)`: Depending on the button type, you either set it to an `Interaction ID` which is then used in the `$onInteraction[Interaction ID]` or `$onInteraction` callback or a `URL` if it's a link button. -> You don't need `$onInteraction`/`$onInteraction[]` for URL. -- `Label` `(Type: String || Flag: Emptiable)`: The text visible on the button. -- `Style` `(Type: Enum || Flag: Required)`: It's used to specify the button's background color. If the button has a link/url you **have to** set this value to `link`. Check [this section](#button-style) for more details. -- `Disable?` `(Type: Bool || Flag: Vacantable)`: If set to `yes` the button can't be pressed. Defaults as `no`. -- `Emoji` `(Type: Emoji || Flag: Vacantable)`: Adds an emoji inside the button. Emojis have to be either pasted as *unicode* or be in the following format `<:emoji name:emoji ID>`. -- `message ID` `(Type: Snowflake || Flag: Vacantable)`: Adds a button to the provided message ID. It's important to note that provided message ID author **has to** be the bot. - -> Interactive buttons can't have duplicated `ID`'s in the same message. So for example, you can't have two buttons with the ID set to `test`. - -> If `URL` is used in `Interaction ID/url` argument, it **has to** start with `http://` or `https://` - -## Example -``` -$nomention -Hello -$addButton[no;test;Say hello!;primary;no;] -``` - -```discord yaml -- user_id: 803569638084313098 - username: RainbowKey - color: "#E67E22" - content: | - !example -- user_id: 1009018156494368798 - username: BDFD Support - color: "#378afa" - bot: true - verified: true - content: | - Hello - components: - - - - type: primary - label: Say hello! -``` - - -# $editButton -Edits an already existing button. - -## Syntax -``` -$editButton[Interaction ID/URL;Label;Style;(Disable?;Emoji;Message ID)] -``` - -### Parameters -- `Interaction ID/URL` `(Type: String, URL || Flag: Required)`: Depending on the button type, you either set it to an `Interaction ID` which is then used in the `$onInteraction[Interaction ID]` callback or a `URL` if it's a link button. -- `Label` `(Type: String || Flag: Emptiable)`: The text visible on the button. -- `Style` `(Type: Enum || Flag: Required)`: It's used to specify the button's background color. If the button has a link/url you **have to** set this value to `link`. Check [this section](#button-style) for more details. -- `Disable?` `(Type: Bool || Flag: Vacantable)`: If set to `yes` the button can't be pressed. Defaults as `no`. _(Optional)_ -- `Emoji` `(Type: Emoji || Flag: Vacantable)`: Edits an emoji inside the button. Emojis have to be either pasted as *unicode* or be in the following format `<:emoji name:emoji ID>`. _(Optional)_ -- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Edits a button in a message with the provided ID. It's important to note that provided message ID author **has to** be the bot. _(Optional)_ -## Example -#### Trigger: `$onInteraction[test]` -``` -$nomention -$username said hello! -$editButton[test;Say hello!;danger;yes;] -``` -![example](https://user-images.githubusercontent.com/113303649/210611967-f15b8c9b-7bd9-4218-a89b-08e93ce7eeb3.png) - - -# $removeButtons -Removes all buttons from the triggered message. -## Syntax -``` -$removeButtons -``` -## Example -#### Trigger: `$onInteraction[test]` -``` -$nomention -$username removed all buttons from this message -$removeButtons -``` -![example](https://user-images.githubusercontent.com/113303649/210621352-ae7334a6-a2de-4fbe-8749-7134f9a73af3.png) - -# $removeButtons[] -Removes all buttons from the specified message. -## Syntax -``` -$removeButtons[Message ID] -``` -### Parameters -- `Message ID` `(Type: Snowflake || Flag: Required)`: Removes buttons from the message with the provided ID. It's important to note that provided message ID author **has to** be the bot. -## Example -``` -$nomention -$username removed all buttons from the specified message id -$removeButtons[$message] -``` -![example](https://user-images.githubusercontent.com/113303649/210875885-aa20517e-1c37-4206-8eee-eefa765eb40a.png) - -# $removeComponent -Removes a certain component from a message. -## Syntax -``` -$removeComponent[Interaction ID/URL;(Message ID)] -``` -> This function supports [select-menu](../selectMenus/aboutSelectMenu.md) and [button](../buttons/aboutButtons.md). -### Parameters -- `Interaction ID/URL` `(Type: String || Flag: Required)`: The interaction ID of the button, to remove from the message. -- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Removes the button from the message with the provided ID. It's important to note that provided message ID author **has to** be the bot. _(Optional)_ -## Example -``` -$nomention -$username successfully removed the button! -$removeComponent[test;$message] -``` -![example](https://user-images.githubusercontent.com/113303649/211163378-2aaa540d-b0a1-4511-8f34-6a91260b079d.png) - -![example](https://user-images.githubusercontent.com/113303649/211163615-ecffddcf-1d2b-4065-8445-9ec7ed1eb2b4.png) - -# Create interaction -### Example with `$onInteraction[]` callback: -1. Create two commands with `!example` and `$onInteraction[test]` triggers. -2. Paste the following code: -Code for the command with the `!example` trigger: -``` -$nomention -Click the button below! -$addButton[no;test;Click;primary] -$addButton[no;button;Button disabled;secondary;yes] -$addButton[yes;https://botdesignerdiscord.com/;Link;link] -``` -Code for the command with the `$onInteraction[test]` trigger: -``` -$nomention -$editButton[test;Clicked;danger;yes] -$sendMessage[$username hello!] -``` - -> Note that the interaction ID provided in `$onInteraction[]` is the same as the one provided in `$addButton[]` -> -> In `$addButton[]`, `yes` is being used for the `new row?` argument so that the button would appear in the next row. -3. Execute command `!example` - -![example](https://user-images.githubusercontent.com/113303649/211164994-695cf7b6-b2fa-49e5-a78f-dc21db213a9a.png) - -### Example with `$onInteraction` callback: -1. Create two commands with `!example` and `$onInteraction` triggers. -2. Paste the following code: -Code for the command with the `!example` trigger: -``` -$nomention -Click the button below! -$addButton[no;test;Click;primary] -$addButton[no;button;Button disabled;secondary;yes] -$addButton[yes;https://botdesignerdiscord.com/;Link;link] -``` -Code for the command with the `$onInteraction` trigger: -``` -$nomention -$if[$customID==test] - $editButton[test;Clicked;danger;yes] - $sendMessage[$username hello!] -$endif -``` -> Note that the interaction ID returned by `$customID` will be the same as the one provided in `$addButton[]` -> -> In `$addButton[]`, `yes` is being used for the `new row?` argument so that the button would appear in the next row. - -3. Execute command `!example` - -![example](https://user-images.githubusercontent.com/113303649/211164994-695cf7b6-b2fa-49e5-a78f-dc21db213a9a.png) - - -> How [`$onInteraction`](../../../../callbacks/onInteraction.md) or [`$onInteraction[]`](../../../..//callbacks/onInteractionComplex.md) works? - +# Buttons +In this section, you'll learn how to use the button component. + +## Content +[**Functions Used**](#functions-used) > [**Button Style**](#button-style) > [**Button Type**](#button-type) > [**$addButton[]**](#addbutton) > [**$editButton[]**](#editbutton) > [**$removeButtons**](#removebuttons) > [**$removeButtons[]**](#removebuttons-1) > [**$removeComponent[]**](#removecomponent) > [**Create Interaction**](#create-interaction) + +## Functions Used +- [`$addButton[]`](../../../../bdscript/addButton.md) +- [`$editButton[]`](../../../../bdscript/editButton.md) +- [`$removeButtons`](../../../../bdscript/removeButtons.md) +- [`$removeButtons[]`](../../../../bdscript/removeButtonsComplex.md) +- [`$removeComponent[]`](../../../../bdscript/removeComponent.md) + +## Support Callbacks Used +- [`$onInteraction`](../../../../callbacks/onInteraction.md) +- [`$onInteraction[]`](../../../../callbacks/onInteractionComplex.md) + +## Button Style +Buttons can have different styles _(background colors)_. +Here, are all possible values for the `style` function argument. +- `primary` - Blue button +- `secondary` - Gray button +- `success` - Green button +- `danger` - Red button +- `link` - Redirect button + +```discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Buttons: + components: + - + - type: primary + label: Primary + - type: primary + label: Primary + disabled: true + - + - type: success + label: Success + - type: success + label: Success + disabled: true + - + - type: destructive + label: Danger + - type: destructive + label: Danger + disabled: true + - + - type: secondary + label: Secondary + - type: secondary + label: Secondary + disabled: true +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Other Buttons: + components: + - + - type: secondary + label: Link + url: https://nilpointer-software.github.io/bdfd-wiki/nightly/ + - type: secondary + label: Link + disabled: true + url: https://nilpointer-software.github.io/bdfd-wiki/nightly/ + - + - type: secondary + label: Emoji + emoji: https://em-content.zobj.net/thumbs/120/mozilla/36/heavy-black-heart_2764.png +``` + +> If `link` style is used, the button **won't send** any interactions! + +## Button Type +There are 2 types of buttons : `interactive` and `link`. + +When an interactive button is pressed, it sends an interaction which can be used together with `$onInteraction[ID]`. + +Every interactive button has an `ID`. A `$onInteraction[ID]` callback, will only get triggered when the button with the same `ID` is pressed. +Interactive buttons can use every `style` except `link`. + +> Link buttons **don't send** any interactions. When they're pressed they forward the user to a website. +> +> Link buttons **need to** set their `style` argument value to `link`. + +# $addButton +Adds a button to the response message. +## Syntax +``` +$addButton[New row?;Interaction ID/url;Label;Style;(Disable?;Emoji;Message ID)] +``` +### Parameters +- `New row?` `(Type: Bool || Flag: Required)`: If set to `yes` the button will appear in a new row. If it's set to `no` the button will appear in the same row as a previous button. + + > A message can have a maximum of 25 buttons (5 rows of 5 buttons). + +- `Interaction ID/URL` `(Type: String, URL || Flag: Required)`: Depending on the button type, you either set it to an `Interaction ID` which is then used in the `$onInteraction[Interaction ID]` or `$onInteraction` callback or a `URL` if it's a link button. +> You don't need `$onInteraction`/`$onInteraction[]` for URL. +- `Label` `(Type: String || Flag: Emptiable)`: The text visible on the button. +- `Style` `(Type: Enum || Flag: Required)`: It's used to specify the button's background color. If the button has a link/url you **have to** set this value to `link`. Check [this section](#button-style) for more details. +- `Disable?` `(Type: Bool || Flag: Vacantable)`: If set to `yes` the button can't be pressed. Defaults as `no`. +- `Emoji` `(Type: Emoji || Flag: Vacantable)`: Adds an emoji inside the button. Emojis have to be either pasted as *unicode* or be in the following format `<:emoji name:emoji ID>`. +- `message ID` `(Type: Snowflake || Flag: Vacantable)`: Adds a button to the provided message ID. It's important to note that provided message ID author **has to** be the bot. + +> Interactive buttons can't have duplicated `ID`'s in the same message. So for example, you can't have two buttons with the ID set to `test`. + +> If `URL` is used in `Interaction ID/url` argument, it **has to** start with `http://` or `https://` + +## Example +``` +$nomention +Hello +$addButton[no;test;Say hello!;primary;no;] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Hello + components: + - + - type: primary + label: Say hello! +``` + + +# $editButton +Edits an already existing button. + +## Syntax +``` +$editButton[Interaction ID/URL;Label;Style;(Disable?;Emoji;Message ID)] +``` + +### Parameters +- `Interaction ID/URL` `(Type: String, URL || Flag: Required)`: Depending on the button type, you either set it to an `Interaction ID` which is then used in the `$onInteraction[Interaction ID]` callback or a `URL` if it's a link button. +- `Label` `(Type: String || Flag: Emptiable)`: The text visible on the button. +- `Style` `(Type: Enum || Flag: Required)`: It's used to specify the button's background color. If the button has a link/url you **have to** set this value to `link`. Check [this section](#button-style) for more details. +- `Disable?` `(Type: Bool || Flag: Vacantable)`: If set to `yes` the button can't be pressed. Defaults as `no`. _(Optional)_ +- `Emoji` `(Type: Emoji || Flag: Vacantable)`: Edits an emoji inside the button. Emojis have to be either pasted as *unicode* or be in the following format `<:emoji name:emoji ID>`. _(Optional)_ +- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Edits a button in a message with the provided ID. It's important to note that provided message ID author **has to** be the bot. _(Optional)_ + +## Example +#### Trigger: `$onInteraction[test]` +``` +$nomention +$username said hello! +$editButton[test;Say hello!;danger;yes;] +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + edited: true + content: | + rainbow_key said hello! + components: + - + - type: destructive + label: Say hello! + disabled: true +``` + + +# $removeButtons +Removes all buttons from the triggered message. +## Syntax +``` +$removeButtons +``` +## Example +#### Trigger: `$onInteraction[test]` +``` +$nomention +$username removed all buttons from this message. +$removeButtons +``` + +```discord yaml +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + edited: true + content: | + rainbow_key removed all buttons from this message. +``` + +# $removeButtons[] +Removes all buttons from the specified message. +## Syntax +``` +$removeButtons[Message ID] +``` +### Parameters +- `Message ID` `(Type: Snowflake || Flag: Required)`: Removes buttons from the message with the provided ID. It's important to note that provided message ID author **has to** be the bot. +## Example +``` +$nomention +$username removed all buttons from the specified message ID. +$removeButtons[$message] +``` + +```discord yaml +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + Message ID: 1291982295888166974 +- user_id: 803569638084313098 + username: RainbowKey + color: "#E67E22" + content: | + !example 1291982295888166974 +- user_id: 1009018156494368798 + username: BDFD Support + color: "#378afa" + bot: true + verified: true + content: | + rainbow_key removed all buttons from the specified message ID. +``` + +# $removeComponent +Removes a certain component from a message. +## Syntax +``` +$removeComponent[Interaction ID/URL;(Message ID)] +``` +> This function supports [select-menu](../selectMenus/aboutSelectMenu.md) and [button](../buttons/aboutButtons.md). +### Parameters +- `Interaction ID/URL` `(Type: String || Flag: Required)`: The interaction ID of the button, to remove from the message. +- `Message ID` `(Type: Snowflake || Flag: Vacantable)`: Removes the button from the message with the provided ID. It's important to note that provided message ID author **has to** be the bot. _(Optional)_ +## Example +``` +$nomention +$username successfully removed the button! +$removeComponent[test;$message] +``` +![example](https://user-images.githubusercontent.com/113303649/211163378-2aaa540d-b0a1-4511-8f34-6a91260b079d.png) + +![example](https://user-images.githubusercontent.com/113303649/211163615-ecffddcf-1d2b-4065-8445-9ec7ed1eb2b4.png) + +# Create interaction +### Example with `$onInteraction[]` callback: +1. Create two commands with `!example` and `$onInteraction[test]` triggers. +2. Paste the following code: +Code for the command with the `!example` trigger: +``` +$nomention +Click the button below! +$addButton[no;test;Click;primary] +$addButton[no;button;Button disabled;secondary;yes] +$addButton[yes;https://botdesignerdiscord.com/;Link;link] +``` +Code for the command with the `$onInteraction[test]` trigger: +``` +$nomention +$editButton[test;Clicked;danger;yes] +$sendMessage[$username hello!] +``` + +> Note that the interaction ID provided in `$onInteraction[]` is the same as the one provided in `$addButton[]` +> +> In `$addButton[]`, `yes` is being used for the `new row?` argument so that the button would appear in the next row. +3. Execute command `!example` + +![example](https://user-images.githubusercontent.com/113303649/211164994-695cf7b6-b2fa-49e5-a78f-dc21db213a9a.png) + +### Example with `$onInteraction` callback: +1. Create two commands with `!example` and `$onInteraction` triggers. +2. Paste the following code: +Code for the command with the `!example` trigger: +``` +$nomention +Click the button below! +$addButton[no;test;Click;primary] +$addButton[no;button;Button disabled;secondary;yes] +$addButton[yes;https://botdesignerdiscord.com/;Link;link] +``` +Code for the command with the `$onInteraction` trigger: +``` +$nomention +$if[$customID==test] + $editButton[test;Clicked;danger;yes] + $sendMessage[$username hello!] +$endif +``` +> Note that the interaction ID returned by `$customID` will be the same as the one provided in `$addButton[]` +> +> In `$addButton[]`, `yes` is being used for the `new row?` argument so that the button would appear in the next row. + +3. Execute command `!example` + +![example](https://user-images.githubusercontent.com/113303649/211164994-695cf7b6-b2fa-49e5-a78f-dc21db213a9a.png) + + +> How [`$onInteraction`](../../../../callbacks/onInteraction.md) or [`$onInteraction[]`](../../../..//callbacks/onInteractionComplex.md) works? + diff --git a/src/guides/general/interactions/modals/aboutModals.md b/src/guides/general/interactions/modals/aboutModals.md index fc5cc1b658a..0f51d0651b2 100644 --- a/src/guides/general/interactions/modals/aboutModals.md +++ b/src/guides/general/interactions/modals/aboutModals.md @@ -1,81 +1,81 @@ -# Modals -In this section, you'll learn how to use the modal message component. - -![](https://imgur.com/XUbUhdG.png) - -> ⚠ī¸ **Warning:** Modals are only supported for interaction responses (like slash commands, buttons, select menus, etc), you can't open a modal from just a message command. - -## Creating a Modal -``` -$newModal[Modal ID;Title] -``` - -- `Modal ID` - Used in `$onInteraction[ID]` callback. It works same way as [buttons](../buttons/aboutButtons.md) and [select menus](../selectMenus/aboutSelectMenu.md). -- `Title` - The text which is displayed on top of a modal. This value must be less than or equal to 45 characters. - -## Adding Input Fields -``` -$addTextInput[Text Input ID;Style;Label;(Minimum length;Maximum length;Required;Value;Placeholder)] -``` - -- `Text Input ID` - ID that is used to retrieve the text input in the field. This value must be unique. _(Used in [`$input[Text Input ID]`](#getting-input-from-a-modal-submission))_ -- `Style` - The text input field style, either `short` or `paragraph`. - \ - ![](https://user-images.githubusercontent.com/95774950/168493815-9ab58410-f5ca-48af-baed-0f68aade3bc4.png) -- `Label` - Name of the text input field. This value must be less than or equal to 45 characters. -- `Minimum length` - Minimum number of characters a user needs to input. This value must be an integer between 0 and 4000, and can't be greater than the `Maximum length`. -- `Maximum length` - Maximum number of characters a user can input. This value must be an integer between 0 and 4000, and can't be less than the `Minimum length`. -- `Required` - Whether a user must fill in the text input field, defaults to true. -- `Value` - The text that is written by default in the text input field. This value must be less than or equal to 4000 characters and must not be less than `Minimum length` and no more than `Maximum length`. -- `Placeholder` - The text that is displayed if the text input field is empty. This value must be less than or equal to 100 characters. - -> 🧙‍♂ī¸ **Note:** You can't add more than 5 text input fields. - -## Getting Input from a Modal Submission -_Use this function in response to the modal submission interaction:_ -``` -$input[Text Input ID] -``` - -- `Text Input ID` - The text input field to get the user's input from. - -## Example - -Command Trigger: `!modal` | Command Code: - -``` -$nomention -Modal Example -$addButton[no;bio;Click me!;primary] -``` - -Command Trigger: `$onInteraction[bio]` | Command Code: - -``` -$nomention -$newModal[modal;User Bio] -$addTextInput[modalInput1;short;What is your name?;3;30;yes;;Mikołaj] -$addTextInput[modalInput2;short;What are your pronouns?;2;30;yes;;He/Him] -$addTextInput[modalInput3;paragraph;Can you tell us about yourself?;5;1000;no;;I am a Developer] -``` - -> 🤔 **Explanation:** The code above executes when the [button](../buttons/aboutButtons.md) from the previous code gets clicked. So, when the user clicks the button the modal appears. - -Command Trigger: `$onInteraction[modal]` | Command Code: - -``` -$nomention -Name : $input[modalInput1] -Pronouns : $input[modalInput2] -About me : $input[modalInput3] -``` - -> 🤔 **Explanation:** The code above executes when the modal is submitted, because in the previous command we inputted the custom ID 'modal' into the `$newModal[]` function: `$newModal[modal;User Bio]`. - -### Result - -![](https://user-images.githubusercontent.com/69215413/168921581-24738366-8a3d-4de3-8398-34ea562501ce.png) - -![](https://imgur.com/0Vd3Ipq.png) - -![](https://user-images.githubusercontent.com/69215413/168921575-9c2e3106-4ac0-4388-8b41-46e640e6126a.png) +# Modals +In this section, you'll learn how to use the modal message component. + +![](https://imgur.com/XUbUhdG.png) + +> ⚠ī¸ **Warning:** Modals are only supported for interaction responses (like slash commands, buttons, select menus, etc), you can't open a modal from just a message command. + +## Creating a Modal +``` +$newModal[Modal ID;Title] +``` + +- `Modal ID` - Used in `$onInteraction[ID]` callback. It works same way as [buttons](../buttons/aboutButtons.md) and [select menus](../selectMenus/aboutSelectMenu.md). +- `Title` - The text which is displayed on top of a modal. This value must be less than or equal to 45 characters. + +## Adding Input Fields +``` +$addTextInput[Text Input ID;Style;Label;(Minimum length;Maximum length;Required;Value;Placeholder)] +``` + +- `Text Input ID` - ID that is used to retrieve the text input in the field. This value must be unique. _(Used in [`$input[Text Input ID]`](#getting-input-from-a-modal-submission))_ +- `Style` - The text input field style, either `short` or `paragraph`. + \ + ![](https://user-images.githubusercontent.com/95774950/168493815-9ab58410-f5ca-48af-baed-0f68aade3bc4.png) +- `Label` - Name of the text input field. This value must be less than or equal to 45 characters. +- `Minimum length` - Minimum number of characters a user needs to input. This value must be an integer between 0 and 4000, and can't be greater than the `Maximum length`. +- `Maximum length` - Maximum number of characters a user can input. This value must be an integer between 0 and 4000, and can't be less than the `Minimum length`. +- `Required` - Whether a user must fill in the text input field, defaults to true. +- `Value` - The text that is written by default in the text input field. This value must be less than or equal to 4000 characters and must not be less than `Minimum length` and no more than `Maximum length`. +- `Placeholder` - The text that is displayed if the text input field is empty. This value must be less than or equal to 100 characters. + +> **Note:** You can't add more than 5 text input fields. + +## Getting Input from a Modal Submission +_Use this function in response to the modal submission interaction:_ +``` +$input[Text Input ID] +``` + +- `Text Input ID` - The text input field to get the user's input from. + +## Example + +Command Trigger: `!modal` | Command Code: + +``` +$nomention +Modal Example +$addButton[no;bio;Click me!;primary] +``` + +Command Trigger: `$onInteraction[bio]` | Command Code: + +``` +$nomention +$newModal[modal;User Bio] +$addTextInput[modalInput1;short;What is your name?;3;30;yes;;Mikołaj] +$addTextInput[modalInput2;short;What are your pronouns?;2;30;yes;;He/Him] +$addTextInput[modalInput3;paragraph;Can you tell us about yourself?;5;1000;no;;I am a Developer] +``` + +> 🤔 **Explanation:** The code above executes when the [button](../buttons/aboutButtons.md) from the previous code gets clicked. So, when the user clicks the button the modal appears. + +Command Trigger: `$onInteraction[modal]` | Command Code: + +``` +$nomention +Name : $input[modalInput1] +Pronouns : $input[modalInput2] +About me : $input[modalInput3] +``` + +> 🤔 **Explanation:** The code above executes when the modal is submitted, because in the previous command we inputted the custom ID 'modal' into the `$newModal[]` function: `$newModal[modal;User Bio]`. + +### Result + +![](https://user-images.githubusercontent.com/69215413/168921581-24738366-8a3d-4de3-8398-34ea562501ce.png) + +![](https://imgur.com/0Vd3Ipq.png) + +![](https://user-images.githubusercontent.com/69215413/168921575-9c2e3106-4ac0-4388-8b41-46e640e6126a.png) diff --git a/src/guides/general/interactions/selectMenus/aboutSelectMenu.md b/src/guides/general/interactions/selectMenus/aboutSelectMenu.md index 319b7e130e5..4c40d0795aa 100644 --- a/src/guides/general/interactions/selectMenus/aboutSelectMenu.md +++ b/src/guides/general/interactions/selectMenus/aboutSelectMenu.md @@ -1,125 +1,125 @@ -# Select Menu -In this section you'll learn how to use the select menu component. - -![Preview 1](https://user-images.githubusercontent.com/70456337/194143249-eb32bed6-5fc9-4d7b-b88c-65b37dfcbfc9.png) -![Preview 2](https://user-images.githubusercontent.com/70456337/194143111-bf128046-3428-4226-840d-9ea4b0569677.png) - -## Creating a Select Menu -``` -$newSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)] -``` -- `Menu ID` - it's used for `$onInteraction[ID]` callback. It works the same way as [buttons](../buttons/aboutButtons.md). -- `Min` - minimum amount of values that can be selected. -- `Max` - maximum amount of values that can be selected. -- `Placeholder` - it's a text that appears if no option is selected. -- `Message ID` - ID of a message that should have select menu added to it. By default it's the bot's response. - -## Adding an Option -``` -$addSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)] -``` -- `Menu option ID` - it has to be the same as the ID used in `$newSelectMenu[]`. -- `Label` - the name of the option. -- `Value` - it's the data that gets passed to `$onInteraction[]` callback. **The value has to be unique in the select menu!** -- `Description` - it shows up under the `label`. -- `Default` - should the option be selected by default. **There can be only one default option!** -- `Emoji` - it shows up next to the `label`. -- `Message ID` - same as in `$newSelectMenu[]`. - -## Example -### Select Menu Code -``` -$newSelectMenu[Example;1;1;Choose some option] -$addSelectMenuOption[Example;First;first-option;The first option] -$addSelectMenuOption[Example;Second;second-option;The second option] -$addSelectMenuOption[Example;Third;third-option;The third option] -``` -### Interaction Code -> `$onInteraction[Example]` -``` -$if[$message==first-option] -You have chosen the first option -$elseif[$message==second-option] -You have chosen the second option -$elseif[$message==third-option] -You have chosen the third option -$endif -``` -### Usage -![Usage 1](https://user-images.githubusercontent.com/70456337/194143799-a48e72cb-5947-4657-99d3-d4bafaef5eb5.png) -# Multi-Select Menu -In the Select Menu you can choose not only one option, but several at once. -You could understand this by the presence of arguments `Min` and `Max`. - -## Example -### Select Menu Code -> Here we will change the argument `Max` to 3. -``` -$newSelectMenu[Example;1;3;Choose some option] -$addSelectMenuOption[Example;First;first-option;The first option] -$addSelectMenuOption[Example;Second;second-option;The second option] -$addSelectMenuOption[Example;Third;third-option;The third option] -``` -### Interaction Code -``` -$if[$checkContains[$message;first-option]==true] -$addCmdReactions[1ī¸âƒŖ] -$endif - -$if[$checkContains[$message;second-option]==true] -$addCmdReactions[2ī¸âƒŖ] -$endif - -$if[$checkContains[$message;third-option]==true] -$addCmdReactions[3ī¸âƒŖ] -$endif -``` -> If we choose several options, several reactions will be added. -### Usage -![Usage 2.1](https://user-images.githubusercontent.com/70456337/194145414-33fa645f-c3ac-4105-95d9-4edc89fcfae5.png) -![Usage 2.2](https://user-images.githubusercontent.com/70456337/194145159-6c2996f1-7dbc-4fa3-90e0-9a0b8f5c2d9e.png) - -# Editing a Select Menu -You can edit Select Menu, as well as options in this menu. -## $editSelectMenu -### Usage -``` -$editSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)] -``` -## $editSelectMenuOption -### Usage -``` -$editSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)] -``` - -> As you can notice, the arguments are exactly the same. - -## Example -### Select Menu Code -``` -$newSelectMenu[Example;1;1;Choose some option] -$addSelectMenuOption[Example;First;first-option;The first option] -$addSelectMenuOption[Example;Second;second-option;The second option] -$addSelectMenuOption[Example;Third;third-option;The third option] -``` -### Interaction Code -#### Example 1 -``` -$editSelectMenuOption[Example;First;first-option;The first option;no;1ī¸âƒŖ] -$editSelectMenuOption[Example;Second;second-option;The second option;no;2ī¸âƒŖ] -$editSelectMenuOption[Example;Third;third-option;The third option;no;3ī¸âƒŖ] -``` -![Example 1](https://user-images.githubusercontent.com/70456337/194148923-a25962f8-544d-4744-8a5c-876d9455eaa3.png) -![Example 1](https://user-images.githubusercontent.com/70456337/194149283-42724349-84d1-4d70-b8e6-d4b58e8c365f.png) -![Example 1](https://user-images.githubusercontent.com/70456337/194149485-750c15e8-2a3c-46d0-857b-493178b9468c.png) -> We just added emoji to our options after choosing (any) option. -#### Example 2 -``` -$editSelectMenu[Example;1;1;Choose some option 😀] -$addSelectMenuOption[Example;First;first-option;The first option] -$addSelectMenuOption[Example;Second;second-option;The second option] -$addSelectMenuOption[Example;Third;third-option;The third option] -``` -![Example 2](https://user-images.githubusercontent.com/70456337/194151805-879cca9b-e970-4e32-bd70-fb5f9010fd97.png) -![Example 2](https://user-images.githubusercontent.com/70456337/194151852-70c8d754-e6cd-4269-982c-af03c6c3ba3c.png) -> We just changed the placeholder of our Select Menu after choosing (any) option. +# Select Menu +In this section you'll learn how to use the select menu component. + +![Preview 1](https://user-images.githubusercontent.com/70456337/194143249-eb32bed6-5fc9-4d7b-b88c-65b37dfcbfc9.png) +![Preview 2](https://user-images.githubusercontent.com/70456337/194143111-bf128046-3428-4226-840d-9ea4b0569677.png) + +## Creating a Select Menu +``` +$newSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)] +``` +- `Menu ID` - it's used for `$onInteraction[ID]` callback. It works the same way as [buttons](../buttons/aboutButtons.md). +- `Min` - minimum amount of values that can be selected. +- `Max` - maximum amount of values that can be selected. +- `Placeholder` - it's a text that appears if no option is selected. +- `Message ID` - ID of a message that should have select menu added to it. By default it's the bot's response. + +## Adding an Option +``` +$addSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)] +``` +- `Menu option ID` - it has to be the same as the ID used in `$newSelectMenu[]`. +- `Label` - the name of the option. +- `Value` - it's the data that gets passed to `$onInteraction[]` callback. **The value has to be unique in the select menu!** +- `Description` - it shows up under the `label`. +- `Default` - should the option be selected by default. **There can be only one default option!** +- `Emoji` - it shows up next to the `label`. +- `Message ID` - same as in `$newSelectMenu[]`. + +## Example +### Select Menu Code +``` +$newSelectMenu[Example;1;1;Choose some option] +$addSelectMenuOption[Example;First;first-option;The first option] +$addSelectMenuOption[Example;Second;second-option;The second option] +$addSelectMenuOption[Example;Third;third-option;The third option] +``` +### Interaction Code +> `$onInteraction[Example]` +``` +$if[$message==first-option] +You have chosen the first option +$elseif[$message==second-option] +You have chosen the second option +$elseif[$message==third-option] +You have chosen the third option +$endif +``` +### Usage +![Usage 1](https://user-images.githubusercontent.com/70456337/194143799-a48e72cb-5947-4657-99d3-d4bafaef5eb5.png) +# Multi-Select Menu +In the Select Menu you can choose not only one option, but several at once. +You could understand this by the presence of arguments `Min` and `Max`. + +## Example +### Select Menu Code +> Here we will change the argument `Max` to 3. +``` +$newSelectMenu[Example;1;3;Choose some option] +$addSelectMenuOption[Example;First;first-option;The first option] +$addSelectMenuOption[Example;Second;second-option;The second option] +$addSelectMenuOption[Example;Third;third-option;The third option] +``` +### Interaction Code +``` +$if[$checkContains[$message;first-option]==true] +$addCmdReactions[1ī¸âƒŖ] +$endif + +$if[$checkContains[$message;second-option]==true] +$addCmdReactions[2ī¸âƒŖ] +$endif + +$if[$checkContains[$message;third-option]==true] +$addCmdReactions[3ī¸âƒŖ] +$endif +``` +> If we choose several options, several reactions will be added. +### Usage +![Usage 2.1](https://user-images.githubusercontent.com/70456337/194145414-33fa645f-c3ac-4105-95d9-4edc89fcfae5.png) +![Usage 2.2](https://user-images.githubusercontent.com/70456337/194145159-6c2996f1-7dbc-4fa3-90e0-9a0b8f5c2d9e.png) + +# Editing a Select Menu +You can edit Select Menu, as well as options in this menu. +## $editSelectMenu +### Usage +``` +$editSelectMenu[Menu ID;Min;Max;(Placeholder;Message ID)] +``` +## $editSelectMenuOption +### Usage +``` +$editSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)] +``` + +> As you can notice, the arguments are exactly the same. + +## Example +### Select Menu Code +``` +$newSelectMenu[Example;1;1;Choose some option] +$addSelectMenuOption[Example;First;first-option;The first option] +$addSelectMenuOption[Example;Second;second-option;The second option] +$addSelectMenuOption[Example;Third;third-option;The third option] +``` +### Interaction Code +#### Example 1 +``` +$editSelectMenuOption[Example;First;first-option;The first option;no;1ī¸âƒŖ] +$editSelectMenuOption[Example;Second;second-option;The second option;no;2ī¸âƒŖ] +$editSelectMenuOption[Example;Third;third-option;The third option;no;3ī¸âƒŖ] +``` +![Example 1](https://user-images.githubusercontent.com/70456337/194148923-a25962f8-544d-4744-8a5c-876d9455eaa3.png) +![Example 1](https://user-images.githubusercontent.com/70456337/194149283-42724349-84d1-4d70-b8e6-d4b58e8c365f.png) +![Example 1](https://user-images.githubusercontent.com/70456337/194149485-750c15e8-2a3c-46d0-857b-493178b9468c.png) +> We just added emoji to our options after choosing (any) option. +#### Example 2 +``` +$editSelectMenu[Example;1;1;Choose some option 😀] +$addSelectMenuOption[Example;First;first-option;The first option] +$addSelectMenuOption[Example;Second;second-option;The second option] +$addSelectMenuOption[Example;Third;third-option;The third option] +``` +![Example 2](https://user-images.githubusercontent.com/70456337/194151805-879cca9b-e970-4e32-bd70-fb5f9010fd97.png) +![Example 2](https://user-images.githubusercontent.com/70456337/194151852-70c8d754-e6cd-4269-982c-af03c6c3ba3c.png) +> We just changed the placeholder of our Select Menu after choosing (any) option. diff --git a/src/guides/general/interactions/slashCommands/aboutSlashCommands.md b/src/guides/general/interactions/slashCommands/aboutSlashCommands.md index 8f010e8e7ed..011300ff519 100644 --- a/src/guides/general/interactions/slashCommands/aboutSlashCommands.md +++ b/src/guides/general/interactions/slashCommands/aboutSlashCommands.md @@ -1,113 +1,113 @@ -# Slash Commands -In this guide, you will learn more about implementing slash commands to your bot. - -Slash commands are type of interactive application commands. It let's users to interact with your bot by typing `/`. - -![preview](https://i.imgur.com/kLNyEby.jpg) - -# General information -- Discord allows up to 200 slash commands _(100 global & 100 guild based commands)_. -- To use slash commands, you need to invite the bot with `applications.commands` scope. -- Creating/modifying/deleting global slash commands might take up to **1 hour**. -- Creating a guild slash command is instant but it won't appear unless you have registered them in the current guild using `$registerGuildCommands[(slash command name;...)]` function. - - - > 📝 Guild slash commands don't appear in DMs unlike global slash commands. -# Getting started -Before you start, you need **2.0.18** version of the app or later. - -## Inviting the bot -- Method #1 - - Visit [Discord Developer](https://discord.com/developers/applications) official website and select your bot application. - - Click hamburger icon `≡` on top-left of the website and choose `OAuth2` tab. - - In `OAuth2` tab, click `URL Generator` sub-tab. - - Choose `bot` & `application.commands` in scopes and desired bot permissions. - - Copy the generated url below and invite your bot into your server. - -- Method #2 - - Open BDFD app and select your bot. - - Press `Add invite bot to server` button in dashboard tab. - - Click `Edit invite link scopes` and enable *"Slash commands"* if its disabled. - - Now, go back & press *"Add your bot to your server"* - - Finally, invite the bot into your server. - -## Creating a slash command -- Create or modify an existing command. -- Click *"Slash command trigger"*. -- Choose *"Enable global slash command"* or *"Enable guild slash command"* as per your preference. -- Fill-up necessary data and save it. - -> 📝 Slash commands can have a maximum of 4000 characters _(combined name, description, and value properties)_ per slash. - -#### Example - -![Screenshot_20220717_170852](https://user-images.githubusercontent.com/95774950/179396882-832a7158-f3db-46f2-bf38-2f5a3125c201.png) -![Screenshot_20220717_170915](https://user-images.githubusercontent.com/95774950/179396889-d9891b2a-74dd-4454-97b5-75eee1d12db0.png) -![Screenshot_20220717_171511](https://user-images.githubusercontent.com/95774950/179396894-e8b8e0c7-fe73-4f0b-8787-d40f8d3df630.png) - - -## Slash options -Slash options are great way to get an user's input in slash commands. - -To create a slash option, -- Open your slash command edit trigger page. -- Click *"Add"* button in `Options` section. -- Fill-up necessary data and save the changes. - -> 📝 Slash commands can have up to maximum 25 options per slash. - -### Slash options types - -- Text - Accepts any string data input. -- Integer - Accepts only integer value input. For example: 3, -70 etc. -- Number - Accepts only number value input. For example: 5.3, -35, 23 etc. -- Boolean - Accepts either true or false input. -- User - It allows to mention any user. -- Channel - It allows to mention any channel. -- Role - It allows to mention any role. -- Mentionable - It allows to mention any user or role. -- Attachments - It allows to upload attachments. - -### Retrieving value from options -To retrieve a value from an option, use `$message[