Skip to main content
Module

x/grammy_conversations/mod.ts>ConversationHandle#sleep

Conversational interfaces for grammY
Go to Latest
method ConversationHandle.prototype.sleep
import { ConversationHandle } from "https://deno.land/x/grammy_conversations@v1.1.1/mod.ts";

This method is rarely useful because it freezes your bot and that's most likely not actually what you want to do. Consider using one of the variants of wait instead.

Freezes your bot for the specified number of milliseconds. The current middleware execution will simply stop for a while. Note that if you're processing updates concurrently (with grammY runner) then unrelated updates will still be handled in the meantime. Note further that sleeping during webhooks is dangerous because it can lead to duplicate updates.

You should use this instead of your own sleeping function so that you don't block the conversation while it is restoring a previous position.

Parameters

milliseconds: number

The number of milliseconds to sleep

Returns

Promise<void>