Skip to content

Commit 8813d55

Browse files
committed
Fix bugs
1 parent 2c467ac commit 8813d55

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

docs/source/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Glossary
3232
Releases
3333
----------------------
3434

35+
v2.8.1
36+
=================
37+
- Fixed bug ``timezone required argument 'offset' when trying to save TextMESSAGE`` #325
38+
- Fixed bug ``AutoGUILD incorrect type hints`` #326
39+
40+
3541
v2.8
3642
=================
3743

src/daf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
from .misc import *
2020

2121

22-
VERSION = "2.8.0"
22+
VERSION = "2.8.1"

src/daf/guild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def __init__(self,
837837
include_pattern: str,
838838
exclude_pattern: Optional[str] = None,
839839
remove_after: Optional[Union[timedelta, datetime]] = None,
840-
messages: Optional[List[BaseMESSAGE]] = None,
840+
messages: Optional[List[Union[TextMESSAGE, VoiceMESSAGE]]] = None,
841841
logging: Optional[bool] = False,
842842
interval: Optional[timedelta] = timedelta(minutes=1),
843843
auto_join: Optional[web.GuildDISCOVERY] = None,

src/daf_gui/convert.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def issubclass_noexcept(*args):
5353
"minute": int,
5454
"second": int,
5555
"microsecond": int,
56-
"tzinfo": Union[dt.tzinfo, None],
5756
"fold": int
5857
},
5958
discord.Embed: {
@@ -90,6 +89,10 @@ def issubclass_noexcept(*args):
9089
daf.AUDIO: {
9190
"filename": "orig"
9291
},
92+
dt.timezone: {
93+
"offset": "_offset",
94+
"name": "_name",
95+
}
9396
}
9497

9598
OBJECT_CONV_CACHE = {}
@@ -99,6 +102,7 @@ def issubclass_noexcept(*args):
99102
CONVERSION_ATTR_TO_PARAM[daf.client.ACCOUNT]["username"] = lambda account: account.selenium._username if account.selenium is not None else None
100103
CONVERSION_ATTR_TO_PARAM[daf.client.ACCOUNT]["password"] = lambda account: account.selenium._password if account.selenium is not None else None
101104

105+
102106
if daf.sql.SQL_INSTALLED:
103107
sql_ = daf.sql
104108

@@ -117,7 +121,7 @@ def issubclass_noexcept(*args):
117121

118122

119123
CONVERSION_ATTR_TO_PARAM[daf.TextMESSAGE]["channels"] = (
120-
lambda message_: [x.id for x in message_.channels] if not isinstance(message_.channels, daf.AutoCHANNEL) else message_.channels
124+
lambda message_: [x if isinstance(x, int) else x.id for x in message_.channels] if not isinstance(message_.channels, daf.AutoCHANNEL) else message_.channels
121125
)
122126
CONVERSION_ATTR_TO_PARAM[daf.VoiceMESSAGE]["channels"] = CONVERSION_ATTR_TO_PARAM[daf.TextMESSAGE]["channels"]
123127

@@ -295,7 +299,6 @@ def get_conversion_map(object_type):
295299

296300
attrs = get_conversion_map(object_type)
297301
ret = _convert_object_info(object_, save_original, object_type, attrs)
298-
299302
with suppress(TypeError):
300303
if cache:
301304
OBJECT_CONV_CACHE[object_] = ret

0 commit comments

Comments
 (0)