Moved string substitution for chat  to a separate function
Added chat variable: $team (@ballsnack)