@@ -0,0 +1,1237 @@
+import random%0A%0Afrom bs4 import BeautifulSoup%0A%0Afrom plumeria.command import commands, CommandError%0Afrom plumeria.util import http%0Afrom plumeria.util.ratelimit import rate_limit%0A%0A%0A@commands.register(%22wallhaven%22, %22wallbase%22, category=%22Search%22)%0A@rate_limit()%0Aasync def wallhaven(message):%0A    %22%22%22%0A    Searches wallbase.cc for wallpapers and returns one wallpaper. If no query is provided,%0A    then a random wallpaper will be returned.%0A%0A    Example::%0A%0A        /wallhaven birds%0A    %22%22%22%0A    query = message.content.strip()%0A%0A    r = await http.get(%22https://alpha.wallhaven.cc/search%22, params=%5B%0A        ('q', query),%0A        ('categories', '100'),%0A        ('purity', '110'),%0A        ('sorting', 'favorites'),%0A        ('order', 'desc')%0A    %5D)%0A%0A    results = %5B%5D%0A    soup = BeautifulSoup(r.text(), %22html.parser%22)%0A    for thumb in soup.find_all(%22figure%22, class_=%22thumb%22):%0A        image = thumb.find(%22img%22)%0A        if image:%0A            image_url = image%5B'data-src'%5D%0A            link = thumb.find(%22a%22, class_=%22preview%22)%5B'href'%5D%0A            results.append((image_url, link))%0A    if len(results):%0A        choice = random.choice(results)%0A        return %22%7B%7D%5CnGet it here: %3C%7B%7D%3E%22.format(*choice)%0A    else:%0A        raise CommandError(%22No wallpapers found!%22)%0A

Add wallhaven module.