From d53d8caf4df7fc10e248dda2647a31f8a63f298d Mon Sep 17 00:00:00 2001 From: fulcanelly Date: Fri, 15 Nov 2024 07:20:43 +0200 Subject: [PATCH] doc: fix typo & formatting --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 13239a3..afb312c 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ which would create needed models in your project folder After that you'll have to apply migration migrate ```bash -yarn prisma migrate dev --name add_chat_toolkit_models +yarn prisma migrate dev --name add_chat_toolkit_models ``` ### Adjust code to supply events to handler @@ -165,14 +165,14 @@ expectAny :: (Message -> a) -> Effect a for example ```ts - await expectAny(msg => { - if ('photo' in msg) { - return msg.photo[0] - } - if ('text' in msg) { - return msg.text - } - }) +await expectAny(msg => { + if ('photo' in msg) { + return msg.photo[0] + } + if ('text' in msg) { + return msg.text + } +}) ``` @@ -254,13 +254,17 @@ const bot = new Telegraf(process.env.TG_TOKEN) /// ... -export const { setupCallbackHandler, createCallbackHandle } - = createRedisInlineKeyboardHandler({ +export const { + setupCallbackHandler, + createCallbackHandle, + } = createRedisInlineKeyboardHandler({ redis, projectName: 'mybot', ivalidateIn: duration(1, 'day'), }) + // ... + setupCallbackHandler(bot) ```