Skip to content

Commit c213a75

Browse files
authored
Trunk/docs (#775)
1 parent 06b5601 commit c213a75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1280
-36548
lines changed

.github/SECURITY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
| Version | Supported |
66
| ------- | ------------------ |
77
| 2.0.0 | :white_check_mark: |
8-
| 1.7.x | :white_check_mark: |
9-
| < 1.7.3 | :x: |
8+
| <2.0.0 | :x: |
109

1110
## Reporting a Vulnerability
1211

.github/workflows/docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Docs
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
docs:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [ 3.8 ]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install -U pip
20+
pip install -U sphinx sphinxcontrib-trio aiohttp sphinxcontrib-websupport myst-parser
21+
- name: Compile to html
22+
run: |
23+
cd docs
24+
make html

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ docs/crowdin.py
1010
*.mp3
1111
*.m4a
1212
*.wav
13-
*.png
1413
*.jpg
1514
*.flac
1615
*.mo
1716
.idea/
17+
env/
18+
.vs/
1819
.DS_Store
1920
.python-version
2021
__pycache__
21-
.vs/slnx.sqlite
22-
env/
2322
build/
23+
node_modules/*
24+
test.py
25+
*.png

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sphinx:
1010
builder: html
1111

1212
python:
13-
version: 3.8
13+
version: "3.8"
1414
install:
1515
- method: pip
1616
path: .

README.ja.rst

Lines changed: 0 additions & 119 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ Rapptz, also known as Danny, the maintainer and core developer of discord.py wil
2323

2424
Pycord v1.7.3 is the same as discord.py v1.7.3, however, Pycord v2.0 will support newer features of the API such as slash commands, context menus, scheduled events, timeouts, and others.
2525

26-
2726
Key Features
2827
------------
2928

3029
- Modern Pythonic API using ``async`` and ``await``.
3130
- Proper rate limit handling.
3231
- Optimised for both speed and memory usage.
33-
- Supports Slash Commands, Context Menus and Message Components.
32+
- Full Application Command Support
3433

3534
Installing
3635
----------
@@ -86,7 +85,7 @@ Optional Packages
8685
Please note that while installing voice support on Linux, you must install the following packages via your preferred package manager (e.g. ``apt``, ``dnf``, etc) BEFORE running the above commands:
8786

8887
* libffi-dev (or ``libffi-devel`` on some systems)
89-
* python-dev (e.g. ``python3.6-dev`` for Python 3.6)
88+
* python-dev (e.g. ``python3.10-dev`` for Python 3.10)
9089

9190
Quick Example
9291
-------------

discord/activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'CustomActivity',
4444
)
4545

46-
"""If curious, this is the current schema for an activity.
46+
"""If you're curious, this is the current schema for an activity.
4747
4848
It's fairly long so I will document it here:
4949

discord/asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def with_format(self, format: ValidAssetFormatTypes, /) -> Asset:
385385
Raises
386386
-------
387387
InvalidArgument
388-
The asset had an invalid format.
388+
The asset has an invalid format.
389389
390390
Returns
391391
--------

discord/bot.py

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
import asyncio
2929
import collections
3030
import inspect
31+
import sys
3132
import traceback
32-
from .commands.errors import CheckFailure
33-
3433
from typing import (
3534
Any,
3635
Callable,
@@ -43,11 +42,8 @@
4342
Union,
4443
)
4544

46-
import sys
47-
4845
from .client import Client
49-
from .shard import AutoShardedClient
50-
from .utils import MISSING, get, find, async_all
46+
from .cog import CogMixin
5147
from .commands import (
5248
SlashCommand,
5349
SlashCommandGroup,
@@ -58,10 +54,11 @@
5854
AutocompleteContext,
5955
command,
6056
)
61-
from .cog import CogMixin
62-
57+
from .commands.errors import CheckFailure
6358
from .errors import Forbidden, DiscordException
6459
from .interactions import Interaction
60+
from .shard import AutoShardedClient
61+
from .utils import MISSING, get, find, async_all
6562
from .enums import InteractionType
6663
from .user import User
6764

@@ -819,17 +816,15 @@ async def on_application_command_error(
819816
# TODO: Remove these from commands.Bot
820817

821818
def check(self, func):
822-
r"""A decorator that adds a global check to the bot.
823-
A global check is similar to a :func:`.check` that is applied
824-
on a per command basis except it is run before any command checks
825-
have been verified and applies to every command the bot has.
819+
"""A decorator that adds a global check to the bot. A global check is similar to a :func:`.check` that is
820+
applied on a per command basis except it is run before any command checks have been verified and applies to
821+
every command the bot has.
826822
827823
.. note::
828824
829-
This function can either be a regular function or a coroutine.
830-
Similar to a command :func:`.check`\, this takes a single parameter
831-
of type :class:`.Context` and can only raise exceptions inherited from
832-
:exc:`.CommandError`.
825+
This function can either be a regular function or a coroutine. Similar to a command :func:`.check`, this
826+
takes a single parameter of type :class:`.Context` and can only raise exceptions inherited from
827+
:exc:`.CommandError`.
833828
834829
Example
835830
---------
@@ -845,17 +840,15 @@ def check_commands(ctx):
845840
return func
846841

847842
def add_check(self, func, *, call_once: bool = False) -> None:
848-
"""Adds a global check to the bot.
849-
This is the non-decorator interface to :meth:`.check`
850-
and :meth:`.check_once`.
843+
"""Adds a global check to the bot. This is the non-decorator interface to :meth:`.check` and
844+
:meth:`.check_once`.
851845
852846
Parameters
853847
-----------
854848
func
855849
The function that was used as a global check.
856850
call_once: :class:`bool`
857-
If the function should only be called once per
858-
:meth:`.invoke` call.
851+
If the function should only be called once per :meth:`.Bot.invoke` call.
859852
860853
"""
861854

@@ -886,26 +879,21 @@ def remove_check(self, func, *, call_once: bool = False) -> None:
886879
pass
887880

888881
def check_once(self, func):
889-
r"""A decorator that adds a "call once" global check to the bot.
890-
Unlike regular global checks, this one is called only once
891-
per :meth:`.invoke` call.
892-
Regular global checks are called whenever a command is called
893-
or :meth:`.Command.can_run` is called. This type of check
894-
bypasses that and ensures that it's called only once, even inside
895-
the default help command.
882+
"""A decorator that adds a "call once" global check to the bot. Unlike regular global checks, this one is called
883+
only once per :meth:`.Bot.invoke` call. Regular global checks are called whenever a command is called or
884+
:meth:`.Command.can_run` is called. This type of check bypasses that and ensures that it's called only once,
885+
even inside the default help command.
896886
897887
.. note::
898888
899-
When using this function the :class:`.Context` sent to a group subcommand
900-
may only parse the parent command and not the subcommands due to it
901-
being invoked once per :meth:`.Bot.invoke` call.
889+
When using this function the :class:`.Context` sent to a group subcommand may only parse the parent command
890+
and not the subcommands due to it being invoked once per :meth:`.Bot.invoke` call.
902891
903892
.. note::
904893
905-
This function can either be a regular function or a coroutine.
906-
Similar to a command :func:`.check`\, this takes a single parameter
907-
of type :class:`.Context` and can only raise exceptions inherited from
908-
:exc:`.CommandError`.
894+
This function can either be a regular function or a coroutine. Similar to a command :func:`.check`,
895+
this takes a single parameter of type :class:`.Context` and can only raise exceptions inherited from
896+
:exc:`.CommandError`.
909897
910898
Example
911899
---------

discord/channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def _single_delete_strategy(messages: Iterable[Message]):
9797

9898

9999
class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
100-
"""Represents a Discord guild text channel.
100+
"""Represents a Discord text channel.
101101
102102
.. container:: operations
103103
@@ -239,7 +239,7 @@ def is_nsfw(self) -> bool:
239239
return self.nsfw
240240

241241
def is_news(self) -> bool:
242-
""":class:`bool`: Checks if the channel is a news channel."""
242+
""":class:`bool`: Checks if the channel is a news/anouncements channel."""
243243
return self._type == ChannelType.news.value
244244

245245
@property

0 commit comments

Comments
 (0)