Skip to content

amatgil/wawa

Repository files navigation

wawa

A fully fledged uiua-capable discord bot.

It is run with prefix commands: wawa!<cmd> <args> or w!<cmd> <args>

Usage

Use either of the prefixes or a direct mention followed by the command. For example:

  • wawa!ping: pong
  • wawa!run <code>: run the code (can be in ascii!)
  • wawa!docs <fn>: print the documentation for a function
  • wawa!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).

Full list of commands

  • 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

Goals

  • Docs command: w! docs tuple returns the documentation for tuple
  • w! pad <code> Automatic pad link
  • have fmt color 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!cmd syntax
  • Automate command dispatch
  • Add tracing
  • Detect raw pad links and sent it wrapped (Check if the string contains https://uiua.org/pad?src and 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

Server install

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

About

A uiua discord bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages