We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2ca97e4 + 0204960 commit c863cf4Copy full SHA for c863cf4
1 file changed
twitter/api.py
@@ -4836,6 +4836,32 @@ def VerifyCredentials(self, include_entities=None, skip_status=None, include_ema
4836
4837
return User.NewFromJsonDict(data)
4838
4839
+ def ReplyTo(self, status, in_reply_to_status_id, **kwargs):
4840
+ """Relay to a status. Automatically add @username before the status for
4841
+ convenience.This method calls api.GetStatus to get username.
4842
+
4843
4844
+ Args:
4845
+ status (str):
4846
+ The message text to be replyed.Must be less than or equal to 140 characters.
4847
+ in_reply_to_status_id (int):
4848
+ The ID of an existing status that the status to be posted is in reply to.
4849
+ **kwargs:
4850
+ The other args api.PostUpadtes need.
4851
4852
+ Returns:
4853
+ (twitter.Status) A twitter.Status instance representing the message replied.
4854
+ """
4855
+ reply_status = self.GetStatus(in_reply_to_status_id)
4856
+ u_status = "@%s " % reply_status.user.screen_name
4857
+ if isinstance(status, str) or self._input_encoding is None:
4858
+ u_status = u_status + status
4859
+ else:
4860
+ u_status = u_status + str(u_status, self._input_encoding)
4861
4862
+ return self.PostUpdate(u_status, in_reply_to_status_id=in_reply_to_status_id, **kwargs)
4863
4864
4865
def SetCache(self, cache):
4866
"""Override the default cache. Set to None to prevent caching.
4867
0 commit comments