Added the function create_mute and destroy_mute
authorantoinemcgrath <antoine.mcgrath@gmail.com>
Wed, 6 Jun 2018 22:09:41 +0000 (15:09 -0700)
committerantoinemcgrath <antoine.mcgrath@gmail.com>
Wed, 6 Jun 2018 22:09:41 +0000 (15:09 -0700)
tweepy/api.py

index 26ed0891c930a14b90172cc24bd37863604c5907..9781cda59891311fb2c5fb8e7607477b03ac3944 100644 (file)
@@ -121,7 +121,7 @@ class API(object):
             path='/statuses/user_timeline.json',
             payload_type='status', payload_list=True,
             allowed_param=['id', 'user_id', 'screen_name', 'since_id',
-                           'max_id', 'count', 'include_rts', 'trim_user', 
+                           'max_id', 'count', 'include_rts', 'trim_user',
                            'exclude_replies']
         )
 
@@ -802,6 +802,38 @@ class API(object):
             require_auth=True
         )
 
+
+
+    @property
+    def create_mute(self):
+        """ :reference: https://dev.twitter.com/rest/reference/post/mutes/users/create
+            :allowed_param:'id', 'user_id', 'screen_name'
+        """
+        return bind_api(
+            api=self,
+            path='/mutes/users/create.json',
+            method='POST',
+            payload_type='user',
+            allowed_param=['id', 'user_id', 'screen_name'],
+            require_auth=True
+        )
+
+    @property
+    def destroy_mute(self):
+        """ :reference: https://dev.twitter.com/rest/reference/post/mutes/users/destroy
+            :allowed_param:'id', 'user_id', 'screen_name'
+        """
+        return bind_api(
+            api=self,
+            path='/mutes/users/destroy.json',
+            method='POST',
+            payload_type='user',
+            allowed_param=['id', 'user_id', 'screen_name'],
+            require_auth=True
+        )
+
+
+
     @property
     def blocks(self):
         """ :reference: https://dev.twitter.com/rest/reference/get/blocks/list