mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 22:46:41 +07:00
added per-group and per-channel templates
This commit is contained in:
parent
a3fcb429ce
commit
3f2e07b391
5 changed files with 28 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
import * as yup from "yup";
|
||||
import { VkConfig, VkEvent } from "./types";
|
||||
import { templateOptionalSchema } from "../../config/validate";
|
||||
|
||||
const vkChannelEventSchema = yup.string().oneOf(Object.values(VkEvent));
|
||||
|
||||
|
@ -12,6 +13,7 @@ const vkChannelSchema = yup
|
|||
.required()
|
||||
.matches(/^@/, ({ path }) => `${path} should start with "@"`),
|
||||
events: yup.array().of(vkChannelEventSchema),
|
||||
templates: templateOptionalSchema,
|
||||
});
|
||||
|
||||
export const vkConfigSchema = yup
|
||||
|
@ -30,6 +32,7 @@ export const vkConfigSchema = yup
|
|||
secretKey: yup.string().required(),
|
||||
apiKey: yup.string().required(),
|
||||
channels: yup.array().of(vkChannelSchema),
|
||||
templates: templateOptionalSchema,
|
||||
})
|
||||
),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue