refactor: replace old bot code with Matrix infra configs and scripts
- Remove obsolete Python bot (Wordle, commands, callbacks, welcome) - Add hookshot/ — all 11 webhook transformation functions + deploy.sh - Add cinny/ — config.json and dev-update.sh (nightly dev branch build) - Add landing/ — matrix.lotusguild.org landing page HTML - Add systemd/ — livekit-server, draupnir, cinny cron unit files - Add draupnir/ — production config (access token redacted) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
hookshot/seerr.js
Normal file
29
hookshot/seerr.js
Normal file
@@ -0,0 +1,29 @@
|
||||
var evtype = data.notification_type || data.event || 'Notification';
|
||||
var subject = data.subject || evtype;
|
||||
var message = data.message || '';
|
||||
var media = data.media || {};
|
||||
var request = data.request || {};
|
||||
var issue = data.issue || {};
|
||||
var comment = data.comment || {};
|
||||
var user = request.requestedBy_username || request.requestedBy_email || (data.account && data.account.username) || '';
|
||||
var mt = media.media_type || '';
|
||||
var status4k = media.status4k || 0;
|
||||
var typeEmoji = mt === 'movie' ? '🎬' : (mt === 'tv' ? '📺' : '📋');
|
||||
var statusEmoji;
|
||||
if (evtype.indexOf('PENDING') >= 0) statusEmoji = '🟡';
|
||||
else if (evtype.indexOf('APPROVED') >= 0 || evtype.indexOf('AVAILABLE') >= 0) statusEmoji = '✅';
|
||||
else if (evtype.indexOf('DECLINED') >= 0 || evtype.indexOf('FAILED') >= 0) statusEmoji = '❌';
|
||||
else if (evtype.indexOf('ISSUE') >= 0) statusEmoji = '⚠️';
|
||||
else if (evtype.indexOf('COMMENT') >= 0) statusEmoji = '💬';
|
||||
else statusEmoji = typeEmoji;
|
||||
var lines = [statusEmoji + ' ' + subject];
|
||||
var htmlParts = ['<b>' + statusEmoji + ' ' + subject + '</b>'];
|
||||
if (user) { lines.push('Requested by: ' + user); htmlParts.push('Requested by: ' + user); }
|
||||
if (message && message !== subject) { lines.push(message); htmlParts.push(message); }
|
||||
if (status4k) { lines.push('4K request'); htmlParts.push('4K request'); }
|
||||
if (issue.issue_type) {
|
||||
var issueLine = 'Issue: ' + issue.issue_type + (issue.message ? ' \u2014 ' + issue.message : '');
|
||||
lines.push(issueLine); htmlParts.push(issueLine);
|
||||
}
|
||||
if (comment.message) { lines.push('Comment: ' + comment.message); htmlParts.push('Comment: ' + comment.message); }
|
||||
result = { version: 'v2', plain: lines.join('\n'), html: htmlParts.join('<br>'), msgtype: 'm.notice' };
|
||||
Reference in New Issue
Block a user