Commit Graph

82 Commits

Author SHA1 Message Date
Re-bin
e1854c4373 feat: make Telegram reply-to-message behavior configurable, default false 2026-02-20 11:13:10 +00:00
Re-bin
44eb1bdca2 Merge branch 'main' into pr-815 2026-02-20 08:57:02 +00:00
Re-bin
2f315ec567 style: trim _on_help docstring 2026-02-20 08:39:26 +00:00
Re-bin
7957f84e3d Merge branch 'main' into pr-824 2026-02-20 08:36:34 +00:00
Re-bin
73fdd0dd45 fix: complete ensure_ascii=False and UTF-8 encoding migration 2026-02-20 07:59:32 +00:00
Re-bin
37252a4226 fix: complete loguru native formatting migration across all files 2026-02-20 07:55:34 +00:00
Nikolas de Hor
53b83a38e2 fix: use loguru native formatting to prevent KeyError on messages containing curly braces
Closes #857
2026-02-19 17:19:36 -03:00
Re-bin
3890f1a7dd refactor(feishu): clean up send() and remove dead code 2026-02-19 17:33:08 +00:00
Ubuntu
d08c022255 feat(feishu): support sending images, audio, and files
- Add image upload via im.v1.image.create API
- Add file upload via im.v1.file.create API
- Support sending images (.png, .jpg, .gif, etc.) as image messages
- Support sending audio (.opus) as voice messages
- Support sending other files as file messages
- Refactor send() to handle media attachments before text content
2026-02-19 16:31:00 +08:00
chtangwin
124c611426 Fix: Add ensure_ascii=False to WhatsApp send payload
The send() payload contains user message content (msg.content) which
may include non-ASCII characters (e.g. CJK, German umlauts, emoji).

The auth frame and Discord heartbeat/identify payloads are left
unchanged as they only carry ASCII protocol fields.
2026-02-18 18:46:23 -08:00
chtangwin
a2379a08ac Fix: Ensure UTF-8 encoding and ensure_ascii=False for remaining file/JSON operations 2026-02-18 18:37:17 -08:00
Nikolas de Hor
33d760d312 fix: handle /help command directly in Telegram, bypassing ACL check
The /help command was routed through _forward_command → _handle_message
→ is_allowed(), which denied access to users not in the allowFrom list.
Since /help is purely informational, it should be accessible to all
users — similar to how /start already works with its own handler.

Add a dedicated _on_help handler that replies directly without going
through the message bus access control.

Closes #687
2026-02-18 21:31:11 -03:00
Darye
3ac5513004 If given a message_id to telegram provider send, the bot will try to reply to that message 2026-02-18 20:27:48 +01:00
Hyudryu
72db01db63 slack: Added replyInThread logic and custom react emoji in config 2026-02-17 13:42:57 -08:00
Re-bin
5ad9c837df refactor: clean up telegram media sending logic 2026-02-17 10:37:55 +00:00
Darye
23b7e1ef5e Handle media files (voice messages, audio, images, documents) on Telegram Channel 2026-02-16 16:29:03 +01:00
Grzegorz Grasza
c9926153b2 Add table-to-text conversion for Slack messages
Slack has no native table support, so Markdown tables are passed
through verbatim by slackify-markdown.  Pre-process tables into
readable key-value rows before converting to mrkdwn.

Assisted-by: Claude 4.6 Opus (Anthropic)
2026-02-16 14:03:33 +01:00
Grzegorz Grasza
ed5593bbe0 slack: use slackify-markdown for proper mrkdwn formatting
Replace the regex-based Markdown-to-Slack converter with the
slackify-markdown library, which uses a proper Markdown parser
(markdown-it-py, already a dependency) to correctly handle headings,
bold/italic, code blocks, links, bullet lists, and strikethrough.

The regex approach didn't handle headings (###), bullet lists (* ),
or code block protection, causing raw Markdown to leak into Slack
messages.

Net -40 lines.

