vk-io
Version:
Modern VK API SDK for Node.js
66 lines (65 loc) • 1.9 kB
TypeScript
import { Params } from '../../api';
import { Context, ContextFactoryOptions, ContextDefaultState } from './context';
import { kSerializeData } from '../../utils/constants';
export type GroupUserContextType = 'group_user';
export type GroupUserContextSubType = 'user_block' | 'user_unblock';
export interface IGroupUserContextPayload {
admin_id: number;
user_id: number;
comment: string;
reason: number;
unblock_date?: number;
by_end_date?: number;
}
export type GroupUserContextOptions<S> = ContextFactoryOptions<IGroupUserContextPayload, S>;
export declare class GroupUserContext<S = ContextDefaultState> extends Context<IGroupUserContextPayload, S, GroupUserContextType, GroupUserContextSubType> {
constructor(options: GroupUserContextOptions<S>);
/**
* Checks is join user
*/
get isBlocked(): boolean;
/**
* Checks is leave user
*/
get isUnblocked(): boolean;
/**
* Checks that the block has expired
*/
get isExpired(): boolean | undefined;
/**
* Returns the identifier admin
*/
get adminId(): number;
/**
* Returns the identifier user
*/
get userId(): number;
/**
* Returns the reason for the ban
*/
get reasonId(): number | undefined;
/**
* Returns the reason name for the ban
*/
get reasonName(): string | undefined;
/**
* Returns unblock date or undefined if permanent
*/
get unblockAt(): number | undefined;
/**
* Returns the administrator comment to block
*/
get comment(): string | undefined;
/**
* Adds a user to the community blacklist
*/
ban(params: Partial<Params.GroupsBanParams>): Promise<number>;
/**
* Adds a user to the community blacklist
*/
unban(): Promise<number>;
/**
* Returns the custom data
*/
[kSerializeData](): object;
}