Skip to content

Commit cd2231a

Browse files
authored
Merge pull request #599 from davidhozic/develop
Merge develop before v4.1.x release
2 parents 450100c + 65f5448 commit cd2231a

37 files changed

+1361
-856
lines changed

.github/workflows/build_exe.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
echo "from daf_gui import run;run()" > discord-advert-framework.py
2525
pyinstaller --onefile --windowed discord-advert-framework.py --add-data src/daf_gui/img/:daf_gui/img/ --icon src/daf_gui/img/logo.png --add-data src/_discord/bin/:_discord/bin/
2626
- name: Upload
27-
uses: softprops/action-gh-release@v1
27+
uses: softprops/action-gh-release@v2
2828
with:
2929
files: |
3030
dist/discord-advert-framework.exe

.github/workflows/create_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@master
2525
- name: Create tag
2626
id: tag_version
27-
uses: mathieudutour/github-tag-action@v6.1
27+
uses: mathieudutour/github-tag-action@v6.2
2828
with:
2929
github_token: ${{ secrets.TOKEN_GH }}
3030
custom_tag : ${{github.event.inputs.version-major}}.${{github.event.inputs.version-minor}}.${{github.event.inputs.version-bugfix}}

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
python -m build
3131
3232
- name: Publish package
33-
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
33+
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241
3434
with:
3535
user: __token__
3636
password: ${{ secrets.PYPI_API_TOKEN }}

docs/source/changelog.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ Glossary
3737
Releases
3838
---------------------
3939

40+
v4.1.0
41+
=====================
42+
- New message period types:
43+
44+
+ :class:`daf.message.messageperiod.NamedDayOfYearPeriod`
45+
+ :class:`daf.message.messageperiod.NamedDayOfMonthPeriod`
46+
47+
- Added optional case-sensitive matching to :class:`daf.logic.contains` and :class:`daf.logic.regex`. The default
48+
is still case-insensitive.
49+
- Added ``constraints`` parameter to :class:`daf.message.TextMESSAGE`. See :ref:`Message constraints` for more
50+
information.
51+
- Fixed SQL log removal through the GUI.
52+
- Fixed CSV and JSON reading through remote.
53+
- Disabled the :ref:`Automatic guild discovery and join` features due to the search provider shutting down its
54+
services. It will be reenabled in a future version.
55+
56+
4057
v4.0.5
4158
=====================
4259
- Fixed exe build.
-18.9 KB
Loading

docs/source/guide/core/shilldefine.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ We will not cover :class:`daf.guild.USER` separately as the definition process i
106106
the same.
107107
We will also not cover :class:`daf.guild.AutoGUILD` here, as it is covered in :ref:`Automatic Generation (core)`.
108108

109-
Let's define our :class:`daf.guild.GUILD` object now. Its most important parameters are:
109+
Let's define our :class:`daf.guild.GUILD` object now. Its most important (but not all) parameters are:
110110

111111
- ``snowflake``: An integer parameter. Represents a unique identifier, which identifies every Discord resource.
112112
Snowflake can be obtained by
@@ -146,6 +146,8 @@ Let's expand our example from :ref:`Definition of accounts (core)`.
146146
daf.run(accounts=accounts)
147147
148148
149+
150+
149151
Now let's define our messages.
150152

151153
--------------------------------------
@@ -178,13 +180,20 @@ The most important parameters inside :class:`daf.message.TextMESSAGE` are:
178180
multiple specified days at a specific time.
179181
- :class:`~daf.message.messageperiod.DailyPeriod`: A period that sends every day at a specific time.
180182

183+
- ``constraints``: A list of constraints that only allow a message to be sent when they are fulfilled. This can for
184+
example be used to only send messages to channels when the last message in that channel is not or own, thus
185+
**preventing unnecessary spam**. Currently a single constraint is supported:
186+
187+
- :class:`daf.message.constraints.AntiSpamMessageConstraint`
188+
181189
Now that we have an overview of the most important parameters, let's define our message.
182190
We will define a message that sends fixed data into a single channel, with a fixed time (duration) period.
183191

