/** Discord channel type helpers shared by server fetchers and client pickers. */

export const CHANNEL_TYPES = {
  text: [0, 5, 15, 16],
  voice: [2, 13],
  category: [4],
  messageable: [0, 5, 15, 16]
} as const;

export type ChannelKind = keyof typeof CHANNEL_TYPES;

/** Channel types returned by the dashboard channels API. */
export const DASHBOARD_CHANNEL_TYPES = new Set([
  0, // GUILD_TEXT
  2, // GUILD_VOICE
  4, // GUILD_CATEGORY
  5, // GUILD_ANNOUNCEMENT
  13, // GUILD_STAGE_VOICE
  15, // GUILD_FORUM
  16 // GUILD_MEDIA
]);

export function channelPrefix(type: number): string {
  if (type === 2 || type === 13) {
    return '🔊 ';
  }
  if (type === 4) {
    return '📁 ';
  }
  return '#';
}
