seyfert
Version:
The most advanced framework for discord bots
39 lines (38 loc) • 2.23 kB
TypeScript
import type { UsingClient } from '../../../commands';
import type { GatewayIntentBits } from '../../../types';
import type { Cache, CacheFrom, ReturnCache } from '../../index';
export declare class GuildBasedResource<T = any, S = any> {
protected cache: Cache;
readonly client: UsingClient;
namespace: string;
constructor(cache: Cache, client: UsingClient);
filter(data: any, id: string, guild_id: string, from: CacheFrom): boolean;
parse(data: any, id: string, guild_id: string): any;
get adapter(): import("../../index").Adapter;
removeIfNI(intent: keyof typeof GatewayIntentBits, id: string | string[], guildId: string): import("../../../common").Awaitable<void>;
setIfNI(from: CacheFrom, intent: keyof typeof GatewayIntentBits, id: string, guildId: string, data: S): void;
get(id: string, guild: string): ReturnCache<(T & {
guild_id: string;
}) | undefined>;
bulk(ids: string[], guild: string): ReturnCache<(T & {
guild_id: string;
})[]>;
set(from: CacheFrom, __keys: string, guild: string, data: S): ReturnCache<void>;
set(from: CacheFrom, __keys: [string, S][], guild: string): ReturnCache<void>;
patch(from: CacheFrom, __keys: string, guild: string, data: S): ReturnCache<void>;
patch(from: CacheFrom, __keys: [string, any][], guild: string): ReturnCache<void>;
remove(id: string | string[], guild: string): import("../../../common").Awaitable<void>;
keys(guild: string): ReturnCache<string[]>;
values(guild: string): ReturnCache<(T & {
guild_id: string;
})[]>;
count(guild: string): ReturnCache<number>;
contains(id: string, guild: string): ReturnCache<boolean>;
getToRelationship(guild: string): import("../../../common").Awaitable<string[]>;
addToRelationship(id: string | string[], guild: string): import("../../../common").Awaitable<void>;
removeToRelationship(id: string | string[], guild: string): import("../../../common").Awaitable<void>;
removeRelationship(id: string | string[]): import("../../../common").Awaitable<void>;
hashId(id: string): string;
hashGuildId(guild: string, id: string): string;
flush(guild?: '*' | (string & {})): unknown[] | Promise<unknown[]>;
}