fix: align Telegram grammY type imports (#81975)

This commit is contained in:
Peter Steinberger
2026-05-15 07:41:18 +01:00
parent 91f01b7664
commit 1109abc947
20 changed files with 22 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { MediaFetchError } from "openclaw/plugin-sdk/media-runtime";
export function isMediaSizeLimitError(err: unknown): boolean {

View File

@@ -1,4 +1,4 @@
import type { Message, ReactionTypeEmoji } from "@grammyjs/types";
import type { Message, ReactionTypeEmoji } from "grammy/types";
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
import { resolveChannelConfigWrites } from "openclaw/plugin-sdk/channel-config-helpers";
import {

View File

@@ -1,4 +1,4 @@
import type { ReactionTypeEmoji } from "@grammyjs/types";
import type { ReactionTypeEmoji } from "grammy/types";
import {
resolveAckReaction,
shouldAckReaction as shouldAckReactionGate,

View File

@@ -1,6 +1,6 @@
import { createHash } from "node:crypto";
import type { LanguageCode } from "@grammyjs/types";
import type { Bot } from "grammy";
import type { LanguageCode } from "grammy/types";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import {

View File

@@ -1,4 +1,4 @@
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { createDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
import type { TelegramContext } from "./bot/types.js";

View File

@@ -1,4 +1,4 @@
import type { Chat, Message, MessageOrigin, User } from "@grammyjs/types";
import type { Chat, Message, MessageOrigin, User } from "grammy/types";
import type { NormalizedLocation } from "openclaw/plugin-sdk/channel-inbound";
import {
normalizeLowercaseStringOrEmpty,

View File

@@ -1,4 +1,4 @@
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveMedia } from "./delivery.resolve-media.js";

View File

@@ -1,4 +1,4 @@
import type { Chat, Message } from "@grammyjs/types";
import type { Chat, Message } from "grammy/types";
import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
import {
resolveCommandAuthorization,

View File

@@ -1,4 +1,4 @@
import type { ChatFullInfo, Message, UserFromGetMe } from "@grammyjs/types";
import type { ChatFullInfo, Message, UserFromGetMe } from "grammy/types";
/** App-specific stream mode for Telegram stream previews. */
export type TelegramStreamMode = "off" | "partial" | "block" | "progress";

View File

@@ -31,7 +31,7 @@ vi.mock("./api-logging.js", () => ({
withTelegramApiErrorLogging: withTelegramApiErrorLoggingMock,
}));
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { normalizeAllowFrom } from "./bot-access.js";
let enforceTelegramDmAccess: typeof import("./dm-access.js").enforceTelegramDmAccess;

View File

@@ -1,5 +1,5 @@
import type { Message } from "@grammyjs/types";
import type { Bot } from "grammy";
import type { Message } from "grammy/types";
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
import type { DmPolicy } from "openclaw/plugin-sdk/config-contracts";
import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";

View File

@@ -1,4 +1,4 @@
import type { InlineKeyboardButton, InlineKeyboardMarkup } from "@grammyjs/types";
import type { InlineKeyboardButton, InlineKeyboardMarkup } from "grammy/types";
import type { TelegramInlineButtons } from "./button-types.js";
function toInlineKeyboardButton(

View File

@@ -1,5 +1,5 @@
import { readFile, rm, writeFile } from "node:fs/promises";
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { describe, expect, it } from "vitest";
import {
buildTelegramConversationContext,

View File

@@ -1,5 +1,5 @@
import fs from "node:fs";
import type { Message } from "@grammyjs/types";
import type { Message } from "grammy/types";
import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
import type { MsgContext } from "openclaw/plugin-sdk/reply-runtime";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";

View File

@@ -1,4 +1,4 @@
import type { MessageEntity } from "@grammyjs/types";
import type { MessageEntity } from "grammy/types";
import { buildTelegramThreadParams, type TelegramThreadSpec } from "./bot/helpers.js";
import { normalizeTelegramReplyToMessageId } from "./outbound-params.js";

View File

@@ -1,6 +1,6 @@
import type { ReactionType, ReactionTypeEmoji } from "@grammyjs/types";
import * as grammy from "grammy";
import { type ApiClientOptions, Bot, HttpError } from "grammy";
import type { ReactionType, ReactionTypeEmoji } from "grammy/types";
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/diagnostic-runtime";
import { formatUncaughtError } from "openclaw/plugin-sdk/error-runtime";

View File

@@ -1,4 +1,4 @@
import type { Chat, Message } from "@grammyjs/types";
import type { Chat, Message } from "grammy/types";
import { describe, expect, it } from "vitest";
import { getTelegramSequentialKey } from "./sequential-key.js";

View File

@@ -1,4 +1,4 @@
import type { Message, UserFromGetMe } from "@grammyjs/types";
import type { Message, UserFromGetMe } from "grammy/types";
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
import {
listChatCommands,

View File

@@ -1,4 +1,4 @@
import type { ReactionTypeEmoji } from "@grammyjs/types";
import type { ReactionTypeEmoji } from "grammy/types";
import { DEFAULT_EMOJIS, type StatusReactionEmojis } from "openclaw/plugin-sdk/channel-feedback";
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
import type { TelegramChatDetails, TelegramGetChat } from "./bot/types.js";

View File

@@ -1,5 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "../.."
},
"include": [
"../../src/**/*.d.ts",
"../../src/**/*.test.ts",