@grammyjs/conversations
Advanced tools
Comparing version 1.1.1 to 1.1.2
import { type ApiResponse, type CallbackQueryContext, type CommandContext, Context, type Filter, type FilterQuery, type GameQueryContext, type HearsContext, type LazySessionFlavor, type Middleware, type MiddlewareFn, type RawApi, type SessionFlavor, type Update, type User } from "./deps.node.js"; | ||
import { ConversationForm } from "./form.js"; | ||
import { type Resolver } from "./utils.js"; | ||
declare type MaybeArray<T> = T | T[]; | ||
declare type StringWithSuggestions<S extends string> = (string & {}) | S; | ||
type MaybeArray<T> = T | T[]; | ||
type StringWithSuggestions<S extends string> = (string & {}) | S; | ||
/** | ||
@@ -24,3 +24,3 @@ * A user-defined conversation builder function that can be turned into | ||
*/ | ||
export declare type ConversationFn<C extends Context> = (conversation: Conversation<C>, ctx: C) => unknown | Promise<unknown>; | ||
export type ConversationFn<C extends Context> = (conversation: Conversation<C>, ctx: C) => unknown | Promise<unknown>; | ||
/** | ||
@@ -31,3 +31,3 @@ * Context flavor for the conversations plugin. Adds the conversation control | ||
*/ | ||
export declare type ConversationFlavor<C extends Context | undefined = undefined> = { | ||
export type ConversationFlavor<C extends Context | undefined = undefined> = { | ||
conversation: ConversationControls; | ||
@@ -261,3 +261,3 @@ } & (C extends Context ? C extends LazySessionFlavor<infer V> ? Omit<C, "session"> & LazySessionFlavor<ConversationSessionData & V> : C & SessionFlavor<ConversationSessionData> : SessionFlavor<ConversationSessionData> | LazySessionFlavor<ConversationSessionData>); | ||
*/ | ||
export declare type OtherwiseHandler<C extends Context> = (ctx: C) => unknown | Promise<unknown>; | ||
export type OtherwiseHandler<C extends Context> = (ctx: C) => unknown | Promise<unknown>; | ||
/** | ||
@@ -276,3 +276,3 @@ * Options object with settings that determine how to handle a failing | ||
*/ | ||
export declare type OtherwiseConfig<C extends Context> = OtherwiseHandler<C> | OtherwiseOptions<C>; | ||
export type OtherwiseConfig<C extends Context> = OtherwiseHandler<C> | OtherwiseOptions<C>; | ||
/** | ||
@@ -306,3 +306,3 @@ * > This should be the first parameter in your conversation builder function. | ||
*/ | ||
export declare type Conversation<C extends Context> = ConversationHandle<C>; | ||
export type Conversation<C extends Context> = ConversationHandle<C>; | ||
/** | ||
@@ -309,0 +309,0 @@ * Internally used class which acts as a conversation handle. |
@@ -143,3 +143,3 @@ "use strict"; | ||
const session = await this[internal].session(); | ||
if (session.conversation === undefined) | ||
if (session.conversation == null) | ||
return; | ||
@@ -276,3 +276,3 @@ if (id === undefined) { | ||
const session = await ctx.session; | ||
if (session.conversation !== undefined) { | ||
if (session.conversation != null) { | ||
session.conversation = (0, deps_node_js_1.listify)(session.conversation, KNOWN_TYPES); | ||
@@ -386,3 +386,3 @@ } | ||
// Clean up if no conversations remain | ||
if (session.conversation !== undefined && | ||
if (session.conversation != null && | ||
Object.keys(session.conversation).length === 0) { | ||
@@ -389,0 +389,0 @@ session.conversation = undefined; |
{ | ||
"name": "@grammyjs/conversations", | ||
"description": "Conversational interfaces for grammY", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "KnorpelSenf", | ||
@@ -20,5 +20,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"@grammyjs/types": "^2.8.2", | ||
"@grammyjs/types": "^3.1.1", | ||
"debug": "^4.3.4", | ||
"o-son": "^1.0.0" | ||
"o-son": "^1.0.1" | ||
}, | ||
@@ -29,5 +29,5 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@types/debug": "^4.1.7", | ||
"@types/debug": "^4.1.8", | ||
"@types/node": "^12.20.55", | ||
"deno2node": "^1.4.0" | ||
"deno2node": "^1.8.1" | ||
}, | ||
@@ -34,0 +34,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83762
- Removed@grammyjs/types@2.12.1(transitive)
Updated@grammyjs/types@^3.1.1
Updatedo-son@^1.0.1