Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/botnadzor/extension/llms.txt

Use this file to discover all available pages before exploring further.

The Account Inspector is a powerful tool that provides detailed analysis of suspicious VK accounts, helping you identify bot behavior patterns and unusual activity.

Overview

The Inspector analyzes account activity and provides insights into:
  • Comment patterns and frequency
  • Account behavior indicators
  • Suspicious activity detection
  • Detailed account metadata

How to Open the Inspector

The Inspector can be triggered from any comment or account page by clicking the Inspector button (magnifying glass icon) in the action bar.

Inspector Button

The Inspector button appears in the action bar alongside other tools:
// src/entrypoints/content/insertion-variants/shared/@markup-ui/action-bar.ts
function createInspectorButton({
  contentId,
  derivedPageInfo,
  serviceLookup,
  tooltipDirection,
}): InsertionUi {
  const actionUi = createActionUi({
    derivedPageInfo,
    tagName: 'button',
    tooltipDirection,
  });
  
  actionUi.render({
    ariaLabel: "Инспектор",
    icon: "userSearch",
    tooltip: true,
  });
}
The button:
  • Shows a user search icon
  • Only appears for user accounts (not communities)
  • Requires valid authentication with inspector permissions
  • Stops event propagation to prevent interfering with VK’s UI

Inspector Service

The Inspector is powered by the InspectorService (src/entrypoints/background/@services/inspector-service.ts) which manages:

Instance Management

Each Inspector instance is tracked by a unique contentId:
type InspectorInstanceConfig = {
  accountInfo: {
    avatarUrl: string;
    name: string;
    vkDomain: VkDomain;
  };
  trigger: InspectorTrigger;
  tab: "activity" | "report";
  triggeredAt: IsoDateTime;
};

Triggering the Inspector

When you click the Inspector button, the service:
async trigger(
  contentId: ContentId,
  payload: InspectorInstancePayload | undefined,
): Promise<void> {
  const authStatus = this.authService.getAuthStatus();
  
  if (authStatus.state !== "valid") {
    await this.notificationService.trigger(contentId, {
      type: "inspectorUnauthorized",
    });
    return;
  }
  
  if (!authStatus.permissionLookup.inspectAccount) {
    await this.notificationService.trigger(contentId, {
      type: "inspectorMissingPermission",
    });
    return;
  }
  
  await this.setInstanceConfig(contentId, {
    ...payload,
    tab: "activity",
    triggeredAt: isoDateTimeSchema.parse(new Date()),
  });
}
  1. Validates authentication status
  2. Checks for inspectAccount permission
  3. Creates an Inspector instance configuration
  4. Opens the Inspector with the “activity” tab

Inspector Tabs

The Inspector has two main tabs:

1. Activity Tab

Displays detailed account analysis including:
  • Comment activity patterns
  • Posting frequency
  • Behavioral indicators
  • Account metadata

2. Report Tab

Allows you to report suspicious accounts to Botnadzor administrators (see Reporting). Switch between tabs using:
async setTab(
  contentId: ContentId,
  tab: "activity" | "report",
): Promise<void> {
  const instanceConfig = await this.getInstanceConfig(contentId);
  if (!instanceConfig) return;
  
  await this.setInstanceConfig(contentId, {
    ...instanceConfig,
    tab,
  });
}

Account Inspection API

The Inspector fetches account data from the Botnadzor dynamic API:
async reinspectAccount(vkDomain: VkDomain): Promise<ResultOfInspectAccount> {
  const vkId = await this.vkDomainResolver.resolve(vkDomain);
  
  if (!isPositiveVkId(vkId)) {
    return {
      problem: true,
      type: "bn:ext:invalid-payload",
      description: "Инспектор не поддерживает проверку сообществ",
      fields: ["vkId"],
    };
  }
  
  const outcome = await this.authService.fetchFromDynamicApiWithAccessCode(
    "inspectAccount",
    { vkId },
  );
  
  return outcome;
}

API Features

  • VK Domain Resolution: Converts VK nicknames to numeric IDs
  • Request Deduplication: Prevents duplicate API calls for the same account
  • Caching: Stores results to avoid unnecessary API requests
  • Permission Management: Tracks remaining inspection quota
  • Point System: Updates remaining points after each inspection

Result Types

The inspection can return:
type ResultOfInspectAccount = 
  | { problem: false; /* inspection data */ }
  | { problem: true; type: string; description: string; };
Error types:
  • bn:ext:unforeseen-error - Failed to resolve account ID
  • bn:ext:invalid-payload - Invalid account (e.g., community instead of user)
  • bn:ext:invalid-access-code - Authentication failed
  • bn:ext:missing-permission - Insufficient permissions

Polling System

The Inspector uses a polling mechanism to keep data synchronized:
async pollInstanceConfig(
  lastPollVersion: PollVersion | undefined,
  contentId: ContentId,
): Promise<PollResult<InspectorInstanceConfig | undefined>> {
  this.pollableInspectorInstanceByContentId[contentId] ??= 
    new Pollable<InspectorInstanceConfig | undefined>(
      await this.getInstanceConfig(contentId)
    );
  
  return this.pollableInspectorInstanceByContentId[contentId].poll(
    lastPollVersion,
  );
}
This ensures:
  • Real-time updates when inspection data changes
  • Efficient updates (only when version changes)
  • Multiple components can subscribe to the same data

Permission Requirements

To use the Inspector, you need:
  1. Valid authentication - Configured access code
  2. Inspector permission - Either:
    • Points in your account
    • Additional permission levels
If permissions are missing, you’ll see a notification:
  • inspectorUnauthorized - Need to configure access
  • inspectorMissingPermission - Need points or higher permission level

Storage

Inspector instances are stored in session storage:
const inspectorStore = defineStoreWithSchema(
  "session:inspector",
  inspectorServiceConfigSchema,
);
This means:
  • Inspector state persists across page navigations
  • Instances are cleared when the browser session ends
  • Multiple Inspector instances can be open simultaneously

Use Cases

Investigating Suspicious Comments

  1. Spot a suspicious comment
  2. Click the Inspector button on the comment
  3. Review the account’s activity patterns
  4. Report if bot behavior is confirmed

Analyzing Account Patterns

  1. Open Inspector on an account page
  2. Study comment frequency and timing
  3. Check for automated behavior indicators
  4. Cross-reference with known bot patterns

Verifying Bot Reports

  1. Someone reports a potential bot
  2. Use Inspector to gather evidence
  3. Review activity history
  4. Make informed decision on reporting