dragon-bot/app/wallpaper.py
Unknown 522609c8ef Complete Rewrite
changed everything
2017-08-17 00:30:17 -05:00

23 lines
580 B
Python

import help_methods
def get_wall(message):
unsplash_url = "https://source.unsplash.com/{}/?".format(resolution)
if len(message.split()) > 2:
search_terms = message.split()[1:]
# Turn search_terms into strings separated by commas
joined_terms = ','.join(search_terms)
# Add those comma separated strings onto the end of the URL variable
url = unsplash_url + joined_terms
elif len(message.split()) > 1:
term = message.split()[1]
url = unsplash_url + term
else:
url = unsplash_url
return url