Exemplo n.º 1
0
        public async Task getfeat([Remainder] string Name = null)
        {
            Character c = null;

            if (!Name.NullorEmpty() && Name.ToLower().EndsWith("-c"))
            {
                Name = Name.Replace("-c", "");
                c    = GetCompanion();

                if (c == null)
                {
                    await ReplyAsync("You have no active companion.");

                    return;
                }
            }
            else
            {
                c = GetCharacter();

                if (c == null)
                {
                    await ReplyAsync("You have no active character.");

                    return;
                }
            }

            if (Name.NullorEmpty())
            {
                var fs = await SheetService.GetAllFeats(c, Context);

                if (fs == null)
                {
                    await ReplyAsync(c.Name + " has no feats.");

                    return;
                }
                await ReplyAsync("", fs);

                return;
            }

            var f = await SheetService.GetFeat(c, Name, Context);

            if (f == null)
            {
                await ReplyAsync(c.Name + " has no feat that start with that name.");

                return;
            }
            await ReplyAsync("", f);

            return;
        }