Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = async function App(context) {
return router([
text('/list', withProps(ShowTodos, { todos: context.state.todos })),
text('/clear', ClearTodos),
text('*', AddTodo),
]);
};
async function HandleNumber(context) {
const data = cache.get(context.state.word);
if (context.state.word == '' || data === undefined) {
return HintEnterNewWord;
}
const Router = router([
text('1', HandleNumber1),
text('2', HandleNumber2),
text('3', HandleNumber3),
text('4', HandleNumber4),
text('5', HandleNumber5),
text('*', HandleOtherNumber),
]);
return withProps(Router, { data });
}
module.exports = async function App(context) {
if (context.event.isFollow || context.event.isJoin) {
return Greeting;
}
return router([
text(/^h(ello|i)|^\/start/, Greeting),
text('@@@', Diagnose),
text(/^\d$/, HandleNumber),
text(/^[a-zA-Z\s-]+$/, SearchWord),
text('*', WrongInput),
]);
};