import { ConversationHandle } from "https://deno.land/x/grammy_conversations@v1.1.1/mod.ts";
Safely performs an operation with side-effects. You must use this to wrap all communication with external systems that does not go through grammY, such as database communication or calls to external APIs.
This function will then make sure the operation is only performed once, and not every time a message is handled by the conversation.
It will need to be able to store the result value of this operation in
the session. Hence, it must store and load the result of the operation
according to your storage adapter. It is therefore best to only return
primitive values or POJOs. If you need to transform your data before it
can be stored, you can specify the beforeStore
function. If you need to
transform your data after it was loaded, you can specify the afterLoad
function.
Parameters
An external operation to perform