Assisted-by: Claude 4.6 Opus (Anthropic)
2026-02-16 13:56:30 +01:00
Re-bin
db0e8aa61b fix: handle Telegram message length limit with smart splitting 2026-02-16 12:39:39 +00:00
Re-bin
48a14edbda Merge branch 'main' into pr-694 2026-02-16 12:16:05 +00:00
Re-bin
ffbb264a5d fix: consistent sender_id for Telegram command allowlist matching 2026-02-16 12:11:03 +00:00
Re-bin
ba923c0205 Merge branch 'main' into pr-701 2026-02-16 12:07:58 +00:00
Re-bin
e8e7215d3e refactor: simplify Slack markdown-to-mrkdwn conversion 2026-02-16 11:57:55 +00:00
Aleksander W. Oleszkiewicz (Alek)
fe0341da5b Fix regex for URL formatting in Slack channel 2026-02-16 09:58:38 +01:00
Aleksander W. Oleszkiewicz (Alek)
5d683da38f Fix regex for URL and image URL formatting 2026-02-16 09:53:20 +01:00
Aleksander W. Oleszkiewicz (Alek)
90be900448 Enhance Slack message formatting with new regex rules
Added regex substitutions for strikethrough, URL formatting, and image URLs in Slack message conversion.
2026-02-16 09:49:44 +01:00
Thomas Lisankie
51d22b7ef4 Fix: _forward_command now builds sender_id with username for allowlist matching 2026-02-16 00:14:34 -05:00
zhouzhuojie
9bfc86af41 refactor(telegram): extract message splitting into helper function
- Added _split_message() helper for cleaner separation of concerns
- Simplified send() method by using the helper
- Net -18 lines for the message splitting feature
2026-02-15 22:49:01 +00:00
zhouzhuojie
203aa154d4 fix(telegram): split long messages to avoid Message is too long error
Telegram has a 4096 character limit per message. This fix:
- Splits messages longer than 4000 chars into multiple chunks
- Prefers breaking at newline boundaries to preserve formatting
- Falls back to space boundaries if no newlines available
- Forces split at max length if no good boundaries exist
- Adds comprehensive tests for message splitting logic
2026-02-15 22:39:31 +00:00
Aleksander W. Oleszkiewicz (Alek)
7e2d801ffc Implement markdown conversion for Slack messages
Add markdown conversion for Slack messages including italics, bold, and table formatting.
2026-02-15 15:51:19 +01:00
Ahwei
5e082690d8 refactor(feishu): support both direct and localized post content formats 2026-02-14 14:37:23 +08:00
Ahwei
4e4eb21d23 feat(feishu): Add rich text message content extraction feature
Newly added the _extract_post_text function to extract plain text content from Feishu rich text messages, supporting the parsing of titles, text, links, and @mentions.
2026-02-14 12:14:31 +08:00
Xubin Ren
3f59a8e234 Merge pull request #593 from C-Li/feishu_fix
Optimize the display of Markdown titles in Lark card information.
2026-02-13 17:02:27 +08:00
Ahwei
ccf9a6c146 fix(feishu): convert markdown headings to div elements in card messages
Markdown heading syntax (#) is not properly rendered in Feishu interactive
cards. Convert headings to div elements with lark_md format (bold text) for
proper display.

- Add _HEADING_RE regex to match markdown headings (h1-h6)
- Add _split_headings() method to parse and convert headings to div elements
- Update _build_card_elements() to process headings before markdown content
2026-02-13 15:31:30 +08:00
Re-bin
fd7e477b18 fix(security): bind WhatsApp bridge to localhost + optional token auth 2026-02-13 05:37:56 +00:00
Re-bin
903caaa642 feat: unified slash commands (/new, /help) across all channels 2026-02-13 03:30:21 +00:00
Re-bin
b429bf9381 fix: improve long-running stability for various channels 2026-02-12 01:20:57 +00:00
Re-bin
ba2bdb080d refactor: streamline mochat channel 2026-02-10 07:06:04 +00:00
Re-bin
d1f0615282 resolve conflicts with main; remove test_mochat_channel.py 2026-02-10 06:52:52 +00:00
Re-bin
4f928e9d2a feat: improve QQ channel setup guide and fix botpy intent flags 2026-02-09 16:17:35 +00:00
Re-bin
a63a44fa79 fix: align QQ channel with BaseChannel conventions, simplify implementation 2026-02-09 12:04:34 +00:00
Re-bin
2c45657b14 resolve merge conflicts: keep all channels and add QQ 2026-02-09 11:58:38 +00:00
Re-bin
f3ab8066a7 fix: use websockets backend, simplify subtype check, add Slack docs 2026-02-09 11:39:13 +00:00
Re-bin
74e3c411a1 resolve merge conflicts: keep all channels and add slack 2026-02-09 11:17:07 +00:00
tjb-tech
ef7972b6d3 Merge origin/main into feat/mochat-channel 2026-02-09 09:01:25 +00:00
tjb-tech
3779225917 refactor(channels): rename moltchat integration to mochat 2026-02-09 08:50:17 +00:00
tjb-tech
20b8a2fc58 feat(channels): add Moltchat websocket channel with polling fallback 2026-02-09 08:46:47 +00:00
yinwm
34dc933fce feat: add QQ channel integration with botpy SDK
Add official QQ platform support using botpy SDK with WebSocket connection.

Features:
- C2C (private message) support via QQ Open Platform
- WebSocket-based bot connection (no public IP required)
- Message deduplication with efficient deque-based LRU cache
- User whitelist support via allow_from configuration
- Clean async architecture using single event loop

Changes:
- Add QQChannel implementation in nanobot/channels/qq.py
- Add QQConfig schema with appId and secret fields
- Register QQ channel in ChannelManager
- Update README with QQ setup instructions
- Add qq-botpy dependency to pyproject.toml
- Add botpy.log to .gitignore

Setup:
1. Get AppID and Secret from q.qq.com
2. Configure in ~/.nanobot/config.json:
   {
     "channels": {
       "qq": {
         "enabled": true,
         "appId": "YOUR_APP_ID",
         "secret": "YOUR_APP_SECRET",
         "allowFrom": []
       }
     }
   }
3. Run: nanobot gateway

Note: Group chat support will be added in future updates.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 15:54:14 +08:00
Re-bin
d223454a98 fix: cap processed UIDs, move email docs into README, remove standalone guide 2026-02-09 06:19:35 +00:00
Re-bin
994f5601e9 resolve merge conflicts: keep both dingtalk and email channels 2026-02-09 06:02:36 +00:00