def shorten_url(url, botan_token, user_id):
try:
return requests.get(SHORTENER_URL, params={
'token': botan_token,
'url': url,
'user_ids': str(user_id),
}).text
except requests.exceptions:
return url