Skip to content

Commit

Permalink
Merge branch 'python3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmptrluke committed Feb 10, 2015
2 parents 0b828c7 + 7af790a commit 6b548d4
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CloudBot Docs

Stuff will eventually go here
8 changes: 8 additions & 0 deletions docs/user/main_user.md
Original file line number Diff line number Diff line change
@@ -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.
66 changes: 66 additions & 0 deletions plugins/flip.py
Original file line number Diff line number Diff line change
@@ -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):
"""<text> -- Flips <text> 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):
"""<text> -- (╯°□°)╯︵ <ʇxǝʇ>"""
message(random.choice(flippers) + " ︵ " + formatting.multi_replace(text[::-1], replacements))


9 changes: 6 additions & 3 deletions plugins/geoip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion plugins/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b548d4

Please sign in to comment.