/// <summary> /// Function that Catches MessageReceived Event from the Discord Bot /// </summary> /// <param name="Message"></param> /// <returns></returns> public async Task MessageReceived(SocketMessage Message) { if (!IsLogging) { return; } if (Message.Content.Contains("!msg ") && Message.Content.Contains(':')) { string message = Message.Content.Substring(Message.Content.IndexOf(':') + 1); string argument = Message.Content.Substring(5, Message.Content.IndexOf(':') - 5); if (Message.Content.IndexOf(':') > 10) { argument = "zone"; } message = AQMessage.XMLDecode(message); AQMessage.Send(message, argument); return; } if (Message.Content.Contains("!msg ")) { string message = ""; message = AQMessage.XMLDecode(Message.Content.Substring(5)); AQMessage.Send(message, "zone"); return; } if (Message.Content.Contains("!DM ")) { string message = Message.Content.Substring(Message.Content.IndexOf(':') + 1); string reciever = Message.Content.Substring(4, Message.Content.IndexOf(':') - 4); message = AQMessage.XMLDecode(message); AQMessage.SendDM(message, reciever); return; } }