Exemple #1
0
        private static string formatDefinition(UrbanDictionaryDefinition definition)
        {
            string outstr = $"**{definition.word}**\n";

            outstr += $"Definition: {definition.definition.Replace("[","").Replace("]","")}\n";
            outstr += $"{definition.author} - {definition.written_on}\n";
            outstr += $"[Link]({definition.permalink}) - {definition.thumbs_up}👍/{definition.thumbs_down}👎";
            return(outstr);
        }
Exemple #2
0
        private static DiscordEmbed embedDef(UrbanDictionaryDefinition definition)
        {
            var embedbuilder = new DiscordEmbedBuilder();

            embedbuilder.WithTitle(definition.word)
            .WithAuthor($"{definition.word} - Urban Dictionary", definition.permalink)
            .WithDescription(definition.definition.Replace("[", "").Replace("]", ""));
            embedbuilder.AddField("Written on", definition.written_on.ToShortDateString(), true);
            embedbuilder.AddField("Written by", definition.author);
            embedbuilder.AddField("Ratio", $"{definition.thumbs_up}👍/{definition.thumbs_down}👎", true);
            return(embedbuilder.Build());
        }