Skip to content

Commit eb7efb9

Browse files
committed
fix typing and docs for allowed_mentions
1 parent fc1596d commit eb7efb9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ from discord_webhook import DiscordWebhook
303303

304304
content = "@everyone say hello to our new friends <@123> and <@124>"
305305
allowed_mentions = {
306+
"parse": ["everyone"],
306307
"users": ["123", "124"]
307308
}
308309

discord_webhook/webhook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class DiscordWebhook:
219219
Webhook for Discord
220220
"""
221221

222-
allowed_mentions: List[str]
222+
allowed_mentions: Dict[str, List[str]]
223223
attachments: Optional[List[Dict[str, Any]]]
224224
avatar_url: Optional[str]
225225
components: Optional[list]
@@ -242,7 +242,7 @@ def __init__(self, url: str, **kwargs) -> None:
242242
Init Webhook for Discord.
243243
---------
244244
:param str url: your discord webhook url
245-
:keyword list allowed_mentions: allowed mentions for the message
245+
:keyword dict allowed_mentions: allowed mentions for the message
246246
:keyword dict attachments: attachments that should be included
247247
:keyword str avatar_url: override the default avatar of the webhook
248248
:keyword str content: the message contents
@@ -258,7 +258,7 @@ def __init__(self, url: str, **kwargs) -> None:
258258
:keyword str username: override the default username of the webhook
259259
:keyword bool wait: waits for server confirmation of message send before response (defaults to True)
260260
"""
261-
self.allowed_mentions = kwargs.get("allowed_mentions", [])
261+
self.allowed_mentions = kwargs.get("allowed_mentions", {})
262262
self.attachments = kwargs.get("attachments", [])
263263
self.avatar_url = kwargs.get("avatar_url")
264264
self.content = kwargs.get("content")

0 commit comments

Comments
 (0)