forked from distok/cutthecord
Slash commands!
Closes #11 Still needs a /help. Look into createLocalMessage IG. Also, improve message interception so that we can potentially make stuff like OTR in the future. That sounds hot, eh?
This commit is contained in:
parent
cd2ead46a9
commit
f2dfc15645
3 changed files with 1222 additions and 0 deletions
1186
patches/slashcommands/900.patch
Normal file
1186
patches/slashcommands/900.patch
Normal file
File diff suppressed because it is too large
Load diff
21
patches/slashcommands/README.md
Normal file
21
patches/slashcommands/README.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
## DisTok CutTheCord: Slash Commands Patch
|
||||||
|
|
||||||
|
This patch adds a message intercept feature with minimal changes to the original code, and adds slash commands.
|
||||||
|
|
||||||
|
The following slash commands are supported:
|
||||||
|
- /upper
|
||||||
|
- /lower
|
||||||
|
- /bold
|
||||||
|
- /spoiler
|
||||||
|
- /me
|
||||||
|
- /st (strikethrough)
|
||||||
|
- /shrug
|
||||||
|
- /tableflip
|
||||||
|
- /unflip
|
||||||
|
- /fw (fullwidth text)
|
||||||
|
|
||||||
|
Commands like fw can be generated by `textreplacegen.py` provided in this folder.
|
||||||
|
|
||||||
|
#### Available and tested on:
|
||||||
|
- 9.0.0
|
||||||
|
|
15
patches/slashcommands/textreplacegen.py
Normal file
15
patches/slashcommands/textreplacegen.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
fw = dict((chr(i), chr(i + 0xFEE0)) for i in range(0x21, 0x7F))
|
||||||
|
|
||||||
|
code = """
|
||||||
|
const-string v0, "before"
|
||||||
|
|
||||||
|
const-string v1, "after"
|
||||||
|
|
||||||
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
|
||||||
|
|
||||||
|
move-result-object p0"""
|
||||||
|
|
||||||
|
for entry in fw:
|
||||||
|
if entry in ["\\", "\""]:
|
||||||
|
continue
|
||||||
|
print(code.replace("before", entry).replace("after", fw[entry]))
|
Loading…
Reference in a new issue