Skip to content

Commit 6b548d4

Browse files
committed
Merge branch 'python3.4'
2 parents 0b828c7 + 7af790a commit 6b548d4

5 files changed

Lines changed: 84 additions & 4 deletions

File tree

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CloudBot Docs
2+
3+
Stuff will eventually go here

docs/user/main_user.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# User Docs for CloudBot
2+
3+
## Introduction
4+
5+
Welcome to CloudBot, in this guide, we will cover the setup and configuration procedures in the following files:
6+
7+
- main_user.md (This File) contains the introductory material for setting up CloudBot.
8+
- configuration.md contains more information on creating a JSON configuration file for CloudBot.

plugins/flip.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import random
2+
3+
from cloudbot import hook
4+
from cloudbot.util import formatting
5+
6+
USE_FLIPPERS = False
7+
8+
replacements = {
9+
'a': 'ɐ',
10+
'b': 'q',
11+
'c': 'ɔ',
12+
'd': 'p',
13+
'e': 'ǝ',
14+
'f': 'ɟ',
15+
'g': 'b',
16+
'h': 'ɥ',
17+
'i': 'ı',
18+
'j': 'ظ',
19+
'k': 'ʞ',
20+
'l': 'ן',
21+
'm': 'ɯ',
22+
'n': 'u',
23+
'o': 'o',
24+
'p': 'd',
25+
'q': 'b',
26+
'r': 'ɹ',
27+
's': 's',
28+
't': 'ʇ',
29+
'u': 'n',
30+
'v': 'ʌ',
31+
'w': 'ʍ',
32+
'x': 'x',
33+
'y': 'ʎ',
34+
'z': 'z',
35+
'?': '¿',
36+
'.': '˙',
37+
'/': '\\',
38+
'\\': '/',
39+
'(': ')',
40+
')': '(',
41+
'<': '>',
42+
'>': '<',
43+
'[': ']',
44+
']': '[',
45+
'{': '}',
46+
'}': '{',
47+
'\'': ',',
48+
'_': '‾'}
49+
50+
flippers = ["( ノ⊙︵⊙)ノ", "(╯°□°)╯", "( ノ♉︵♉ )ノ"]
51+
52+
@hook.command
53+
def flip(text, message, reply):
54+
"""<text> -- Flips <text> over."""
55+
if USE_FLIPPERS:
56+
message(random.choice(flippers) + " ︵ " + formatting.multi_replace(text[::-1], replacements))
57+
else:
58+
reply(formatting.multi_replace(text[::-1], replacements))
59+
60+
61+
@hook.command
62+
def table(text, message):
63+
"""<text> -- (╯°□°)╯︵ <ʇxǝʇ>"""
64+
message(random.choice(flippers) + " ︵ " + formatting.multi_replace(text[::-1], replacements))
65+
66+

plugins/geoip.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ def geoip(text, reply, loop):
9292
data = {
9393
"cc": location_data.country.iso_code or "N/A",
9494
"country": location_data.country.name or "Unknown",
95-
"city": location_data.city.name or "Unknown",
96-
"region": ", " + location_data.subdivisions.most_specific.name or ""
95+
"city": location_data.city.name or "Unknown"
9796
}
9897

99-
reply("\x02Country:\x02 {country} ({cc}), \x02City:\x02 {city}{region}".format(**data))
98+
# add a region to the city if one is listed
99+
if location_data.subdivisions.most_specific.name:
100+
data["city"] += ", " + location_data.subdivisions.most_specific.name
101+
102+
reply("\x02Country:\x02 {country} ({cc}), \x02City:\x02 {city}".format(**data))

plugins/youtube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get_video_description(video_id):
7070
@hook.on_start()
7171
def load_key(bot):
7272
global dev_key
73-
dev_key = bot.config.get("api_keys", {}).get("google_dev_key")
73+
dev_key = bot.config.get("api_keys", {}).get("google_dev_key", None)
7474

7575

7676
@hook.regex(youtube_re)

0 commit comments

Comments
 (0)