aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhazhismel <[email protected]>2015-11-19 10:18:27 -0500
committerRapptz <[email protected]>2015-11-19 23:16:47 -0500
commit52d34574434acfe0f97f320bd7f785f7b9b77b7a (patch)
tree25b8ff887daa3a5edac1afc3821204682656760e
parentfixed voice_members not updating when changing channels (diff)
downloaddiscord.py-52d34574434acfe0f97f320bd7f785f7b9b77b7a.tar.xz
discord.py-52d34574434acfe0f97f320bd7f785f7b9b77b7a.zip
Add send_typing command to allow sending typing updates.
-rw-r--r--discord/client.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index 7b1dc6ac..8a6d10dd 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -655,6 +655,24 @@ class Client(object):
message = Message(channel=channel, **data)
return message
+ def send_typing(self, destination):
+ """Send a "typing" status to the destination.
+
+ "Typing" status will go away after 10 seconds, or after a message is sent.
+
+ The destination parameter follows the same rules as :meth:`send_message`.
+
+ :param destination: The location to send the typing update.
+ """
+
+ channel_id = self._resolve_destination(destination)
+
+ url = '{base}/{id}/typing'.format(base=endpoints.CHANNELS, id=channel_id)
+
+ response = requests.post(url, headers=self.headers)
+ log.debug(request_logging_format.format(response=response))
+ _verify_successful_response(response)
+
def send_file(self, destination, filename):
"""Sends a message to the destination given with the file given.