Class: Lita::Handlers::ClearTeam

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/clear_team.rb

Instance Method Summary collapse

Instance Method Details

#clear(response) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/lita/handlers/clear_team.rb', line 17

def clear(response)
  team_name = response.match_data[1]
  if team = get_team(team_name)
    team[:members] = {}
    redis.set(team[:name], MultiJson.dump(team))
    response.reply(t(:cleared, team_name: team_name))
  else
    response.reply(render_template(:team_not_found, team_name: team_name))
  end
end