EventScore GetEvent(params StreamEventType[] types) { EventScore score = streameventmodule.GetLastMonthLeader(types); if (score == null) { score = streameventmodule.GetLeader(types); } return(score); }
StreamHttpEvent Convert(string title, EventScore score) { if (score == null) { return(new StreamHttpEvent { Timestamp = DateTime.Now, Title = new MessageBuilder().Text(title, Color.White, FontWeight.Bold).BuildMessage(), Message = new MessageBuilder().Text("<none>", Color.LightGray).BuildMessage() }); } return(new StreamHttpEvent { Timestamp = DateTime.Now, Title = new MessageBuilder().Text(title, Color.White, FontWeight.Bold).BuildMessage(), Message = new MessageBuilder().User(usermodule.GetUser(score.UserID), u => imagemodule.AddImage(u.Avatar)).Score((int)score.Score).BuildMessage() }); }