Skip to content

Commit 8ba816d

Browse files
committed
Merge branch 'master' into pr/417
2 parents 19a7df3 + 7fbfaeb commit 8ba816d

File tree

6 files changed

+50
-2
lines changed

6 files changed

+50
-2
lines changed

.github/workflows/bandit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: bandit
2+
on: [pull_request, push]
3+
jobs:
4+
bandit:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install bandit
10+
- run: bandit --recursive --skip B101,B104,B105,B110,B307,B311,B404,B603,B607 .

.github/workflows/mypy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: mypy
2+
on: [pull_request, push]
3+
jobs:
4+
mypy:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install mypy
10+
- run: pip install -r requirements.txt
11+
- run: mkdir --parents --verbose .mypy_cache
12+
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true

discord/colour.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,31 @@ def nitro_pink(cls: Type[CT]) -> CT:
333333
.. versionadded:: 2.0
334334
"""
335335
return cls(0xf47fff)
336+
337+
@classmethod
338+
def embed_background(cls: Type[CT], theme: str = "dark") -> CT:
339+
"""A factory method that returns a :class:`Color` corresponding to the embed colors on discord clients, with a value of
340+
``0x2F3136`` (dark)
341+
``0xf2f3f5`` (light)
342+
``0x000000`` (amoled).
343+
344+
.. versionadded:: 2.0
345+
346+
Parameters
347+
-----------
348+
theme: :class:`str`
349+
The theme color to apply, must be one of "dark", "light", or "amoled".
350+
"""
351+
themes_cls = {
352+
"dark": 0x2F3136,
353+
"light": 0xf2f3f5,
354+
"amoled": 0x000000,
355+
}
356+
357+
if theme not in themes_cls:
358+
raise TypeError("Theme must be \"dark\", \"light\", or \"amoled\".")
359+
360+
return cls(themes_cls[theme])
336361

337362

338363
Color = Colour

discord/guild.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class Guild(Hashable):
202202
- ``ANIMATED_BANNER``: Guild can upload an animated banner.
203203
- ``ANIMATED_ICON``: Guild can upload an animated icon.
204204
- ``BANNER``: Guild can upload and use a banner. (i.e. :attr:`.banner`)
205+
- ``CHANNEL_BANNER``: Guild can upload and use a channel banners.
205206
- ``COMMERCE``: Guild can sell things using store channels.
206207
- ``COMMUNITY``: Guild is a community server.
207208
- ``DISCOVERABLE``: Guild shows up in Server Discovery.

discord/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def json_or_text(response: aiohttp.ClientResponse) -> Union[Dict[str, Any]
110110

111111

112112
class Route:
113-
BASE: ClassVar[str] = 'https://discord.com/api/v8'
113+
BASE: ClassVar[str] = 'https://discord.com/api/v9'
114114

115115
def __init__(self, method: str, path: str, **parameters: Any) -> None:
116116
self.path: str = path

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
extras_require = {
4444
'voice': ['PyNaCl>=1.3.0,<1.5'],
4545
'docs': [
46-
'sphinx==4.2.0',
46+
'sphinx==4.3.0',
4747
'sphinxcontrib_trio==1.1.2',
4848
'sphinxcontrib-websupport',
4949
],

0 commit comments

Comments
 (0)