/// <summary> /// Sends a message into the Debug Message Channel if it is defined and Debug is true /// </summary> /// <param name="message">Message to send</param> public static async Task SendDebugMessage(DebugCategories category, string message, string description = null) { if (DebugMessage != null) { await DebugMessage(new LogMessage(LogSeverity.Debug, category.ToString(), message)); } if (debugLogging[(int)category] && GuildChannelHelper.TryGetChannel(GuildChannelHelper.DebugChannelId, out SocketTextChannel channel)) { EmbedBuilder debugembed; if (string.IsNullOrEmpty(description)) { debugembed = new EmbedBuilder { Color = BotCore.EmbedColor, Title = $"**[{category.ToString().ToUpper()}]**", Description = message }; } else { debugembed = new EmbedBuilder { Color = BotCore.EmbedColor, Title = $"**[{category.ToString().ToUpper()}]** {message}", Description = description }; } await channel.SendEmbedAsync(debugembed); } }
/// <summary> /// Sends a message into the Debug Message Channel if it is defined and Debug is true /// </summary> /// <param name="message">Message to send</param> public static async Task SendDebugMessage(string message, DebugCategories category) { if (DebugMessage != null) { await DebugMessage(new LogMessage(LogSeverity.Debug, category.ToString(), message)); } if (debugLogging[(int)category] && DebugMessageChannelId != 0) { ISocketMessageChannel channel = Var.client.GetChannel(DebugMessageChannelId) as ISocketMessageChannel; if (channel != null) { EmbedBuilder debugembed = new EmbedBuilder(); debugembed.Color = Var.BOTCOLOR; debugembed.Title = string.Format("**__Debug: {0}__**", category.ToString().ToUpper()); debugembed.Description = message; await channel.SendEmbedAsync(debugembed); } } }