Updated removeFirend
This commit is contained in:
@@ -11,7 +11,12 @@ from .utils import *
|
|||||||
from .models import *
|
from .models import *
|
||||||
from .graphql import *
|
from .graphql import *
|
||||||
import time
|
import time
|
||||||
|
try:
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
from urllib.parse import parse_qs
|
||||||
|
except ImportError:
|
||||||
|
from urlparse import urlparse
|
||||||
|
from urlparse import parse_qs
|
||||||
|
|
||||||
|
|
||||||
class Client(object):
|
class Client(object):
|
||||||
@@ -469,14 +474,25 @@ class Client(object):
|
|||||||
END DEFAULT THREAD METHODS
|
END DEFAULT THREAD METHODS
|
||||||
"""
|
"""
|
||||||
def removeFriend(self, friend_id=None):
|
def removeFriend(self, friend_id=None):
|
||||||
"""param friend_id: The id of the friend that you want to remove"""
|
"""
|
||||||
|
Removes a specifed friend from your friend list
|
||||||
|
:param friend_id: The id of the friend that you want to remove
|
||||||
|
:returns error when the removing was unsuccessful
|
||||||
|
:returns True when the removing was successful
|
||||||
|
"""
|
||||||
payload = {
|
payload = {
|
||||||
"friend_id": friend_id,
|
"friend_id": friend_id,
|
||||||
"unref": "none",
|
"unref": "none",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
}
|
}
|
||||||
r = self._post(self.req_url.REMOVE_FRIEND,payload)
|
r = self._post(self.req_url.REMOVE_FRIEND,payload)
|
||||||
return r.ok
|
dict = parse_qs(urlparse(r.url).query)
|
||||||
|
if "err" not in dict:
|
||||||
|
print ("Remove was successful!")
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print ("Error while removing friend")
|
||||||
|
return False
|
||||||
"""
|
"""
|
||||||
FETCH METHODS
|
FETCH METHODS
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user