Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mtkruto/3_storage.ts>Storage

[WIP] Cross-runtime JavaScript library for building Telegram clients
Go to Latest
class Storage
Re-export
Abstract
import { Storage } from "https://deno.land/x/mtkruto@0.1.130/3_storage.ts";

Properties

readonly
authKeyId
abstract
readonly
supportsFiles: boolean

Methods

abstract
branch(id: string): Storage
abstract
get<T>(key: readonly StorageKeyPart[]): MaybePromise<T | null>
getChannelPts(channelId: bigint)
getChats(listId: number)
getEntity(type: "channel", id: bigint): Promise<types.Channel | types.ChannelForbidden | null>
getEntity(type: "chat", id: bigint): Promise<types.Chat | types.ChatForbidden | null>
getEntity(type: "user", id: bigint): Promise<types.User | null>
getEntity(type: "channel" | "chat" | "user", id: bigint): Promise<
| types.Channel
| types.ChannelForbidden
| types.Chat
| types.ChatForbidden
| types.User
| null
>
getFile(id: bigint)
getHistory(
chatId: number,
offsetId: number,
limit: number,
)
getLastMessage(chatId: number)
abstract
getMany<T>(prefix: GetManyFilter, params?: { limit?: number; reverse?: boolean; }): MaybePromise<Generator<[readonly StorageKeyPart[], T]> | AsyncGenerator<[readonly StorageKeyPart[], T]>>
getMessage(chatId: number, messageId: number)
getMessageChat(messageId: number)
getPinnedChats(listId: number)
getStickerSetName(id: bigint, accessHash: bigint)
getTlObject(keyOrBuffer: Uint8Array | readonly StorageKeyPart[])
getUserAccessHash(id: bigint)
getUsername(username: string)
hasAllChats(listId: number)
abstract
incr(key: readonly StorageKeyPart[], by: number): MaybePromise<void>
abstract
init(): MaybePromise<void>
iterFileParts(id: bigint, partCount: number)
removeChats(listId: number)
removeEntity(entity:
| types.User
| types.Channel
| types.ChannelForbidden
| types.Chat
| types.ChatForbidden
)
saveFilePart(
id: bigint,
index: number,
bytes: Uint8Array,
)
abstract
set(key: readonly StorageKeyPart[], value: unknown): MaybePromise<void>
setAccountType(type: "user" | "bot")
setAuthKey(authKey: Uint8Array | null)
setChannelAccessHash(id: bigint, accessHash: bigint)
setChannelPts(channelId: bigint, pts: number)
setChat(
listId: number,
chatId: number,
pinned: number,
topMessageId: number,
topMessageDate: Date,
)
setCustomEmojiDocument(id: bigint, document: types.Document)
setDc(dc: DC | null)
setEntity(entity:
| types.User
| types.Channel
| types.ChannelForbidden
| types.Chat
| types.ChatForbidden
)
setFilePartCount(id: bigint, partCount: number)
setHasAllChats(listId: number, hasAllChats: boolean)
setMessage(
chatId: number,
messageId: number,
message: enums.Message | null,
)
setPinnedChats(listId: number, chatIds: number[] | null)
setServerSalt(serverSalt: bigint)
setState(state: enums.updates.State)
setTlObject(key: readonly StorageKeyPart[], value: TLObject | null)
setUserAccessHash(id: bigint, accessHash: bigint)
updateStickerSetName(
id: bigint,
accessHash: bigint,
name: string,
)
updateUsernames(
type: "user" | "channel",
id: bigint,
usernames: string[],
)