Skip to content

Commit 442a74d

Browse files
committed
fix(automod): Fix an Attribute Error when initialising an AutoModAction
Signed-off-by: Mathieu Corsham <[email protected]>
1 parent 72262f3 commit 442a74d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discord/automod.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ def __init__(self, type: AutoModActionType, **metadata):
137137

138138
if action_type.block_message:
139139
try:
140-
self.custom_message: Optional[str] = metadata['custom_message']
140+
custom_message: Optional[str] = metadata['custom_message']
141141
except KeyError:
142142
pass
143143
else:
144-
if len(self.custom_message) > 150:
144+
if len(custom_message) > 150:
145145
raise ValueError('The maximum length of the custom message is 150 characters.')
146+
self.custom_message: Optional[str] = custom_message
146147

147148
elif action_type.send_alert_message:
148149
try:

0 commit comments

Comments
 (0)