pipe|bot
is a Discord chatbot that allows you to chain multiple text commands
together with pipes. It also supports arbritrary subgrouping.
pipe|bot runs text through commands and posts the results. Run a command by appending it to your message with the pipe character, « | ».
"Hello, world! | uppercase" will give you "HELLO, WORLD!"
You can chain together as many commands as you would like:
"Hello, world! | caps | zalgo | italics" gives "H͓̒͘E̜͒͜L̷̥ͥL͔̠̖Ǫ̼ͧ,̪̺͢ W̸̪͠Ǫ͛̀R̞̻̣L̶͑̇D̷͓͛"
You can run sub-groups between curly braces:
"Hello, {world! | redact}" gives "Hello, █████!"
pipe|bot can use the text of previous messages with $LAST and $MESSAGE.
$LAST is replaced with the text of the last message in the channel. It can also take a @mention or an ID, and use that person's last channel message.
$MESSAGE is similar, but requires a message link or ID.
With both $LAST and $MESSAGE, the message text is escaped, so characters such as pipes and curly braces won't interfere with the current operations.
As a convenience, a $LAST is implied if a message starts with « | ».
Command | Description | Example |
---|---|---|
caps | Uppercase | UPPERCASE |
lowercase | Lowercase | lowercase |
swapcase | Swaps case per letter | sWAPS CASE PER LETTER |
base64 | Base64 encoded | QmFzZTY0IGVuY29kZWQ= |
binary | Binary representation | 1000010 1101001 1101110 1100001 1110010 1111001 100000 1110010 1100101 1110000 1110010 1100101 1110011 1100101 1101110 1110100 1100001 1110100 1101001 1101111 1101110 |
from_base64 | Text from base 64 | N/A |
from_hex | Text from hexidecimal | N/A |
hex | Hexidecimal representation | 48 65 78 69 64 65 63 69 6d 61 6c 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e |
md5 | MD5 hash | 0205eacc79baf77a16ff08e24fbba67a |
sha256 | SHA256 hash | 92dfe7a311aa63bf4e6171c23270b2181a011f735836cfa16a2355cc115f8a31 |
blockquote | Block quote | > Block quote |
bold | Bold | **Bold** |
code | Inline code tag | `Inline code tag` |
codeblock | Code block | ``` Code block ``` |
italic | Italics | *Italics* |
spoiler | Spoiler tag | ||Spoiler tag|| |
underline | Underline | __Underline__ |
clap | Emojis between words (default 👏) | Emojis 👏 between 👏 words 👏 (default 👏 👏) |
mock | Random upper/lowercase | RanDOm UppEr/LoWErCAsE |
scramble | Scrambled characters | elmabSdrc taaechcsrr |
uwu | Cursed UwU text | Cuwsed UwU text |
zalgo | Spooky zalgo text | S̮͆p̹ͨo̩͚ȯ̓k̸ͬy̪̭ z̼̐ą͙l̐̽g̰ͭoͧ̓ t̀͠e͂ͫx͔̏t͘ͅ |
blackletter | Old timey blackletter | 𝔒𝔩𝔡 𝔱𝔦𝔪𝔢𝔶 𝔟𝔩𝔞𝔠𝔨𝔩𝔢𝔱𝔱𝔢𝔯 |
leet | Elite hacker text | 31I73 H4CK3R 73X7 |
redact | Letters substituted for character (default █). | ███████ ███████████ ███ █████████ (███████ █). |
serif | Unicode serif font | 𝐔𝐧𝐢𝐜𝐨𝐝𝐞 𝐬𝐞𝐫𝐢𝐟 𝐟𝐨𝐧𝐭 |
upsidedown | Unicode upside-down font | ∩uᴉɔopǝ ndsᴉpǝ-poʍu ɟouʇ |
vaporwave | CJK full width letters | CJK full width letters |
The bot can be added to your server with the following link:
[LINK]
You're encouraged to rehost the bot and modify it to your needs.
Source overview:
Source file | Function |
---|---|
main.py |
The Discord bot itself. This is the file run to start the bot. |
text_transform.py |
The hand-written lexer, parser, and generator. The grand majority of the bot's functionality is implemented here. |
commands.py |
Data related to the bots commands, including aliases, descriptions, examples,
and the names of callbacks.
The end of the file has useful data structures and regex patterns related to the commands. |
command_funcs.py |
The callback functions for each command. |
Related file | Function |
test.py |
Tests, mostly focusing on the lexer/parser/generator. Run with pytest. |
utils.py |
Related utilities to debug the lexer and to generate the command table for the README. |
Code is under the BSD simplified licence. See LICENCE.txt.