diff --git a/plugins/utility.py b/plugins/utility.py index 84d186955..d75c4c40a 100644 --- a/plugins/utility.py +++ b/plugins/utility.py @@ -92,7 +92,7 @@ def qrcode(text): @hook.command("capitalize", "capitalise") def capitalize(text): - """ -- Capitalizes . + """ - Capitalizes . :type text: str """ return ". ".join([sentence.capitalize() for sentence in text.split(". ")]) @@ -100,30 +100,30 @@ def capitalize(text): @hook.command def upper(text): - """ -- Convert string to uppercase.""" + """ - Convert string to uppercase.""" return text.upper() @hook.command def lower(text): - """ -- Convert string to lowercase.""" + """ - Convert string to lowercase.""" return text.lower() @hook.command def titlecase(text): - """ -- Convert string to title case.""" + """ - Convert string to title case.""" return text.title() @hook.command def swapcase(text): - """ -- Swaps the capitalization of .""" + """ - Swaps the capitalization of .""" return text.swapcase() @hook.command("aesthetic", "vapor", "fw") def fullwidth(text): - """ -- Converts to full width characters.""" + """ - Converts to full width characters.""" HALFWIDTH_TO_FULLWIDTH = str.maketrans( '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[]^_`{|}~', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!゛#$%&()*+、ー。/:;〈=〉?@[]^_‘{|}~' @@ -134,20 +134,20 @@ def fullwidth(text): @hook.command("rot13") def rot13_encode(text): - """ -- Encode with rot13.""" + """ - Encode with rot13.""" encoder = codecs.getencoder("rot-13") return encoder(text)[0] @hook.command("base64") def base64_encode(text): - """ -- Encode with base64.""" + """ - Encode with base64.""" return base64.b64encode(text.encode()).decode() @hook.command("debase64", "unbase64") def base64_decode(text, notice, message): - """ -- Decode with base64.""" + """ - Decode with base64.""" try: return " ".join(base64.b64decode(text.encode()).decode().splitlines()) except binascii.Error: @@ -156,7 +156,7 @@ def base64_decode(text, notice, message): @hook.command("isbase64", "checkbase64") def base64_check(text): - """ -- Checks if is a valid base64 encoded string""" + """ - Checks if is a valid base64 encoded string""" try: base64.b64decode(text.encode()) except binascii.Error: @@ -167,14 +167,14 @@ def base64_check(text): @hook.command def unescape(text, message): - """ -- Unicode unescapes .""" + """ - Unicode unescapes .""" decoder = codecs.getdecoder("unicode_escape") return " ".join(decoder(text)[0].splitlines()) @hook.command def escape(text): - """ -- Unicode escapes .""" + """ - Unicode escapes .""" encoder = codecs.getencoder("unicode_escape") return " ".join(encoder(text)[0].decode().splitlines()) @@ -184,7 +184,7 @@ def escape(text): @hook.command def length(text): - """ -- Gets the length of """ + """ - Gets the length of """ return "The length of that string is {} characters.".format(len(text)) @@ -193,7 +193,7 @@ def length(text): @hook.command def reverse(text): - """ -- Reverses .""" + """ - Reverses .""" return text[::-1] @@ -202,7 +202,7 @@ def reverse(text): @hook.command("hash") def hash_command(text): - """ -- Returns hashes of .""" + """ - Returns hashes of .""" return ', '.join(x + ": " + getattr(hashlib, x)(text.encode("utf-8")).hexdigest() for x in ['md5', 'sha1', 'sha256']) @@ -212,13 +212,13 @@ def hash_command(text): @hook.command def munge(text): - """ -- Munges up .""" + """ - Munges up .""" return formatting.munge(text) @hook.command def leet(text): - """ -- Makes more 1337h4x0rz.""" + """ - Makes more 1337h4x0rz.""" output = ''.join(random.choice(leet[ch]) if ch.isalpha() else ch for ch in text.lower()) return output @@ -248,13 +248,14 @@ def derpify(text): # colors @hook.command def color_parse(text): + """ - Formats a string, replacing words wrapped in $( ) with actual colours or formatting.""" return colors.parse(text) # colors - based on code by Reece Selwood - @hook.command def rainbow(text): - """ -- Gives rainbow colors.""" + """ - Gives rainbow colors.""" text = str(text) text = strip(text) col = list(COLORS.items()) @@ -270,7 +271,7 @@ def rainbow(text): @hook.command def wrainbow(text): - """ -- Gives each word in rainbow colors.""" + """ - Gives each word in rainbow colors.""" text = str(text) col = list(COLORS.items()) text = strip(text).split(' ') @@ -283,7 +284,7 @@ def wrainbow(text): @hook.command def usa(text): - """ -- Makes more patriotic.""" + """ - Makes more patriotic.""" text = strip(text) c = [COLORS['red'], '\x0300', COLORS['blue']] l = len(c) @@ -295,7 +296,7 @@ def usa(text): @hook.command def superscript(text): - """ -- Makes superscript.""" + """ - Makes superscript.""" regular = "abcdefghijklmnoprstuvwxyzABDEGHIJKLMNOPRTUVW0123456789+-=()" super_script = "ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁⱽᵂ⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾" result = []