2
0
Fork 0
forked from zynk/zynk

Full forecast mode, 24h times, startup version, doc fixes. (0.40.5)

- Added 'full' keyword to !forecast: '!forecast frankfurt full' shows
  per-day detail lines with weather description, sunrise/sunset, and
  moonrise/moonset in 24-hour format, sent as separate IRC messages.
- Added to_24h() helper to convert wttr.in's 12-hour AM/PM astronomy
  times to 24-hour format (e.g. '05:20 AM' -> '05:20').
- Fixed missing first letter of weather descriptions in full mode
  ('value' offset was 11 instead of 10, skipping the first char).
- Startup message now includes the version: '[zynk 0.40.5] starting up'.
- Added doc comments to to_24h(), find_day_obj(), and other forecast
  helper functions with full parameter documentation.
- Fixed 'Not implemented...' fallback to only trigger when ! is
  followed by a letter (e.g. !foo), so bare ! or !!! no longer
  produce the message.
- Updated README.md to document !forecast [city] [full] syntax.
- Updated CHANGELOG.md with 0.40.5 entry.
This commit is contained in:
Johannes Findeisen 2026-07-23 23:52:18 +02:00
commit d4c1b7cfcf
6 changed files with 335 additions and 64 deletions

View file

@ -1,6 +1,6 @@
# zynk - Companion AI Logic Chatbot
# zynk - An IRC bot
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.
An 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.
## Features
@ -60,29 +60,29 @@ 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 |
| 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 (can not be disabled) |
| `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 (can not be disabled) |
### Minimal build
@ -153,11 +153,11 @@ rm -rf build
### Weather & Finance
| Command | Description |
|-------------------------------|---------------------------------------------------------|
| `!weather [city]` | Current weather (default: Berlin) |
| `!forecast [city]` | 3-day forecast (default: Berlin) |
| `!stock <SYMBOL>[,SYMBOL...]` | Stock quotes, up to 3 symbols (e.g. `!stock AAPL,MSFT`) |
| Command | Description |
|-------------------------------|-----------------------------------------------------------------------------------------------------|
| `!weather [city]` | Current weather (default: Berlin) |
| `!forecast [city] [full]` | 3-day forecast; `full` adds weather description, sunrise/sunset, moonrise/moonset (default: Berlin) |
| `!stock <SYMBOL>[,SYMBOL...]` | Stock quotes, up to 3 symbols (e.g. `!stock AAPL,MSFT`) |
### Utilities