diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..07d6974f2 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,3 @@ +# CloudBot Docs + +Stuff will eventually go here \ No newline at end of file diff --git a/docs/user/main_user.md b/docs/user/main_user.md new file mode 100644 index 000000000..6f2fe9439 --- /dev/null +++ b/docs/user/main_user.md @@ -0,0 +1,8 @@ +# User Docs for CloudBot + +## Introduction + +Welcome to CloudBot, in this guide, we will cover the setup and configuration procedures in the following files: + + - main_user.md (This File) contains the introductory material for setting up CloudBot. + - configuration.md contains more information on creating a JSON configuration file for CloudBot. \ No newline at end of file diff --git a/plugins/flip.py b/plugins/flip.py new file mode 100644 index 000000000..7581908e2 --- /dev/null +++ b/plugins/flip.py @@ -0,0 +1,66 @@ +import random + +from cloudbot import hook +from cloudbot.util import formatting + +USE_FLIPPERS = False + +replacements = { + 'a': 'ɐ', + 'b': 'q', + 'c': 'ɔ', + 'd': 'p', + 'e': 'ǝ', + 'f': 'ɟ', + 'g': 'b', + 'h': 'ɥ', + 'i': 'ı', + 'j': 'ظ', + 'k': 'ʞ', + 'l': 'ן', + 'm': 'ɯ', + 'n': 'u', + 'o': 'o', + 'p': 'd', + 'q': 'b', + 'r': 'ɹ', + 's': 's', + 't': 'ʇ', + 'u': 'n', + 'v': 'ʌ', + 'w': 'ʍ', + 'x': 'x', + 'y': 'ʎ', + 'z': 'z', + '?': '¿', + '.': '˙', + '/': '\\', + '\\': '/', + '(': ')', + ')': '(', + '<': '>', + '>': '<', + '[': ']', + ']': '[', + '{': '}', + '}': '{', + '\'': ',', + '_': '‾'} + +flippers = ["( ノ⊙︵⊙)ノ", "(╯°□°)╯", "( ノ♉︵♉ )ノ"] + +@hook.command +def flip(text, message, reply): + """ -- Flips over.""" + if USE_FLIPPERS: + message(random.choice(flippers) + " ︵ " + formatting.multi_replace(text[::-1], replacements)) + else: + reply(formatting.multi_replace(text[::-1], replacements)) + + +@hook.command +def table(text, message): + """ -- (╯°□°)╯︵ <ʇxǝʇ>""" + message(random.choice(flippers) + " ︵ " + formatting.multi_replace(text[::-1], replacements)) + + diff --git a/plugins/geoip.py b/plugins/geoip.py index a9d9baa29..3d5b36bde 100644 --- a/plugins/geoip.py +++ b/plugins/geoip.py @@ -92,8 +92,11 @@ def geoip(text, reply, loop): data = { "cc": location_data.country.iso_code or "N/A", "country": location_data.country.name or "Unknown", - "city": location_data.city.name or "Unknown", - "region": ", " + location_data.subdivisions.most_specific.name or "" + "city": location_data.city.name or "Unknown" } - reply("\x02Country:\x02 {country} ({cc}), \x02City:\x02 {city}{region}".format(**data)) + # add a region to the city if one is listed + if location_data.subdivisions.most_specific.name: + data["city"] += ", " + location_data.subdivisions.most_specific.name + + reply("\x02Country:\x02 {country} ({cc}), \x02City:\x02 {city}".format(**data)) diff --git a/plugins/youtube.py b/plugins/youtube.py index b86ef49de..86106c8cb 100644 --- a/plugins/youtube.py +++ b/plugins/youtube.py @@ -70,7 +70,7 @@ def get_video_description(video_id): @hook.on_start() def load_key(bot): global dev_key - dev_key = bot.config.get("api_keys", {}).get("google_dev_key") + dev_key = bot.config.get("api_keys", {}).get("google_dev_key", None) @hook.regex(youtube_re)