-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Guide] Intro & Quickstart guide #9263
base: docs/guide
Are you sure you want to change the base?
[Guide] Intro & Quickstart guide #9263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of quick grammar nitpicks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guide is not an introduction to the library, but a guide to installing the library. You should consider changing the file name to install.rst
or similar, and creating a true introduction such as the django overview or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good, a couple of newer developments in discord that should be updated though
As mentioned some time ago in the #docs channel on the discord server by me.
I've noticed that they are never mentioned in the documentation at all (unless I really missed them) and many people don't even know about these helpful features for setting up the base skeleton of both. |
Co-authored-by: numbermaniac <[email protected]>
Co-authored-by: numbermaniac <[email protected]>
Co-authored-by: numbermaniac <[email protected]>
Co-authored-by: Riley Miļeško <[email protected]>
14e85d1
to
1a5cf3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the content has been reviewed by several others by now I'll just restate that the files should be renamed. A guide/intro
should not tell me how to install a library, consider renaming to guide/install[ation]
. This also makes space for guide/quickstart
to be renamed to guide/intro[duction]
.
I personally agree with this and will rename these files appropriately. If there are issues we can always revert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments below.
happy with the content so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per usual, I left some of my suggestions and thoughts down in this review. The section "A Simple Bot" (in docs/guide/introduction.rst
) doesn't flow nicely and it was really hard to read in order to understand what it was supposed to be guiding me through.
|
||
python3 -m pip install -U discord.py | ||
|
||
On Windows systems, you can use the following command instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows systems, you can use the following command instead. | |
On Windows, you can use the following command instead. |
Primer | ||
------------- | ||
|
||
On Unix systems you can run the following command to install discord.py from PyPI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Unix systems you can run the following command to install discord.py from PyPI. | |
On Unix-based systems you can run the following command to install discord.py from PyPI. |
Linux systems may need to install additional dependencies via your package manager to get full voice support:- | ||
|
||
.. tab:: Debian/Ubuntu | ||
|
||
.. code-block:: shell | ||
|
||
$ sudo apt install libffi-dev libsodium-dev python3-dev | ||
|
||
.. tab:: Fedora/CentOS | ||
|
||
.. code-block:: shell | ||
|
||
$ sudo dnf install libffi-devel libsodium-devel python3-devel | ||
|
||
.. tab:: Arch Linux | ||
|
||
.. code-block:: shell | ||
|
||
$ pacman -Syu libsodium libffi | ||
|
||
For other distributions, please use your package manager to find libraries for ``libffi``, ``libsodium``, and the Python 3 development headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux systems may need to install additional dependencies via your package manager to get full voice support:- | |
.. tab:: Debian/Ubuntu | |
.. code-block:: shell | |
$ sudo apt install libffi-dev libsodium-dev python3-dev | |
.. tab:: Fedora/CentOS | |
.. code-block:: shell | |
$ sudo dnf install libffi-devel libsodium-devel python3-devel | |
.. tab:: Arch Linux | |
.. code-block:: shell | |
$ pacman -Syu libsodium libffi | |
For other distributions, please use your package manager to find libraries for ``libffi``, ``libsodium``, and the Python 3 development headers. | |
.. note:: | |
You may need to install additional libraries to enable voice support on Linux, below are the commands for some popular distributions. | |
.. tab:: Debian/Ubuntu | |
.. code-block:: shell | |
$ sudo apt install libffi-dev libsodium-dev python3-dev | |
.. tab:: Fedora/CentOS | |
.. code-block:: shell | |
$ sudo dnf install libffi-devel libsodium-devel python3-devel | |
.. tab:: Arch Linux | |
.. code-block:: shell | |
$ pacman -Syu libsodium libffi | |
For other distributions, please use your package manager to find libraries for ``libffi``, ``libsodium``, and the Python 3 development headers. |
.. code-block:: shell | ||
|
||
$ cd your_bot_source | ||
$ python3 -m venv .venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to be distro specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why creating a venv would be distro specific here. Could you explain your comment in more detail? We can have a note that says for windows systems to use the py
launcher to gently remind users for that.
|
||
The ``.venv`` argument is the output folder of the virtual environment, this can be named anything but be sure to remember it. | ||
|
||
2. Activate the virtual environment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be tabs too.
Next Steps | ||
----------- | ||
|
||
Now that you've installed discord.py, the next step is to begin making your bot application. See :ref:`_guide_intro` for further getting started steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you've installed discord.py, the next step is to begin making your bot application. See :ref:`_guide_intro` for further getting started steps. | |
Now that you've installed discord.py, the next step is to begin making your application. See :ref:`_guide_intro` for further getting started steps. |
|
||
.. warning:: | ||
|
||
If you accidentally use the ``Client Secret`` for your bot token, it's **NOT** what you are looking for - you need the bot **Token**, which has a different format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably reword this, Maybe "Ensure you don't use the Client Secret
in place of your token, these are not the same thing and ..."
async def apples(ctx: commands.Context, amount: int) -> None: | ||
await ctx.send(f"Hello, I would like {amount} apples please!") | ||
|
||
Here's where our commands will be defined. We use the :meth:`@bot.command() <ext.commands.Bot.command>` decorator to flag this function as a command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's here?
Here's where our commands will be defined. We use the :meth:`@bot.command() <ext.commands.Bot.command>` decorator to flag this function as a command. | ||
This creates a command ``!apples`` that we can type into a channel, and the bot will respond with the given amount of applies in a predefined sentence.. A few key features: | ||
|
||
- :class:`~ext.commands.Context` refers to the command invocation context - this includes the :attr:`~ext.commands.Context.channel`, command :attr:`~ext.commands.Context.author`, :attr:`~ext.commands.Context.message` and more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reword the "this includes" section to use "such as ..." rather than "... and more".
|
||
TOKEN = "your bot token here" | ||
|
||
This is the final step, you put your bot token here, save and run the file and the bot will start up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nowhere in this do I see Bot.run explicitly being called. you'll need to add that.
|
||
Activate the virtual environment (if you made one): | ||
|
||
.. code-block:: shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, use tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big nono dot png
Summary
(Duplicate of #7500 due to contributor inactivity).
This PR will add the Intro and Quickstart guides to the discord.py guide.
Checklist