From 92a7cbac35444d6ec9f6a705e8d431b886c38962 Mon Sep 17 00:00:00 2001 From: alex martin shepherd <110127860+alexmshepherd@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:43:40 +0100 Subject: [PATCH 1/2] Clarify status_reply ( #310 ) --- mastodon/statuses.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mastodon/statuses.py b/mastodon/statuses.py index 36a7d2b..7368961 100644 --- a/mastodon/statuses.py +++ b/mastodon/statuses.py @@ -326,6 +326,8 @@ class Mastodon(Internals): the users that are being replied to to the status text and retains CW and visibility if not explicitly overridden. + Note that `to_status` should be a :ref:`status dict ` and not an ID. + Set `untag` to True if you want the reply to only go to the user you are replying to, removing every other mentioned user from the conversation. From 2905c07863ab7ebc237707dd8eeee3c3ebd46999 Mon Sep 17 00:00:00 2001 From: alex martin shepherd <110127860+alexmshepherd@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:47:43 +0100 Subject: [PATCH 2/2] Add custom exception --- mastodon/statuses.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/statuses.py b/mastodon/statuses.py index 7368961..d2c8628 100644 --- a/mastodon/statuses.py +++ b/mastodon/statuses.py @@ -341,7 +341,10 @@ class Mastodon(Internals): # Determine users to mention mentioned_accounts = collections.OrderedDict() - mentioned_accounts[to_status.account.id] = to_status.account.acct + try: + mentioned_accounts[to_status.account.id] = to_status.account.acct + except AttributeError as e: + raise TypeError("to_status must specify a status dict!") from e if not untag: for account in to_status.mentions: