-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunicode.py
More file actions
49 lines (44 loc) · 1.63 KB
/
Copy pathunicode.py
File metadata and controls
49 lines (44 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
__module_author__ = 'Ward Muylaert'
__module_name__ = 'Unicode'
__module_version__ = '0.3'
__module_description__ = 'Replaces random smileys with Unicode variants'
import xchat
def intercept_print(word, word_eol, userdata):
if (word_eol[0][:3] == '###'):
return xchat.EAT_NONE
# surely this can be more efficient
line = word_eol[0] \
.replace('<3', '♥') \
.replace('=)', 'ツ') \
.replace('^^', '^̮^') \
.replace('!!', '‼') \
.replace('°C', '℃') \
.replace('->', '→') \
.replace('=>', '⇒') \
.replace('(tm)', '™') \
.replace('(r)', '®') \
.replace('(c)', '©') \
.replace(':dis:', 'ಠ_ಠ') \
.replace(':cry:', 'ಥ_ಥ') \
.replace('?!', '‽') \
.replace(':roll:', '◔_◔') \
.replace(':commy:', '☭') \
.replace(':king:', '♔') \
.replace(':zzz:', '( ̄。 ̄)~zzz') \
.replace(':hugme:', '(ノ゜,゜)ノ') \
.replace(':fliptable:', '(╯°□°)╯︵ ┻━┻') \
.replace('\\infty', '∞') \
.replace('\\in', '∈') \
.replace('\\forall', '∀') \
.replace('\\nin', '∉') \
.replace('\\sqrt', '√') \
.replace('\\pm', '±') \
.replace('+-', '±') \
.replace('\\neq', '≠')
xchat.command(' '.join(['msg', xchat.get_info('channel'), line]))
return xchat.EAT_ALL
# Empty command means catching normal text apparently
xchat.hook_command('', intercept_print)
xchat.prnt('Loaded %s v%s by %s.'
% (__module_name__, __module_version__, __module_author__))