/** Redis key for tag cooldowns (guild + tag + user or channel scope). */
export function tagCooldownKey(guildId: string, tagId: string, scopeId: string): string {
  return `tag:cooldown:${guildId}:${tagId}:${scopeId}`;
}

export function matchesTriggerWord(content: string, triggerWord: string): boolean {
  const escaped = triggerWord.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  const pattern = new RegExp(`\\b${escaped}\\b`, 'i');
  return pattern.test(content);
}
