aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorapple502j <[email protected]>2019-03-20 20:59:29 +0900
committerRapptz <[email protected]>2019-03-20 22:30:22 -0400
commit9c32bcdf80f36ead1989f486a31d29b6aada5caf (patch)
tree5b59dfde4283b914559fd0699e42afe3152214fe /docs
parentAdd type checking to multi-file send (diff)
downloaddiscord.py-9c32bcdf80f36ead1989f486a31d29b6aada5caf.tar.xz
discord.py-9c32bcdf80f36ead1989f486a31d29b6aada5caf.zip
Update docs, mostly Inviting Your Bot
Diffstat (limited to 'docs')
-rw-r--r--docs/discord.rst69
-rw-r--r--docs/faq.rst5
-rw-r--r--docs/images/discord_bot_user_options.pngbin44015 -> 48479 bytes
-rw-r--r--docs/images/discord_client_id.pngbin7443 -> 0 bytes
-rw-r--r--docs/images/discord_create_app_button.pngbin24729 -> 1580 bytes
-rw-r--r--docs/images/discord_create_app_form.pngbin34794 -> 12216 bytes
-rw-r--r--docs/images/discord_create_bot_user.pngbin48484 -> 16587 bytes
-rw-r--r--docs/images/discord_oauth2.pngbin0 -> 29649 bytes
-rw-r--r--docs/images/discord_oauth2_perms.pngbin0 -> 52706 bytes
-rw-r--r--docs/images/discord_oauth2_scope.pngbin0 -> 31714 bytes
10 files changed, 35 insertions, 39 deletions
diff --git a/docs/discord.rst b/docs/discord.rst
index ac159ae9..80dc7e6f 100644
--- a/docs/discord.rst
+++ b/docs/discord.rst
@@ -8,23 +8,23 @@ In order to work with the library and the Discord API in general, we must first
Creating a Bot account is a pretty straightforward process.
1. Make sure you're logged on to the `Discord website <https://discordapp.com>`_.
-2. Navigate to the `application page <https://discordapp.com/developers/applications/me>`_
-3. Click on the "New App" button.
+2. Navigate to the `application page <https://discordapp.com/developers/applications>`_
+3. Click on the "New Application" button.
.. image:: /images/discord_create_app_button.png
- :alt: The new app button.
+ :alt: The new application button.
-4. Give the application a name and a description if wanted and click "Create App".
-
- - You can also put an avatar you want your bot to use, don't worry you can change this later.
- - **Leave the Redirect URI(s) blank** unless are creating a service.
+4. Give the application a name and click "Create".
.. image:: /images/discord_create_app_form.png
:alt: The new application form filled in.
-5. Create a Bot User by clicking on the accompanying button and confirming it.
+
+5. Create a Bot User by navigating to the "Bot" tab and clicking "Add Bot".
+
+ - Click "Yes, do it!" to continue.
.. image:: /images/discord_create_bot_user.png
- :alt: The Create a Bot User button.
+ :alt: The Add Bot button.
6. Make sure that **Public Bot** is ticked if you want others to invite your bot.
- You should also make sure that **Require OAuth2 Code Grant** is unchecked unless you
@@ -33,10 +33,9 @@ Creating a Bot account is a pretty straightforward process.
.. image:: /images/discord_bot_user_options.png
:alt: How the Bot User options should look like for most people.
-7. Click to reveal the token.
+7. Copy the token using the "Copy" button.
- - **This is not the Client Secret**
- - Look at the image above to see where the **Token** is.
+ - **This is not the Client Secret at the General Information page**
.. warning::
@@ -47,6 +46,10 @@ Creating a Bot account is a pretty straightforward process.
The possibilities are endless, so **do not share this token.**
+ If you accidentally leaked your token, click the "Regenerate" button as soon
+ as possible. This revokes your old token and re-generates a new one.
+ Now you need to use the new token to login.
+
And that's it. You now have a bot account and you can login with that token.
.. _discord_invite_bot:
@@ -56,42 +59,36 @@ Inviting Your Bot
So you've made a Bot User but it's not actually in any server.
-If you want to invite your bot you must create an invite URL for your bot.
-
-First, you must fetch the Client ID of the Bot. You can find this in the Bot's application page.
+If you want to invite your bot you must create an invite URL for it.
-.. image:: /images/discord_client_id.png
- :alt: The Bot's Client ID.
+1. Make sure you're logged on to the `Discord website <https://discordapp.com>`_.
+2. Navigate to the `application page <https://discordapp.com/developers/applications>`_
+3. Click on your bot's page.
+4. Go to the "OAuth2" tab.
-Copy paste that into the pre-formatted URL:
+ .. image:: /images/discord_oauth2.png
+ :alt: How the OAuth2 page should look like.
-.. code-block:: none
+5. Tick the "bot" checkbox under "scopes".
- https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=0
+ .. image:: /images/discord_oauth2_scope.png
+ :alt: The scopes checkbox with "bot" ticked.
-Replace ``YOUR_CLIENT_ID`` with the Client ID we got in the previous step. For example,
-in the image above our client ID is 312777964700041216 so the resulting URL would be
-https://discordapp.com/oauth2/authorize?client_id=312777964700041216&scope=bot&permissions=0
-(note that this bot has been deleted).
+6. Tick the permissions required for your bot to function under "Bot Permissions".
-Now you can click the link and invite your bot to any server you have "Manage Server" permissions on.
+ - Please be aware of the consequences of requiring your bot to have the "Administrator" permission.
-Adding Permissions
-~~~~~~~~~~~~~~~~~~~~
+ - Bot owners must have 2FA enabled for certain actions and permissions when added in servers that have Server-Wide 2FA enabled. Check the `2FA support page <https://support.discordapp.com/hc/en-us/articles/219576828-Setting-up-Two-Factor-Authentication>`_ for more information.
-In the above URL, you might have noticed an interesting bit, the ``permissions=0`` fragment.
+ .. image:: /images/discord_oauth2_perms.png
+ :alt: The permission checkboxes with some permissions checked.
-Bot accounts can request specific permissions to be granted upon joining. When the bot joins
-the guild, they will be granted a managed role that contains the permissions you requested.
-If the permissions is 0, then no special role is created.
+7. Now the resulting URL can be used to add your bot to a server. Copy and paste the URL into your browser, choose a server to invite the bot to, and click "Authorize".
-This ``permissions`` value is calculated based on bit-wise arithmetic. Thankfully, people have
-created a calculator that makes it easy to calculate the permissions necessary visually.
-- https://discordapi.com/permissions.html
-- https://finitereality.github.io/permissions/
+.. note::
-Feel free to use whichever is easier for you to grasp.
+ The person adding the bot needs "Manage Server" permissions to do so.
If you want to generate this URL dynamically at run-time inside your bot and using the
:class:`discord.Permissions` interface, you can use :func:`discord.utils.oauth_url`.
diff --git a/docs/faq.rst b/docs/faq.rst
index 3dbfc4c8..5e9aa604 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -215,8 +215,8 @@ one of the following functions:
The following use an HTTP request:
-- :meth:`abc.Messageable.get_message`
-- :meth:`Client.get_user_info`
+- :meth:`abc.Messageable.fetch_message`
+- :meth:`Client.fetch_user`
If the functions above do not help you, then use of :func:`utils.find` or :func:`utils.get` would serve some use in finding
@@ -297,4 +297,3 @@ Example: ::
await ctx.send('Pushing to {} {}'.format(remote, branch))
This could then be used as ``?git push origin master``.
-
diff --git a/docs/images/discord_bot_user_options.png b/docs/images/discord_bot_user_options.png
index 24537991..4091bd88 100644
--- a/docs/images/discord_bot_user_options.png
+++ b/docs/images/discord_bot_user_options.png
Binary files differ
diff --git a/docs/images/discord_client_id.png b/docs/images/discord_client_id.png
deleted file mode 100644
index fc4cbc0b..00000000
--- a/docs/images/discord_client_id.png
+++ /dev/null
Binary files differ
diff --git a/docs/images/discord_create_app_button.png b/docs/images/discord_create_app_button.png
index dd47be15..e6d06a7a 100644
--- a/docs/images/discord_create_app_button.png
+++ b/docs/images/discord_create_app_button.png
Binary files differ
diff --git a/docs/images/discord_create_app_form.png b/docs/images/discord_create_app_form.png
index a204ca84..a8afd4fa 100644
--- a/docs/images/discord_create_app_form.png
+++ b/docs/images/discord_create_app_form.png
Binary files differ
diff --git a/docs/images/discord_create_bot_user.png b/docs/images/discord_create_bot_user.png
index 791cb79a..2d0a3a03 100644
--- a/docs/images/discord_create_bot_user.png
+++ b/docs/images/discord_create_bot_user.png
Binary files differ
diff --git a/docs/images/discord_oauth2.png b/docs/images/discord_oauth2.png
new file mode 100644
index 00000000..f32fcc7b
--- /dev/null
+++ b/docs/images/discord_oauth2.png
Binary files differ
diff --git a/docs/images/discord_oauth2_perms.png b/docs/images/discord_oauth2_perms.png
new file mode 100644
index 00000000..0e6df51b
--- /dev/null
+++ b/docs/images/discord_oauth2_perms.png
Binary files differ
diff --git a/docs/images/discord_oauth2_scope.png b/docs/images/discord_oauth2_scope.png
new file mode 100644
index 00000000..9e2cdeff
--- /dev/null
+++ b/docs/images/discord_oauth2_scope.png
Binary files differ