Updated removeFirend

This commit is contained in:
ThatAlexanderA
2018-06-05 18:41:09 +02:00
committed by GitHub
parent 91778f43b7
commit b599033c54

View File

@@ -11,7 +11,12 @@ from .utils import *
from .models import *
from .graphql import *
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):
@@ -469,14 +474,25 @@ class Client(object):
END DEFAULT THREAD METHODS
"""
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 = {
"friend_id": friend_id,
"unref": "none",
"confirm": "Confirm",
}
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
"""