2
0
Fork 0
forked from zynk/zynk
Commit graph

24 commits

Author SHA1 Message Date
19b07fa76f Wikipedia search command (!wp), version 0.43.0
- Add !wp <search terms> command: searches Wikipedia via MediaWiki API
  (action=query&list=search), displays article titles, snippets, and links.
  Single-result mode fetches the first chapter via Extracts API (exchars=800);
  multi-result mode shows a numbered list with short snippets and per-result
  Read full article links.
- Add self-contained JSON parser helpers: wp_json_get_string(),
  wp_json_next_array_item(), wp_decode_json_string() with \uXXXX Unicode
  support.
- Add wp_url_encode() (RFC 3986), wp_codepoint_to_utf8(), wp_strip_html(),
  wp_collapse_spaces(), wp_hex_digit().
- Add WITH_WP CMake feature toggle (ON by default, HAS_CMD_WP compile def).
- Add !wp to the !help command listing.
- Add doc comments to all 9 functions in cmd_wp.h.
- Update CHANGELOG.md with 0.43.0 entry.
- Update README.md: add Wikipedia to features list, feature toggles table,
  IRC commands utilities table, and minimal build command.
2026-07-26 00:23:38 +02:00
d59d4dc46c Add !yt YouTube title lookup command via oEmbed API. (0.41.0)
Added new !yt command (cmd_yt.h) that fetches the title and channel name
of a YouTube video using the YouTube oEmbed API. The video URL is
percent-encoded via a new yt_url_encode() helper before being passed as a
query parameter. The JSON response is parsed for 'title' and 'author_name'
fields using the existing json_find() helper, and the result is formatted
as 'Title - Channel'.

- New file: cmd_yt.h with yt_url_encode() and cmd_yt() command handler
- CMakeLists.txt: added WITH_YT feature toggle (ON by default)
- zynk.c: added conditional #include for cmd_yt.h
- irc.h: added cmd_yt() dispatch in handle_privmsg()
- cmd_help.h: added !yt <url> to the help listing
- zynk.c: added doc comments to json_find() function
- cmd_yt.h: added doc comments to yt_url_encode() and cmd_yt()
- CHANGELOG.md: added 0.41.0 entry documenting all changes
- README.md: updated feature summary, features list, feature toggles
  table, minimal build command, and IRC commands utilities table
2026-07-25 02:17:59 +02:00
3b863d581d Strip trailing space from wttr.in weather descriptions. (0.40.6)
- Fixed trailing space in weather descriptions from wttr.in (e.g.
  'Partly Cloudy ' -> 'Partly Cloudy'), which caused a stray space
  before the closing parenthesis in !forecast full output (e.g.
  '(Partly Cloudy )' instead of '(Partly Cloudy)').
- Applied the same trailing-space fix to the cond field used by
  non-full !forecast and !weather.
- Updated CHANGELOG.md with 0.40.6 entry.
2026-07-24 01:42:13 +02:00
d4c1b7cfcf 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.
2026-07-23 23:52:18 +02:00
1f9f4b60f5 Raise AI code mode limit, simplify plan mode prompt. (0.40.4)
- Increased AI code mode response limit back to 2000 chars (was reduced
  to 1000 in 0.40.3, but code changes need more room).
- Simplified the AI plan mode system prompt further: removed the explicit
  'tell them you are in plan mode' instruction, keeping it to a short
  'You are in plan mode. Answer briefly.' directive.
- Fixed !gitlog default count in README.md from 5 to 1 (matching the
  actual GITLOG_COUNT value set in 0.38.2).
- Re-aligned the utilities command table in README.md for cleaner
  formatting.
- Minor grammar and punctuation fixes across older changelog entries.
2026-07-23 21:34:12 +02:00
db72b957b8 Simplify CMake feature loop, adjust AI response limits. (0.40.3)
- Refactored CMake feature configuration: merged the two separate
  foreach loops (one for building _cmd_defs and one for printing status)
  into a single loop, removing redundant iteration. Improved the status
  banner formatting for clearer feature configuration output.
- Reduced AI code mode response limit from 2000 to 1000 chars to keep
  IRC replies concise.
- Increased AI plan mode response limit from 800 to 1000 chars, giving
  slightly more room for explanations.
- Simplified AI plan mode system prompt description for clarity.
- Fixed minor whitespace alignment in README.md command table.
2026-07-23 21:15:44 +02:00
739e3622b5 Commit links for !gitlog, full changelog link for !changelog, CMake, multi-file refactor
- !gitlog now shows a link to each commit in the repository, using the
  git remote URL converted from SSH/SCP to HTTPS
- !changelog now shows a 'Full changelog: <url>' link to CHANGELOG.md
  in the repository as the last message after all entries
- Removed 'full' keyword from !gitlog and !changelog (previously showed
  full commit messages and complete changelog entries)
