Add stats, feeds, scheduler, and guild backup features to the bot
- Introduced new models in the Prisma schema for statistics, social feeds, scheduled messages, and guild backups, enhancing the bot's functionality. - Implemented command modules for managing stats channels, feeds, scheduling messages, and creating/restoring backups, improving user engagement and server management. - Updated job handling to include dedicated workers for stats updates, feed polling, scheduling, and backup restoration, enhancing automation. - Enhanced command localization for new features in both German and English. - Documented the new features and their setup processes in PHASE-TRACKING.md for clarity on implementation steps.
This commit is contained in:
54
apps/bot/src/modules/feeds/command-definitions.ts
Normal file
54
apps/bot/src/modules/feeds/command-definitions.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { ChannelType } from 'discord.js';
|
||||
import {
|
||||
applyCommandDescription,
|
||||
applyOptionDescription,
|
||||
localizedChoice
|
||||
} from '@nexumi/shared';
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
const feedTypeChoices = [
|
||||
localizedChoice('feeds.choice.type.twitch', 'TWITCH'),
|
||||
localizedChoice('feeds.choice.type.youtube', 'YOUTUBE'),
|
||||
localizedChoice('feeds.choice.type.rss', 'RSS'),
|
||||
localizedChoice('feeds.choice.type.reddit', 'REDDIT')
|
||||
] as const;
|
||||
|
||||
export const feedsCommandData = applyCommandDescription(
|
||||
new SlashCommandBuilder()
|
||||
.setName('feeds')
|
||||
.addSubcommand((sub) =>
|
||||
applyCommandDescription(sub.setName('add'), 'feeds.add.description')
|
||||
.addStringOption((o) =>
|
||||
applyOptionDescription(o.setName('type').setRequired(true), 'feeds.add.options.type').addChoices(
|
||||
...feedTypeChoices
|
||||
)
|
||||
)
|
||||
.addStringOption((o) =>
|
||||
applyOptionDescription(o.setName('source').setRequired(true), 'feeds.add.options.source')
|
||||
)
|
||||
.addChannelOption((o) =>
|
||||
applyOptionDescription(
|
||||
o.setName('channel').addChannelTypes(ChannelType.GuildText).setRequired(true),
|
||||
'feeds.add.options.channel'
|
||||
)
|
||||
)
|
||||
.addRoleOption((o) =>
|
||||
applyOptionDescription(o.setName('role'), 'feeds.add.options.role')
|
||||
)
|
||||
.addStringOption((o) =>
|
||||
applyOptionDescription(o.setName('template'), 'feeds.add.options.template')
|
||||
)
|
||||
)
|
||||
.addSubcommand((sub) =>
|
||||
applyCommandDescription(sub.setName('remove'), 'feeds.remove.description').addStringOption((o) =>
|
||||
applyOptionDescription(o.setName('id').setRequired(true), 'feeds.remove.options.id')
|
||||
)
|
||||
)
|
||||
.addSubcommand((sub) => applyCommandDescription(sub.setName('list'), 'feeds.list.description'))
|
||||
.addSubcommand((sub) =>
|
||||
applyCommandDescription(sub.setName('test'), 'feeds.test.description').addStringOption((o) =>
|
||||
applyOptionDescription(o.setName('id').setRequired(true), 'feeds.test.options.id')
|
||||
)
|
||||
),
|
||||
'feeds.description'
|
||||
);
|
||||
Reference in New Issue
Block a user