4242 '[' : ']' ,
4343 '{' : '}' ,
4444 '\' ' : ',' ,
45- '_' : '‾' }
45+ '_' : '‾' ,
46+ }
4647
4748# append an inverted form of replacements to itself, so flipping works both ways
4849replacements .update (dict ((v , k ) for k , v in replacements .items ()))
5455@hook .command
5556def flip (text , reply , message , chan ):
5657 """<text> - Flips <text> over."""
57- global table_status
58- # table_status = defaultdict(False)
5958 if USE_FLIPPERS :
6059 if text in ['table' , 'tables' ]:
6160 message (random .choice ([random .choice (flippers ) + " ︵ " + "\u253B \u2501 \u253B " , table_flipper ]))
@@ -72,7 +71,7 @@ def flip(text, reply, message, chan):
7271 reply (formatting .multi_replace (text [::- 1 ], replacements ))
7372
7473
75- @hook .command ( autohelp = False )
74+ @hook .command
7675def table (text , message ):
7776 """<text> - (╯°□°)╯︵ <ʇxǝʇ>"""
7877 message (random .choice (flippers ) + " ︵ " + formatting .multi_replace (text [::- 1 ].lower (), replacements ))
@@ -83,10 +82,9 @@ def fix(text, reply, message, chan):
8382 """<text> - fixes a flipped over table. ┬─┬ノ(ಠ_ಠノ)"""
8483 global table_status
8584 if text in ['table' , 'tables' ]:
86- if table_status [ chan ] is True :
85+ if table_status . pop ( chan , False ) is True :
8786 message ("┬─┬ノ(ಠ_ಠノ)" )
88- table_status [chan ] = False
8987 else :
9088 message ("no tables have been turned over in {}, thanks for checking!" .format (chan ))
9189 else :
92- message ( flip (text , reply , message , chan ) )
90+ flip (text , reply , message , chan )
0 commit comments