184192
.. code-block:: python
185193
:linenos:
186-
:emphasize-lines: 1-3, 19-23
194+
:emphasize-lines: 1-4, 19-24
187195
196+
from daf.message.constraints import AntiSpamMessageConstraint
188197
from daf.message.messageperiod import FixedDurationPeriod
189198
from daf.messagedata import TextMessageData
190199
from daf.message import TextMESSAGE
@@ -201,12 +210,13 @@ We will define a message that sends fixed data into a single channel, with a fix
201210
is_user=False, # Above token is user account's token and not a bot token.
202211
servers=[
203212
GUILD(
204-
snowflake=863071397207212052,
213+
snowflake=2312312312312312313123,
205214
messages=[
206215
TextMESSAGE(
207216
data=TextMessageData(content="Looking for NFT?"),
208-
channels=[1159224699830677685],
209-
period=FixedDurationPeriod(duration=timedelta(seconds=15))
217+
channels=[3215125123123123123123],
218+
period=FixedDurationPeriod(duration=timedelta(seconds=5)),
219+
constraints=[AntiSpamMessageConstraint(per_channel=True)]
210220
)
211221
]
212222
)
@@ -217,6 +227,7 @@ We will define a message that sends fixed data into a single channel, with a fix
217227
daf.run(accounts=accounts)
218228
219229
230+
220231
.. image:: ./images/message_definition_example_output.png
221232
:width: 20cm
222233

@@ -233,7 +244,7 @@ Additionally, it contains a ``volume`` parameter.
233244
Message advertisement examples
234245
--------------------------------------
235246

236-
The following examples show a complete core script setup needed to advertise periodic messages.
247+
The following examples show a complete core script (without message constraints) setup needed to advertise periodic messages.
237248

238249
.. dropdown:: TextMESSAGE
239250

docs/source/guide/core/web.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ If you restart DAF, it will not re-login, but will just load the data from the s
6363

6464
Automatic guild discovery and join
6565
======================================
66+
67+
.. error::
68+
69+
This feature is currently **disabled** due to the search provider shutting down its
70+
services. It will be reenabled in a future version.
71+
6672
The web layer beside login with username and password, also allows (semi) automatic guild discovery and join.
6773

6874
To use this feature, users need to create an :class:`~daf.guild.AutoGUILD` instance, where they pass the ``auto_join``

requirements/docs.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
sphinx==7.1.2
2-
sphinx-autobuild==2021.3.14
1+
sphinx==7.3.7
2+
sphinx-autobuild==2024.9.3
33
sphinx-copybutton==0.5.2
4-
furo==2024.1.29
5-
enum-tools[sphinx]==0.11.0
6-
sphinx-design[furo]==0.5.0
4+
furo==2024.8.6
5+
enum-tools[sphinx]==0.12.0
6+
sphinx-design[furo]==0.6.1
77
readthedocs-sphinx-search==0.3.2
88
sphinxcontrib-svg2pdfconverter==1.2.2

requirements/mandatory.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
aiohttp>=3.9.0,<3.10.0
2-
aiohttp_socks>=0.8,<0.9
1+
aiohttp>=3.9.0,<3.11.0
2+
aiohttp_socks>=0.8,<0.10
33
typeguard>=2.13,<2.14
44
typing_extensions>=4,<5; python_version < "3.11"
5-
tkinter-async-execute>=1.2,<1.3
5+
tkinter-async-execute>=1.2,<1.4
66
asyncio-event-hub>=1.0,<1.2
77
tkclasswiz>=1.4,<1.5
88
ttkbootstrap==1.10.1

requirements/sql.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sqlalchemy[asyncio]>=2.0,<3.0
2-
aiosqlite>=0.19,<0.20
3-
pymssql>=2.2,<2.3
2+
aiosqlite>=0.19,<0.21
3+
pymssql>=2.2,<2.4
44
asyncpg>=0.29,<0.30
55
asyncmy>=0.2,<0.3

0 commit comments

Comments
 (0)