feat(moderation): enhance message capture and storage with thread support

- Added functions to retrieve message location, sticker metadata, and display content in messageCapture.ts.
- Updated captureMessage function to store thread information and sticker metadata in the database.
- Modified messageStore.ts to support querying messages and attachments by thread ID.
- Updated types.ts to include thread_id in AttachmentRecord.
- Altered database schema in muxer-queue.ts to add thread_id column to attachments.
- Introduced ChannelSummary interface and listWatchableChannels method in voiceController.ts to fetch watchable channels.
- Added API endpoint in webserver.ts to retrieve channels for a given guild.
This commit is contained in:
MythEclipse
2026-05-13 20:52:37 +07:00
parent c7d8353403
commit d55b56c897
9 changed files with 1071 additions and 477 deletions
+7
View File
@@ -84,6 +84,7 @@ function initializeDatabase(): SqliteDatabase {
message_id TEXT NOT NULL,
guild_id TEXT NOT NULL,
channel_id TEXT NOT NULL,
thread_id TEXT,
user_id TEXT NOT NULL,
filename TEXT NOT NULL,
size INTEGER NOT NULL,
@@ -102,6 +103,12 @@ function initializeDatabase(): SqliteDatabase {
CREATE INDEX IF NOT EXISTS idx_attachments_status ON attachments(upload_status);
`);
try {
database.exec("ALTER TABLE attachments ADD COLUMN thread_id TEXT");
} catch {
// Column already exists on databases initialized after the moderation schema was added.
}
return database;
}