@@ -0,0 +1,1141 @@
+import plumeria.util.http as http%0Afrom plumeria import config%0Afrom plumeria.command import commands, CommandError%0Afrom plumeria.command.parse import Text%0Afrom plumeria.message.mappings import build_mapping%0Afrom plumeria.util.collections import SafeStructure%0Afrom plumeria.util.ratelimit import rate_limit%0A%0A%0A@commands.register(%22haveibeenpwned%22, %22pwned%22, category=%22Search%22, params=%5BText('query')%5D)%0A@rate_limit(burst_size=4)%0Aasync def have_i_been_pwned(message, query):%0A    %22%22%22%0A    Checks where an account (specified by account name or email address) exists%0A    on sites that have experienced data breaches.%0A%0A    Example::%0A%0A        pwned email@example.com%0A%0A    %22%22%22%0A    r = await http.get(%22https://haveibeenpwned.com/api/v2/breachedaccount/%22 + query, headers=%5B%0A        ('User-Agent', 'Plumeria chat bot (+https://gitlab.com/sk89q/Plumeria)')%0A    %5D)%0A%0A    if not len(r.text().strip()):%0A        raise CommandError(%22Account not found! (That's good.)%22)%0A%0A    results = SafeStructure(r.json())%0A%0A    return build_mapping(%0A        %5B(e.Title, %22%7B%7D (%7B%7D breached) (%7B%7D)%22.format(e.BreachDate, e.PwnCount, %22, %22.join(e.DataClasses))) for e in%0A         results%5D)%0A

Add Have I Been Pwned? plugin.