First :D
This commit is contained in:
commit
37588421f3
100 changed files with 22673 additions and 0 deletions
67
plugins/flip.py
Normal file
67
plugins/flip.py
Normal file
|
@ -0,0 +1,67 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from util import hook
|
||||
import random
|
||||
|
||||
@hook.command
|
||||
def flip(inp, flip_count=0, say = None):
|
||||
".flip <text> -- flips the given text"
|
||||
guy = unicode(random.choice(flips), 'utf8')
|
||||
inp = inp.lower()
|
||||
inp = inp[::-1]
|
||||
reps = 0
|
||||
for n in xrange(len(inp)):
|
||||
rep = character_replacements.get(inp[n])
|
||||
if rep:
|
||||
inp = inp[:n] + rep.decode('utf8') + inp[n + 1:]
|
||||
reps += 1
|
||||
if reps == flip_count:
|
||||
break
|
||||
say(guy + u" ︵ " + inp)
|
||||
|
||||
flips = ["(屮ಠ︵ಠ)屮",
|
||||
"( ノ♉︵♉ )ノ",
|
||||
"(╯°□°)╯",
|
||||
"( ノ⊙︵⊙)ノ"]
|
||||
|
||||
character_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',
|
||||
'?': '¿',
|
||||
'.': '˙',
|
||||
'/': '\\',
|
||||
'\\': '/',
|
||||
'(': ')',
|
||||
')': '(',
|
||||
'<': '>',
|
||||
'>': '<',
|
||||
'[': ']',
|
||||
']': '[',
|
||||
'{': '}',
|
||||
'}': '{',
|
||||
'\'': ',',
|
||||
'_': '‾'}
|
Reference in a new issue