/my_id
command.',
sendSilently: 'Send Silently',
sendSilentlyTip: 'Send notifications with no sound',
});
const NotificationsTelegram: React.FC = () => {
const intl = useIntl();
const { addToast } = useToasts();
const { data, error, revalidate } = useSWR(
'/api/v1/settings/notifications/telegram'
);
const NotificationsTelegramSchema = Yup.object().shape({
botAPI: Yup.string().when('enabled', {
is: true,
then: Yup.string()
.nullable()
.required(intl.formatMessage(messages.validationBotAPIRequired)),
otherwise: Yup.string().nullable(),
}),
chatId: Yup.string()
.when('enabled', {
is: true,
then: Yup.string()
.nullable()
.required(intl.formatMessage(messages.validationChatIdRequired)),
otherwise: Yup.string().nullable(),
})
.matches(
/^-?\d+$/,
intl.formatMessage(messages.validationChatIdRequired)
),
});
if (!data && !error) {
return {msg}
;
},
})}