A fully fledged uiua-capable discord bot.
It is run with prefix commands: wawa!<cmd> <args> or w!<cmd> <args>
Use either of the prefixes or a direct mention followed by the command. For example:
wawa!ping: pongwawa!run <code>: run the code (can be in ascii!)wawa!docs <fn>: print the documentation for a functionwawa!pad <code>: format the code and provide a pad link
All uiua codeblocks use custom syntax highlighting using the ansi environment (which is
quite limited, discord does not offer much of the ansi spec).
- ping: pong
- h / help: display this text!
- v / ver / version: display uiua version used by the rest of commands
- f / fmt: run the formatter
- p / pad: format and generate a link to the pad
- d / docs : show the first paragraph or so of the specified function
- r / run: format and run the code
- e / emojify: converts the given code to discord emoji as best as possible
- Docs command:
w! docs tuplereturns the documentation fortuple -
w! pad <code>Automatic pad link - have
fmtcolor glyphs - have
fmt's colors look good - Catch messages that are too long
- Audio embeds (don't just crash)
- Image embeds (don't just crash)
- Gif embeds (don't just crash)
- Short summary of function in
w! docs - Write out help
- Accept
w!cmdsyntax - Automate command dispatch
- Add
tracing - Detect raw pad links and sent it wrapped (Check if the string contains
https://uiua.org/pad?srcand not(https://uiua.org/pad?src) - Slash commands (example 5)
-
w!docs changelog - Fix internal links in documentation (like in
under's docs), probably by regex subst - Add space and time constraints for
w!run - Unify extended message sending function
- Add char limit to advanced (embed) msg sender fn
- True parallelism
- Keep it running properly (make it a service)
- Make sure short arrays don't become audio
- Preserve spaces, not just newlines, in input
- Log what's happening in the terminal but the contents of the code and such to disk
- Show stdout in
w!run - inline
fmt - Rerun code if source was edited
- Use Uiua::take_stack_lines for grouping outputs based on line
Place this under /etc/systemd/system/wawa.service to make it a daemon:
[Unit]
Description=wawa discord bot
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=700ms
RestartSec=3
StartLimitIntervalSec=0
WorkingDirectory= # Path to your working directory here
Environment="RUST_LOG=wawa=trace,error"
ExecStart= # Path to your binary goes here
MemoryMax=200M
[Install]
WantedBy=multi-user.target