public static string Emoji(this EMType type, bool hide = false) { if (hide) { return(""); } switch (type) { case EMType.Bot: return("🐙"); case EMType.Info: return("ℹ"); case EMType.Error: return("🚫"); case EMType.Success: return("✅"); case EMType.Warning: return("⚠"); default: case EMType.Neutral: return(""); } }
public EMType SaveEMType(EMType entertainmentType) { if (entertainmentType.Id == 0) { entertainmentType.Id = entertainmentTypeCollection.Insert(entertainmentType); } else { entertainmentType.Updated(); _ = entertainmentTypeCollection.Update(entertainmentType); } return(entertainmentType); }
public async Task GivePingAsync() { int latency = Context.Client.Latency; EMType type = EMType.Error; if (latency < 400) { type = EMType.Warning; } if (latency < 200) { type = EMType.Success; } await ReplyAsync("", embed : $"Pong! `{latency}ms`".ToEmbedMessage(type).Build()); }
public static Color Color(this EMType type) { switch (type) { case EMType.Bot: return(new Color(158, 62, 211)); case EMType.Error: return(new Color(255, 0, 0)); case EMType.Info: return(new Color(0, 122, 204)); case EMType.Success: return(new Color(51, 255, 51)); case EMType.Warning: return(new Color(255, 255, 0)); default: case EMType.Neutral: return(new Color(128, 128, 128)); } }
public static EmbedBuilder ToEmbedMessage(this string message, EMType type = EMType.Neutral, bool icon = false) { return(new EmbedBuilder().WithColor(type.Color()).WithDescription($"{type.Emoji(!icon)}{message}")); }
public List <EMValidTypeMedium> GetValidMediumsForType(EMType emType) { var mediums = GetValidMediumsForType(emType.Id); return(mediums); }