Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

683 B
Raw Blame
import type { ApiContextType } from '@/context/ApiContext';

/** Persist the platform editor's auxiliary settings through the Settings owner. */
export async function savePlatformSettings(
  api: Pick<ApiContextType, 'saveSettings'>,
  platform: string,
  data: Record<string, unknown>,
  canManageAccessMembers: boolean,
): Promise<void> {
  const guilds = data.discordGuildAllowlist;
  if (canManageAccessMembers && platform === 'discord' && Array.isArray(guilds)
    && (guilds.length > 0 || data.discordGuildAllowlistTouched === true)) {
    await api.saveSettings({
      guilds: Object.fromEntries(guilds.map((id: string) => [id, { enabled: true }])),
    }, 'discord');
  }
}