From d531877e6652e6075d47ee74cea62013d38656fb Mon Sep 17 00:00:00 2001 From: Foxlet Date: Mon, 2 Feb 2015 22:15:51 -0500 Subject: [PATCH 1/4] Return NoneType if no API - youtube.py Fixes a bug where no message is returned in the YouTube module if no GDC Key is set. --- plugins/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From e3c00c01fa8987438ae6682ae4e4bd2906c4de46 Mon Sep 17 00:00:00 2001 From: Foxlet Date: Thu, 5 Feb 2015 01:30:31 -0500 Subject: [PATCH 2/4] Initializing Structure for Docs - CloudBot Docs The docs/ folder contains all the new documentation for the release/development version of CloudBot. --- docs/README.md | 3 +++ docs/user/main_user.md | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 docs/README.md create mode 100644 docs/user/main_user.md 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 From e9e904878d7307a8a7acc9f50b6186a33089440e Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 10 Feb 2015 18:56:11 +1300 Subject: [PATCH 3/4] =?UTF-8?q?(=E2=95=AF=C2=B0=E2=96=A1=C2=B0=EF=BC=89?= =?UTF-8?q?=E2=95=AF=EF=B8=B5=20<=CA=87x=C7=9D=CA=87>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/flip.py | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 plugins/flip.py 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)) + + From 7af790a65f0631521dce97a62e7161b54b2d3277 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 10 Feb 2015 19:02:09 +1300 Subject: [PATCH 4/4] GeoIP now correctly handles queries with no region, fixes #90 --- plugins/geoip.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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))