Пример #1
0
        public async Task TagAsync([Remainder] string name)
        {
            var tag = await _db.GetTagAsync(Context.Guild.Id, name.ToLower());

            if (tag == null)
            {
                var tags = await _db.FindTagsAsync(Context.Guild.Id, name, 5);

                string reply = $"Could not find a tag like `{name}`.";
                if (tags.Count() > 0)
                {
                    string related = string.Join(", ", tags.Select(x => x.Aliases.First()));
                    reply += $"\nDid you mean: {related}";
                }

                await ReplyAsync(reply);

                return;
            }

            await ReplyAsync($"{tag.Aliases.First()}: {tag.Content}");
        }
Пример #2
0
        public async Task Tag(string name)
        {
            Tag tag = await _db.GetTagAsync(Context.Guild.Id, name);

            if (tag == null)
            {
                return;
            }

            await ReplyAsync("", embed : new EmbedBuilder()
            {
                Title       = tag.Name,
                Color       = _settings.GetColor(),
                Description = tag.Text,
                ImageUrl    = tag.Attachment
            }.Build());
        }