mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix: align Telegram grammY type imports (#81975)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ReactionTypeEmoji } from "@grammyjs/types";
|
||||
import type { ReactionTypeEmoji } from "grammy/types";
|
||||
import {
|
||||
resolveAckReaction,
|
||||
shouldAckReaction as shouldAckReactionGate,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "../.."
|
||||
},
|
||||
"include": [
|
||||
"../../src/**/*.d.ts",
|
||||
"../../src/**/*.test.ts",
|
||||
|
||||
Reference in New Issue
Block a user