happybot/readme.md

41 lines
1.2 KiB
Markdown

`input`:
- The named pipe to talk as the bot.
`bin/`:
- `raw` - Sends `$1` to freenode.
- `reply` - Uses env vars to send message `$@`.
- `result` - Like reply, but does not prepend `nick:`.
- `privmsg` - Sends privmsg to `$1`, with message `shift;$@`.
- `notice` - Sends privmsg to `$1`, with message `shift;$@`.
- `action` - Sends ctcp action to `$1`, with message `shift;$@`.
- `ctcp` - Sends a ctcp query, returns the response.
- `connect` - Connects to IRC, calls commands in `irc/`, listens to `input`,
and writes to log the file.
- `hateweek/start` - Begins hateweek mode.
- `hateweek/end` - Ends hateweek mode.
- `hateweek/isnow` - Check to see if hateweek is now (returns 0 if now, 1 if
not now).
`log.txt`:
- The single file that has all of the logs.
- Uses the IRC format with a timestamp prepended.
`irc/`:
- IRC commands are run as shell commands.
- `bin/` is in their `PATH`.
- Set up env vars before calling various functions.
- Add data to log files if needed.
Env vars:
- `$acct`: NickServ account name, or `\*`.
- `$nick`
- `$cmd`
- `$where`
- `$msg`
`/tmp/happybot/`:
- directory for temporary information
- `nick` - The bot's nick.
- `acct` - Look up account name by nick.
- Either a directory, or a file.