feat: plugins v1.5
This commit is contained in:
@@ -18,7 +18,10 @@ import {
|
||||
SaveBanCommand,
|
||||
RemoveBanCommand,
|
||||
SaveAttachmentCommand,
|
||||
DeleteAttachmentsForMessageCommand
|
||||
DeleteAttachmentsForMessageCommand,
|
||||
SavePluginDataCommand,
|
||||
DeletePluginDataCommand,
|
||||
SaveMetaCommand
|
||||
} from '../types';
|
||||
import { handleSaveMessage } from './handlers/saveMessage';
|
||||
import { handleDeleteMessage } from './handlers/deleteMessage';
|
||||
@@ -36,6 +39,9 @@ import { handleSaveBan } from './handlers/saveBan';
|
||||
import { handleRemoveBan } from './handlers/removeBan';
|
||||
import { handleSaveAttachment } from './handlers/saveAttachment';
|
||||
import { handleDeleteAttachmentsForMessage } from './handlers/deleteAttachmentsForMessage';
|
||||
import { handleSavePluginData } from './handlers/savePluginData';
|
||||
import { handleDeletePluginData } from './handlers/deletePluginData';
|
||||
import { handleSaveMeta } from './handlers/saveMeta';
|
||||
import { handleClearAllData } from './handlers/clearAllData';
|
||||
|
||||
export const buildCommandHandlers = (dataSource: DataSource): Record<CommandTypeKey, (command: Command) => Promise<unknown>> => ({
|
||||
@@ -55,5 +61,8 @@ export const buildCommandHandlers = (dataSource: DataSource): Record<CommandType
|
||||
[CommandType.RemoveBan]: (cmd) => handleRemoveBan(cmd as RemoveBanCommand, dataSource),
|
||||
[CommandType.SaveAttachment]: (cmd) => handleSaveAttachment(cmd as SaveAttachmentCommand, dataSource),
|
||||
[CommandType.DeleteAttachmentsForMessage]: (cmd) => handleDeleteAttachmentsForMessage(cmd as DeleteAttachmentsForMessageCommand, dataSource),
|
||||
[CommandType.SavePluginData]: (cmd) => handleSavePluginData(cmd as SavePluginDataCommand, dataSource),
|
||||
[CommandType.DeletePluginData]: (cmd) => handleDeletePluginData(cmd as DeletePluginDataCommand, dataSource),
|
||||
[CommandType.SaveMeta]: (cmd) => handleSaveMeta(cmd as SaveMetaCommand, dataSource),
|
||||
[CommandType.ClearAllData]: () => handleClearAllData(dataSource)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user