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.118/3_storage.ts";

Properties

readonly
authKeyId

Methods

abstract
get<T>(key: readonly StorageKeyPart[]): MaybePromise<T | null>
getChannelPts(channelId: bigint)
getEntity(type: "channel", id: bigint): Promise<types.Channel | null>
getEntity(type: "chat", id: bigint): Promise<types.Chat | null>
getEntity(type: "user", id: bigint): Promise<types.User | null>
getEntity(type: "channel" | "chat" | "user", id: bigint): Promise<
| types.Channel
| types.Chat
| types.User
| null
>
abstract
getMany<T>(prefix: readonly StorageKeyPart[]): MaybePromise<Generator<[readonly StorageKeyPart[], T]> | AsyncGenerator<[readonly StorageKeyPart[], T]>>
getMessage(chatId: number, messageId: number)
getMessageChat(messageId: number)
getStickerSetName(id: bigint, accessHash: bigint)
getTLObject(key: readonly StorageKeyPart[])
getUserAccessHash(id: bigint)
getUsername(username: string)
abstract
init(): MaybePromise<void>
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)
setDc(dc: DC | null)
setEntity(peer: types.Channel): Promise<void>
setEntity(peer: types.Chat): Promise<void>
setEntity(peer: types.User): Promise<void>
setMessage(
chatId: number,
messageId: number,
message: types.TypeMessage | null,
)
setServerSalt(serverSalt: bigint)
setState(state: types.UpdatesState)
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[],
)