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

x/mtkruto/storage/0_storage.ts>Storage

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

Properties

private
_authKeyId: bigint | null
readonly
authKeyId

Methods

private
resetAuthKeyId(authKey: Uint8Array | null)
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
>
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,
)
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[],
)