import { Storage } from "https://deno.land/x/mtkruto@0.1.157/3_storage.ts";
Methods
assertBot(source: string)
assertUser(source: string)
clear()
exportAuthString(): Promise<string>
abstract
get<T>(key: readonly StorageKeyPart[]): MaybePromise<T | null>getAccountType(): Promise<"user" | "bot" | null>
getAuthKey(): Promise<Uint8Array | null>
getChannelAccessHash(id: number): Promise<bigint | null>
getChannelPts(channelId: bigint): MaybePromise<number | null>
getCustomEmojiDocument(id: bigint): Promise<[types.Document, Date] | null>
getDc(): MaybePromise<DC | null>
getEntity(key: number): Promise<ReadObject | null>
getFile(id: bigint): Promise<[number, number] | null>
getFirstUpdate(boxId: bigint): Promise<[readonly StorageKeyPart[], enums.Update] | null>
getHistory(): Promise<enums.Message[]>
chatId: number,
offsetId: number,
limit: number,
getLastMessage(chatId: number): Promise<enums.Message | null>
abstract
getMany<T>(prefix: GetManyFilter, params?: { limit?: number; reverse?: boolean; }): MaybePromise<Generator<[readonly StorageKeyPart[], T]> | AsyncGenerator<[readonly StorageKeyPart[], T]>>getMessage(chatId: number, messageId: number): Promise<enums.Message | null>
getMessageChat(messageId: number): MaybePromise<number | null>
getPinnedChats(listId: number): Promise<number[] | null>
getServerSalt(): MaybePromise<bigint | null>
getState(): Promise<enums.updates.State | null>
getStickerSetName(id: bigint, accessHash: bigint): MaybePromise<[string, Date] | null>
getTlObject(keyOrBuffer: TLObject | Uint8Array | readonly StorageKeyPart[]): Promise<ReadObject | null>
getUserAccessHash(id: number): Promise<bigint | null>
getUsername(username: string): Promise<[number, Date] | null>
hasAllChats(listId: number): Promise<boolean>
importAuthString(string: string)
abstract
incr(key: readonly StorageKeyPart[], by: number): MaybePromise<void>abstract
initialize(): MaybePromise<void>iterFileParts(): AsyncGenerator<Uint8Array>
id: bigint,
partCount: number,
offset: number,
removeChats(listId: number)
saveFilePart()
id: bigint,
index: number,
bytes: Uint8Array,
abstract
set(key: readonly StorageKeyPart[], value: unknown): MaybePromise<void>setAccountType(type: "user" | "bot")
setAuthKey(authKey: Uint8Array | null)
setChannelPts(channelId: bigint, pts: number)
setCustomEmojiDocument(id: bigint, document: types.Document)
setFilePartCount()
id: bigint,
partCount: number,
chunkSize: 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)
setUpdate(boxId: bigint, update: enums.Update)
updateStickerSetName()
id: bigint,
accessHash: bigint,
name: string,
updateUsernames(id: number, usernames: string[])