Compare commits
12 Commits
23548be6ad
...
cd2266e249
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd2266e249 | ||
|
|
e4984d607d | ||
|
|
76f564ae83 | ||
|
|
45a2ee8e1d | ||
|
|
44a080cc13 | ||
|
|
d0ca96191c | ||
|
|
e42e5ca563 | ||
|
|
e4421d7bc9 | ||
|
|
eaaa297d9e | ||
|
|
e5d562ef70 | ||
|
|
bec7f13d82 | ||
|
|
03999875b5 |
362
bot.log
Normal file
362
bot.log
Normal file
@@ -0,0 +1,362 @@
|
|||||||
|
[2026-02-09 18:50:22,298] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] Bot startup
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:50:22,298] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 18:50:22,299] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 18:50:22,299] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 18:50:22,299] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 18:50:23,017] [INFO ] Shard ID None has connected to Gateway (Session ID: 8b3b9dcded2207fd246768c4001697f4).
|
||||||
|
[2026-02-09 18:50:25,020] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 18:50:25,021] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 18:51:46,921] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:51:46,921] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:51:46,921] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:51:46,922] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 18:51:47,467] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 18:51:47,491] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 18:51:47,492] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 18:51:47,493] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 18:51:47,950] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 300
|
||||||
|
[2026-02-09 18:51:47,950] [WARNING ] Tududi error: 201
|
||||||
|
[2026-02-09 18:51:47,951] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
[2026-02-09 18:51:48,299] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:51:48,299] [INFO ] Updated tracker, total links: 3
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] Bot startup
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:56:31,691] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 18:56:31,692] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 18:56:31,692] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 18:56:31,692] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 18:56:32,615] [INFO ] Shard ID None has connected to Gateway (Session ID: 09e45e9c8641de84053a5c464a702441).
|
||||||
|
[2026-02-09 18:56:34,643] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 18:56:34,643] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 18:58:15,792] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:58:15,792] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:58:15,792] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:58:15,793] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 18:58:16,377] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 18:58:16,400] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 18:58:16,401] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 18:58:16,415] [WARNING ] Sub-agent error: /usr/bin/python3: No module named openclaw
|
||||||
|
|
||||||
|
[2026-02-09 18:58:16,416] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 18:58:16,416] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 18:58:17,077] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 364
|
||||||
|
[2026-02-09 18:58:17,077] [INFO ] ✓ Added to Tududi inbox with tag: interesting
|
||||||
|
[2026-02-09 18:58:17,078] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
🏷️ Tag: `interesting`
|
||||||
|
[2026-02-09 18:58:17,370] [ERROR ] ❌ Error processing https://github.com/kiranshila/Doplarr: name 'analysis' is not defined
|
||||||
|
[2026-02-09 18:58:17,603] [INFO ] Updated tracker, total links: 3
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] Bot startup
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] ============================================================
|
||||||
|
[2026-02-09 18:59:15,471] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 18:59:15,471] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 18:59:15,472] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 18:59:15,472] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 18:59:16,322] [INFO ] Shard ID None has connected to Gateway (Session ID: 95fc1aa438f4a70b8226682da4796d15).
|
||||||
|
[2026-02-09 18:59:18,359] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 18:59:18,359] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:00:17,734] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:00:17,735] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:00:17,735] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:00:17,736] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:00:18,371] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:00:18,393] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:00:18,394] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:00:18,408] [WARNING ] Sub-agent error: /usr/bin/python3: No module named openclaw
|
||||||
|
|
||||||
|
[2026-02-09 19:00:18,408] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:00:18,408] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:00:18,857] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 364
|
||||||
|
[2026-02-09 19:00:18,857] [INFO ] ✓ Added to Tududi inbox with tag: interesting
|
||||||
|
[2026-02-09 19:00:18,858] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
🏷️ Tag: `interesting`
|
||||||
|
[2026-02-09 19:00:19,288] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:00:19,288] [INFO ] Updated tracker, total links: 4
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:05:37,565] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:05:37,565] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:05:37,566] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:05:37,566] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:05:38,374] [INFO ] Shard ID None has connected to Gateway (Session ID: 9f0b1790c433f5d72fab2358de9a0b79).
|
||||||
|
[2026-02-09 19:05:40,376] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:05:40,376] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:09:35,451] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:09:35,451] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:09:35,451] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:09:35,452] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:09:35,994] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:09:36,018] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:09:36,019] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:09:36,019] [DEBUG ] ✓ Tag: project, Summary: GitHub repository: Doplarr
|
||||||
|
[2026-02-09 19:09:36,019] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:09:36,020] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:09:36,484] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 448
|
||||||
|
[2026-02-09 19:09:36,484] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:09:36,485] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 GitHub repository: Doplarr
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:09:36,784] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:09:36,784] [INFO ] Updated tracker, total links: 5
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:11:47,526] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:11:47,526] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:11:47,527] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:11:47,527] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:11:48,381] [INFO ] Shard ID None has connected to Gateway (Session ID: 6bb2221d75c5e8ca8c2cfaecf9a62aa5).
|
||||||
|
[2026-02-09 19:11:50,384] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:11:50,384] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:13:02,447] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:13:02,447] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:13:02,447] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:13:02,448] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:13:03,059] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:13:03,081] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:13:03,082] [DEBUG ] 📊 Fetch status: ok
|
||||||
|
[2026-02-09 19:13:03,082] [DEBUG ] 🔍 Starting analysis...
|
||||||
|
[2026-02-09 19:13:03,082] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:13:03,082] [DEBUG ] Content length: 4000 chars
|
||||||
|
[2026-02-09 19:13:03,082] [DEBUG ] Link type: GitHub
|
||||||
|
[2026-02-09 19:13:03,083] [INFO ] ✓ Analysis complete - Tag: project, Summary: GitHub repository: Doplarr
|
||||||
|
[2026-02-09 19:13:03,083] [DEBUG ] Returning: {'summary': 'GitHub repository: Doplarr', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:13:03,083] [DEBUG ] Analysis result: {'summary': 'GitHub repository: Doplarr', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:13:03,083] [DEBUG ] ✓ Got summary: GitHub repository: Doplarr
|
||||||
|
[2026-02-09 19:13:03,083] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:13:03,083] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:13:03,563] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 448
|
||||||
|
[2026-02-09 19:13:03,563] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:13:03,563] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 GitHub repository: Doplarr
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:13:03,913] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:13:03,913] [INFO ] Updated tracker, total links: 6
|
||||||
|
[2026-02-09 19:13:41,144] [DEBUG ] No URLs in message from w_shark7
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:17:43,586] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:17:43,586] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:17:43,587] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:17:43,587] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:17:44,351] [INFO ] Shard ID None has connected to Gateway (Session ID: 51492ca6056049f95f0e4e098e65f548).
|
||||||
|
[2026-02-09 19:17:46,365] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:17:46,365] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:18:49,206] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:18:49,206] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:18:49,206] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:18:49,207] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:18:49,796] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:18:49,818] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:18:49,819] [DEBUG ] 📊 Fetch status: ok
|
||||||
|
[2026-02-09 19:18:49,819] [DEBUG ] 🔍 Starting analysis...
|
||||||
|
[2026-02-09 19:18:49,819] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:18:49,820] [DEBUG ] Extracted 35 chars of clean text
|
||||||
|
[2026-02-09 19:18:49,820] [DEBUG ] Sending to gateway for analysis...
|
||||||
|
[2026-02-09 19:18:49,820] [DEBUG ] Starting new HTTP connection (1): 127.0.0.1:18789
|
||||||
|
[2026-02-09 19:18:49,826] [DEBUG ] http://127.0.0.1:18789 "POST /sessions/turn HTTP/1.1" 405 18
|
||||||
|
[2026-02-09 19:18:49,826] [WARNING ] Gateway error 405, falling back to heuristic
|
||||||
|
[2026-02-09 19:18:49,826] [DEBUG ] Analysis result: {'summary': ':root { --tab-size-preference: 4; }', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:18:49,826] [DEBUG ] ✓ Got summary: :root { --tab-size-preference: 4; }
|
||||||
|
[2026-02-09 19:18:49,826] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:18:49,827] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:18:50,284] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 455
|
||||||
|
[2026-02-09 19:18:50,284] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:18:50,285] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 :root { --tab-size-preference: 4; }
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:18:50,677] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:18:50,677] [INFO ] Updated tracker, total links: 7
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:19:40,320] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:19:40,321] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:19:40,321] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:19:40,321] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:19:41,140] [INFO ] Shard ID None has connected to Gateway (Session ID: 9d502bdb80214f7e97213acc212a7792).
|
||||||
|
[2026-02-09 19:19:43,143] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:19:43,143] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:20:13,512] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:20:13,512] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:20:13,512] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:20:13,513] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:20:14,103] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:20:14,126] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:20:14,126] [DEBUG ] 📊 Fetch status: ok
|
||||||
|
[2026-02-09 19:20:14,127] [DEBUG ] 🔍 Starting analysis...
|
||||||
|
[2026-02-09 19:20:14,127] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:20:14,127] [DEBUG ] Extracted 24 chars of clean text
|
||||||
|
[2026-02-09 19:20:14,127] [DEBUG ] Sending to gateway for analysis...
|
||||||
|
[2026-02-09 19:20:14,128] [DEBUG ] Starting new HTTP connection (1): 127.0.0.1:18789
|
||||||
|
[2026-02-09 19:20:14,133] [DEBUG ] http://127.0.0.1:18789 "POST /sessions/turn HTTP/1.1" 405 18
|
||||||
|
[2026-02-09 19:20:14,133] [WARNING ] Gateway error 405, falling back to heuristic
|
||||||
|
[2026-02-09 19:20:14,133] [DEBUG ] Analysis result: {'summary': '(Content not accessible)', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:20:14,133] [DEBUG ] ✓ Got summary: (Content not accessible)
|
||||||
|
[2026-02-09 19:20:14,133] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:20:14,134] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:20:14,580] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 445
|
||||||
|
[2026-02-09 19:20:14,580] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:20:14,581] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 (Content not accessible)
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:20:14,984] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:20:14,984] [INFO ] Updated tracker, total links: 8
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:23:15,445] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:23:15,446] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:23:15,446] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:23:15,446] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:23:16,532] [INFO ] Shard ID None has connected to Gateway (Session ID: 5d75f8182f41a6b5f5c458ad4a84f609).
|
||||||
|
[2026-02-09 19:23:18,535] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:23:18,535] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:24:04,358] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:24:04,358] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:24:04,358] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:24:04,359] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:24:05,005] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:24:05,029] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:24:05,030] [DEBUG ] 📊 Fetch status: ok
|
||||||
|
[2026-02-09 19:24:05,030] [DEBUG ] 🔍 Starting analysis...
|
||||||
|
[2026-02-09 19:24:05,030] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:24:05,030] [DEBUG ] Fetching GitHub repo info from API
|
||||||
|
[2026-02-09 19:24:05,031] [DEBUG ] Starting new HTTPS connection (1): api.github.com:443
|
||||||
|
[2026-02-09 19:24:05,292] [DEBUG ] https://api.github.com:443 "GET /repos/kiranshila/Doplarr/readme HTTP/1.1" 200 1517
|
||||||
|
[2026-02-09 19:24:05,292] [DEBUG ] Got README: 1514 chars
|
||||||
|
[2026-02-09 19:24:05,293] [DEBUG ] Extracted 1514 chars of content
|
||||||
|
[2026-02-09 19:24:05,294] [DEBUG ] Sending to gateway for analysis...
|
||||||
|
[2026-02-09 19:24:05,294] [DEBUG ] Starting new HTTP connection (1): 127.0.0.1:18789
|
||||||
|
[2026-02-09 19:24:05,299] [DEBUG ] http://127.0.0.1:18789 "POST /sessions/turn HTTP/1.1" 405 18
|
||||||
|
[2026-02-09 19:24:05,299] [WARNING ] Gateway error 405, falling back to heuristic
|
||||||
|
[2026-02-09 19:24:05,299] [DEBUG ] Analysis result: {'summary': '<p align="center">\n <img src="https://raw', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:24:05,299] [DEBUG ] ✓ Got summary: <p align="center">
|
||||||
|
<img src="https://raw
|
||||||
|
[2026-02-09 19:24:05,299] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:24:05,300] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:24:05,782] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 466
|
||||||
|
[2026-02-09 19:24:05,782] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:24:05,783] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 <p align="center">
|
||||||
|
<img src="https://raw
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:24:06,267] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:24:06,268] [INFO ] Updated tracker, total links: 9
|
||||||
|
[2026-02-09 19:29:13,430] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:29:13,430] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:29:13,430] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:29:13,430] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:29:13,430] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:29:13,431] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:29:13,431] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:29:13,431] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:29:13,431] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:29:13,431] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:29:14,527] [INFO ] Shard ID None has connected to Gateway (Session ID: 391db5ec2964e4409f6ebbe6a8cd8c84).
|
||||||
|
[2026-02-09 19:29:16,531] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:29:16,531] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:30:24,149] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:30:24,149] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:30:24,150] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:30:24,150] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:30:24,703] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:30:24,726] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:30:24,727] [DEBUG ] 📊 Fetch status: ok
|
||||||
|
[2026-02-09 19:30:24,727] [DEBUG ] 🔍 Starting analysis...
|
||||||
|
[2026-02-09 19:30:24,727] [DEBUG ] 🤖 Analyzing content: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:30:24,727] [DEBUG ] Fetching GitHub repo info from API
|
||||||
|
[2026-02-09 19:30:24,728] [DEBUG ] Starting new HTTPS connection (1): api.github.com:443
|
||||||
|
[2026-02-09 19:30:24,977] [DEBUG ] https://api.github.com:443 "GET /repos/kiranshila/Doplarr/readme HTTP/1.1" 200 1517
|
||||||
|
[2026-02-09 19:30:24,977] [DEBUG ] Got README: 1357 chars after cleaning
|
||||||
|
[2026-02-09 19:30:24,978] [DEBUG ] Extracted 1357 chars of content
|
||||||
|
[2026-02-09 19:30:24,978] [DEBUG ] Sending to gateway for analysis...
|
||||||
|
[2026-02-09 19:30:24,979] [DEBUG ] Starting new HTTP connection (1): 127.0.0.1:18789
|
||||||
|
[2026-02-09 19:30:24,983] [DEBUG ] http://127.0.0.1:18789 "POST /sessions/turn HTTP/1.1" 405 18
|
||||||
|
[2026-02-09 19:30:24,983] [WARNING ] Gateway error 405, falling back to heuristic
|
||||||
|
[2026-02-09 19:30:24,984] [DEBUG ] Analysis result: {'summary': '<p align="center"> <img src="https://raw', 'tag': 'project', 'relevance': 'relevant'}
|
||||||
|
[2026-02-09 19:30:24,984] [DEBUG ] ✓ Got summary: <p align="center"> <img src="https://raw
|
||||||
|
[2026-02-09 19:30:24,984] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:30:24,984] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:30:25,440] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 462
|
||||||
|
[2026-02-09 19:30:25,440] [INFO ] ✓ Added to Tududi inbox with tag: project
|
||||||
|
[2026-02-09 19:30:25,441] [DEBUG ] Posting response: 📌 **GitHub**: Doplarr
|
||||||
|
|
||||||
|
💡 <p align="center"> <img src="https://raw
|
||||||
|
|
||||||
|
🏷️ Tag: `project`
|
||||||
|
[2026-02-09 19:30:25,731] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:30:25,732] [INFO ] Updated tracker, total links: 10
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] Bot startup
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] Channel ID: 1467557082583535729
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] Tududi API: https://todo.dilain.com/api/v1
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] Gateway: http://127.0.0.1:18789
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] ============================================================
|
||||||
|
[2026-02-09 19:32:31,351] [INFO ] Starting bot...
|
||||||
|
[2026-02-09 19:32:31,351] [WARNING ] PyNaCl is not installed, voice will NOT be supported
|
||||||
|
[2026-02-09 19:32:31,352] [DEBUG ] Using selector: EpollSelector
|
||||||
|
[2026-02-09 19:32:31,352] [INFO ] logging in using static token
|
||||||
|
[2026-02-09 19:32:32,179] [INFO ] Shard ID None has connected to Gateway (Session ID: 66e14ae3f40a0ce4fbce59d63b5531ae).
|
||||||
|
[2026-02-09 19:32:34,191] [INFO ] ✅ Bot logged in as Remora#5747
|
||||||
|
[2026-02-09 19:32:34,191] [INFO ] 📍 Watching channel #remora (1467557082583535729)
|
||||||
|
[2026-02-09 19:33:43,539] [INFO ] 🔗 New link(s) from w_shark7: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:33:43,539] [INFO ] Processing: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:33:43,539] [DEBUG ] 📥 Fetching: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:33:43,540] [DEBUG ] Starting new HTTPS connection (1): github.com:443
|
||||||
|
[2026-02-09 19:33:44,115] [DEBUG ] https://github.com:443 "GET /kiranshila/Doplarr HTTP/1.1" 200 None
|
||||||
|
[2026-02-09 19:33:44,138] [DEBUG ] ✓ Fetched: Doplarr
|
||||||
|
[2026-02-09 19:33:44,138] [DEBUG ] Analyzing...
|
||||||
|
[2026-02-09 19:33:44,139] [DEBUG ] 🤖 Analyzing with Haiku: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:33:44,139] [DEBUG ] Sending to Haiku...
|
||||||
|
[2026-02-09 19:33:44,139] [DEBUG ] Starting new HTTP connection (1): 127.0.0.1:18789
|
||||||
|
[2026-02-09 19:33:44,145] [DEBUG ] http://127.0.0.1:18789 "POST /sessions/turn HTTP/1.1" 405 18
|
||||||
|
[2026-02-09 19:33:44,145] [WARNING ] Gateway error: 405
|
||||||
|
[2026-02-09 19:33:44,145] [DEBUG ] 📌 Adding to Tududi: Doplarr
|
||||||
|
[2026-02-09 19:33:44,146] [DEBUG ] Starting new HTTPS connection (1): todo.dilain.com:443
|
||||||
|
[2026-02-09 19:33:44,595] [DEBUG ] https://todo.dilain.com:443 "POST /api/v1/inbox HTTP/1.1" 201 346
|
||||||
|
[2026-02-09 19:33:44,595] [INFO ] ✓ Added to Tududi
|
||||||
|
[2026-02-09 19:33:44,596] [DEBUG ] Posting response...
|
||||||
|
[2026-02-09 19:33:44,878] [INFO ] ✓ Processed: https://github.com/kiranshila/Doplarr
|
||||||
|
[2026-02-09 19:33:44,879] [INFO ] Updated tracker: 11 links total
|
||||||
277
bot.py
277
bot.py
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Discord bot for #remora channel - analyzes links in real-time
|
Discord bot for #remora channel - analyzes links in real-time with Haiku
|
||||||
Posts summaries, adds to Tududi inbox, maintains JSON history
|
Fetches content, sends to gateway for AI analysis, adds to Tududi inbox
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
@@ -12,17 +12,38 @@ import requests
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
import logging
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
# Load .env file
|
# Load .env file
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
# Setup logging
|
||||||
|
log_file = Path(__file__).parent / "bot.log"
|
||||||
|
logging.basicConfig(
|
||||||
|
level=logging.DEBUG,
|
||||||
|
format='[%(asctime)s] [%(levelname)-8s] %(message)s',
|
||||||
|
handlers=[
|
||||||
|
logging.FileHandler(log_file),
|
||||||
|
logging.StreamHandler()
|
||||||
|
]
|
||||||
|
)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Config
|
# Config
|
||||||
CHANNEL_ID = 1467557082583535729
|
CHANNEL_ID = 1467557082583535729
|
||||||
TRACKER_FILE = Path(__file__).parent / "tracker.json"
|
TRACKER_FILE = Path(__file__).parent / "tracker.json"
|
||||||
TUDUDI_API_URL = os.getenv("TUDUDI_API_URL", "https://todo.dilain.com/api/v1")
|
TUDUDI_API_URL = os.getenv("TUDUDI_API_URL", "https://todo.dilain.com/api/v1")
|
||||||
TUDUDI_API_KEY = os.getenv("TUDUDI_API_KEY")
|
TUDUDI_API_KEY = os.getenv("TUDUDI_API_KEY")
|
||||||
GATEWAY_URL = os.getenv("OPENCLAW_GATEWAY", "http://127.0.0.1:18789")
|
GATEWAY_URL = os.getenv("OPENCLAW_GATEWAY", "http://127.0.0.1:18789")
|
||||||
GATEWAY_TOKEN = os.getenv("OPENCLAW_GATEWAY_TOKEN")
|
GATEWAY_TOKEN = os.getenv("OPENCLAW_GATEWAY_TOKEN", "")
|
||||||
|
|
||||||
|
logger.info("=" * 60)
|
||||||
|
logger.info("Bot startup")
|
||||||
|
logger.info(f" Channel ID: {CHANNEL_ID}")
|
||||||
|
logger.info(f" Tududi API: {TUDUDI_API_URL}")
|
||||||
|
logger.info(f" Gateway: {GATEWAY_URL}")
|
||||||
|
logger.info("=" * 60)
|
||||||
|
|
||||||
# Load or init tracker
|
# Load or init tracker
|
||||||
def load_tracker():
|
def load_tracker():
|
||||||
@@ -44,56 +65,156 @@ def extract_urls(text):
|
|||||||
url_pattern = r'https?://[^\s<>"{}|\\^`\[\]]+'
|
url_pattern = r'https?://[^\s<>"{}|\\^`\[\]]+'
|
||||||
return re.findall(url_pattern, text)
|
return re.findall(url_pattern, text)
|
||||||
|
|
||||||
# Fetch and analyze URL
|
# Detect link type
|
||||||
def analyze_url(url):
|
def detect_link_type(url):
|
||||||
"""Fetch URL and create summary"""
|
domain = urlparse(url).netloc.lower()
|
||||||
|
|
||||||
|
if "github.com" in domain:
|
||||||
|
return "GitHub"
|
||||||
|
elif "reddit.com" in domain:
|
||||||
|
return "Reddit"
|
||||||
|
elif "youtube.com" in domain or "youtu.be" in domain:
|
||||||
|
return "YouTube"
|
||||||
|
elif "tiktok.com" in domain:
|
||||||
|
return "TikTok"
|
||||||
|
elif "twitter.com" in domain or "x.com" in domain:
|
||||||
|
return "Twitter/X"
|
||||||
|
elif "medium.com" in domain:
|
||||||
|
return "Medium"
|
||||||
|
elif "dev.to" in domain:
|
||||||
|
return "Dev.to"
|
||||||
|
elif "arxiv.org" in domain:
|
||||||
|
return "arXiv"
|
||||||
|
else:
|
||||||
|
return "Article"
|
||||||
|
|
||||||
|
# Fetch URL content
|
||||||
|
def fetch_url_content(url):
|
||||||
|
"""Fetch URL and return content"""
|
||||||
|
logger.debug(f" 📥 Fetching: {url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(f" 📥 Fetching: {url}")
|
response = requests.get(
|
||||||
response = requests.get(url, timeout=5, headers={
|
url,
|
||||||
'User-Agent': 'Mozilla/5.0'
|
timeout=8,
|
||||||
})
|
headers={
|
||||||
content = response.text[:2000] # First 2k chars
|
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||||
|
'Accept': 'text/html,application/xhtml+xml'
|
||||||
|
},
|
||||||
|
allow_redirects=True
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
content = response.text[:5000] # First 5k chars
|
||||||
|
|
||||||
# Extract title
|
# Try to find title
|
||||||
title_match = re.search(r'<title[^>]*>([^<]+)</title>', content, re.IGNORECASE)
|
title = None
|
||||||
title = title_match.group(1).strip() if title_match else url.split('/')[-1]
|
title_match = re.search(r'<title[^>]*>\s*([^<]+?)\s*</title>', content, re.IGNORECASE)
|
||||||
|
if title_match:
|
||||||
|
title = title_match.group(1).strip()
|
||||||
|
|
||||||
# Simple content type detection
|
if not title:
|
||||||
link_type = "webpage"
|
og_match = re.search(r'<meta\s+property="og:title"\s+content="([^"]+)"', content, re.IGNORECASE)
|
||||||
if "github.com" in url:
|
if og_match:
|
||||||
link_type = "GitHub"
|
title = og_match.group(1).strip()
|
||||||
elif "reddit.com" in url:
|
|
||||||
link_type = "Reddit"
|
|
||||||
elif "youtube.com" in url or "youtu.be" in url:
|
|
||||||
link_type = "YouTube"
|
|
||||||
elif "tiktok.com" in url:
|
|
||||||
link_type = "TikTok"
|
|
||||||
elif "twitter.com" in url or "x.com" in url:
|
|
||||||
link_type = "Twitter/X"
|
|
||||||
|
|
||||||
|
if not title:
|
||||||
|
title = url.split('/')[-1] or "Untitled"
|
||||||
|
|
||||||
|
logger.debug(f" ✓ Fetched: {title}")
|
||||||
return {
|
return {
|
||||||
"title": title,
|
"title": title,
|
||||||
"type": link_type,
|
"content": content,
|
||||||
"status": "ok"
|
"status": "ok"
|
||||||
}
|
}
|
||||||
|
except requests.Timeout:
|
||||||
|
logger.warning(f" ⏱️ Timeout: {url}")
|
||||||
|
return {"title": "Request timeout", "status": "timeout", "content": ""}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f" ❌ Error fetching: {e}")
|
logger.error(f" ❌ Error: {e}")
|
||||||
|
return {"title": "Fetch failed", "status": "error", "content": ""}
|
||||||
|
|
||||||
|
# Analyze with Haiku via gateway
|
||||||
|
def analyze_content(url, title, content, link_type):
|
||||||
|
"""Send raw content to Haiku for analysis"""
|
||||||
|
logger.debug(f" 🤖 Analyzing with Haiku: {url}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Simple prompt - send raw content
|
||||||
|
prompt = f"""Analyze this webpage content quickly.
|
||||||
|
|
||||||
|
**URL**: {url}
|
||||||
|
**Title**: {title}
|
||||||
|
|
||||||
|
**RAW PAGE CONTENT** (first 3000 chars):
|
||||||
|
{content[:3000]}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Write a 2-3 sentence summary explaining:
|
||||||
|
1. What is this about?
|
||||||
|
2. Why would this be useful?
|
||||||
|
|
||||||
|
Be concise. Skip marketing. No URLs or titles in summary."""
|
||||||
|
|
||||||
|
logger.debug(f" Sending to Haiku...")
|
||||||
|
response = requests.post(
|
||||||
|
f"{GATEWAY_URL}/sessions/turn",
|
||||||
|
json={
|
||||||
|
"message": prompt,
|
||||||
|
"session": "main"
|
||||||
|
},
|
||||||
|
timeout=20,
|
||||||
|
headers={"Authorization": f"Bearer {GATEWAY_TOKEN}"} if GATEWAY_TOKEN else {}
|
||||||
|
)
|
||||||
|
|
||||||
|
if response.status_code == 200:
|
||||||
|
result = response.json()
|
||||||
|
summary = result.get("message", "")
|
||||||
|
if isinstance(summary, list) and summary:
|
||||||
|
summary = summary[0].get("text", "") if isinstance(summary[0], dict) else summary[0]
|
||||||
|
summary = str(summary).strip()[:300]
|
||||||
|
|
||||||
|
logger.info(f" ✓ Got analysis: {summary[:50]}")
|
||||||
|
|
||||||
|
tag = "to-read"
|
||||||
|
if link_type == "GitHub":
|
||||||
|
tag = "project"
|
||||||
|
elif link_type == "YouTube":
|
||||||
|
tag = "video"
|
||||||
|
elif link_type == "Reddit":
|
||||||
|
tag = "discussion"
|
||||||
|
elif link_type in ["Medium", "Dev.to"]:
|
||||||
|
tag = "article"
|
||||||
|
elif link_type == "arXiv":
|
||||||
|
tag = "learning"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"title": "Couldn't fetch",
|
"summary": summary,
|
||||||
"type": "unknown",
|
"tag": tag
|
||||||
"status": "error",
|
|
||||||
"error": str(e)
|
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
logger.warning(f" Gateway error: {response.status_code}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f" Analysis error: {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
# Send to Tududi inbox
|
# Send to Tududi inbox
|
||||||
def add_to_tududi(title, url, link_type):
|
def add_to_tududi(title, url, link_type, summary="", tag=""):
|
||||||
"""Add to Tududi inbox with summary"""
|
"""Add to Tududi inbox"""
|
||||||
|
logger.debug(f" 📌 Adding to Tududi: {title}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not TUDUDI_API_KEY:
|
if not TUDUDI_API_KEY:
|
||||||
print(" ⚠️ TUDUDI_API_KEY not set")
|
logger.warning(" TUDUDI_API_KEY not set")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
content = f"📌 {link_type}: {title}\n🔗 {url}"
|
content = f"📌 **{link_type}**: {title}\n🔗 {url}"
|
||||||
|
if summary:
|
||||||
|
content += f"\n\n💡 {summary}"
|
||||||
|
if tag:
|
||||||
|
content += f"\n\n🏷️ {tag}"
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{TUDUDI_API_URL}/inbox",
|
f"{TUDUDI_API_URL}/inbox",
|
||||||
@@ -105,14 +226,14 @@ def add_to_tududi(title, url, link_type):
|
|||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code in [200, 201]:
|
||||||
print(f" ✅ Added to Tududi: {title}")
|
logger.info(f" ✓ Added to Tududi")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print(f" ⚠️ Tududi error: {response.status_code}")
|
logger.warning(f" Tududi error: {response.status_code}")
|
||||||
return False
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f" ❌ Tududi error: {e}")
|
logger.error(f" Tududi error: {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Discord bot
|
# Discord bot
|
||||||
@@ -121,8 +242,8 @@ intents.message_content = True
|
|||||||
|
|
||||||
class LinkAnalyzerBot(discord.Client):
|
class LinkAnalyzerBot(discord.Client):
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print(f"✅ Bot logged in as {self.user}")
|
logger.info(f"✅ Bot logged in as {self.user}")
|
||||||
print(f"📍 Watching channel #remora ({CHANNEL_ID})")
|
logger.info(f"📍 Watching channel #remora ({CHANNEL_ID})")
|
||||||
|
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
# Ignore bot's own messages
|
# Ignore bot's own messages
|
||||||
@@ -136,55 +257,91 @@ class LinkAnalyzerBot(discord.Client):
|
|||||||
# Check for URLs
|
# Check for URLs
|
||||||
urls = extract_urls(message.content)
|
urls = extract_urls(message.content)
|
||||||
if not urls:
|
if not urls:
|
||||||
|
logger.debug(f"No URLs in message from {message.author}")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Skip if already processed
|
# Skip if already processed
|
||||||
tracker = load_tracker()
|
tracker = load_tracker()
|
||||||
if message.id in tracker["processed_message_ids"]:
|
if message.id in tracker["processed_message_ids"]:
|
||||||
|
logger.debug(f"Skipping already-processed message {message.id}")
|
||||||
return
|
return
|
||||||
|
|
||||||
print(f"🔗 New link from {message.author}: {message.content}")
|
logger.info(f"🔗 New link(s) from {message.author}: {message.content}")
|
||||||
|
|
||||||
# Process each URL
|
# Process each URL
|
||||||
for url in urls:
|
for url in urls:
|
||||||
print(f" Processing: {url}")
|
try:
|
||||||
|
logger.info(f"Processing: {url}")
|
||||||
|
link_type = detect_link_type(url)
|
||||||
|
|
||||||
# Analyze
|
# Fetch content
|
||||||
analysis = analyze_url(url)
|
fetch_result = fetch_url_content(url)
|
||||||
|
title = fetch_result["title"]
|
||||||
|
|
||||||
|
# Analyze with Haiku
|
||||||
|
analysis_data = None
|
||||||
|
if fetch_result["status"] == "ok":
|
||||||
|
logger.debug(f" Analyzing...")
|
||||||
|
analysis_data = analyze_content(url, title, fetch_result["content"], link_type)
|
||||||
|
|
||||||
|
# Prepare summary
|
||||||
|
summary_text = ""
|
||||||
|
tag = "interesting"
|
||||||
|
if analysis_data:
|
||||||
|
summary_text = analysis_data.get("summary", "")
|
||||||
|
tag = analysis_data.get("tag", "interesting")
|
||||||
|
logger.debug(f" Summary: {summary_text[:60]}")
|
||||||
|
|
||||||
# Add to Tududi
|
# Add to Tududi
|
||||||
add_to_tududi(analysis["title"], url, analysis["type"])
|
add_to_tududi(title, url, link_type, summary_text, tag)
|
||||||
|
|
||||||
# Prepare response
|
# Format response
|
||||||
summary = f"📌 **{analysis['type']}**: {analysis['title']}"
|
response_text = f"📌 **{link_type}**: {title}"
|
||||||
if analysis["status"] == "error":
|
if summary_text:
|
||||||
summary += f"\n⚠️ {analysis['error']}"
|
response_text += f"\n\n💡 {summary_text}"
|
||||||
|
if tag:
|
||||||
|
response_text += f"\n\n🏷️ `{tag}`"
|
||||||
|
|
||||||
# Post summary in channel
|
logger.debug(f"Posting response...")
|
||||||
await message.reply(summary, mention_author=False)
|
|
||||||
|
|
||||||
# Add to tracker
|
# Post in channel
|
||||||
|
await message.reply(response_text, mention_author=False)
|
||||||
|
|
||||||
|
# Update tracker
|
||||||
tracker["links"].append({
|
tracker["links"].append({
|
||||||
"url": url,
|
"url": url,
|
||||||
"title": analysis["title"],
|
"title": title,
|
||||||
"type": analysis["type"],
|
"type": link_type,
|
||||||
"author": str(message.author),
|
"author": str(message.author),
|
||||||
"message_id": message.id,
|
"message_id": message.id,
|
||||||
"date": datetime.now().isoformat(),
|
"date": datetime.now().isoformat(),
|
||||||
"tududi": True
|
"summary": summary_text,
|
||||||
|
"tag": tag
|
||||||
})
|
})
|
||||||
|
|
||||||
# Update processed IDs
|
logger.info(f"✓ Processed: {url}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"❌ Error: {e}")
|
||||||
|
import traceback
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
try:
|
||||||
|
await message.reply(f"❌ Error: {str(e)[:100]}", mention_author=False)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Update tracker
|
||||||
tracker["processed_message_ids"].append(message.id)
|
tracker["processed_message_ids"].append(message.id)
|
||||||
save_tracker(tracker)
|
save_tracker(tracker)
|
||||||
|
logger.info(f"Updated tracker: {len(tracker['links'])} links total")
|
||||||
|
|
||||||
# Main
|
# Main
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
token = os.getenv("DISCORD_BOT_TOKEN")
|
token = os.getenv("DISCORD_BOT_TOKEN")
|
||||||
if not token:
|
if not token:
|
||||||
print("❌ DISCORD_BOT_TOKEN not set!")
|
logger.error("❌ DISCORD_BOT_TOKEN not set!")
|
||||||
print("Set it: export DISCORD_BOT_TOKEN='your_token'")
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
logger.info("Starting bot...")
|
||||||
bot = LinkAnalyzerBot(intents=intents)
|
bot = LinkAnalyzerBot(intents=intents)
|
||||||
bot.run(token)
|
bot.run(token)
|
||||||
|
|||||||
Reference in New Issue
Block a user