Enhance component message handling and introduce new features
- Added `ComponentMessageBinding` model to manage message components in the database. - Updated `WelcomeConfig`, `Tag`, and `ScheduledMessage` models to support new component fields. - Integrated component handling in various modules, including Scheduler and Tags, to improve message customization. - Enhanced user experience by implementing new commands for creating and managing component messages in the utility module. - Updated localization files to reflect new component-related features and improve user guidance.
This commit is contained in:
@@ -18,6 +18,7 @@ import { expireBirthdayRole, runBirthdayCheck } from './modules/birthdays/index.
|
||||
import { ensureStatsRecurringJobs, startStatsWorker } from './modules/stats/index.js';
|
||||
import { pollAllFeeds } from './modules/feeds/index.js';
|
||||
import { sendScheduledMessage } from './modules/scheduler/index.js';
|
||||
import { sendDashboardMessage, type DashboardMessageSendJob } from './modules/components-v2/send.js';
|
||||
import { runGuildBackupRestoreJob } from './modules/guildbackup/index.js';
|
||||
import { runSuggestionStatusUpdateJob } from './modules/suggestions/index.js';
|
||||
import { runPresenceRefreshJob } from './presence.js';
|
||||
@@ -32,6 +33,7 @@ import {
|
||||
feedsQueueName,
|
||||
giveawayQueueName,
|
||||
guildBackupQueueName,
|
||||
messagesQueueName,
|
||||
moderationQueueName,
|
||||
presenceQueue,
|
||||
presenceQueueName,
|
||||
@@ -281,6 +283,20 @@ export function startWorkers(context: BotContext): Worker[] {
|
||||
logger.error({ jobId: job?.id, error }, 'Schedule job failed');
|
||||
});
|
||||
|
||||
const messagesWorker = new Worker<DashboardMessageSendJob>(
|
||||
messagesQueueName,
|
||||
async (job) => {
|
||||
if (job.name !== 'dashboardMessageSend') {
|
||||
return;
|
||||
}
|
||||
return sendDashboardMessage(context, job.data);
|
||||
},
|
||||
{ connection: redis }
|
||||
);
|
||||
messagesWorker.on('failed', (job, error) => {
|
||||
logger.error({ jobId: job?.id, error }, 'Dashboard message send job failed');
|
||||
});
|
||||
|
||||
const guildBackupWorker = new Worker<{ backupId: string; guildId: string }>(
|
||||
guildBackupQueueName,
|
||||
async (job) => {
|
||||
@@ -349,6 +365,7 @@ export function startWorkers(context: BotContext): Worker[] {
|
||||
statsWorker,
|
||||
feedsWorker,
|
||||
scheduleWorker,
|
||||
messagesWorker,
|
||||
guildBackupWorker,
|
||||
suggestionsWorker,
|
||||
presenceWorker,
|
||||
|
||||
Reference in New Issue
Block a user