Skip to content

Commit 315a4b7

Browse files
authored
Merge pull request #278 from davidhozic/develop
Release 2.5 Prep
2 parents 56da420 + 3ef1021 commit 315a4b7

File tree

178 files changed

+6958
-2528
lines changed

Some content is hidden

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

178 files changed

+6958
-2528
lines changed

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
min_python_version = 3.10
3+
4+
exclude = src/_discord
5+
6+
ignore =
7+
F403
8+
F405
9+
W504
10+
11+
max-line-length = 120
12+
max-complexity=40

.github/workflows/docs.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ jobs:
2222
- uses: actions/checkout@v3
2323
- uses: actions/setup-python@v4
2424
with:
25-
python-version: '3.8'
25+
python-version: '3.10'
2626
- name: Install requirements
2727
run: |
28-
pip install .[docs]
29-
pip install .[all]
30-
- name: Install latex
31-
run: sudo apt-get update && sudo apt-get install texlive texlive-publishers texlive-science latexmk cm-super
32-
- name: Install inkscape
33-
run: sudo apt-get install inkscape -y
34-
- name: Build html, latex, pdf
35-
run: cd docs && make html && make latexpdf
36-
28+
sh install.sh
29+
- name: Build html and pdf
30+
run: |
31+
. venv/bin/activate
32+
cd docs && make html && make pdf
33+
34+

.github/workflows/python-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
max-parallel: 1
1515
fail-fast: false
1616
matrix:
17-
python-version: ["3.8", "3.11"]
17+
python-version: ["3.10", "3.11"]
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Set up Python ${{ matrix.python-version }}
@@ -35,13 +35,13 @@ jobs:
3535
- name: Test version compatibility
3636
env:
3737
DISCORD_TOKEN: ${{secrets.DATT}}
38-
if: ${{ matrix.python-version != 3.8 }}
38+
if: ${{ matrix.python-version != 3.10 }}
3939
run: |
4040
pytest -v testing/test_period_dynamic.py
4141
- name: Test all
4242
env:
4343
DISCORD_TOKEN: ${{secrets.DATT}}
44-
if: ${{ matrix.python-version == 3.8 }}
44+
if: ${{ matrix.python-version == 3.10 }}
4545
run: |
4646
pytest -v
4747

