2026-07-14 23:52:56 +02:00
# zynk - Companion AI Logic Chatbot
2026-06-07 01:49:31 +02:00
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
A single-file IRC bot in C. Features a key-value store backed by SQLite3, weather lookups via wttr.in, stock quotes, calculator, time, user tracking, and AI-powered replies.
2026-06-07 01:50:05 +02:00
## Features
2026-07-23 01:46:37 +02:00
- **Key-Value Store**: Persist facts, notes, or any data with `!zynk key = value` ; Overwrite existing keys with `!zynk! key = value`
2026-06-07 01:50:05 +02:00
- **Weather**: Current conditions and 3-day forecasts via `wttr.in`
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
- **Stock Quotes**: Real-time stock prices via Yahoo Finance
- **Calculator**: Evaluate math expressions with `!calc`
- **Time**: Show current time in any timezone with `!time`
- **User Tracking**: Track when users were last seen with `!seen`
- **Offline Messages**: Leave messages for offline users with `!tell`
2026-06-07 01:50:05 +02:00
- **AI Queries**: Ask questions via `!ai` or by addressing the bot; powered by `opencode`
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
- **Code Changes**: AI-powered code editing with auto-recompile and hot reload
2026-06-07 01:50:05 +02:00
- **Chat Greetings**: Responds to `hi` , `hello` , `hey` , `bye` , and more
2026-07-21 16:17:43 +02:00
- **Hot Reload**: Reload or restart without leaving channels, losing your nick, or dropping voice mode
2026-06-07 01:50:05 +02:00
- **TLS**: Secure connections via OpenSSL
- **Rate Limiting**: Per-nick protection against spam
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
- **Reconnection**: Auto-reconnect with exponential backoff
2026-06-07 01:50:05 +02:00
- **Single File**: Easy to deploy and modify
## Requirements
- `gcc` (or any C99 compiler)
- `libssl-dev` (OpenSSL)
- `libdl` (dynamic linker)
- `libsqlite3` (loaded at runtime via `dlopen` )
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
- `curl` (for weather, forecast, and stock lookups)
- `bc` (for the calculator command)
2026-07-20 18:28:06 +02:00
- `git` (for the gitlog command)
2026-07-20 03:37:17 +02:00
- `date` (for timezone-aware time lookups)
2026-07-20 06:50:35 +02:00
- `tzdata` (optional — without it, `!time` falls back to 45 built-in timezones)
2026-07-14 23:52:56 +02:00
- `opencode` (for AI queries)
2026-06-07 01:50:05 +02:00
## Build
2026-07-23 01:46:37 +02:00
### Quick build
2026-06-07 01:50:05 +02:00
```sh
2026-07-23 01:46:37 +02:00
cmake -B build && cmake --build build
2026-06-07 01:50:05 +02:00
```
2026-07-23 01:46:37 +02:00
The binary is placed in `build/zynk` .
### Install
2026-06-07 01:50:05 +02:00
```sh
2026-07-23 01:46:37 +02:00
cmake --build build --target install
```
### Feature toggles
All commands are enabled by default. Disable any command at build time with `-DWITH_<FEATURE>=OFF` :
```sh
cmake -B build -DWITH_WEATHER=OFF -DWITH_AI=OFF
cmake --build build
```
Available options (the `!command` shown in parentheses):
| Option | Command | Description | Default |
|-------------------------|------------------|----------------------------------|---------|
| `WITH_ZYNK` | `!zynk` | Key-value store | ON |
| `WITH_PING` | `!ping` | Ping/pong | ON |
| `WITH_VERSION` | `!version` | Version info | ON |
| `WITH_HELP` | `!help` | Help listing | ON |
| `WITH_QUIT` | `!quit` / `!die` | Shut down the bot | ON |
| `WITH_WEATHER` | `!weather` | Weather lookup (requires curl) | ON |
| `WITH_FORECAST` | `!forecast` | 3-day forecast (requires curl) | ON |
| `WITH_STOCK` | `!stock` | Stock quotes (requires curl) | ON |
| `WITH_CALC` | `!calc` | Calculator (requires bc) | ON |
| `WITH_TIME` | `!time` | Time/timezone lookup | ON |
| `WITH_SEEN` | `!seen` | User tracking | ON |
| `WITH_TELL` | `!tell` | Offline messages | ON |
| `WITH_GITLOG` | `!gitlog` | Recent git commits | ON |
| `WITH_CHANGELOG` | `!changelog` | Changelog entries | ON |
| `WITH_AI` | `!ai` | AI questions (requires opencode) | ON |
| `WITH_CODE` | `!code` | AI code changes (ops only) | OFF |
| `WITH_REBUILD` | `!rebuild` | Rebuild & restart (ops only) | OFF |
| `WITH_UPTIME` | `!uptime` | Uptime display | ON |
| `WITH_RELOAD` | `!reload` | Hot reload (ops only) | ON |
| `WITH_RESTART` | `!restart` | Restart (ops only) | ON |
| `WITH_GREETING_OR_CHAT` | `<nick>: <text>` | Greeting/chat with AI fallback | ON |
### Minimal build
Disable everything except the core store, quit, and help:
```sh
cmake -B build \
-DWITH_PING=OFF -DWITH_VERSION=OFF -DWITH_WEATHER=OFF -DWITH_FORECAST=OFF \
-DWITH_STOCK=OFF -DWITH_CALC=OFF -DWITH_TIME=OFF -DWITH_SEEN=OFF \
-DWITH_TELL=OFF -DWITH_GITLOG=OFF -DWITH_CHANGELOG=OFF -DWITH_AI=OFF \
-DWITH_CODE=OFF -DWITH_REBUILD=OFF -DWITH_UPTIME=OFF -DWITH_RELOAD=OFF \
-DWITH_RESTART=OFF -DWITH_GREETING_OR_CHAT=OFF
cmake --build build
```
### Clean
```sh
rm -rf build
2026-06-07 01:50:05 +02:00
```
## Usage
```sh
2026-07-14 23:52:56 +02:00
./zynk [options]
2026-06-07 01:50:05 +02:00
```
### Options
2026-07-21 02:44:54 +02:00
| Option | Description |
|------------------|--------------------------------------------------------|
| `-ssl` | Enable TLS (auto-enabled on ports 6697/7000) |
| `-noverify` | Skip TLS certificate verification |
| `-server <host>` | IRC server (default: `irc.libera.chat` ) |
| `-port <p>` | Port (default: `6697` ) |
| `-pass <p>` | Server password |
| `-nick <n>` | Nickname (default: `zynk` ) |
| `-join <c>` | Auto-join channels, comma-separated (default: `#zynk` ) |
| `-opencode <p>` | Path to opencode binary (default: `/usr/bin/opencode` ) |
| `-h` | Show help |
2026-06-07 01:50:05 +02:00
### Example
```sh
2026-07-14 23:52:56 +02:00
./zynk -ssl -nick mybot -join "#mychan ,#myotherchan "
2026-06-07 01:50:05 +02:00
```
## IRC Commands
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
### General
2026-07-21 02:44:54 +02:00
| Command | Description |
|------------------|------------------------------|
| `!help` | List all available commands |
| `!version` | Show the bot version |
| `!ping` | Responds with `pong` |
| `!uptime` | Show bot uptime |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!quit` / `!die` | Shut down the bot (ops only) |
### Key-Value Store
2026-07-23 01:46:37 +02:00
| Command | Description |
|------------------------------|-----------------------------------------------|
| `!zynk <key>` | Look up a stored value |
| `!zynk <key> = <value>` | Store a value (key is lowercased) |
| `!zynk! <key> = <value>` | Overwrite an existing value (ops in channels) |
| `!zynk` | Get a random stored entry |
2026-06-07 01:50:05 +02:00
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
### Weather & Finance
2026-06-07 01:50:05 +02:00
2026-07-21 02:44:54 +02:00
| Command | Description |
|-------------------------------|---------------------------------------------------------|
| `!weather [city]` | Current weather (default: Berlin) |
| `!forecast [city]` | 3-day forecast (default: Berlin) |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!stock <SYMBOL>[,SYMBOL...]` | Stock quotes, up to 3 symbols (e.g. `!stock AAPL,MSFT` ) |
2026-06-07 01:50:05 +02:00
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
### Utilities
2026-06-07 01:50:05 +02:00
2026-07-21 14:08:53 +02:00
| Command | Description |
|-----------------------------|---------------------------------------------------------------------------------|
| `!calc <expression>` | Evaluate math (see below) |
| `!time [timezone]` | Show current time (see below) |
| `!seen <nick>` | Check when a user was last seen |
| `!tell <nick> <message>` | Leave a message for an offline user |
2026-07-23 01:46:37 +02:00
| `!gitlog [count]` | Show recent git commits with links (default: 5, max: 20) |
| `!changelog [count]` | Show changelog entries (default: 1, max: 10) |
2026-06-07 01:50:05 +02:00
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
#### Time (`!time`)
Shows the current date and time. Without arguments, displays the bot's local time. With a timezone argument, displays the time in that timezone using POSIX `TZ` format.
2026-07-20 06:59:46 +02:00
**Output format:** `YYYY-MM-DD HH:MM:SS`
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Examples:**
2026-07-21 02:44:54 +02:00
| Command | Description |
|--------------------------|-------------------------|
| `!time` | Bot's local time |
| `!time UTC` | Current UTC time |
| `!time US/Eastern` | US Eastern time |
| `!time US/Pacific` | US Pacific time |
| `!time Europe/Berlin` | Central European time |
| `!time Europe/London` | UK time |
| `!time Asia/Tokyo` | Japan time |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!time Australia/Sydney` | Australian Eastern time |
docs: document all undocumented functions, add built-in timezone table to README
- Added doc comments (/* ... */) to all 14 undocumented static functions in
zynk.c matching the existing documentation style (function name, description,
Parameters, Returns sections):
* DB ops: seen_update, seen_lookup, tell_add, tell_deliver
* String utils: valid_irc_word, normalize_city, collapse_spaces
* Command handlers: cmd_reload, cmd_time, cmd_seen, cmd_tell, cmd_greeting_or_chat
* Timezone helpers: tz_lookup, tz_format
- Added complete reference table of all 45 built-in timezones to README.md
with region, UTC offset, and DST support status, so users know which
timezones work without tzdata installed.
- Updated CHANGELOG.md v0.35.5 entry to reflect these additions.
- Clean build, zero warnings.
2026-07-20 05:06:50 +02:00
If the system has `tzdata` installed, any IANA/Olson timezone name works. Otherwise, the bot falls back to a built-in table with the following timezones:
**Built-in timezones (no tzdata required):**
2026-07-21 02:44:54 +02:00
| Timezone | Region | Offset | DST |
|---------------------------------------|-------------------|----------------|-----|
| `UTC` / `GMT` | Global | +0 | No |
| `EST` / `CST` / `MST` / `PST` / `HST` | US (fixed) | -5 to -10 | No |
| `US/Eastern` | US Eastern | -5 / -4 | Yes |
| `US/Central` | US Central | -6 / -5 | Yes |
| `US/Mountain` | US Mountain | -7 / -6 | Yes |
| `US/Pacific` | US Pacific | -8 / -7 | Yes |
| `US/Alaska` | US Alaska | -9 / -8 | Yes |
| `US/Honolulu` | US Hawaii | -10 | No |
| `Canada/Toronto` | Canada Eastern | -5 / -4 | Yes |
| `Canada/Vancouver` | Canada Pacific | -8 / -7 | Yes |
| `America/Sao_Paulo` | Brazil | -3 / -2 | Yes |
| `America/Mexico_City` | Mexico | -6 / -5 | Yes |
| `America/Argentina/Buenos_Aires` | Argentina | -3 | No |
| `Europe/London` | UK | 0 / +1 | Yes |
| `Europe/Berlin` | Central Europe | +1 / +2 | Yes |
| `Europe/Paris` | France | +1 / +2 | Yes |
| `Europe/Moscow` | Russia | +3 | No |
| `Europe/Istanbul` | Turkey | +3 | No |
| `Asia/Tokyo` | Japan | +9 | No |
| `Asia/Shanghai` | China | +8 | No |
| `Asia/Kolkata` | India | +5:30 | No |
| `Asia/Dubai` | UAE | +4 | No |
| `Asia/Singapore` | Singapore | +8 | No |
| `Asia/Seoul` | South Korea | +9 | No |
| `Asia/Hong_Kong` | Hong Kong | +8 | No |
| `Asia/Taipei` | Taiwan | +8 | No |
| `Australia/Sydney` | Australia Eastern | +10 / +11 | Yes |
| `Australia/Melbourne` | Australia Eastern | +10 / +11 | Yes |
| `Australia/Brisbane` | Australia Eastern | +10 | No |
| `Australia/Perth` | Australia Western | +8 | No |
| `Australia/Adelaide` | Australia Central | +9:30 / +10:30 | Yes |
| `Australia/Darwin` | Australia Central | +9:30 | No |
| `Pacific/Auckland` | New Zealand | +12 / +13 | Yes |
| `Pacific/Honolulu` | Hawaii | -10 | No |
| `Pacific/Fiji` | Fiji | +12 / +13 | Yes |
| `Africa/Cairo` | Egypt | +2 | No |
| `Africa/Johannesburg` | South Africa | +2 | No |
| `Africa/Lagos` | West Africa | +1 | No |
| `Africa/Nairobi` | East Africa | +3 | No |
| `Atlantic/Reykjavik` | Iceland | +0 | No |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
#### Calculator (`!calc`)
The calculator uses `bc -l` (POSIX arbitrary-precision calculator with the math library). Any valid `bc` expression works.
**Basic arithmetic:**
2026-07-21 02:44:54 +02:00
| Expression | Result |
|----------------|--------------------------|
| `!calc 2+2` | `4` |
| `!calc 100-37` | `63` |
| `!calc 6*7` | `42` |
| `!calc 100/3` | `33.3333333333333333333` |
| `!calc 10%3` | `1` |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Parentheses for grouping:**
2026-07-21 02:44:54 +02:00
| Expression | Result |
|--------------------|--------|
| `!calc (3+7)*2` | `20` |
| `!calc (100-50)/5` | `10` |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Powers:**
2026-07-21 02:44:54 +02:00
| Expression | Result |
|--------------|--------|
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!calc 2^10` | `1024` |
2026-07-21 02:44:54 +02:00
| `!calc 3^3` | `27` |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
2026-07-20 03:37:17 +02:00
**Constants:**
2026-07-21 02:44:54 +02:00
| Expression | Description |
|----------------|--------------------------------|
| `!calc pi()` | Pi (3.14159...) |
2026-07-20 03:37:17 +02:00
| `!calc pi()*2` | Circumference of a unit circle |
2026-07-21 02:44:54 +02:00
| `!calc pi()^2` | Pi squared |
2026-07-20 03:37:17 +02:00
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Math library functions** (enabled by `-l` ):
2026-07-21 02:44:54 +02:00
| Expression | Description |
|----------------|--------------------------|
| `!calc s(1)` | Sine of 1 (radians) |
| `!calc c(0)` | Cosine of 0 |
| `!calc a(1)` | Arctangent of 1 |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!calc l(100)` | Natural logarithm of 100 |
2026-07-21 02:44:54 +02:00
| `!calc e(1)` | e^1 |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Scale (decimal places):**
2026-07-21 02:44:54 +02:00
| Expression | Description |
|----------------------|-------------|
| `!calc scale=4; 1/3` | `0.3333` |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
**Variables and multi-statement:**
2026-07-21 02:44:54 +02:00
| Expression | Description |
|------------------|----------------------------|
| `!calc x=5; x*2` | `10` |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!calc 2+2; 3*3` | `4` (first line of output) |
### AI
2026-07-21 02:44:54 +02:00
| Command | Description |
|-----------------------|------------------------------------------------------------|
| `!ai <question>` | Ask the AI a question (plan mode, read-only) |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
| `!code <instruction>` | AI code change with auto-recompile (ops only, in channels) |
2026-07-21 02:44:54 +02:00
| `<nick>: <question>` | Address the bot by nick to ask the AI |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
### Admin (Ops Only)
2026-07-21 14:08:53 +02:00
| Command | Description |
|-----------------------|-------------------------------------------------------------------------------------|
2026-07-21 16:17:43 +02:00
| `!reload` | Hot reload (preserve IRC session, fork-in-place) |
| `!restart` | Restart the bot (preserves session, same as !reload) |
2026-07-21 14:08:53 +02:00
| `!rebuild [pull]` | Rebuild and restart (ops only, in channels; `pull` runs Git pull before rebuilding) |
| `!code <instruction>` | Make AI-powered code changes |
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
### Chat
2026-07-21 02:44:54 +02:00
| Command | Description |
|------------------------|-------------------------|
| `<nick>: hi/hello/hey` | Greeting response |
| `<nick>: bye` | Farewell response |
| `<nick>: <anything>` | AI-powered conversation |
2026-06-07 01:50:05 +02:00
## Database
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
Data is stored in `zynk.db` (SQLite3) in the working directory. The bot creates four tables:
2026-06-07 01:50:05 +02:00
2026-07-14 23:52:56 +02:00
- `zynk` - key-value pairs with nick and timestamp metadata
2026-06-29 17:00:08 +02:00
- `ai_pending` - single-row table for managing in-flight AI queries
v0.35.0: add !calc, !time, !seen, !tell commands
New IRC commands:
- !calc <expr>: evaluate math via bc -l (arithmetic, powers, trig, log, vars)
- !time [tz]: show current time in any IANA timezone
- !seen <nick>: track/query last-seen activity (auto-updated on speak/part/quit)
- !tell <nick> <msg>: leave offline messages, delivered when target speaks
Database:
- Added 'seen' table for user activity tracking (nick, timestamp, channel, action)
- Added 'tell' table for pending offline messages
Other changes:
- Updated !help to list all new commands
- Updated README.md with detailed docs for all commands including !calc
expression syntax and !time timezone examples
- Bumped version to 0.35.0
2026-07-20 02:43:21 +02:00
- `seen` - tracks when users were last seen (nick, timestamp, channel, action)
- `tell` - stores pending offline messages for delivery
2026-06-07 01:50:05 +02:00
## Architecture
2026-07-21 16:17:43 +02:00
`zynk` uses a single `poll()` loop with a 100 ms timeout. AI queries fork a child process that runs the `opencode` CLI; the parent picks up the result on the next poll iteration. SQLite3 is loaded at runtime via `dlopen` to avoid a compile-time dependency. The bot supports hot reload: `!reload` and `!restart` fork without exec, so the child inherits the live socket and SSL session — the bot stays connected, keeps its nick, and remains voiced in channels. `!rebuild` /`!code` do a clean QUIT+exec since the binary changed on disk.
2026-06-07 01:50:05 +02:00
## License
2026-06-07 01:52:28 +02:00
MIT - see LICENSE file.