public BotMessage GetResponse(MargieBot.Models.ResponseContext context) { BotMessage message = new BotMessage(); string messageText = ""; if (m_Bot.Players != null) { for (int i = 0; i < m_Bot.Players.Count; ++i) { messageText += m_Bot.Players[i].Name + " -- Score: " + m_Bot.Players[i].Score + "\n"; } if (m_Bot.Players.Count > ATTACHMENT_THRESHOLD) { SlackAttachment playerAttachment = new SlackAttachment(); playerAttachment.Fallback = messageText; playerAttachment.PreText = "See who's playing."; playerAttachment.Text = messageText; playerAttachment.Title = "Players in " + m_Bot.Status.Name; message.Attachments.Add(playerAttachment); } else message.Text = ">Players for " + m_Bot.Status.Name + "\n" + messageText; } else message.Text = "Server players unavailable. Connection settings may be incorrect or server may be down."; return message; }
public bool CanRespond(MargieBot.Models.ResponseContext context) { return context.Message.Text == m_Keyword; }