- Switched build system from Make to CMake with feature toggles
  (-DWITH_<FEATURE>=ON/OFF)
- Refactored single-file codebase into dedicated header files: each
  command now lives in its own cmd_*.h file, with separate modules for
  database (db.h), IRC protocol (irc.h), networking (net.h), TLS (tls.h),
  and AI (ai.h)
- Updated README.md to reflect the simplified !gitlog and !changelog
  syntax and the new CMake build instructions

(0.40.0)
2026-07-23 01:46:37 +02:00
738323ebaf Hot reload preserves IRC session (nick, channels, voice). (0.39.0) 2026-07-21 16:17:43 +02:00
52b1627d69 Full mode for !gitlog/!changelog, optional pull for !rebuild. (0.38.2)
- Added optional full keyword to !gitlog and !changelog for showing
  full commit messages and changelog entries instead of just headers.
- !gitlog full uses git log (without --oneline) and strips leading
  indentation from commit blocks, collapses multiple spaces.
- !changelog full collects full entry text with bullet points and
  shows the newest entries (first N in file, not last N).
- Added optional pull argument to !rebuild: !rebuild pull runs git
  pull before make clean/make, plain !rebuild only rebuilds.
- Added collapse_spaces() call in !gitlog oneline path to remove
  double spaces in compact output.
- Changed default GITLOG_COUNT and CHANGELOG_COUNT from 5 to 1.
- Reduced GITLOG_MAX from 10 to 5.
- Updated !help text to document [full] and [pull] options.
- Updated README.md with full option for !gitlog/!changelog and
  pull option for !rebuild.
- Added CHANGELOG.md entry for v0.38.2.
2026-07-21 14:08:53 +02:00
e254b64745 Add !changelog command, reduce GITLOG_MAX and CHANGELOG_MAX (0.38.0)
- Added !changelog [count] command: displays the latest changelog entries
  from CHANGELOG.md. Defaults to 5 entries (CHANGELOG_COUNT), accepts 1-10
  as count. Each entry title is sent as a separate IRC message with a
  200ms delay to avoid IRC server flood protection.
- Reduced GITLOG_MAX and CHANGELOG_MAX from 20 to 10.
- Rewrote cmd_changelog to use getline() for robust line reading and
  isdigit() checks for reliable date pattern detection.
- Updated !help to list !changelog.
- Updated README.md with !changelog documentation and corrected max values.
- Added CHANGELOG.md entry for v0.38.0.
- Version bumped to 0.38.0.
2026-07-21 02:44:54 +02:00
caa70ee448 feat: add !rebuild command for git pull + make + restart (0.37.0)
Added !rebuild op-only command that runs git pull, make clean, and make
in sequence, then triggers hot reload on success. Reports build errors
from stderr if any step fails. Updated !help and README.md docs.
2026-07-20 23:14:26 +02:00
01a51c17e5 feat: add !gitlog command to display recent git commits
Add !gitlog [count] IRC command that runs 'git log --oneline' and
sends each commit as a separate PRIVMSG. Defaults to GITLOG_COUNT (5)
commits when no argument is provided; accepts 1-20 as count.

- Fork/exec pattern consistent with existing !calc command
- Rate-limited per-nick like all other commands
- Listed in !help output
- Added git to README.md requirements
- Documented in README.md utilities section
- Added changelog entry for v0.36.0
2026-07-20 18:28:06 +02:00
9ba0601f5a feat: remove timezone abbreviation from !time response
The !time command now outputs only date and time (YYYY-MM-DD HH:MM:SS)
without the timezone abbreviation. This keeps responses shorter and
cleaner in IRC. Removed the dead abbreviation-matching code from
tz_format() which previously mapped 45 IANA timezone names to their
respective abbreviations (CEST, EDT, JST, etc.). Updated README to
reflect the new output format.
2026-07-20 06:59:46 +02:00
c3e92b27b1 readme: add tzdata as optional requirement for full timezone support 2026-07-20 06:50:35 +02:00
18dfa64acc 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
9ab428ef9a update README with !calc pi() docs and date requirement 2026-07-20 03:37:17 +02:00
c554ed60d9 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
999814e5df Added !help command to list available bot commands. 2026-07-15 21:12:29 +02:00
2247b9a480 Renamed calc to zynk and refactored all relevant parts. 2026-07-14 23:52:56 +02:00
Armin
e2ed06a0f1 — -> - 2026-06-29 17:00:08 +02:00
Armin
965e5e5fc1 update README 2026-06-07 22:18:34 +02:00
Armin
4707c8304f update LICENSE / README 2026-06-07 01:52:28 +02:00
Armin
ea1dd23c59 init 2026-06-07 01:50:05 +02:00
Armin
8e86ff746e Initial commit 2026-06-07 01:49:31 +02:00