Пример #1
0
        private async Task SendUserInventoryList(List <List <PokemonForReturnDto> > listOfCollections, UserForReturnDto userData, string username)
        {
            var uniqueCount = userData.PokeCollection.Select(x => x.Name).Distinct().Count();
            var message     = $":globe_with_meridians:` HELLO, {username.ToUpper()}. WELCOME TO YOUR POKEMON STORAGE UNIT. \nBELOW YOU CAN FIND A LIST OF ALL THE POKEMON YOU'VE CAUGHT...`\n\n";

            message += $":ballot_box:`POKE STORAGE | Unique Pokemon Found: {uniqueCount} / 151`\n";
            foreach (var collection in listOfCollections)
            {
                message += PokeCollectionUtil.ChunkToString(collection);
                await _discord.GetUser(userData.DiscordId).SendMessageAsync(message);

                message = "";
            }
        }
Пример #2
0
        public async Task SendPokemonListToPlayer(ulong discordId)
        {
            var userForReturn = await _userController.GetUserByDiscordId(discordId);

            var    listOfCollections = PokeCollectionUtil.SlicePokeCollection((List <PokemonForReturnDto>)userForReturn.PokeCollection, 20);
            string message           = "```🍚 Type `!choose #` where '#' is the pokemon's corresponding Id number.```";

            foreach (var collection in listOfCollections)
            {
                message += PokeCollectionUtil.ChunkToString(collection);
                await SendPlayerMessage(message, discordId);

                message = "";
            }
        }
Пример #3
0
        public async Task Inventory()
        {
            var user = Context.Message.Author;

            if (!(await _userController.UserExists(user.Id)))
            {
                await RegisterUser(user);
                await ReplyAsync($"Your inventory is empty. Go catch some pokemon!");

                return;
            }

            var userData = await _userController.GetUserByDiscordId(user.Id);

            var listOfCollections = PokeCollectionUtil.SlicePokeCollection((List <PokemonForReturnDto>)userData.PokeCollection, 20);

            await SendUserInventoryList(listOfCollections, userData, user.Username);
        }