コード例 #1
0
ファイル: GameHandler.cs プロジェクト: jbakeacake/PokeBot
        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 = "";
            }
        }
コード例 #2
0
ファイル: PokeModule.cs プロジェクト: jbakeacake/PokeBot
        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);
        }