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:
31
hookshot/tinker-tickets.js
Normal file
31
hookshot/tinker-tickets.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var id = data.ticket_id || '?';
|
||||
var title = data.title || 'Untitled';
|
||||
var priority = parseInt(data.priority) || 4;
|
||||
var category = data.category || 'General';
|
||||
var type = data.type || 'Issue';
|
||||
var source = data.source || '';
|
||||
var url = data.url || '';
|
||||
var trigger = data.trigger || 'manual';
|
||||
var notifyUsers = data.notify_users || [];
|
||||
var priorityEmojis = ['', '🔴', '🟠', '🔵', '🟢', '⚫'];
|
||||
var priorityLabels = ['', 'P1 Critical', 'P2 High', 'P3 Medium', 'P4 Low', 'P5 Info'];
|
||||
var emoji = (priority >= 1 && priority <= 5) ? priorityEmojis[priority] : '⚫';
|
||||
var pLabel = (priority >= 1 && priority <= 5) ? priorityLabels[priority] : 'P' + priority;
|
||||
var tLabel = trigger === 'automated' ? 'Automated' : 'Manual';
|
||||
var meta = pLabel + ' \u00b7 ' + category + ' \u00b7 ' + type + (source ? ' \u00b7 ' + source : '') + ' [' + tLabel + ']';
|
||||
var mentionPlain = '';
|
||||
var mentionHtml = '';
|
||||
if (notifyUsers.length > 0) {
|
||||
var pParts = [], hParts = [];
|
||||
for (var i = 0; i < notifyUsers.length; i++) {
|
||||
var uid = notifyUsers[i];
|
||||
var disp = uid.replace(/^@/, '').split(':')[0];
|
||||
pParts.push(uid);
|
||||
hParts.push('<a href="https://matrix.to/#/' + uid + '">' + disp + '</a>');
|
||||
}
|
||||
mentionPlain = '\n' + pParts.join(' ');
|
||||
mentionHtml = '<br>' + hParts.join(' ');
|
||||
}
|
||||
var plain = emoji + ' New Ticket #' + id + ': ' + title + '\n' + meta + (url ? '\n' + url : '') + mentionPlain;
|
||||
var html = '<b>' + emoji + ' <a href="' + url + '">#' + id + '</a>: ' + title + '</b><br>' + meta + mentionHtml;
|
||||
result = { version: 'v2', plain: plain, html: html, msgtype: 'm.text' };
|
||||
Reference in New Issue
Block a user