/** Minimum ctx shape the chat-type predicates read: `chat` on message-flavoured ctxs, * `message.chat` on callback ctxs (which have no `chat`). */ export type ChatTypeCtx = { chat?: { type?: string; }; message?: { chat?: { type?: string; }; }; }; /** Minimum ctx shape {@link chatIdOf} reads: `chat` (message ctxs), or `chatId` / * `message.chat` (callback ctxs). */ export type ChatIdCtx = { chat?: { id?: number; }; chatId?: number; message?: { chat?: { id?: number; }; }; }; /** Minimum ctx shape `isGroupAdmin` reads. `bot` is the running gramio Bot — typed * `unknown` so MenuCtx and every real ctx assign without a cast; its * `api.getChatAdministrators` is asserted at call time. `senderChat` is the * anonymous-admin identity on message ctxs (callback ctxs have none). */ export type GroupAdminCtx = ChatIdCtx & { bot: unknown; from?: { id?: number; }; senderChat?: { id?: number; }; }; /** The ctx's chat id, whatever the event spelling. `undefined` only when the event has * no chat at all (inline queries, some service events). */ export declare const chatIdOf: (ctx: ChatIdCtx) => number | undefined; /** True for a group or supergroup chat. */ export declare const isGroupChat: (ctx: ChatTypeCtx) => boolean; /** True for a 1:1 private chat. */ export declare const isPrivateChat: (ctx: ChatTypeCtx) => boolean; /** * Whether a user is a creator/administrator of a group, per `getChatAdministrators` * membership. Chat and user default to the ctx's own ({@link chatIdOf}, `ctx.from.id` — * gramio's own parameter-defaulting idiom); pass `chatId` / `userId` for cross-chat * checks. An anonymous admin's own message (`senderChat` = the chat itself) answers * `true` without an API call — unless an explicit `userId` asks about someone else. * Missing ids (an actor-less service event) or an API rejection answer `false`. */ export declare function isGroupAdmin(ctx: GroupAdminCtx, opts?: { chatId?: number; userId?: number; }): Promise; //# sourceMappingURL=groups.d.ts.map