
<% @bots.each do |bot| %>
    <bot nick="<%= bot.botnick %>" owner="<%= bot.owner %>">
      <% @channels.each do |c| %>
          <% if c.bot_id == bot.id then %>
              <ch name="<%= c.name %>" />
          <% end %>
      <% end %>
    </bot>
<% end %>



<% @freqs.each do |f| %>
    <frequency name="<%= f.name %>" prefix="<%= f.prefix %>" helpmsg="<%= f.helpmsg %>"  desc="<%= f.description %>" delay="<%= f.delay %>">
      <% @bans.each do |b| %>
          <% if b.frequency_id == f.id then %>
              <ban hostmask="<%= b.hostmask %>" reason="<%= b.reason %>" valid_from="<%= b.valid_from %>" valid_to="<%= b.valid_to %>" />
          <% end %>
      <% end %>
    </frequency>
<% end %>

