Merge pull request #327 from alexmshepherd/status_reply-patch

Status reply patch
This commit is contained in:
Lorenz Diener 2023-04-23 18:51:59 +03:00 committed by GitHub
commit 0e0e8cd687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,6 +320,8 @@ class Mastodon(Internals):
the users that are being replied to to the status text and retains the users that are being replied to to the status text and retains
CW and visibility if not explicitly overridden. CW and visibility if not explicitly overridden.
Note that `to_status` should be a :ref:`status dict <status dict>` and not an ID.
Set `untag` to True if you want the reply to only go to the user you 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 are replying to, removing every other mentioned user from the
conversation. conversation.
@ -333,7 +335,10 @@ class Mastodon(Internals):
# Determine users to mention # Determine users to mention
mentioned_accounts = collections.OrderedDict() 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: if not untag:
for account in to_status.mentions: for account in to_status.mentions: