From 18a27065421a470ecd3102f691d28e7b671dc982 Mon Sep 17 00:00:00 2001 From: Copycat4858 <52893462+Auriosi@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:59:07 -0500 Subject: [PATCH 1/5] Fix links to Bases page --- roblox/client.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roblox/client.py b/roblox/client.py index fbea3a43..65c93aa2 100644 --- a/roblox/client.py +++ b/roblox/client.py @@ -221,7 +221,7 @@ def get_base_user(self, user_id: int) -> BaseUser: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: user_id: A Roblox user ID. @@ -282,7 +282,7 @@ def get_base_group(self, group_id: int) -> BaseGroup: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: group_id: A Roblox group ID. @@ -335,7 +335,7 @@ def get_base_universe(self, universe_id: int) -> BaseUniverse: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: universe_id: A Roblox universe ID. @@ -389,7 +389,7 @@ def get_base_place(self, place_id: int) -> BasePlace: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: place_id: A Roblox place ID. @@ -430,7 +430,7 @@ def get_base_asset(self, asset_id: int) -> BaseAsset: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: asset_id: A Roblox asset ID. @@ -484,7 +484,7 @@ def get_base_plugin(self, plugin_id: int) -> BasePlugin: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: plugin_id: A Roblox plugin ID. @@ -525,7 +525,7 @@ def get_base_badge(self, badge_id: int) -> BaseBadge: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: badge_id: A Roblox badge ID. @@ -542,7 +542,7 @@ def get_base_gamepass(self, gamepass_id: int) -> BaseGamePass: !!! note This method does not send any requests - it just generates an object. - For more information on bases, please see [Bases](/bases). + For more information on bases, please see [Bases](/dev/bases). Arguments: gamepass_id: A Roblox gamepass ID. From b4aac7fb02f28915314bcd87a8ba308adfc0fd28 Mon Sep 17 00:00:00 2001 From: Copycat4858 <52893462+Auriosi@users.noreply.github.com> Date: Wed, 22 Jun 2022 17:04:03 -0500 Subject: [PATCH 2/5] Clarify bases.md Clarifies that get_base_XYZ methods are not asynchronous --- docs/bases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/bases.md b/docs/bases.md index ec676495..cde64d2a 100644 --- a/docs/bases.md +++ b/docs/bases.md @@ -15,4 +15,4 @@ user = client.get_base_user(1) async for username in user.username_history(): print(username) ``` -This code is functionally identical but won't send any unnecessary requests. \ No newline at end of file +This code is functionally identical but won't send any unnecessary requests. Note that `get_base_XYZ` functions are not asynchronous, so you do not need to await them. From ed94921439c4e3da57363236ba1c70cd706648dd Mon Sep 17 00:00:00 2001 From: Copycat4858 <52893462+Auriosi@users.noreply.github.com> Date: Sat, 25 Jun 2022 20:13:20 -0500 Subject: [PATCH 3/5] Create setup.md --- docs/tutorial/group-bot/setup.md | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/tutorial/group-bot/setup.md diff --git a/docs/tutorial/group-bot/setup.md b/docs/tutorial/group-bot/setup.md new file mode 100644 index 00000000..bd2ce252 --- /dev/null +++ b/docs/tutorial/group-bot/setup.md @@ -0,0 +1,33 @@ +# Discord-Roblox Group Management Bot +One of the most common uses of ro.py is for Discord-Roblox bots, usually for managing groups. In this guide, we'll create a bot from scratch using [discord.py](https://discordpy.readthedocs.io/en/stable/) and ro.py to manage a group. +While this will all work on its own, you will likely need to make modifications to have some parts work in your own bot (if you already have one). +!!! note + This tutorial uses discord.py prefix commands, which will require the Message Content intent to be enabled on + September 1st, 2022. Concepts related to ro.py will likely still apply when using application commands, but this + guide does not use them. + +## Prerequisites +* Basic knowledge (and how to use [async/await syntax](https://realpython.com/async-io-python/#the-asyncawait-syntax-and-native-coroutines)) and installation of Python +* Basic knowledge of discord.py + +## Setup +Before we get started, there are 2 packages we need to install. Use the following commands in your terminal: +``` +pip install discord.py +pip install roblox +``` +Next, create a new Python file wherever on your system that you'd like. Once you've done so, open it in your favorite editor, and add the following: +```python title="main.py" +import discord +from discord.ext import commands +import roblox + +bot = commands.Bot("!") +client = roblox.Client("YOUR_TOKEN_HERE") +``` +Here, we've imported the discord.py package, the commands extension, and the ro.py package, then created a new Discord Bot Client and Roblox Client. Replace `YOUR_TOKEN_HERE` with your [.ROBLOSECURITY](https://ro.py.jmk.gg/dev/roblosecurity/) token. +!!! danger + Under no circumstances should you give anyone else access to your .ROBLOSECURITY token, as this gives them access + to your account. It is recommended to use an alternate account for this, and one with only the permissions necessary + for your bot to function. It is also recommended to [enable 2FA](https://en.help.roblox.com/hc/articles/212459863), + as this makes it much more difficult for some to randomly gain access to your account, even if they know your password. From d3f30a3d9abbcf5c62fe334d42c692cc6f7157e3 Mon Sep 17 00:00:00 2001 From: Copycat4858 <52893462+Auriosi@users.noreply.github.com> Date: Sun, 26 Jun 2022 09:38:21 -0500 Subject: [PATCH 4/5] Add comment about intents in setup.md --- docs/tutorial/group-bot/setup.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/tutorial/group-bot/setup.md b/docs/tutorial/group-bot/setup.md index bd2ce252..81381d4b 100644 --- a/docs/tutorial/group-bot/setup.md +++ b/docs/tutorial/group-bot/setup.md @@ -2,9 +2,9 @@ One of the most common uses of ro.py is for Discord-Roblox bots, usually for managing groups. In this guide, we'll create a bot from scratch using [discord.py](https://discordpy.readthedocs.io/en/stable/) and ro.py to manage a group. While this will all work on its own, you will likely need to make modifications to have some parts work in your own bot (if you already have one). !!! note - This tutorial uses discord.py prefix commands, which will require the Message Content intent to be enabled on - September 1st, 2022. Concepts related to ro.py will likely still apply when using application commands, but this - guide does not use them. + This tutorial uses discord.py prefix commands, which will require the Message Content intent to be enabled on + September 1st, 2022. Concepts related to ro.py will likely still apply when using application commands, but this + guide does not use them. ## Prerequisites * Basic knowledge (and how to use [async/await syntax](https://realpython.com/async-io-python/#the-asyncawait-syntax-and-native-coroutines)) and installation of Python @@ -22,7 +22,8 @@ import discord from discord.ext import commands import roblox -bot = commands.Bot("!") +bot = commands.Bot("!", intents=discord.Intents.default()) +# If your bot will do other things, you may need different intents. Check https://discordpy.readthedocs.io/en/stable/intents.html for information on how to use intents. client = roblox.Client("YOUR_TOKEN_HERE") ``` Here, we've imported the discord.py package, the commands extension, and the ro.py package, then created a new Discord Bot Client and Roblox Client. Replace `YOUR_TOKEN_HERE` with your [.ROBLOSECURITY](https://ro.py.jmk.gg/dev/roblosecurity/) token. From d884f4d7a80c82a078ac225eb85e9639f0c8ab22 Mon Sep 17 00:00:00 2001 From: Copycat4858 <52893462+Auriosi@users.noreply.github.com> Date: Thu, 4 Aug 2022 16:50:25 -0500 Subject: [PATCH 5/5] Fix dev-docs.yml --- .github/workflows/dev-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-docs.yml b/.github/workflows/dev-docs.yml index 2ac795b1..6292ded3 100644 --- a/.github/workflows/dev-docs.yml +++ b/.github/workflows/dev-docs.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | pip install git+https://github.com/squidfunk/mkdocs-material.git@8.0.0b2 - pip install mkdocstrings httpx mkdocs-literate-nav mkdocs-gen-files mike + pip install mkdocstrings[python] httpx mkdocs-literate-nav mkdocs-gen-files mike - name: Configure Git user run: |