.gitignore

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
**/__pycache__/**
2-
settings.json
32
dist/**
43
build**
5-
**.egg-info
6-
src/test.py
7-
venv/**
8-
docs/source/ref.rst
9-
docs/source/reference/
4+
**egg-info**
5+
6+
.vscode
7+
.idea
8+
9+
docs/build
10+
docs/source/reference/
11+
12+
docs/thesis/thesis_lit.rst
13+
docs/thesis/reference/
14+
15+
docs/common/reference
16+
**/DEP/**
17+
18+
daf_web_data
19+
test.py

.readthedocs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
version: 2
2-
formats: []
2+
formats: [
3+
"pdf"
4+
]
35

46
sphinx:
57
configuration: docs/source/conf.py
68
fail_on_warning: false
79

810
build:
911
os: ubuntu-22.04
12+
apt_packages:
13+
- inkscape
1014
tools:
11-
python: "3.8"
15+
python: "3.10"
1216
jobs:
1317
pre_build:
1418
- pip install .[all] .[docs]
15-
- python3 ./docs/scripts/generate_autodoc.py
19+
- python3 ./docs/setup.py

Examples/Web/main_web.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
This example shows how the user can use username and password to login into Discord and
3+
it also shows how to configure the automatic guild discovery and join feature (auto_join parameter)
4+
"""
5+
6+
from daf import QuerySortBy, QueryMembers
7+
import daf
8+
9+
accounts = [
10+
daf.ACCOUNT(
11+
username="[email protected]",
12+
password="Password6745;*",
13+
servers=[
14+
daf.AutoGUILD(
15+
include_pattern=".*",
16+
auto_join=daf.GuildDISCOVERY(prompt="NFT arts",
17+
sort_by=QuerySortBy.TOP,
18+
total_members=QueryMembers.ALL,
19+
limit=20),
20+
),
21+
],
22+
proxy="protocol://ip:port"
23+
)
24+
]
25+
26+
27+
daf.run(
28+
accounts=accounts,
29+
debug=daf.TraceLEVELS.NORMAL
30+
)

LICENSE.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
**Discord Advertisement Framework Licence:**<br>
1+
**DAF License**
2+
23
MIT License
34

45
Copyright (c) 2022 David Hozic
@@ -20,14 +21,19 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2021
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2122
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2223
SOFTWARE.
23-
***
24+
25+
<br><br><br>
26+
27+
**PyCord (API Wrapper) License:**
28+
29+
*Concerns only src/_discord/ folder*
30+
<br>
2431
<br>
2532

26-
**PyCord Licence:**<br>
2733
The MIT License (MIT)
2834

29-
Copyright (c) 2015-2021 Rapptz <br>
30-
Copyright (c) 2021-present Pycord Development<br>
35+
Copyright (c) 2015-2021 Rapptz
36+
Copyright (c) 2021-present Pycord Development
3137

3238
Permission is hereby granted, free of charge, to any person obtaining a
3339
copy of this software and associated documentation files (the "Software"),
@@ -46,3 +52,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4652
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4753
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
4854
DEALINGS IN THE SOFTWARE.
55+

Patches/1_client.patch

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
diff --git a/src/_discord/client.py b/src/_discord/client.py
2-
index e6fa165..9c681a5 100644
2+
index 0be4855..08c6469 100644
33
--- a/src/_discord/client.py
44
+++ b/src/_discord/client.py
5-
@@ -30,7 +30,7 @@ import logging
6-
import signal
7-
import sys
8-
import traceback
9-
-from typing import TYPE_CHECKING, Any, Callable, Coroutine, Generator, Sequence, TypeVar
10-
+from typing import TYPE_CHECKING, Any, Callable, Coroutine, Generator, Optional, Sequence, TypeVar
11-
12-
import aiohttp
13-
14-
@@ -109,7 +109,7 @@ def _cleanup_loop(loop: asyncio.AbstractEventLoop) -> None:
15-
loop.run_until_complete(loop.shutdown_asyncgens())
16-
finally:
17-
_log.info("Closing the event loop.")
18-
- loop.close()
19-
+ loop.call_soon(loop.close)
20-
21-
22-
class Client:
235
@@ -482,7 +482,7 @@ class Client:
246

257
# login state management
@@ -29,16 +11,7 @@ index e6fa165..9c681a5 100644
2911
"""|coro|
3012

3113
Logs in the client with the specified credentials.
32-
@@ -492,6 +492,8 @@ class Client:
33-
token: :class:`str`
34-
The authentication token. Do not prefix this token with
35-
anything as the library will do it for you.
36-
+ bot: bool
37-
+ Is the token from a bot account.
38-
39-
Raises
40-
------
41-
@@ -511,7 +513,7 @@ class Client:
14+
@@ -511,7 +511,7 @@ class Client:
4215

4316
_log.info("logging in using static token")
4417

@@ -47,16 +20,16 @@ index e6fa165..9c681a5 100644
4720
self._connection.user = ClientUser(state=self._connection, data=data)
4821

4922
async def connect(self, *, reconnect: bool = True) -> None:
50-
@@ -646,7 +648,7 @@ class Client:
23+
@@ -645,7 +645,7 @@ class Client:
5124
self._connection.clear()
5225
self.http.recreate()
5326

5427
- async def start(self, token: str, *, reconnect: bool = True) -> None:
55-
+ async def start(self, token: str, *, reconnect: bool = True, bot: Optional[bool] = True) -> None:
28+
+ async def start(self, token: str, *, reconnect: bool = True, bot: bool = True) -> None:
5629
"""|coro|
5730

5831
A shorthand coroutine for :meth:`login` + :meth:`connect`.
59-
@@ -656,7 +658,7 @@ class Client:
32+
@@ -655,7 +655,7 @@ class Client:
6033
TypeError
6134
An unexpected keyword argument was received.
6235
"""

0 commit comments

Comments
 (0)